Repository navigation
Conversation
…nswers Claude Code defers every MCP tool behind ToolSearch by default: at session start the model sees only tool names and server instructions, while Grep and Read are always loaded. Codex does the same and shows the server instructions as the namespace description of the deferred tools. Agents therefore reached for grep before the graph tools were even loaded (#509, discussion #2025). - tools/list: search_graph, trace_path and get_code_snippet carry _meta["anthropic/alwaysLoad"] = true (a documented per-tool hint), so the structural discovery path loads upfront while the other 14 tools stay deferred. About 4.6K characters of schema; clients that do not know the key ignore it, as MCP reserves _meta. - Server instructions (default profile) now state, keywords first and as facts, which structural questions the graph answers and where grep fits better: 309 -> 999 characters, within Claude Code's 4,096-character cut. - SessionStart/SubagentStart: the untrusted-metadata label now covers the graph-derived project name only. Wrapping the routing sentences too told the model to treat cbm's own guidance as data. The other sentences are unchanged; sanitization is unchanged. The initialize byte budget is raised deliberately from 512 B to 1.5 KiB (1,188 bytes now); tools/list stays within its 21 KiB budget (20,938 bytes). Refs #509 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
…rofiles The read-only analysis profile and the fast scout profile serve the graph subagents (codebase-memory-auditor, codebase-memory-scout). Their server instructions listed tools only. Like the default profile, they now state as facts which structural questions the graph answers (where a symbol is defined, who calls a function, what it calls, and for analysis also call chains, data flow and change impact), keywords first: analysis 190 -> 648 characters, scout 199 -> 427, well within Claude Code's 4,096-character cut. The profile names, check_index_coverage and the absence of index_repository are unchanged. Stacked on #2698. Refs #509 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2698. Until #2698 merges, this diff also shows its commit (c2ee122); this PR adds only 5e345e3.
What changes
The read-only analysis profile and the fast scout profile serve the graph subagents (codebase-memory-auditor, codebase-memory-scout). Their server instructions only listed tools. Like the default profile in #2698, they now state as facts, keywords first, which structural questions the graph answers: where a symbol is defined, who calls a function and what it calls; the analysis profile also covers call chains, data flow and change impact. Under tool search these instructions are what a client loads before the model searches.
Both stay well under Claude Code's 4,096-character cut. The profile names, the
check_index_coveragepointer and the absence ofindex_repositoryare unchanged, and the existing profile tests still assert them.Tests
server_handle_analysis_profile_filters_and_rejects_mutatorsandserver_handle_scout_profile_exposes_only_the_fast_tiernow also assert the structural-question text.src/mcp/mcp.c, exactly those two tests fail; with this change both pass.mcp379 passed / 0 failed / 4 skipped (Windows-only).Refs #509