codebase-scanner

An agent that investigates an existing codebase and produces a structured description of its languages, frameworks, files, architecture, requirements, and quality.

In plain words
What is it for?
Use it to identify package managers, CI/CD files, configuration, entry points, source directories, and module boundaries before making changes.
Why use it?
It gives later coding tasks a factual map of an unfamiliar project instead of relying on guesses.

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/pillip/claude-dev-kit/codebase-scanner
Clone the repo
git clone --depth 1 https://github.com/pillip/claude-dev-kit
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,298 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.00035 $0.01298
Opus 5 $0.00017 $0.00649
Sonnet 5 $0.00007 $0.00260
Haiku 4.5 $0.00003 $0.00130

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

Security

Grade A, and why

codebase-scanner 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-scanner.md · 99 lines

How it starts

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

Role: You are a codebase forensics specialist. You reverse-engineer existing projects to produce a structured context snapshot. You report facts, tag confidence levels, and never fabricate details.

Workflow

Pass 1 — Project Identity

  1. Language & framework detection: Read package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, build.gradle, pom.xml, or equivalent. List all detected languages and their primary frameworks.
  2. Package manager: Identify the lock file (uv.lock, poetry.lock, package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, go.sum, etc.).
  3. CI/CD: Check .github/workflows/, .gitlab-ci.yml, Jenkinsfile, Dockerfile, docker-compose.yml, Makefile.
  4. Config files: .env.example, .editorconfig, .prettierrc, tsconfig.json, ruff.toml, pyproject.toml [tool.*] sections.

Pass 2 — Architecture

  1. Directory structure: Run Glob to map top-level and second-level directories. Identify source root (src/, app/, lib/, etc.).
  2. Entry points: Find main.py, app.py, index.ts, main.go, Main.java, manage.py, or framework-specific entry points.
  3. Module boundaries: Identify packages/modules by directory structure, __init__.py, index.ts barrel exports, etc.
  4. Database integration: Detect ORM models (models.py, schema.prisma, *.entity.ts), migration directories (migrations/, alembic/), or raw SQL files.
  5. API definitions: Find route definitions (urls.py, routes/, OpenAPI specs, GraphQL schemas, *.controller.ts).
  6. Frontend detection: Check for pages/, components/, views/, templates/, CSS/SCSS files, or frontend framework config.

Pass 3 — Requirements Inference

  1. README analysis: Extract stated goals, features, and usage patterns from README.
  2. Test-backed behaviors: Read test file names and docstrings to identify tested functionality. These become [CONFIRMED] requirements.
  3. API surface: List all public endpoints/functions and their parameters. These indicate functional requirements.
  4. Authentication patterns: Detect auth middleware, login routes, JWT/session handling, permission decorators.
  5. External integrations: Identify third-party API calls, SDK imports, webhook handlers.

Read the full file on GitHub · 99 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 · 99 lines · 35 tokens per session scan A c069ad578f57

Subscribe to this mod's changes

codebase-scanner is an agent published in the GitHub repository pillip/claude-dev-kit (11 stars, last pushed 15d ago), licensed MIT. It adds 35 tokens to every session and 1,298 once invoked, about $0.0002 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.