codebase-analysis

A codebase analysis tool that examines an existing project for similar features, reusable utilities, and established design patterns.

In plain words
What is it for?
Use it to find related files and functions, identify patterns to follow, and produce implementation guidance for a requested task.
Why use it?
It helps an agent understand how the project is structured before changing it, reducing duplicated or inconsistent code.

Skill for Claude CodeCodex

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 skills/mehdic/bazinga/codebase-analysis
Any agent
npx skills add mehdic/bazinga --skill codebase-analysis
Clone the repo
git clone --depth 1 https://github.com/mehdic/bazinga

Made for: Claude Code, Codex.

Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 558 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.00019 $0.00558
Opus 5 $0.00010 $0.00279
Sonnet 5 $0.00004 $0.00112
Haiku 4.5 $0.00002 $0.00056

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

Security

Grade A, and why

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.

The scan reads SKILL.md. This mod also ships 8 executable files (scripts/analyze_codebase.py, scripts/analyze.ps1, scripts/analyze.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/skills/codebase-analysis/SKILL.md · 89 lines

How it starts

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

Codebase Analysis Skill

You are the codebase-analysis skill. Your role is to analyze a codebase and provide developers with relevant context for their implementation tasks.

When to Invoke This Skill

  • Developer needs to understand existing patterns before implementation
  • Complex features require architectural guidance
  • Reusable utilities need to be discovered
  • Similar features exist that could be referenced

Your Task

When invoked with a task description and session ID, you must:

Step 1: Execute Analysis Script

python3 .claude/skills/codebase-analysis/scripts/analyze_codebase.py \
  --task "$TASK_DESCRIPTION" \
  --session "$SESSION_ID" \
  --cache-enabled

Note: Output path defaults to bazinga/artifacts/{session_id}/skills/codebase-analysis/report.json (session-isolated)

Step 2: Read Analysis Results

# Read from session-isolated artifact directory
cat bazinga/artifacts/$SESSION_ID/skills/codebase-analysis/report.json

Step 3: Return Actionable Summary

Return a concise summary including:

  • Similar features found (with file paths and similarity %)
  • Reusable utilities (with function names)
  • Architectural patterns to follow
  • Suggested implementation approach

Example Output Format

CODEBASE ANALYSIS COMPLETE

## Similar Features Found
- User registration (auth/register.py) - 85% similarity
  * Email validation pattern
  * Token generation approach
  * Database transaction handling

## Reusable Utilities
- EmailService (utils/email.py) - send_email(), validate_email()
- TokenGenerator (utils/tokens.py) - generate_token(), verify_token()

## Architectural Patterns
- Service layer pattern (business logic in services/)
- Repository pattern for data access

## Suggested Implementation Approach
1. Create PasswordResetService in services/
2. Reuse EmailService for sending reset emails
3. Use TokenGenerator for reset tokens
4. Follow transaction pattern from register.py

Full analysis: bazinga/artifacts/{session_id}/skills/codebase-analysis/report.json

Read the full file on GitHub · 89 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 · 89 lines · 19 tokens per session scan A 2fb542e97bc1

Subscribe to this mod's changes

codebase-analysis is a skill published in the GitHub repository mehdic/bazinga (21 stars, last pushed 7mo ago), licensed MIT. It adds 19 tokens to every session and 558 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.