map-codebase

A command that examines an existing codebase and writes structured documentation about how it is built and maintained.

In plain words
What is it for?
Use it to create or refresh .paul/codebase/ documents with findings and real file paths, then verify and commit the codebase map.
Why use it?
It gives developers a practical map of unfamiliar technology, architecture, conventions, tests, integrations, and areas of concern.

Command

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 commands/christopherkahler/paul/map-codebase
Clone the repo
git clone --depth 1 https://github.com/ChristopherKahler/paul
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 265 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.00000 $0.00265
Opus 5 $0.00000 $0.00133
Sonnet 5 $0.00000 $0.00053
Haiku 4.5 $0.00000 $0.00026

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

Security

Grade A, and why

map-codebase 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.

src/commands/map-codebase.md · 35 lines

What it actually says

Spawns parallel Explore agents to analyze technology stack, architecture, conventions, testing patterns, external integrations, and areas of concern.

<execution_context> @src/workflows/map-codebase.md </execution_context>

The workflow implements:

  1. Check if .paul/codebase/ exists (offer refresh/update/skip)
  2. Create directory structure
  3. Spawn 4 parallel Explore agents:
    • Agent 1: Stack + Integrations (Technology Focus)
    • Agent 2: Architecture + Structure (Organization Focus)
    • Agent 3: Conventions + Testing (Quality Focus)
    • Agent 4: Concerns (Issues Focus)
  4. Collect and aggregate agent findings
  5. Write 7 codebase documents from templates
  6. Verify and commit
  7. Offer next steps

<success_criteria>

  • .paul/codebase/ directory created
  • All 7 documents populated with findings
  • Documents include actual file paths (actionable)
  • Codebase map committed
  • User informed of next steps </success_criteria>
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 · 35 lines · 0 tokens per session scan A eebbda02ec77

Subscribe to this mod's changes

map-codebase is a command published in the GitHub repository ChristopherKahler/paul (1,206 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 265 tokens. 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.