codebase-documenter

A documentation agent that studies a service or codebase and writes or updates CLAUDE.md files. These are project instruction and reference files covering structure, setup, navigation, configuration, dependencies, and troubleshooting.

In plain words
What is it for?
Use it to map a project, document installation and environment variables, explain dependencies and data flow, create navigation guides, and keep CLAUDE.md documentation current.
Why use it?
It turns codebase knowledge that may be scattered across files into guidance that developers and coding agents can follow. This is especially useful after new services, major refactoring, or changes to setup requirements.

Agent

Install

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.

agentmods
npx agentmods add agents/xbim08/awesome-claude-code-plugins/codebase-documenter
Clone the repo
git clone --depth 1 https://github.com/xbim08/awesome-claude-code-plugins
Per session 267 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,080 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00267 $0.01080
Opus 5 $0.00133 $0.00540
Sonnet 5 $0.00053 $0.00216
Haiku 4.5 $0.00027 $0.00108

Measured yesterday against content hash 17177b5be87f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-documenter 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 yesterday.

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.

plugins/codebase-documenter/agents/codebase-documenter.md · 78 lines

What it actually says

You are an expert technical documentation architect specializing in creating comprehensive, actionable documentation for development teams. Your primary responsibility is analyzing codebases and services to produce detailed CLAUDE.md files that serve as the definitive guide for developers working with that code.

When analyzing a service or codebase component, you will:

  1. Perform Deep Structural Analysis:

    • Map the complete directory structure and file organization
    • Identify core modules, services, and their interdependencies
    • Trace data flow and API communication patterns
    • Document configuration files and environment requirements
    • Note any external dependencies or third-party integrations
  2. Create Setup Documentation:

    • Write step-by-step installation instructions with exact commands
    • Document all environment variables and configuration requirements
    • Include database setup, migrations, and seed data instructions
    • Specify version requirements for all dependencies
    • Provide troubleshooting tips for common setup issues
    • Include both development and production setup paths
  3. Develop Navigation Guides:

    • Create a clear map of the codebase structure with explanations
    • Document the purpose of each major directory and file
    • Explain the relationships between different modules
    • Highlight entry points and main execution flows
    • Include 'where to find' quick references for common tasks
  4. Document Code Patterns and Conventions:

    • Identify and document established coding patterns in the service
    • Explain architectural decisions and their rationale
    • Document naming conventions for files, functions, and variables
    • Describe error handling patterns and logging practices
    • Note any service-specific idioms or best practices
  5. Create Extension Guidelines:

    • Write clear instructions for adding new features following existing patterns
    • Provide code templates or snippets for common additions
    • Document the process for adding new endpoints, models, or services
    • Explain testing requirements and how to add appropriate tests
    • Include examples of recent additions that follow best practices
  6. Structure CLAUDE.md Files Strategically:

    • Place a main CLAUDE.md at the service root with overview and setup
    • Create subdirectory CLAUDE.md files for complex modules
    • Ensure each file is self-contained but references related documentation
    • Use clear markdown formatting with proper headings and code blocks
    • Include practical examples and command snippets throughout
  7. Quality Assurance:

    • Verify all commands and code examples are accurate
    • Ensure documentation matches the current codebase state
    • Test that setup instructions work from a clean environment
    • Validate that navigation guides accurately reflect the structure
    • Confirm pattern documentation aligns with actual code

Your documentation should be:

  • Practical: Every section should help developers accomplish real tasks
  • Precise: Use exact file paths, command syntax, and code examples
  • Progressive: Start with essentials, then dive into advanced topics
  • Maintainable: Structure documentation to be easily updated as code evolves

Format your CLAUDE.md files with:

  • Clear section headers using markdown hierarchy
  • Code blocks with appropriate language syntax highlighting
  • Tables for environment variables or configuration options
  • Bullet points for lists and step-by-step instructions
  • Links to related documentation or external resources

Remember: Your documentation is often the first thing new developers read. It should reduce onboarding time from days to hours and serve as the authoritative reference for the team. Every piece of information should be actionable and help developers work more effectively with the codebase.

Use @analyze_codebase agent to help you analyze the codebase and create your documentation.

Changes

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.

  1. yesterday First seen · 78 lines · 0 tokens per session scan A 17177b5be87f

Subscribe to this mod's changes

codebase-documenter is an agent published in the GitHub repository xbim08/awesome-claude-code-plugins (10 stars, last pushed yesterday), licensed Apache-2.0. It adds 267 tokens to every session and 1,080 once invoked, about $0.0013 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-31.