Skip to content

Commit 331e59c

Browse files
committed
Make code graph opt-in (--code-graph), update README
Change codebase-memory-mcp from default to opt-in: - --no-code-graph → --code-graph (explicit enable) - No regression risk: code graph only activates when user wants it - With Claude Code's MCP Tool Search, tool tax is ~200 tokens when enabled (lazy-loaded, not all 14 tools in every prompt) Update README wrap examples to show --code-graph flag.
1 parent b0ed0de commit 331e59c

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ headroom wrap cursor # Starts proxy + prints Cursor config
151151
headroom wrap openclaw # Installs + configures OpenClaw plugin
152152
headroom wrap claude --memory # With persistent cross-agent memory
153153
headroom wrap codex --memory # Shares the same memory store
154+
headroom wrap claude --code-graph # With code graph intelligence (codebase-memory-mcp)
154155
```
155156

156-
Headroom starts a proxy, points your tool at it, and compresses everything automatically. Add `--memory` for persistent memory that's shared across agents.
157+
Headroom starts a proxy, points your tool at it, and compresses everything automatically. Add `--memory` for persistent memory that's shared across agents. Add `--code-graph` for code intelligence via [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) — indexes your codebase into a knowledge graph for call-chain traversal, impact analysis, and architectural queries.
157158

158159
In Docker-native mode, Headroom still runs in Docker while wrapped tools run on the host. `wrap claude`, `wrap codex`, `wrap aider`, `wrap cursor`, and OpenClaw plugin setup (`wrap openclaw` / `unwrap openclaw`) are host-managed through the installed wrapper.
159160

headroom/cli/wrap.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def _launch_tool(
537537
*,
538538
learn: bool = False,
539539
agent_type: str = "unknown",
540-
no_code_graph: bool = False,
540+
code_graph: bool = False,
541541
backend: str | None = None,
542542
anyllm_provider: str | None = None,
543543
region: str | None = None,
@@ -566,7 +566,7 @@ def _launch_tool(
566566
region=region,
567567
)
568568

569-
if not no_code_graph:
569+
if code_graph:
570570
_setup_code_graph(verbose=False)
571571

572572
click.echo()
@@ -857,7 +857,9 @@ def unwrap() -> None:
857857
@click.option("--port", "-p", default=8787, type=int, help="Proxy port (default: 8787)")
858858
@click.option("--no-rtk", is_flag=True, help="Skip rtk installation and hook registration")
859859
@click.option(
860-
"--no-code-graph", is_flag=True, help="Skip code graph indexing (codebase-memory-mcp)"
860+
"--code-graph",
861+
is_flag=True,
862+
help="Enable code graph indexing via codebase-memory-mcp (optional)",
861863
)
862864
@click.option("--no-proxy", is_flag=True, help="Skip proxy startup (use existing proxy)")
863865
@click.option(
@@ -869,7 +871,7 @@ def unwrap() -> None:
869871
def claude(
870872
port: int,
871873
no_rtk: bool,
872-
no_code_graph: bool,
874+
code_graph: bool,
873875
no_proxy: bool,
874876
learn: bool,
875877
verbose: bool,
@@ -887,7 +889,7 @@ def claude(
887889
headroom wrap claude # Start everything
888890
headroom wrap claude --resume <id> # Resume a session
889891
headroom wrap claude -- -p # Claude in print mode
890-
headroom wrap claude --no-code-graph # Skip code graph
892+
headroom wrap claude --code-graph # With code graph intelligence
891893
headroom wrap claude --no-rtk # Skip rtk (proxy only)
892894
"""
893895
if prepare_only:
@@ -922,10 +924,8 @@ def claude(
922924
elif verbose:
923925
click.echo(" Skipping rtk (--no-rtk)")
924926

925-
if not no_code_graph:
927+
if code_graph:
926928
_setup_code_graph(verbose=verbose)
927-
elif verbose:
928-
click.echo(" Skipping code graph (--no-code-graph)")
929929

930930
click.echo()
931931
click.echo(" Launching Claude Code (API routed through Headroom)...")
@@ -1106,7 +1106,9 @@ def copilot(
11061106
@click.option("--port", "-p", default=8787, type=int, help="Proxy port (default: 8787)")
11071107
@click.option("--no-rtk", is_flag=True, help="Skip rtk installation and AGENTS.md injection")
11081108
@click.option(
1109-
"--no-code-graph", is_flag=True, help="Skip code graph indexing (codebase-memory-mcp)"
1109+
"--code-graph",
1110+
is_flag=True,
1111+
help="Enable code graph indexing via codebase-memory-mcp (optional)",
11101112
)
11111113
@click.option("--no-proxy", is_flag=True, help="Skip proxy startup (use existing proxy)")
11121114
@click.option(
@@ -1131,7 +1133,7 @@ def copilot(
11311133
def codex(
11321134
port: int,
11331135
no_rtk: bool,
1134-
no_code_graph: bool,
1136+
code_graph: bool,
11351137
no_proxy: bool,
11361138
learn: bool,
11371139
backend: str | None,
@@ -1197,7 +1199,7 @@ def codex(
11971199
env_vars_display=[f"OPENAI_BASE_URL=http://127.0.0.1:{port}/v1"],
11981200
learn=learn,
11991201
agent_type="codex",
1200-
no_code_graph=no_code_graph,
1202+
code_graph=code_graph,
12011203
backend=backend,
12021204
anyllm_provider=anyllm_provider,
12031205
region=region,
@@ -1213,7 +1215,9 @@ def codex(
12131215
@click.option("--port", "-p", default=8787, type=int, help="Proxy port (default: 8787)")
12141216
@click.option("--no-rtk", is_flag=True, help="Skip rtk installation and conventions injection")
12151217
@click.option(
1216-
"--no-code-graph", is_flag=True, help="Skip code graph indexing (codebase-memory-mcp)"
1218+
"--code-graph",
1219+
is_flag=True,
1220+
help="Enable code graph indexing via codebase-memory-mcp (optional)",
12171221
)
12181222
@click.option("--no-proxy", is_flag=True, help="Skip proxy startup (use existing proxy)")
12191223
@click.option("--learn", is_flag=True, help="Enable live traffic learning")
@@ -1228,7 +1232,7 @@ def codex(
12281232
def aider(
12291233
port: int,
12301234
no_rtk: bool,
1231-
no_code_graph: bool,
1235+
code_graph: bool,
12321236
no_proxy: bool,
12331237
learn: bool,
12341238
backend: str | None,
@@ -1288,7 +1292,7 @@ def aider(
12881292
],
12891293
learn=learn,
12901294
agent_type="aider",
1291-
no_code_graph=no_code_graph,
1295+
code_graph=code_graph,
12921296
backend=backend,
12931297
anyllm_provider=anyllm_provider,
12941298
region=region,

0 commit comments

Comments
 (0)