map-codebase

A method for building an evidence-based map of an unfamiliar codebase or subsystem. It records relevant files, line references, how calls move between parts of the code, and unanswered questions.

In plain words
What is it for?
Use it when onboarding, tracing how a feature works, finding callers of a function, planning a refactor, or investigating behavior that crosses multiple system boundaries.
Why use it?
It helps developers understand the scope and possible side effects of a change before editing several modules. Each conclusion is tied to code instead of memory or guesswork.

Skill for Claude CodeCodex

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 skills/duthaho/claudekit/map-codebase
Any agent
npx skills add duthaho/claudekit --skill map-codebase
Clone the repo
git clone --depth 1 https://github.com/duthaho/claudekit

Made for: Claude Code, Codex.

Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,166 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.00112 $0.02166
Opus 5 $0.00056 $0.01083
Sonnet 5 $0.00022 $0.00433
Haiku 4.5 $0.00011 $0.00217

Measured 2d ago against content hash a8d79a734d8b, 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 2d 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.

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.

skills/map-codebase/SKILL.md · 155 lines

How it starts

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

Map Codebase

Overview

A methodical exploration workflow that produces an evidence-cited map of a codebase area. Replaces ad-hoc grep with a disciplined four-step pass: scope, list, read, diagram. The output is a short artifact you can attach to a plan or design doc — file paths, line numbers, call directions, and the questions you couldn't answer from reading. The skill's value is enforcing that every claim about the code is backed by a specific file:line citation, not a memory or pattern-match. Senior ICs and tech leads use it to bound the blast radius of a change before they propose it.

When to Use

  • Before writing a plan that touches more than one module
  • When inheriting a codebase area you didn't author
  • When a teammate asks "how does X work" and you don't have a confident answer with citations
  • Before a refactor, to enumerate everything that calls the code you're about to change
  • When debugging crosses a boundary you don't fully understand (auth, ORM, framework internals)

When NOT to Use

  • The change is single-file and you've already read the file
  • You're modifying code you wrote yourself within the last week
  • The "exploration" is really a one-line lookup that Grep answers in 5 seconds

Process

Step 1: Scope

Goal: Pin down what you are mapping and what you explicitly are not.

Inputs: A task, plan, or question that triggered the need to explore.

Actions:

  1. Write one sentence: I am mapping <X> in order to <Y>. X is concrete (a feature, a module, a request path). Y is the decision the map will support.
  2. Write one sentence naming what is out of scope: I am not mapping <Z>. This prevents the exploration from sprawling.
  3. Set a time box. 30 minutes for a single feature, 90 minutes for a subsystem.

Output: A two-sentence scope statement at the top of your scratch artifact.

Step 2: List entry points

Goal: Enumerate every place execution can enter the area being mapped.

Inputs: The scope statement.

Read the full file on GitHub · 155 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. 2d ago First seen · 155 lines · 112 tokens per session scan A a8d79a734d8b

Subscribe to this mod's changes

map-codebase is a skill published in the GitHub repository duthaho/claudekit (97 stars, last pushed 1mo ago), licensed MIT. It adds 112 tokens to every session and 2,166 once invoked, about $0.0006 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-30.

Related

Other skills, from other repositories

writing-workflow-skills

Use when adding a new workflow skill to pi-thinkrail-workflow, changing an existing workflow skill's role, trigger, handoff, or structure, or checking a workflow skill against the workflow system's rules. Not for authoring general-purpose skills outside this package.

JetBrains/thinkrail · 60 tokens

todos

This chat has a shared, live TODO plan — your tasks for the conversation, which the user also edits. Read this skill and reach for the todo tools whenever a request takes more than a couple of steps. It covers the plan model (group = task, items = its steps; loose items are the user's lane), how to work it: propose…

JetBrains/thinkrail · 127 tokens

writing-specs

Use when a workflow step drafts or revises a spec artifact — a goal-and-requirements, an architecture, or a module SPEC — or when a workflow skill names it at such a step. The shared quality bar for specs — not a workflow, nothing to execute.

JetBrains/thinkrail · 59 tokens

clarify

Adaptive requirements clarification with auto-depth routing. Shallow (Q&A) for simple tasks, Deep (exploration + DRAFT + PLAN) for complex ones. Escalates automatically when ambiguity persists.

mag123c/toktrack · 43 tokens

self-assessment

Interactive skill assessment with personalized learning path generation.

FlorianBruniaux/claude-code-ultimate-guide · 12 tokens

source-command-methodology-advisor

Analyzes your codebase and asks 3 targeted questions to recommend the right AI-assisted development methodology stack.

FlorianBruniaux/claude-code-ultimate-guide · 27 tokens