phase-1-codebase-analysis

A structured guide for examining an application's source code and documenting how it is built, secured, operated, and connected to data.

In plain words
What is it for?
Use it to assess architecture, code quality, databases, security, business logic, deployment, and whether each part should be kept, moved, redesigned, or rebuilt.
Why use it?
It creates a factual technical picture before anyone decides what to change or replace.

Command 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 commands/burly-mingo/modernization-kit/phase-1-codebase-analysis
Clone the repo
git clone --depth 1 https://github.com/Burly-Mingo/modernization-kit

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 435 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.00000 $0.00435
Opus 5 $0.00000 $0.00217
Sonnet 5 $0.00000 $0.00087
Haiku 4.5 $0.00000 $0.00044

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

Security

Grade A, and why

phase-1-codebase-analysis 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.

.claude/commands/phase-1-codebase-analysis.md · 39 lines

How it starts

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

Phase 1: Codebase Analysis

Read the actual source code and produce a factual technical assessment of each application. No recommendations yet — purely diagnostic.

For Each Application, Assess:

Architecture & Structure: Pattern, project structure, entry points, request flow, inter-app communication, third-party dependencies with version/EOL status.

Code Quality & Patterns: Language/framework versions, design patterns, separation of concerns, error handling, logging, configuration management.

Data Layer: Database tech/version/count, relationships, cross-DB dependencies, ORM/data access patterns, schema complexity, credential handling.

Security Posture: Password storage, auth/session management, SQL injection, XSS, CSRF, encryption, secrets management, compliance-relevant findings.

Business Logic Location: App code vs. stored procs vs. triggers vs. config tables. Quantify the ratio. Identify black-box components.

Deployment & Operations: Build process, deployment mechanism, environments, monitoring, backup/recovery.

7 R's Classification: For each app/component — Retain, Retire, Rehost, Replatform, Refactor, Rearchitect, or Rebuild. Tag each as [Tactical] or [Strategic] with justification.

Multi-App: Consolidated Assessment

After per-app assessments, produce CONSOLIDATED_ASSESSMENT.md: shared data sources, data ownership conflicts, overlapping business logic, hidden coupling, data consistency risks, blast radius of schema changes, consolidation opportunities, inter-app dependency map.

Deliverables

  • ASSESSMENT.md per application (findings with evidence — file paths, code snippets, config values)
  • CONSOLIDATED_ASSESSMENT.md for multi-app engagements

Scaling (Large Codebases)

  1. Prioritize: entry points, config, data access, auth, build/deploy (80/20 rule)
  2. Run static analysis tools first (SonarQube, Snyk), feed results for interpretation
  3. Consider vector DB approach for semantic code search

Human Checkpoint

Read the full file on GitHub · 39 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 · 39 lines · 0 tokens per session scan A 7f62dbc9b5c6

Subscribe to this mod's changes

phase-1-codebase-analysis is a command published in the GitHub repository Burly-Mingo/modernization-kit (11 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 435 tokens. 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.