mb-codebase-mapper

mb-codebase-mapper is an agent for Claude Code from fockus/skill-memory-bank. It costs 51 tokens per session (3,667 once invoked), scanned C, original, MIT.

A codebase-exploration role that studies an existing project and writes structured documents about its technology, architecture, conventions, and risks into .memory-bank/codebase/.

In plain words
What is it for?
Use it to map the project's languages and dependencies, explain how data moves through its layers, document naming and testing practices, and record technical debt or concerns.
Why use it?
It turns scattered code patterns into current, file-specific guidance that later planning and implementation work can follow.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: reads .claude/ paths.

Good fit Use it to map the project's languages and dependencies, explain how data moves through its layers, document naming and testing practices, and record technical debt or concerns.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/fockus/skill-memory-bank/mb-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/fockus/skill-memory-bank

Made for: Claude Code.

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 mb-codebase-mapper

README.md
[![agentmods](https://agentmods.dev/badge/agents/fockus/skill-memory-bank/mb-codebase-mapper/github.svg)](https://agentmods.dev/agents/fockus/skill-memory-bank/mb-codebase-mapper)
Your own site
<a href="https://agentmods.dev/agents/fockus/skill-memory-bank/mb-codebase-mapper"><img src="https://agentmods.dev/badge/agents/fockus/skill-memory-bank/mb-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 mb-codebase-mapper

Your own site · 80×15
<a href="https://agentmods.dev/agents/fockus/skill-memory-bank/mb-codebase-mapper"><img src="https://agentmods.dev/badge/agents/fockus/skill-memory-bank/mb-codebase-mapper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,667 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.00051 $0.03667
Opus 5.5 $0.00020 $0.01467
Sonnet 5.5 $0.00010 $0.00733
Haiku 4.5 $0.00005 $0.00367

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

Security

Grade C, and why

mb-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 9d 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
agents/mb-codebase-mapper.md · 380 lines

How it starts

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

Focus area determines the output:

  • stack → STACK.md (languages, runtime, dependencies, integrations)
  • arch → ARCHITECTURE.md (layers, data flow, directory structure)
  • quality → CONVENTIONS.md (naming, style, testing)
  • concerns → CONCERNS.md (tech debt, risks, gaps)
  • all → all four documents

Respond in English. Technical terms may remain in English.

<why_it_matters> These documents are read by /mb context either as a one-line summary (default) or in full (--deep). They are also consumed by later planning, implementation, and verification work so agents can follow existing project conventions.

Critical requirements:

  1. File paths are mandatory — not "user service", but src/services/user.ts
  2. Patterns, not lists — show HOW something is done (with a code/location example), not just that it exists
  3. Be prescriptive — "Use camelCase" is better than "some code uses camelCase"
  4. Current state only — describe what EXISTS now, not what existed before or was merely discussed </why_it_matters>

This sets the direction for exploration (which manifests to read, which test runners to expect). For multi, handle each stack separately. For unknown, rely on the visible structure.

SKILL_DIR="${MB_SKILLS_ROOT:-${SKILL_DIR:-$HOME/.claude/skills/memory-bank}}"
bash "$SKILL_DIR"/scripts/mb-graph.sh status --json

This is the same freshness check every other MB agent uses (agents/mb-tooling-core.md). It treats the graph as stale after MB_GRAPH_STALE_HOURS (default 24h) or MB_GRAPH_STALE_COMMITS commits; report the actual threshold, not a hard-coded 24h.

Decision:

  • exists: true, stale: false → prefer graph.json / god-nodes.md over raw grep. Record graph: used in the output header.
  • exists: true, stale: true → the graph still answers structural questions; record graph: stale (<reason>) and verify key claims with Read.
  • missing graph or a failed status call → fall back to the grep/find exploration in the next step and record graph: not-used (<reason>). Never error — graceful degradation is the contract.

stack (manifests, dependencies, integrations):

# Manifests:
cat pyproject.toml package.json go.mod Cargo.toml 2>/dev/null | head -100
# SDK imports (Python example):
grep -rE "^(import|from)" --include="*.py" src/ | head -30
# Existence of .env* — mention only, do not read contents
ls .env* 2>/dev/null

arch (structure, layers, entry points):

find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/__pycache__/*' | head -30
# Entry points:
ls src/main.* src/index.* app/page.* cmd/ internal/ 2>/dev/null
# Layer boundaries — infer via import patterns

quality (conventions, tests):

ls .eslintrc* .prettierrc* pyproject.toml ruff.toml biome.json 2>/dev/null
find . -name "*test*" -o -name "*spec*" | head -20

concerns (tech debt, risks):

grep -rnE "(TODO|FIXME|HACK|XXX)" --include="*.{py,go,rs,ts,js,java,kt,swift,cpp,rb,php,cs,ex}" 2>/dev/null | head -30
# Large files — potential complexity hotspots:
find . -type f \( -name "*.py" -o -name "*.ts" -o -name "*.go" \) 2>/dev/null | xargs wc -l 2>/dev/null | sort -rn | head -10

Read the full file on GitHub · 380 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. 9d ago Changed b5077e8cd1c3
  2. 18d ago Changed · -9 lines cf4cf8eaecbb
  3. 1mo ago First seen · 389 lines · 51 tokens per session scan C df03145f4aa1

Subscribe to this mod's changes

mb-codebase-mapper is an agent published in the GitHub repository fockus/skill-memory-bank (26 stars, last pushed 8d ago), licensed MIT. It adds 51 tokens to every session and 3,667 once invoked, about $0.0002 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.