02-core-use-jcodemunch-for-code-retrievallisted
Install: claude install-skill markkennethbadilla/public-agent-provisioning
# Use jcodemunch for Code Retrieval (CORE)
**Why:** Reading whole code files or grepping the tree dumps thousands of tokens for a few lines you need. jcodemunch indexes the repo and hands back only the matching symbols/snippets — night-and-day token savings. **BARE MODE (as of 2026-07-17):** runs as-is on built-in defaults — NO external summarizer, NO API key (the DeepSeek wiring was removed for speed); skip any summarizer-backed output and work from the raw symbols/snippets.
1. **Code → jcode, not Read/Grep**: For any source-code lookup, call a jcodemunch tool first — it returns just the symbols you asked for, where reading a whole file or grepping the tree floods context with tokens you didn't need. (Native Read/Grep are also gate-removed, rule 20b.)
2. **LAZY FIRST INDEX**: Before the first lookup in a repo, check `list_repos`; if the repo is absent, call `index_repo` / `index_file` / `index_folder` before querying.
3. **TRUST THE HOOK FOR FRESHNESS; "NOT INDEXED" IS NEVER A WALL**: A PostToolUse hook auto-reindexes edited files (see the agent-provisioning toolkit's Claude config). If a repo is already indexed, don't force a full re-index. If it's NOT indexed, that is a one-line setup step to DO (index it, then query) — never a reason to abandon jcode and fall back to native/grep/cat. Abandoning a blessed tool on a fixable setup error is the exact defect rule 20i bans; only a genuinely EXHAUSTED tool (rule 1b) licenses the fallback.
## Core tools & when to use