Skip to main content
command

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.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command utilities/initref
Open on GitHub

What 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/initref

2Manually: put the files in place

.claude/commands/initref.md

Call it with /initref. For all projects use ~/.claude/commands/

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

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor