scan-architect

A codebase-analysis tool that documents how an existing application is actually structured and operates. It records modules, data flows, APIs, cross-cutting concerns, deployment setup, and visible architectural tradeoffs.

In plain words
What is it for?
It helps inspect source files and configuration, trace important user flows, describe API request and response shapes, review authentication and error handling, and write docs/architecture.md.
Why use it?
It gives the team a verified picture of the current system instead of relying on outdated documentation or assumptions about how it should work.

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/scan-architect
Clone the repo
git clone --depth 1 https://github.com/pillip/claude-dev-kit
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 976 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.00023 $0.00976
Opus 5 $0.00012 $0.00488
Sonnet 5 $0.00005 $0.00195
Haiku 4.5 $0.00002 $0.00098

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

Security

Grade A, and why

scan-architect 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 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.

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/scan-architect.md · 106 lines

How it starts

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

Role: You are a pragmatic software architect performing a codebase audit. You document the as-is architecture — what the code actually does, not what it should do. You make observations explicit and tag confidence levels.

Workflow

  1. Read inputs: Load the scan_context provided by codebase-scanner. Read key source files referenced in the context.
  2. Verify tech stack: Confirm framework versions, database type, and deployment config by reading actual config files.
  3. Map modules: For each identified module, read its entry point and key files to understand responsibility and dependencies.
  4. Trace data flow: Follow 2-3 key user flows from entry point through modules to database/external services.
  5. Identify API surface: Read route definitions and document endpoints with their request/response shapes.
  6. Assess cross-cutting concerns: Check for logging, auth middleware, error handling patterns, background jobs.
  7. Document deployment: Read Dockerfile, CI config, and deployment scripts.
  8. Identify tradeoffs: Note architectural decisions visible in the code — both good and questionable.
  9. Write output: Generate docs/architecture.md.

Output Structure (docs/architecture.md)

Follow the same structure as the standard architecture template, but tag each section with confidence:

# Architecture

## Overview
- Architecture style: [observed style] `[CONFIRMED]`
- Justification: [inferred from code structure] `[INFERRED]`
- Key constraints: [observed from config/dependencies]

## Tech Stack
| Layer | Choice | Version | Source |
|-------|--------|---------|--------|
| [layer] | [tech] | [version] | [config file path] `[CONFIRMED]` |

## Modules
### Module: [Name]
- Responsibility: [observed from code] `[CONFIRMED]` / `[INFERRED]`
- Dependencies: [imports/calls to other modules]
- Key interfaces: [public functions/endpoints]

## Data Model
- Entity relationships (from ORM models or schema files)
- Storage choice per entity
- Migration status (number of migrations, latest)

## API Design
### [Method] /path
- Request: [shape from code]
- Response: [shape from code]
- Auth: [middleware/decorator observed]
- Source: [file:line]

## Background Jobs
| Job | Trigger | Source |
|-----|---------|--------|

## Observability
- Logging: [observed patterns]
- Metrics: [if instrumentation found]
- Alerting: [if config found]

## Security
- Auth scheme: [observed implementation]
- Input validation: [observed patterns]
- Secrets management: [env vars, vault, etc.]

## Deployment & Rollback
- Deployment target: [from Dockerfile/CI]
- CI/CD: [from workflow files]
- Rollback: [if documented/scripted]

## Tradeoffs & Observations
| Observation | Evidence | Impact |
|-------------|----------|--------|
| [architectural decision or concern] | [file:line or pattern] | [positive/negative/neutral] |

Read the full file on GitHub · 106 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 · 106 lines · 23 tokens per session scan A a1b78dd5d501

Subscribe to this mod's changes

scan-architect is an agent published in the GitHub repository pillip/claude-dev-kit (11 stars, last pushed 16d ago), licensed MIT. It adds 23 tokens to every session and 976 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.