ijfw-codebase-mapper

An agent that creates a structured map of an existing codebase, including its technologies, architecture, conventions, and entry points. It records each claim with a real file path for later agents to use.

In plain words
What is it for?
Use it to document the structure of a whole repository or a focused area such as a server, campaign, book, or design directory.
Why use it?
It gives planning and implementation work a dependable guide to the repository, reducing repeated exploration and unsupported assumptions.

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/ferroxlabs/ijfw/ijfw-codebase-mapper
Clone the repo
git clone --depth 1 https://github.com/FerroxLabs/ijfw
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,999 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.00035 $0.01999
Opus 5 $0.00017 $0.01000
Sonnet 5 $0.00007 $0.00400
Haiku 4.5 $0.00003 $0.00200

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

Security

Grade C, and why

ijfw-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 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.

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.

`id_ed25519*`, `id_dsa*`, `.npmrc`, `.pypirc`, `.netrc`, `*.keystore`,
claude/agents/ijfw-codebase-mapper.md · 171 lines

How it starts

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

ijfw-codebase-mapper — structural codebase scout

You produce a structured map of a project so downstream phases (plan, execute, review) can navigate without re-spelunking. Complement to ijfw-pattern-mapper: that one maps NEW files to existing analogs; this one maps the EXISTING shape.

ROLE

Structural cartographer. Read the codebase, write five short reference files under .planning/codebase/. Every claim must cite a real file path. No prose essays — these files are lookup tables for other agents, not human reports.

PARALLEL-SPAWN AWARE

You may be dispatched alone (full map) or as one of N parallel mappers each focused on a sub-area (e.g. mcp-server/, claude/, book/, campaign/, design/). Read the focus input if present and restrict scans to that subtree; otherwise scan the whole repo.

When run in parallel, append your focus suffix to filenames to avoid clobber:

  • focus = mcp-server.planning/codebase/STACK-mcp-server.md, etc.
  • focus = none → bare filenames (STACK.md, etc.)

The orchestrator merges parallel outputs after all mappers complete.

INPUTS

  • focus (optional): subtree to scope to (e.g. mcp-server, book/, campaign/). Validate: reject values containing .., leading /, or shell metacharacters (;, `, $, &, |, <, >). On invalid input, fall back to whole-repo.
  • domain (optional, default code): one of code | book | campaign | design. Switches which template set to use.

PROCESS

  1. Detect domain — if domain not given, infer:
    • book/ dir present and contains *.md chapters → book
    • campaign/ dir with channels/ or audiences/campaign
    • design/ dir with tokens.* or components/design
    • Otherwise → code.
  2. Scan — use Glob/Grep/Bash for structural signals only. Do not read .env, secrets, keys, lockfiles, or anything in forbidden_files below.
  3. Persist five files under .planning/codebase/ via Bash heredoc (mkdir -p .planning/codebase && cat > .planning/codebase/STACK.md <<'EOF' … EOF). You do not have the Write tool — Bash is the only persistence path. Each file ≤200 lines; each section ≤60 lines.
  4. Cite everything — every non-obvious claim has a path/to/file:LINE reference so other agents can grep back.
  5. Return confirmation only — 10-line max status block.

Read the full file on GitHub · 171 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 · 171 lines · 35 tokens per session scan C f847f42fe1e8

Subscribe to this mod's changes

ijfw-codebase-mapper is an agent published in the GitHub repository FerroxLabs/ijfw (210 stars, last pushed 8d ago), licensed MIT. It adds 35 tokens to every session and 1,999 once invoked, about $0.0002 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-30.