codemap-inject.en — Claude Code rule: what it does, how to install
codemap-inject.en is a Claude Code rule that injects codebase maps into subagent prompts matching map keywords. The subagent reads the map first and lists new symbols to append upon completion.
Apache-2.0 ★ 262 updated 2026-11-17
.claude/rules/codemap-inject.en.mdWhat codemap-inject.en does
The rule scans the {{CODEMAPS}} directory and adds a prompt instruction whenever a subagent task matches map keywords. The agent reads the referenced map before touching the code.
Upon finishing its task, the subagent outputs an update section where each found item follows the - symbol file:line format. These lines append directly to the target map. The exact structure of map files is defined in the directory's README.md.
What it helps with
- inject relevant code maps into subagent prompts using keyword matching
- collect discovered symbols with file paths and line numbers
- append new code references to maps in
{{CODEMAPS}}automatically
Example prompts for the agent
- Run a subagent to refactor auth logic and follow the matched map in
{{CODEMAPS}} - Inspect the task against code maps and append new symbols to the report
How to install codemap-inject.en
Manually: put the files in place
.claude/rules/codemap-inject.en.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/codemap-inject.en.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/codemap-inject.en.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/codemap-inject.en.mdManually: put the files in place
.clinerules/codemap-inject.en.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about codemap-inject.en
How to install codemap-inject.en in Claude Code?
Save the rule content to .claude/rules/codemap-inject.en.md in your project repository.
What does codemap-inject.en do?
It matches subagent tasks against code maps in {{CODEMAPS}} and directs the agent to read the matching map before starting.
How does the subagent report missing map entries?
The subagent ends its summary with lines formatted as - symbol file:line, which are appended to the map once the task stops.
Source text
codemap-inject.en.md · Apache-2.0
- Code maps (codemap-inject, codemap-fill): when a subagent's task matches the keywords of a map in `{{CODEMAPS}}`, its prompt gets a note to read that map first; the subagent ends its report with a section "## 地图要补的条目(<map path>)" (that exact heading), one line "- symbol file:line" each, which is appended to the map when it stops. The map format is in that directory's README.md.
© zuiho-kai · Apache-2.0 · zuiho-kai/bothouse