Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/awattar/claude-code-best-practices/custom-initgit clone --depth 1 https://github.com/awattar/claude-code-best-practicesWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00012 | $0.02119 |
| Opus 5 | $0.00006 | $0.01059 |
| Sonnet 5 | $0.00002 | $0.00424 |
| Haiku 4.5 | $0.00001 | $0.00212 |
Grade A, and why
custom-init scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 208 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Code User Command: Custom Init
This command helps you initialize a new, well-formatted CLAUDE.md file with codebase documentation.
Usage
To initialize a new CLAUDE.md file with codebase documentation, just type:
/custom-init
Relationship to native /init
Claude Code ships with a built-in /init command that also generates a CLAUDE.md.
/custom-init covers the same goal through the explicit, deterministic phased workflow
below, which produces a more structured result: staged analysis, per-feature detection,
a versioned technology stack inventory, and consistent section ordering. Pick whichever
fits the project — they are alternatives, not a hierarchy.
What This Command Does
Analyzes the project's architecture, technology stack, and key features through the phased workflow below, then writes the findings to CLAUDE.md so Claude (or any AI assistant) can work effectively in the codebase.
Agents Used
The main session orchestrates and dispatches each pass to the best-fit specialist agent through the Task tool, so each agent works in its own context window. Reach for general-purpose only as a fallback when no specialist matches a pass.
- general-solution-architect — Phase 2 (architecture + technology stack).
- general-backend-developer — Phase 3 backend passes (authentication, business domain, data access, communication).
- general-devops — Phase 3 infrastructure pass and Phase 4 deployment pass.
- general-qa — Phase 4 testing pass.
- general-code-quality-debugger — Phase 4 troubleshooting pass.
- general-technical-writer — Phase 4 documentation-discovery pass and Phase 5 assembly.
Phases 0 and 1 run inline in the main session. Phases 2, 3, and 4 can all be dispatched in the same message and run concurrently. Phase 5 is sequential — it consumes the outputs of Phases 2–4 and must wait for them to return.
Follow these steps:
Phase 0: Initialization
- Command Execution
- Execute the command in the current directory.
- Validate that the current directory is a project root.
- Check for an existing CLAUDE.md file.
- Set the analysis depth to a comprehensive scan.
- Environment Setup
- Verify the current directory contains project files.
- Check for a
.gitdirectory or other VCS metadata. - Confirm read access to project files.
- Tool Detection
- Check which relevant CLI tools are available (
git,docker,npm,dotnet, etc.). - Note language-specific tooling that can inform deeper analysis.
- Check which relevant CLI tools are available (
- Configuration Loading
- Use smart defaults for all settings.
- Respect ignore patterns from
.gitignore. - Apply standard markdown output formatting.
- Pre-flight Checks
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 208 lines · 12 tokens per session scan A 2eb70d376ab6
custom-init is a command published in the GitHub repository awattar/claude-code-best-practices (250 stars, last pushed 3mo ago), licensed MIT. It adds 12 tokens to every session and 2,119 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.