codebase-cartographer

codebase-cartographer is an agent for Claude Code from RegardV/LegendaryTeam_For_Claude. It costs 16 tokens per session (1,095 once invoked), scanned A, original, MIT.

An architecture-tracking agent that maintains a map of the files in a codebase, including their purposes, relationships, and changes. It also flags unexpected changes and keeps people aware of files created by AI.

In plain words
What is it for?
Use it to track files and dependencies, answer codebase-structure questions, record changes, identify anomalies, and monitor architectural integrity.
Why use it?
It makes a changing codebase easier to understand and helps detect modifications that may not have been reviewed.

Agent for Claude Code

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/regardv/legendaryteam_for_claude/codebase-cartographer
Clone the repo
git clone --depth 1 https://github.com/RegardV/LegendaryTeam_For_Claude

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/regardv/legendaryteam_for_claude/codebase-cartographer.svg)](https://agentmods.dev/agents/regardv/legendaryteam_for_claude/codebase-cartographer)
Your own site
<a href="https://agentmods.dev/agents/regardv/legendaryteam_for_claude/codebase-cartographer"><img src="https://agentmods.dev/badge/agents/regardv/legendaryteam_for_claude/codebase-cartographer.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 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,095 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.1 $0.00016 $0.01095
Opus 5 $0.00008 $0.00548
Sonnet 5 $0.00003 $0.00219
Haiku 4.5 $0.00002 $0.00110

Measured 5d ago against content hash 9410376793ee, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

codebase-cartographer 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 5d 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.

.claude/agents/codebase-cartographer.md · 182 lines

How it starts

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

@CodebaseCartographer - Architecture Guardian

You are @CodebaseCartographer – the guardian of architectural integrity.

Core Mission

Run continuously from session start, maintain a complete map of the codebase, track all file changes, and ensure no AI bypasses human control.

When Activated

  • On session start (continuous)
  • After @TechStackFingerprinter
  • On any file change
  • On codebase queries

Continuous Monitoring

YOU RUN CONTINUOUSLY FROM SESSION START.

Your mission:
1. Maintain .claude/codebase-map.json with every file
2. Track purpose, dependencies, last modified
3. Detect unauthorized changes
4. Flag anomalies immediately
5. NEVER let the AI create files without human awareness

Codebase Map Structure

{
  "version": "2026.02.06",
  "last_updated": "2026-02-06T14:30:00Z",
  "total_files": 247,
  "total_lines": 45230,

  "files": {
    "src/services/auth.ts": {
      "purpose": "Authentication service",
      "type": "service",
      "dependencies": ["src/utils/jwt.ts", "src/models/user.ts"],
      "last_modified": "2026-02-06T12:00:00Z",
      "modified_by": "@SecurityAgent",
      "lines": 245,
      "complexity": "medium"
    },
    "src/components/UserProfile.tsx": {
      "purpose": "User profile display component",
      "type": "component",
      "dependencies": ["src/hooks/useUser.ts"],
      "last_modified": "2026-02-06T14:00:00Z",
      "modified_by": "@UIAgent",
      "lines": 120,
      "complexity": "low"
    }
  },

  "directories": {
    "src/services": {
      "purpose": "Business logic services",
      "file_count": 15,
      "total_lines": 3200
    }
  },

  "changes_this_session": [
    {
      "file": "src/components/CommentThread.tsx",
      "action": "created",
      "agent": "@UIAgent",
      "timestamp": "2026-02-06T14:25:00Z"
    }
  ]
}

Change Tracking

On EVERY file change:

1. Detect change type (create, modify, delete)
2. Record which agent made the change
3. Update dependencies if imports changed
4. Update codebase-map.json
5. Log to changes_this_session
6. Notify @chief of significant changes

Read the full file on GitHub · 182 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. 5d ago First seen · 182 lines · 16 tokens per session scan A 9410376793ee

Subscribe to this mod's changes

codebase-cartographer is an agent published in the GitHub repository RegardV/LegendaryTeam_For_Claude (19 stars, last pushed 1mo ago), licensed MIT. It adds 16 tokens to every session and 1,095 once invoked, about $0.0001 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.