Problem
The installed codebase-memory skill routes text searches to search_code, but it does not explain how to use the lean output controls now available on main. In practice, agents can respond to broad results by raising limit or combining mode: "full" with a high limit, producing unnecessarily large MCP responses. Literal alternation such as foo|bar is also easy to send without regex: true.
The current release, v0.10.8, does not expose the newer controls. Current main already implements the server-side pieces: max_output_tokens, independent ranked/raw/directory pagination, bounded source and raw-line expansion, semantic truncation metadata, and the literal-pipe warning. This proposal does not change the MCP API or handler behavior.
Proposal
Add a concise Code Search Workflow section to the installer-owned embedded codebase-memory skill in src/cli/cli.c:
- Use
search_graph(semantic_query=[...]) for broad natural-language discovery.
- Use
search_graph for known or partial symbols.
- Use
search_code for exact identifiers, literals, errors, and settings.
- Start with
compact or files, result_limit: 10, and max_output_tokens: 3200.
- Narrow with
path_filter and file_pattern before paging via returned offsets.
- Treat omissions as a narrowing signal rather than immediately raising limits.
- Reserve
full for one to three expected hits and bound source_max_lines.
- Require
regex: true for patterns such as foo|bar.
- Explicitly call out
full + high limit as an anti-pattern.
Keep the always-loaded agent instructions unchanged so detailed usage guidance costs context only when the skill is loaded. Extend cli_skill_files_content to contract-test the key guidance.
Non-goals
- No MCP schema or behavior changes.
- No new
include_tests or generated-file controls. Existing scoped search, ignore rules, and test-result ranking remain unchanged.
- No default changes or compatibility impact.
Would this focused skill-guidance change be acceptable?
Problem
The installed
codebase-memoryskill routes text searches tosearch_code, but it does not explain how to use the lean output controls now available onmain. In practice, agents can respond to broad results by raisinglimitor combiningmode: "full"with a high limit, producing unnecessarily large MCP responses. Literal alternation such asfoo|baris also easy to send withoutregex: true.The current release, v0.10.8, does not expose the newer controls. Current
mainalready implements the server-side pieces:max_output_tokens, independent ranked/raw/directory pagination, bounded source and raw-line expansion, semantic truncation metadata, and the literal-pipe warning. This proposal does not change the MCP API or handler behavior.Proposal
Add a concise
Code Search Workflowsection to the installer-owned embeddedcodebase-memoryskill insrc/cli/cli.c:search_graph(semantic_query=[...])for broad natural-language discovery.search_graphfor known or partial symbols.search_codefor exact identifiers, literals, errors, and settings.compactorfiles,result_limit: 10, andmax_output_tokens: 3200.path_filterandfile_patternbefore paging via returned offsets.fullfor one to three expected hits and boundsource_max_lines.regex: truefor patterns such asfoo|bar.full + high limitas an anti-pattern.Keep the always-loaded agent instructions unchanged so detailed usage guidance costs context only when the skill is loaded. Extend
cli_skill_files_contentto contract-test the key guidance.Non-goals
include_testsor generated-file controls. Existing scoped search, ignore rules, and test-result ranking remain unchanged.Would this focused skill-guidance change be acceptable?