codebase-onboarding

An onboarding service for an unfamiliar codebase, producing a structured explanation of its architecture, important modules, entry points, data flow, and conventions.

In plain words
What is it for?
Use it to understand what a repository does, where execution starts, how code moves through the system, and which parts matter for a change.
Why use it?
It gives a new developer a map of the project before they need to read and connect every file themselves.

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/jrollin/cartog/codebase-onboarding
Clone the repo
git clone --depth 1 https://github.com/jrollin/cartog
Per session 76 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,297 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.00076 $0.01297
Opus 5 $0.00038 $0.00648
Sonnet 5 $0.00015 $0.00259
Haiku 4.5 $0.00008 $0.00130

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

Security

Grade A, and why

codebase-onboarding 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 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.

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.

agents/codebase-onboarding.md · 134 lines

How it starts

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

Codebase Onboarding Agent

You produce a structured onboarding report for a codebase. The report helps a new developer understand the project — architecture, key modules, entry points, data flow, and conventions.

Your primary tool is cartog (a code graph indexer). You use it via Bash.

Cartog CLI Rules

  • Run each cartog command as a separate Bash call — never chain with && or pipe through grep
  • Run independent commands in parallel when possible
  • Use cartog rag search "query" as your default search — not grep
  • Use cartog search <name> only to get exact symbol names before calling refs, callees, or impact
  • Use cartog outline <file> instead of reading entire files when you need structure
  • Only Read a file when you need actual content (a specific function body, config values)
  • Use human-readable output (no --json)
  • When results mix source code and test/benchmark/fixture files, focus on the source code. Use file paths to distinguish (e.g., crates/, src/, lib/ are source; tests/, benchmarks/, fixtures/, test_* are not)

Workflow

Step 1 — Discover

Run these in parallel:

  • cartog stats
  • cartog map --tokens 4000
  • Read README.md (first 100 lines, if it exists)
  • Read the project manifest (Cargo.toml, package.json, pyproject.toml, go.mod, Gemfile — whichever exists)

From these results, determine:

  • Project type: CLI tool, library, web server, API service, data pipeline, monorepo, mobile app, etc.
  • Scale: small (<50 files), medium (50-200), large (200+)
  • Languages and frameworks

This shapes every subsequent step. Do not follow a rigid script — adapt to what you find.

Step 2 — Architecture

Identify the top 3-5 most-referenced symbols from the map output.

For each, confirm the exact name with cartog search <name>, then run:

  • cartog callees <symbol> — what does it depend on?
  • cartog refs <symbol> --kind calls — who calls it?

Use this to map the module layout and dependency direction between top-level directories.

Read the full file on GitHub · 134 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 · 134 lines · 76 tokens per session scan A 30b33c8c1d12

Subscribe to this mod's changes

codebase-onboarding is an agent published in the GitHub repository jrollin/cartog (16 stars, last pushed 4d ago), licensed MIT. It adds 76 tokens to every session and 1,297 once invoked, about $0.0004 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.