Skip to content

Instantly share code, notes, and snippets.

@psteinweber
Last active March 21, 2026 09:17
Show Gist options
  • Select an option

  • Save psteinweber/795a36d95432106eb73461b4cd5673b7 to your computer and use it in GitHub Desktop.

Select an option

Save psteinweber/795a36d95432106eb73461b4cd5673b7 to your computer and use it in GitHub Desktop.
Claude Code Documentation Skill
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

documentation

Document current context to /docs/ and where appropriate CLAUDE.md, so it can be referenced in future conversations. Also check for outdated documentation.

Steps

  1. 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.)

  2. Check for existing docs — read CLAUDE.md and scan /docs/ (create the directory if it doesn't exist) for related documentation that might need updating or that already covers this topic.

  3. Check for outdated documentation — flag anything in CLAUDE.md or /docs/ that contradicts the current state of the codebase or recent decisions. Propose updates or removals.

  4. 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.
  5. Summarize what was documented and any outdated docs that were updated or flagged.

Guidelines

  • Documentation lives in the repo, not in memory files. Always write docs as .md files 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.md concise. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment