understand-codebase

understand-codebase is a skill for Claude Code, Codex from cdeust/ai-architect-mcp-codebase. It costs 45 tokens per session (560 once invoked), scanned A, original, MIT.

A codebase-mapping workflow that builds an evidence-based picture of an unfamiliar repository, including its files, symbols, dependencies, and gaps in analysis.

In plain words
What is it for?
Use it to understand architecture, locate relevant code, investigate unfamiliar areas, explain dependencies, and check structural claims about a repository.
Why use it?
It reduces guesswork before changing or debugging code and makes clear when the map is incomplete.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the ai-architect-mcp-codebase plugin — 3 skills, 25 commands, 23 agents, 6 hooks, 2 MCP servers shipped together

Good fit Use it to understand architecture, locate relevant code, investigate unfamiliar areas, explain dependencies, and check structural claims about a repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cdeust/ai-architect-mcp-codebase/understand-codebase
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.

Any agent
npx skills add cdeust/ai-architect-mcp-codebase --skill understand-codebase
Clone the repo
git clone --depth 1 https://github.com/cdeust/ai-architect-mcp-codebase

Made for: Claude Code, Codex.

Or install ai-architect-mcp-codebase, the plugin that ships this one along with the rest of its 3 skills, 25 commands, 23 agents, 6 hooks, 2 MCP servers.

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 understand-codebase

README.md
[![agentmods](https://agentmods.dev/badge/skills/cdeust/ai-architect-mcp-codebase/understand-codebase/github.svg)](https://agentmods.dev/skills/cdeust/ai-architect-mcp-codebase/understand-codebase)
Your own site
<a href="https://agentmods.dev/skills/cdeust/ai-architect-mcp-codebase/understand-codebase"><img src="https://agentmods.dev/badge/skills/cdeust/ai-architect-mcp-codebase/understand-codebase/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 understand-codebase

Your own site · 80×15
<a href="https://agentmods.dev/skills/cdeust/ai-architect-mcp-codebase/understand-codebase"><img src="https://agentmods.dev/badge/skills/cdeust/ai-architect-mcp-codebase/understand-codebase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00045 $0.00560
Opus 5.5 $0.00018 $0.00224
Sonnet 5.5 $0.00009 $0.00112
Haiku 4.5 $0.00005 $0.00056

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

Security

Grade A, and why

understand-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 1mo 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.

plugins/ai-architect-mcp-codebase/skills/understand-codebase/SKILL.md · 36 lines

How it starts

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

Understand Codebase

Use the eight-tool core profile. Do not assume that pipeline-only tools are available.

For Rust caller or impact questions, request lsp: true in analyze_codebase and make rust-analyzer available. Inspect lsp_status.state: disabled means static-only analysis; failed means analysis continued and may retain partial LSP results. Record the error and treat affected conclusions as unverified until source checks or a successful rerun support them. completed means the pass returned, not that every call resolved. Record unresolved sites and coverage gaps.

If a full-profile workflow supplies a check_security_gates receipt, inspect both gates_passed and assessment_complete. A true pass with an incomplete assessment is not security clearance: report skipped checks, unresolved symbols and warnings. This core-profile workflow does not invoke that additional tool.

Workflow

  1. Call health_check and record the active profile and tool count. Stop with an installation or configuration instruction if the server is unavailable.
  2. Resolve the repository root to an absolute path. Choose a task-scoped, absolute, writable output_dir for graph artifacts; never use the source root or a broad system directory as that output.
  3. Call analyze_codebase with the repository path and output directory. Reuse the exact graph_path returned by the tool in every later call.
  4. Immediately call query_graph with graph="missed". Treat parse-incomplete, skipped, and quarantined files as explicit coverage gaps. Absence from this report is not proof of complete indexing.
  5. Use search_codebase to discover qualified symbol names. Drill into relevant hits with get_context or get_symbol; do not guess qualified names.
  6. Use read-only query_graph queries for structural questions the typed tools do not answer. Add ORDER BY before paging with next_offset.
  7. For any important negative result, inspect the coverage report and use targeted source search for the relevant symbols and call forms, including unflagged files, before concluding that a symbol or edge does not exist. A clean coverage report does not establish relationship completeness.

Read the full file on GitHub · 36 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago Changed · +12 lines f64124469612
  2. 1mo ago First seen · 24 lines · 45 tokens per session scan A 5efece92fcee

Subscribe to this mod's changes

understand-codebase is a skill published in the GitHub repository cdeust/ai-architect-mcp-codebase (7 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 560 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

Other skills, from other repositories

bug-fix

Investigate, reproduce, and safely fix a bug with regression protection. Composes context, diagnosis, architecture, code quality, and testing guardrails into a reproduce-first repair workflow. Use when the user says 'fix this bug', 'debug this', 'investigate this failure', 'patch this regression', 'repair this issue'…

techygarg/lattice · 77 tokens

refactor-safely

Restructure existing code safely without changing externally observable behavior. Composes context, design, architecture, code quality, and testing guardrails into a characterization-first refactoring workflow. Use when the user says 'refactor this', 'clean this up', 'untangle this module', 'move this to the right…

techygarg/lattice · 82 tokens

workflow-bug-triage

Use when investigating a bug to root-cause and FILE a GitHub issue rather than fixing immediately — counterpart to /swe-workbench:debug (which patches). Enforces the Iron Law (no patches without root cause), and produces a structured issue with code-path table and impact assessment.

lugassawan/swe-workbench · 65 tokens

workflow-audit-emit-issues

After a codebase audit, groups audit findings by subsystem (path prefix) and emits them as context-rich GitHub issues with template discovery, label selection, and a batch preview-confirm gate before filing. Keywords — audit findings grouped github issues subsystem emit.

lugassawan/swe-workbench · 58 tokens

workflow-codebase-audit

Use for cold-start, time-boxed, multi-axis audits of unfamiliar codebases — take-home assessments, post-acquisition or due-diligence reviews, pre-refactor tech-debt sweeps. Dispatches the auditor subagent for the broad sweep, optionally fans out to security-auditor / debugger on top findings (only when --depth=deep)…

lugassawan/swe-workbench · 91 tokens

workflow-hotfix

Branch-based P0 incident hotfix lifecycle — skips the worktree provider, opens a ready-for-review PR immediately after a minimal hotfix, ahead of verification and review (deferred by design), stamps a deferred-verification marker in the PR body, then reconciles once a regression test lands and the suite goes green.…

lugassawan/swe-workbench · 79 tokens