KConfig — 18 Operations for AI Agents
Kconfig is how the Linux kernel and embedded firmware decide what gets built. act101 navigates config symbols, menus, and dependencies structurally, so agents trace why an option exists without paging through menu trees.
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze KConfig code through the act MCP server. 18 operations available: 0 refactor, 18 query, 0 analysis. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
Worked KConfig examples
act101 reads a Kconfig file's menu blocks as module declarations and its config entries as constant declarations, named for the option's symbol. symbols covers the identical set with the identical kinds — Kconfig is one of the few grammars where the two queries agree exactly. The unit of structure in this grammar is the option: a config entry's bool/int type, depends on clause, default value, and range are all properties of that option rather than declarations of their own, so neither query reads them. Each example below is the verbatim output of the command shown, run against the file shown. Query outputs are pretty-printed with the timing block omitted.
Read the menu and its options as a skeleton
audio.kconfig groups three options under an Audio DSP menu: AUDIO_DSP enables the pipeline, AUDIO_SAMPLE_RATE sets its sample rate with a range, and AUDIO_DEBUG gates trace logging, both depending on AUDIO_DSP.
$ act query skeleton audio.kconfig
Before
menu "Audio DSP"
config AUDIO_DSP
bool "Enable real-time audio DSP pipeline"
default n
config AUDIO_SAMPLE_RATE
int "Sample rate in Hz"
depends on AUDIO_DSP
default 48000
range 8000 192000
config AUDIO_DEBUG
bool "Verbose DSP trace logging"
depends on AUDIO_DSP
default n
endmenu
Output
{
"type": "Skeleton",
"declarations": [
{
"kind": "module",
"name": "Audio DSP",
"range": {
"start": {
"file": "audio.kconfig",
"line": 1,
"column": 1,
"byte_offset": 0
},
"end": {
"file": "audio.kconfig",
"line": 18,
"column": 8,
"byte_offset": 292
}
},
"name_range": {
"start": {
"file": "audio.kconfig",
"line": 1,
"column": 7,
"byte_offset": 6
},
"end": {
"file": "audio.kconfig",
"line": 1,
"column": 16,
"byte_offset": 15
}
}
},
{
"kind": "constant",
"name": "AUDIO_DSP",
"range": {
"start": {
"file": "audio.kconfig",
"line": 3,
"column": 1,
"byte_offset": 18
},
"end": {
"file": "audio.kconfig",
"line": 7,
"column": 1,
"byte_offset": 91
}
},
"name_range": {
"start": {
"file": "audio.kconfig",
"line": 3,
"column": 8,
"byte_offset": 25
},
"end": {
"file": "audio.kconfig",
"line": 3,
"column": 17,
"byte_offset": 34
}
}
},
{
"kind": "constant",
"name": "AUDIO_SAMPLE_RATE",
"range": {
"start": {
"file": "audio.kconfig",
"line": 7,
"column": 1,
"byte_offset": 91
},
"end": {
"file": "audio.kconfig",
"line": 13,
"column": 1,
"byte_offset": 198
}
},
"name_range": {
"start": {
"file": "audio.kconfig",
"line": 7,
"column": 8,
"byte_offset": 98
},
"end": {
"file": "audio.kconfig",
"line": 7,
"column": 25,
"byte_offset": 115
}
}
},
{
"kind": "constant",
"name": "AUDIO_DEBUG",
"range": {
"start": {
"file": "audio.kconfig",
"line": 13,
"column": 1,
"byte_offset": 198
},
"end": {
"file": "audio.kconfig",
"line": 18,
"column": 1,
"byte_offset": 285
}
},
"name_range": {
"start": {
"file": "audio.kconfig",
"line": 13,
"column": 8,
"byte_offset": 205
},
"end": {
"file": "audio.kconfig",
"line": 13,
"column": 19,
"byte_offset": 216
}
}
}
]
}
The skeleton reports Audio DSP as a module declaration and AUDIO_DSP, AUDIO_SAMPLE_RATE, and AUDIO_DEBUG as constant declarations; the depends on, default, and range lines under each option are not read.
List the same menu and options as symbols
AUDIO_SAMPLE_RATE is the only option in the file with a numeric range, constraining it between 8000 and 192000.
$ act query symbols audio.kconfig
Before
menu "Audio DSP"
config AUDIO_DSP
bool "Enable real-time audio DSP pipeline"
default n
config AUDIO_SAMPLE_RATE
int "Sample rate in Hz"
depends on AUDIO_DSP
default 48000
range 8000 192000
config AUDIO_DEBUG
bool "Verbose DSP trace logging"
depends on AUDIO_DSP
default n
endmenu
Output
{
"type": "Symbols",
"symbols": [
{
"name": "Audio DSP",
"kind": "module",
"range": {
"start": {
"file": "audio.kconfig",
"line": 1,
"column": 7,
"byte_offset": 6
},
"end": {
"file": "audio.kconfig",
"line": 1,
"column": 16,
"byte_offset": 15
}
},
"visibility": "unknown"
},
{
"name": "AUDIO_DSP",
"kind": "constant",
"range": {
"start": {
"file": "audio.kconfig",
"line": 3,
"column": 8,
"byte_offset": 25
},
"end": {
"file": "audio.kconfig",
"line": 3,
"column": 17,
"byte_offset": 34
}
},
"visibility": "unknown"
},
{
"name": "AUDIO_SAMPLE_RATE",
"kind": "constant",
"range": {
"start": {
"file": "audio.kconfig",
"line": 7,
"column": 8,
"byte_offset": 98
},
"end": {
"file": "audio.kconfig",
"line": 7,
"column": 25,
"byte_offset": 115
}
},
"visibility": "unknown"
},
{
"name": "AUDIO_DEBUG",
"kind": "constant",
"range": {
"start": {
"file": "audio.kconfig",
"line": 13,
"column": 8,
"byte_offset": 205
},
"end": {
"file": "audio.kconfig",
"line": 13,
"column": 19,
"byte_offset": 216
}
},
"visibility": "unknown"
}
]
}
symbols reports the identical four entries with the identical kinds skeleton reported, module for Audio DSP and constant for each of the three options.
Query
18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.
callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch