| name | documentation |
|---|---|
| description | Document learnings, decisions, and reference info to /docs/ and CLAUDE.md. Also checks for outdated documentation. Use when the user wants to capture context for future reference. Trigger on "/documentation" or "document this", "update docs". |
| user_invocable | true |
Document current context to /docs/ and where appropriate CLAUDE.md, so it can be referenced in future conversations. Also check for outdated documentation.
-
Analyze the current context — look at what was just discussed, built, or decided. Identify what would be valuable to document for future reference (architecture decisions, API patterns, workflows, conventions, config details, etc.)
-
Check for existing docs — read
CLAUDE.mdand scan/docs/(create the directory if it doesn't exist) for related documentation that might need updating or that already covers this topic. -
Check for outdated documentation — flag anything in
CLAUDE.mdor/docs/that contradicts the current state of the codebase or recent decisions. Propose updates or removals. -
Write or update docs — based on what's appropriate:
/docs/: For detailed reference material (API usage, setup guides, architecture, integrations, troubleshooting). One file per topic, named descriptively (e.g.,api-access.md,deployment.md).CLAUDE.md: For concise project conventions, key commands, and high-level pointers that Claude Code needs in every conversation. Keep CLAUDE.md lean — point to/docs/for details.
-
Summarize what was documented and any outdated docs that were updated or flagged.
- Documentation lives in the repo, not in memory files. Always write docs as
.mdfiles inside the current working directory (e.g.,/docs/,CLAUDE.md, or alongside the relevant code). Never store reference information, decisions, or learnings in Claude's memory system (~/.claude/projects/.../memory/). Memory is for user preferences and feedback — documentation belongs in the repository where it's versioned, searchable, and visible to everyone. - Don't duplicate — if something is already documented, update it rather than creating a new file.
- Keep
CLAUDE.mdconcise. It's loaded every conversation — only put things there that are needed frequently. /docs/files can be more detailed and comprehensive.- Use the user's arguments (if provided) to focus on a specific topic. If no arguments, document whatever is most relevant from the current conversation context.
- Ask the user if anything is unclear about what should be documented.