codebase-mapper

codebase-mapper is an agent for Claude Code from SienkLogic/plan-build-run. It costs 28 tokens per session (2,969 once invoked), scanned C, original, MIT.

An agent that explores an existing codebase and writes structured documents about its technology, architecture, quality, and concerns. It bases claims on files it actually reads and includes their paths.

In plain words
What is it for?
Use it to map a project’s structure, document how it works, assess code quality, and record risks or areas needing attention.
Why use it?
It makes an unfamiliar codebase easier to understand and provides evidence-backed notes instead of guesses based on filenames.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the pbr plugin — 44 skills, 71 commands, 18 agents, 3 hooks shipped together

Good fit Use it to map a project’s structure, document how it works, assess code quality, and record risks or areas needing attention.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sienklogic/plan-build-run/codebase-mapper
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.

Clone the repo
git clone --depth 1 https://github.com/SienkLogic/plan-build-run

Made for: Claude Code.

Or install pbr, the plugin that ships this one along with the rest of its 44 skills, 71 commands, 18 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codebase-mapper

README.md
[![agentmods](https://agentmods.dev/badge/agents/sienklogic/plan-build-run/codebase-mapper/github.svg)](https://agentmods.dev/agents/sienklogic/plan-build-run/codebase-mapper)
Your own site
<a href="https://agentmods.dev/agents/sienklogic/plan-build-run/codebase-mapper"><img src="https://agentmods.dev/badge/agents/sienklogic/plan-build-run/codebase-mapper/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codebase-mapper

Your own site · 80×15
<a href="https://agentmods.dev/agents/sienklogic/plan-build-run/codebase-mapper"><img src="https://agentmods.dev/badge/agents/sienklogic/plan-build-run/codebase-mapper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,969 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00028 $0.02969
Opus 5.5 $0.00011 $0.01188
Sonnet 5.5 $0.00006 $0.00594
Haiku 4.5 $0.00003 $0.00297

Measured 1mo ago against content hash a7e42384bb9a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

codebase-mapper scanned grade C with 1 finding 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 1mo 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- `.npmrc`, `.pypirc`, `.netrc` — Package manager auth tokens
plugins/pbr/agents/codebase-mapper.md · 292 lines

How it starts

The opening of the file, as written. The whole thing — 292 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<files_to_read> CRITICAL: If your spawn prompt contains a files_to_read block, you MUST Read every listed file BEFORE any other action. Skipping this causes hallucinated context and broken output. </files_to_read>

Default files: none (explores freely based on focus area) Optional files (read ONLY if they exist on disk — do NOT attempt if absent): .planning/KNOWLEDGE.md — project knowledge (rules, patterns, lessons)

Plan-Build-Run Codebase Mapper

Core Principle

Document quality over brevity. Every claim references actual file paths.

  • Always include file paths. Every claim must reference the actual code location. Never say "the config file" — say "tsconfig.json at project root" or "src/config/database.ts".
  • Write current state only. No temporal language ("recently added", "will be changed", "was refactored"). Document WHAT IS, not what was or will be.
  • Be prescriptive, not descriptive. When documenting conventions: "Use this pattern" not "This pattern exists."
  • Evidence-based. Read the actual files. Don't guess from file names or directory structures.

<upstream_input>

Upstream Input

From /pbr:scan or /pbr:explore Skill

  • Spawned by: /pbr:scan or /pbr:explore skill
  • Receives: Focus area (tech, arch, quality, or concerns)
  • Input format: Spawn prompt with focus: {area} directive </upstream_input>

<why_this_matters>

Why This Matters — Downstream Consumers

These documents are consumed by other PBR commands:

/pbr:plan loads relevant codebase docs when creating implementation plans:

Phase Type Documents Loaded
UI, frontend, components CONVENTIONS.md, STRUCTURE.md
API, backend, endpoints ARCHITECTURE.md, CONVENTIONS.md
database, schema, models ARCHITECTURE.md, STACK.md
testing, tests TESTING.md, CONVENTIONS.md
integration, external API INTEGRATIONS.md, STACK.md
refactor, cleanup CONCERNS.md, ARCHITECTURE.md
setup, config STACK.md, STRUCTURE.md

Read the full file on GitHub · 292 lines

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. 1mo ago First seen · 292 lines · 28 tokens per session scan C a7e42384bb9a

Subscribe to this mod's changes

codebase-mapper is an agent published in the GitHub repository SienkLogic/plan-build-run (19 stars, last pushed 6mo ago), licensed MIT. It adds 28 tokens to every session and 2,969 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories