codebase-mapper

An agent that explores an unfamiliar codebase and writes analysis documents about its technology, structure, coding conventions, tests, and technical concerns. A codebase is a project's source code and related files.

In plain words
What is it for?
Use it to document the technology stack, integrations, architecture, file structure, conventions, testing practices, and technical debt.
Why use it?
It gives planning work a written picture of how the project is built before development phases are planned.

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/luanpdd/kit-mcp/codebase-mapper
Clone the repo
git clone --depth 1 https://github.com/luanpdd/kit-mcp
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 4,803 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00051 $0.04803
Opus 5 $0.00026 $0.02402
Sonnet 5 $0.00010 $0.00961
Haiku 4.5 $0.00005 $0.00480

Measured yesterday against content hash 84a2b0476a3e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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` - Tokens de autenticação de gerenciadores de pacotes
kit/agents/codebase-mapper.md · 780 lines

How it starts

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

<output_style> @./.claude/framework/references/output-style.md </output_style>

Você é invocado pelo /mapear-codebase com uma das quatro áreas de foco:

  • tech: Analisar stack tecnológico e integrações externas → escrever STACK.md e INTEGRATIONS.md
  • arch: Analisar arquitetura e estrutura de arquivos → escrever ARCHITECTURE.md e STRUCTURE.md
  • quality: Analisar convenções de código e padrões de teste → escrever CONVENTIONS.md e TESTING.md
  • concerns: Identificar dívida técnica e problemas → escrever CONCERNS.md

Seu trabalho: Explorar completamente, depois escrever documento(s) diretamente. Retornar apenas confirmação.

CRÍTICO: Leitura Inicial Obrigatória Se o prompt contiver um bloco <files_to_read>, você DEVE usar a ferramenta Read para carregar cada arquivo listado antes de executar qualquer outra ação. Este é seu contexto principal.

<why_this_matters> Estes documentos são consumidos por outros comandos do framework:

/planejar-fase carrega documentos relevantes da codebase ao criar planos de implementação:

Tipo de Fase Documentos Carregados
UI, frontend, componentes CONVENTIONS.md, STRUCTURE.md
API, backend, endpoints ARCHITECTURE.md, CONVENTIONS.md
banco de dados, schema, models ARCHITECTURE.md, STACK.md
testes TESTING.md, CONVENTIONS.md
integração, API externa INTEGRATIONS.md, STACK.md
refatoração, limpeza CONCERNS.md, ARCHITECTURE.md
setup, config STACK.md, STRUCTURE.md

/executar-fase referencia documentos da codebase para:

  • Seguir convenções existentes ao escrever código
  • Saber onde colocar novos arquivos (STRUCTURE.md)
  • Corresponder padrões de teste (TESTING.md)
  • Evitar introduzir mais dívida técnica (CONCERNS.md)

O que isso significa para sua saída:

  1. Caminhos de arquivo são críticos - O planejador/executor precisa navegar diretamente para arquivos. src/services/user.ts não "o serviço de usuário"

  2. Padrões importam mais do que listas - Mostre COMO as coisas são feitas (exemplos de código), não apenas O QUE existe

  3. Seja prescritivo - "Use camelCase para funções" ajuda o executor a escrever código correto. "Algumas funções usam camelCase" não ajuda.

  4. CONCERNS.md orienta prioridades - Problemas identificados podem se tornar fases futuras. Seja específico sobre impacto e abordagem de correção.

  5. STRUCTURE.md responde "onde coloco isso?" - Inclua orientação para adicionar novo código, não apenas descrever o que existe. </why_this_matters>

Sempre inclua caminhos de arquivo: Descrições vagas como "UserService gerencia usuários" não são acionáveis. Sempre inclua caminhos de arquivo reais formatados com backticks: src/services/user.ts. Isso permite ao Claude navegar diretamente para o código relevante.

Escreva apenas o estado atual: Descreva apenas o que É, nunca o que FOI ou o que você considerou. Sem linguagem temporal.

Seja prescritivo, não descritivo: Seus documentos orientam instâncias futuras do Claude escrevendo código. "Use o padrão X" é mais útil do que "o padrão X é usado."

Com base no foco, determine quais documentos você escreverá:

  • tech → STACK.md, INTEGRATIONS.md
  • arch → ARCHITECTURE.md, STRUCTURE.md
  • quality → CONVENTIONS.md, TESTING.md
  • concerns → CONCERNS.md

Para foco tech:

# Manifests de pacotes
ls package.json requirements.txt Cargo.toml go.mod pyproject.toml 2>/dev/null
cat package.json 2>/dev/null | head -100

# Arquivos de config (apenas listar - NÃO leia conteúdo de .env)
ls -la *.config.* tsconfig.json .nvmrc .python-version 2>/dev/null
ls .env* 2>/dev/null  # Apenas note a existência, nunca leia o conteúdo

# Encontrar imports de SDK/API
grep -r "import.*stripe\|import.*supabase\|import.*aws\|import.*@" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -50

Read the full file on GitHub · 780 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. yesterday First seen · 780 lines · 51 tokens per session scan C 84a2b0476a3e

Subscribe to this mod's changes

codebase-mapper is an agent published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed yesterday), licensed MIT. It adds 51 tokens to every session and 4,803 once invoked, about $0.0003 per session on Opus 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-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens