Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adoption/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ GitHub-hosted macOS runner; see
UV_TOOL_DIR="$eco/python-tools" UV_TOOL_BIN_DIR="$eco/bin" \
uv tool install --python 3.13 git+https://github.com/oraios/serena@c6fbd1c5932df2494ffa0020af5a9fbe80b82143
UV_TOOL_DIR="$eco/python-tools" UV_TOOL_BIN_DIR="$eco/bin" \
uv tool install --python 3.13 jcodemunch-mcp==1.108.319
uv tool install --python 3.13 'jcodemunch-mcp[watch]==1.108.330'
"$eco/bin/serena" --version # Serena 2.0.0.dev0
"$eco/bin/jcodemunch-mcp" --version # jcodemunch-mcp 1.108.319
"$eco/bin/jcodemunch-mcp" --version # jcodemunch-mcp 1.108.330
```
Then run the installer:
```sh
Expand Down
2 changes: 1 addition & 1 deletion adoption/hooks/claude/token-lanes-block.main.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ TOKEN LANES, MAIN SESSION (source: docs/token-session-handbook.md, "Token lanes
- For output above about 5 KB (tests, logs, diffs, listings, JSON), use ctx_batch_execute with queries or ctx_execute with intent. Print only the derived answer; keep failures and the path back to the full output.
- Keep short, fixed-size output in Bash. RTK rewrites supported Bash calls automatically; Read, Grep and Glob bypass RTK.
- Delegate a step whose only product is a conclusion (a survey, a file digest, a multi-file search) to a subagent; it receives its role block automatically.
- For code questions, if exposed: Serena find_symbol and find_referencing_symbols for exact symbols, jcodemunch route (no execute), socraticode or semble for conceptual search, codebase-memory trace_path for call paths. Open the original source before judging or editing.
- For code questions, if exposed: Serena find_symbol and find_referencing_symbols for exact symbols, jcodemunch route (no execute), socraticode or semble for conceptual search, codebase-memory-mcp trace_path for call paths. Open the original source before judging or editing.
- For prior decisions, use ai-memory memory_query (if exposed) as historical evidence only. A memory index line says what a file holds: read the one section you need, never the whole file.
- Use one lane per artifact and never stack compressors. Claim savings only from the client's own counters.
4 changes: 2 additions & 2 deletions adoption/hooks/claude/token-lanes-block.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
TOKEN LANES (source: docs/token-session-handbook.md, "Token lanes carried into subagents").
- Load deferred token tools in ONE ToolSearch call before first use: "select:mcp__plugin_context-mode_context-mode__ctx_execute,mcp__plugin_context-mode_context-mode__ctx_batch_execute,mcp__plugin_context-mode_context-mode__ctx_search,mcp__plugin_context-mode_context-mode__ctx_fetch_and_index,mcp__serena__find_symbol,mcp__serena__find_referencing_symbols"; append task-needed ids to that same call: mcp__jcodemunch__route,mcp__jcodemunch__menu,mcp__jcodemunch__order,mcp__socraticode__codebase_search,mcp__qmd__query,mcp__qmd__get,mcp__ai-memory__memory_query,mcp__codebase-memory__search_graph,mcp__codebase-memory__trace_path,mcp__headroom__headroom_compress,mcp__headroom__headroom_retrieve. ToolSearch returns only tools the agent is granted. Select names exposed by the active client.
- Load deferred token tools in ONE ToolSearch call before first use: "select:mcp__plugin_context-mode_context-mode__ctx_execute,mcp__plugin_context-mode_context-mode__ctx_batch_execute,mcp__plugin_context-mode_context-mode__ctx_search,mcp__plugin_context-mode_context-mode__ctx_fetch_and_index,mcp__serena__find_symbol,mcp__serena__find_referencing_symbols"; append task-needed ids to that same call: mcp__jcodemunch__route,mcp__jcodemunch__menu,mcp__jcodemunch__order,mcp__socraticode__codebase_search,mcp__qmd__query,mcp__qmd__get,mcp__ai-memory__memory_query,mcp__codebase-memory-mcp__search_graph,mcp__codebase-memory-mcp__trace_path,mcp__headroom__headroom_compress,mcp__headroom__headroom_retrieve. ToolSearch returns only tools the agent is granted. Select names exposed by the active client.
- Fetch pages with ctx_fetch_and_index; batch requests with concurrency for several URLs, then quote with ctx_search. Do not use WebFetch for evidence: it answers from a small fast model's reading of the page.
- Use ctx_search with specific queries and limit <=3.
- For output over ~5 KB, use ctx_batch_execute or ctx_execute with intent (indexes output; returns only titles/previews), then ctx_search; print derived answers, keep failures and original-output recovery. Pass ctx_execute cwd = your working directory for every language; without it, non-shell code runs at the server's project root (the coordinator's checkout) and its writes persist. Rust runs in temp; use absolute project paths. Open authorized scratch files from Python inside ctx_execute; ctx_execute_file enforces project boundaries (#852). Never bypass permissions.
- Automatic RTK: a Bash call containing $(...), backticks, <(...), a redirect to a file or a heredoc is never rewritten. && chains and multi-line blocks are rewritten segment by segment. In a pipeline RTK rewrites a supported producer feeding cat, head or tail (git diff | head -n 5) or a final grep/rg stage, but not gh (gh pr view 1 | head -n 5 is not rewritten). Run heavy reads as their own call. Never directly prefix rtk before `git show REV:path`, `diff`, `git branch`, `git log`, `jq`, `cd`, or `find` on a possibly-missing path. Use native commands or `rtk proxy <cmd>` for exact bytes/exit status; process large results in ctx_execute.
- Use Serena find_symbol / find_referencing_symbols for exact symbols and references; jcodemunch route(task, repo: ".") (no execute), menu(query?), order(action, own args) on indexed repos; socraticode codebase_search(query, projectPath) with explicit projectPath for conceptual questions. Open original source before judging or editing.
- Use codebase-memory trace_path (include_evidence=true adds resolver class and confidence; this parameter is on trace_path, not search_graph) or search_graph for symbol/reference queries; treat edges below confidence 0.5 as unverified candidates, and verify exact caller lists with Serena find_referencing_symbols.
- Use codebase-memory-mcp trace_path (include_evidence=true adds resolver class and confidence; this parameter is on trace_path, not search_graph) or search_graph for symbols/references; treat edges below confidence 0.5 as unverified candidates; verify callers with Serena find_referencing_symbols.
- Use qmd query with collections (foundation-docs, foundation-adoption, us-equities-foundation, us-equities-catalog), then get a line window. Use ai-memory memory_query with workspace/project from .ai-memory.toml as historical evidence only, never authority.
- Use TOON for uniform arrays of flat records (same keys in every item); keep compact JSON for nested or non-uniform data, where TOON can be larger (upstream README).
- For large selected text, use headroom_compress, then headroom_retrieve for recovery; require fidelity and count the recovery cost.
Expand Down
4 changes: 2 additions & 2 deletions adoption/mcp/claude-user.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_comment": "User-scope MCP server templates for `claude mcp add --scope user`, drafted 2026-09-23 from the live host's ~/.claude.json mcpServers block (names, commands, args and env var NAMES only -- no credentials, tokens or host-specific secret values). ${HOME} and ${ECO_ROOT} are placeholders in this template's own convention (adoption/templates/*.template.*): render or substitute them for the target host before use; do not commit a rendered copy with literal paths back into this file. install_claude_profile.py renders only ${HOME} and ${ECO_ROOT} and registers each server here but installs none of them (adoption/bootstrap.md step 4a), and `claude mcp add` refuses a name that already exists. To change only some servers, remove each one that should change (`claude mcp remove <name> -s user`) and rerun `install_claude_profile.py --only mcp` without --replace-mcp: that flag re-registers every differing server, ai-memory included. Changed 2026-09-25: serena runs Serena's own `serena` console script. `uv tool install` links it into ${ECO_ROOT}/bin when Serena is installed at the stack pin with the bootstrap's uv-tool layout: UV_TOOL_DIR=\"${ECO_ROOT}/python-tools\" UV_TOOL_BIN_DIR=\"${ECO_ROOT}/bin\" uv tool install --python 3.13 git+https://github.com/oraios/serena@c6fbd1c5932df2494ffa0020af5a9fbe80b82143 (adoption/bootstrap.md step 4a runs it; no bootstrap pin installs Serena). The 2026-09-23 entry named ${ECO_ROOT}/bin/serena-context, a wrapper local to that host (it set SERENA_HOME) that nothing in this repository creates; Serena reads SERENA_HOME itself and defaults to ~/.serena. The ai-memory URL is this repository's default bind, 127.0.0.1:49374 (recipes/README.md `ai-memory serve --bind`, AI_MEMORY_URL in adoption/hosts/example.json); the host's user-scope registration must name the port its own ai-memory unit binds, so on another port run `claude mcp remove ai-memory -s user`, then `claude mcp add --scope user --transport http ai-memory http://127.0.0.1:<port>/mcp`. Changed 2026-09-25: the jcodemunch entry was removed, so that jCodeMunch was no longer registered at user scope, where its server instruction to prefer it over Read/Grep/Glob/Bash loaded into every session. Changed 2026-10-04: the entry is back, on the user's directive that every fresh session starts with the tools ready (docs/decisions/2026-10-04-new-wsl-jcodemunch-user-scope.md), with the documented opt-out of its anonymous savings counter in the env block; `jcodemunch-mcp init` is not run. A project opts in with `claude mcp add --scope local` or a .mcp.json entry (adoption/bootstrap.md step 4a; docs/decisions/2026-09-23-claude-user-profile.md, 2026-09-25 addendum), and the Codex user template keeps it project-scoped too. The installer only visits the servers named here, so a host that registered jcodemunch per project (`--scope local`) keeps that registration beside the user-scope one. Changed 2026-09-30: socraticode, headroom, codebase-memory and qmd join, so this file registers every server the SubagentStart carrier blocks (adoption/hooks/claude/token-lanes-block*.md: the general block and the five role blocks) name except context-mode, which its plugin supplies. Each runs the command, arguments and environment of its entry in adoption/templates/codex.config.template.toml (tests/test_install_claude_profile.py, McpCodexParityTests), with three differences: serena runs Serena's `claude-code` context; socraticode runs the npm bin link ${ECO_ROOT}/bin/socraticode that both bootstraps' install_npm create, because this installer renders no ${SOCRATICODE_VERSION} (1.15.0 on Linux, 1.14.0 on macOS), and node runs the link's target, the package's dist/index.js (--preserve-symlinks-main is off by default); and the Codex-only PATH and RTK_TELEMETRY_DISABLED are left out, as serena's entry always has. SocratiCode's QDRANT_URL and LMSTUDIO_URL name this repository's defaults, QDRANT_URL and EMBED_URL in adoption/hosts/example.json, like the ai-memory URL: the installer compares env NAMES only, so a host already registered with its own values is reported as matching and kept, and a host whose endpoints differ registers its own values by hand. Claude Code has no per-server start-up timeout; MCP_TIMEOUT sets one for every server (https://code.claude.com/docs/en/mcp), where Codex gives serena 60 s and socraticode 120 s. headroom carries the four offline variables of recipes/README.md's registration (headroom-ai 0.37.0 turns its usage beacon on by default). qmd serves the catalog index this repository names, native-agent-stack-catalog (AGENTS.md). codebase-memory was left out by decision on 2026-09-27 (docs/decisions/2026-09-27-claude-harness-settings.md, item 12, token gap codebase-memory-mcp#2); the 2026-09-30 addendum of docs/decisions/2026-09-26-stack-agents-role-dispatch.md supersedes that exclusion for this registration only. No platform pins file installs it yet, so a new host installs the pinned v0.11.0 release by hand (recipes/README.md) before the entry connects, and never runs its `install` subcommand, which edits client configs. The entry is the bare binary with no arguments, upstream's manual form (DeusData/codebase-memory-mcp v0.11.0 README, Manual MCP Configuration): each session's process is a frontend of one shared per-account daemon that the first session starts (the same README, Session Coordination Daemon), so it is never wrapped in a bounded runner, whose scope stop would also stop a daemon started inside it (a forked child keeps its parent's cgroup, cgroups(7)). No shipped agent's tool list gains its tools.",
"_comment": "User-scope MCP server templates for `claude mcp add --scope user`, drafted 2026-09-23 from the live host's ~/.claude.json mcpServers block (names, commands, args and env var NAMES only -- no credentials, tokens or host-specific secret values). ${HOME} and ${ECO_ROOT} are placeholders in this template's own convention (adoption/templates/*.template.*): render or substitute them for the target host before use; do not commit a rendered copy with literal paths back into this file. install_claude_profile.py renders only ${HOME} and ${ECO_ROOT} and registers each server here but installs none of them (adoption/bootstrap.md step 4a), and `claude mcp add` refuses a name that already exists. To change only some servers, remove each one that should change (`claude mcp remove <name> -s user`) and rerun `install_claude_profile.py --only mcp` without --replace-mcp: that flag re-registers every differing server, ai-memory included. Changed 2026-09-25: serena runs Serena's own `serena` console script. `uv tool install` links it into ${ECO_ROOT}/bin when Serena is installed at the stack pin with the bootstrap's uv-tool layout: UV_TOOL_DIR=\"${ECO_ROOT}/python-tools\" UV_TOOL_BIN_DIR=\"${ECO_ROOT}/bin\" uv tool install --python 3.13 git+https://github.com/oraios/serena@c6fbd1c5932df2494ffa0020af5a9fbe80b82143 (adoption/bootstrap.md step 4a runs it; no bootstrap pin installs Serena). The 2026-09-23 entry named ${ECO_ROOT}/bin/serena-context, a wrapper local to that host (it set SERENA_HOME) that nothing in this repository creates; Serena reads SERENA_HOME itself and defaults to ~/.serena. The ai-memory URL is this repository's default bind, 127.0.0.1:49374 (recipes/README.md `ai-memory serve --bind`, AI_MEMORY_URL in adoption/hosts/example.json); the host's user-scope registration must name the port its own ai-memory unit binds, so on another port run `claude mcp remove ai-memory -s user`, then `claude mcp add --scope user --transport http ai-memory http://127.0.0.1:<port>/mcp`. Changed 2026-09-25: the jcodemunch entry was removed, so that jCodeMunch was no longer registered at user scope, where its server instruction to prefer it over Read/Grep/Glob/Bash loaded into every session. Changed 2026-10-04: the entry is back, on the user's directive that every fresh session starts with the tools ready (docs/decisions/2026-10-04-new-wsl-jcodemunch-user-scope.md), with the documented opt-out of its anonymous savings counter in the env block; `jcodemunch-mcp init` is not run. A project opts in with `claude mcp add --scope local` or a .mcp.json entry (adoption/bootstrap.md step 4a; docs/decisions/2026-09-23-claude-user-profile.md, 2026-09-25 addendum), and the Codex user template keeps it project-scoped too. The installer only visits the servers named here, so a host that registered jcodemunch per project (`--scope local`) keeps that registration beside the user-scope one. Changed 2026-09-30: socraticode, headroom, codebase-memory and qmd join, so this file registers every server the SubagentStart carrier blocks (adoption/hooks/claude/token-lanes-block*.md: the general block and the five role blocks) name except context-mode, which its plugin supplies. Each runs the command, arguments and environment of its entry in adoption/templates/codex.config.template.toml (tests/test_install_claude_profile.py, McpCodexParityTests), with three differences: serena runs Serena's `claude-code` context; socraticode runs the npm bin link ${ECO_ROOT}/bin/socraticode that both bootstraps' install_npm create, because this installer renders no ${SOCRATICODE_VERSION} (1.15.0 on Linux, 1.14.0 on macOS), and node runs the link's target, the package's dist/index.js (--preserve-symlinks-main is off by default); and the Codex-only PATH and RTK_TELEMETRY_DISABLED are left out, as serena's entry always has. SocratiCode's QDRANT_URL and LMSTUDIO_URL name this repository's defaults, QDRANT_URL and EMBED_URL in adoption/hosts/example.json, like the ai-memory URL: the installer compares env NAMES only, so a host already registered with its own values is reported as matching and kept, and a host whose endpoints differ registers its own values by hand. Claude Code has no per-server start-up timeout; MCP_TIMEOUT sets one for every server (https://code.claude.com/docs/en/mcp), where Codex gives serena 60 s and socraticode 120 s. headroom carries the four offline variables of recipes/README.md's registration (headroom-ai 0.37.0 turns its usage beacon on by default). qmd serves the catalog index this repository names, native-agent-stack-catalog (AGENTS.md). codebase-memory was left out by decision on 2026-09-27 (docs/decisions/2026-09-27-claude-harness-settings.md, item 12, token gap codebase-memory-mcp#2); the 2026-09-30 addendum of docs/decisions/2026-09-26-stack-agents-role-dispatch.md supersedes that exclusion for this registration only. Changed 2026-10-06: codebase-memory-mcp is the canonical server key after the CC ran the pinned v0.11.0 binary's native install --skip-binary --clients=claude route and read back the vendor registration, context hooks, skill and three agents. This template records the registration shape only; it does not copy or recreate those vendor assets. The entry is the bare binary with no arguments, upstream's manual form (DeusData/codebase-memory-mcp v0.11.0 README, Manual MCP Configuration): each session's process is a frontend of one shared per-account daemon that the first session starts (the same README, Session Coordination Daemon), so it is never wrapped in a bounded runner, whose scope stop would also stop a daemon started inside it (a forked child keeps its parent's cgroup, cgroups(7)). The vendor's Scout/Verify/Audit agents use its native read-only graph tool sets; this template adds no unrelated project agent grant.",
"mcpServers": {
"ai-memory": {
"type": "http",
Expand Down Expand Up @@ -63,7 +63,7 @@
"DO_NOT_TRACK": "1"
}
},
"codebase-memory": {
"codebase-memory-mcp": {
"type": "stdio",
"command": "${ECO_ROOT}/bin/codebase-memory-mcp",
"args": [],
Expand Down
Loading
Loading