initref — Claude Code command: project reference docs in /ref
Builds reference docs about how the project is implemented into a /ref directory and links them from CLAUDE.md.
npx claude-code-templates@latest --command utilities/initrefWhat initref does
The command walks the project files and pulls summaries through the summarize tool instead of reading everything itself. That is deliberate: pulling full file contents into context tends to hit usage limits. Important files still get read in full, and those are what the reference is built on.
Output is markdown files under /ref. Once they exist, the command adds pointers to them in CLAUDE.md, so later sessions know where to look for implementation details.
Worth installing on projects where you are tired of re-explaining the layout to the agent. On a small codebase the payoff is thin, since the summaries already fit in context.
What it helps with
- build a reference for how the project is put together without reading every file
- give the agent a map of important files for later sessions
- keep implementation notes in markdown next to the code
- stay inside context limits while surveying a large repo
Example prompts for the agent
- /initref
- Build reference docs in /ref and update CLAUDE.md
- Run initref and list which files made it into the reference
How to install initref
1claude-code-templates
npx claude-code-templates@latest --command utilities/initref2Manually: put the files in place
.claude/commands/initref.mdCall it with /initref. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/initref.mdCall it with /prompts:initref. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/initref.prompt.mdManually: put the files in place
.gemini/commands/initref.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about initref
How do I install initref in Claude?
Through the templates package: npx claude-code-templates@latest --command utilities/initref. The command lands in .claude/commands/initref.md.
What does initref do?
It summarizes project files, writes markdown reference documents into /ref, and adds pointers to those documents in CLAUDE.md.
Why doesn't initref read every file itself?
Because of usage limits. Most of the material comes from summarize tool output, and only important files are read in full.
Source text
initref.md · MIT
--- description: "Build reference docs in /ref summarizing the implementation details of this project" --- Build a reference for the implementation details of this project. Use provided summarize tool to get summary of the files. Avoid reading the content of many files yourself, as we might hit usage limits. Do read the content of important files though. Use the returned summaries to create reference files in /ref directory. Use markdown format for writing the documentation files. Update CLAUDE.md file with the pointers to important documentation files.
© davila7 · MIT · davila7/claude-code-templates