analyze-repo

analyze-repo is a command for Claude Code from nasrulhazim/claude. It costs 0 tokens per session (1,562 once invoked), scanned A, original, MIT.

A repository analysis command that examines a codebase's project type, size, structure, and dependency directories. A repository is the folder containing a project's source code and related files.

In plain words
What is it for?
Use it to inspect repositories containing PHP, Node.js, Python, Go, Rust, or Ruby projects and identify large components or dependencies.
Why use it?
It helps locate which parts of a repository take up space and reveals the framework or language in use before making cleanup or optimization recommendations.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; positional $N argument.

Part of the claude-toolkit plugin — 36 skills, 12 commands, 20 agents shipped together

Good fit Use it to inspect repositories containing PHP, Node.js, Python, Go, Rust, or Ruby projects and identify large components or dependencies.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/nasrulhazim/claude/analyze-repo
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.

Clone the repo
git clone --depth 1 https://github.com/nasrulhazim/claude

Made for: Claude Code.

Or install claude-toolkit, the plugin that ships this one along with the rest of its 36 skills, 12 commands, 20 agents.

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 analyze-repo

README.md
[![agentmods](https://agentmods.dev/badge/commands/nasrulhazim/claude/analyze-repo/github.svg)](https://agentmods.dev/commands/nasrulhazim/claude/analyze-repo)
Your own site
<a href="https://agentmods.dev/commands/nasrulhazim/claude/analyze-repo"><img src="https://agentmods.dev/badge/commands/nasrulhazim/claude/analyze-repo/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyze-repo

Your own site · 80×15
<a href="https://agentmods.dev/commands/nasrulhazim/claude/analyze-repo"><img src="https://agentmods.dev/badge/commands/nasrulhazim/claude/analyze-repo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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 1,562 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.01562
Opus 5 $0.00000 $0.00781
Sonnet 5 $0.00000 $0.00312
Haiku 4.5 $0.00000 $0.00156

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

Security

Grade A, and why

analyze-repo 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 11d 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.

commands/analyze-repo.md · 239 lines

How it starts

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

Repository Analysis Assistant

You are a specialized assistant for analyzing repository size, structure, and providing optimization recommendations.

Step 1: Detect Project Type

CRITICAL: First, identify what type of project this is.

Detection Checklist

Check Indicator Project Type
composer.json exists Laravel/PHP framework PHP (Laravel/Symfony)
package.json exists Node dependencies Node.js
requirements.txt exists Python packages Python
go.mod exists Go modules Go
Cargo.toml exists Rust crate Rust
Gemfile exists Ruby gems Ruby

Quick Detection Commands

# Check for project indicators
ls composer.json package.json requirements.txt go.mod Cargo.toml Gemfile 2>/dev/null

# Check for framework specifics
[ -f artisan ] && echo "Laravel"
[ -f manage.py ] && echo "Django"
[ -d .next ] && echo "Next.js"

Step 2: Size Analysis

Run these commands to analyze repository size:

Total Size by Component

# Project root size (excluding common excludes)
du -sh . 2>/dev/null | cut -f1

# Vendor/dependencies sizes
du -sh vendor 2>/dev/null | cut -f1
du -sh node_modules 2>/dev/null | cut -f1
du -sh .git 2>/dev/null | cut -f1

# Python virtual environments
du -sh venv .venv 2>/dev/null | cut -f1

Top-Level Directory Breakdown

# Size of each top-level directory
du -sh */ 2>/dev/null | sort -rh | head -20

Large Files Detection (>5MB)

# Find files larger than 5MB
find . -type f -size +5M -exec ls -lh {} \; 2>/dev/null | awk '{print $5, $9}' | sort -rh | head -20

# Exclude vendor/node_modules for source files only
find . -type f -size +5M \
  -not -path "./vendor/*" \
  -not -path "./node_modules/*" \
  -not -path "./.git/*" \
  -exec ls -lh {} \; 2>/dev/null | awk '{print $5, $9}' | sort -rh

File Count by Extension

# Count files by extension (source only)
find . -type f \
  -not -path "./vendor/*" \
  -not -path "./node_modules/*" \
  -not -path "./.git/*" \
  | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -20

Read the full file on GitHub · 239 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. 11d ago First seen · 239 lines · 0 tokens per session scan A cba38a0cacc3

Subscribe to this mod's changes

analyze-repo is a command published in the GitHub repository nasrulhazim/claude (22 stars, last pushed 9d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,562 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.