bundle-analyze

bundle-analyze is a command for Claude Code from TheBeardedBearSAS/claude-craft. It costs 4 tokens per session (2,869 once invoked), scanned A, original, MIT.

A guide for examining a React application's bundle, which is the JavaScript sent to users, to see what makes it large. It covers dependencies, chunks, and common analysis tools.

In plain words
What is it for?
Use it to inspect Webpack, Vite, Next.js, or source-map reports and decide where bundle-size improvements may be possible.
Why use it?
Large bundles can slow down loading, but their causes are often hard to see from source code alone. This guide helps locate oversized dependencies and parts of the build to optimize.

Command for Claude Code

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

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/thebeardedbearsas/claude-craft/bundle-analyze
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/bundle-analyze.svg)](https://agentmods.dev/commands/thebeardedbearsas/claude-craft/bundle-analyze)
Your own site
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/bundle-analyze"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/bundle-analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 4 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,869 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.1 $0.00004 $0.02869
Opus 5 $0.00002 $0.01435
Sonnet 5 $0.00001 $0.00574
Haiku 4.5 $0.00000 $0.00287

Measured yesterday against content hash 9e86382ddb54, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

bundle-analyze 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.

.claude/commands/react/bundle-analyze.md · 475 lines

How it starts

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

Analyse du Bundle React

Tu es un expert performance React. Tu dois analyser la taille du bundle, identifier les dépendances volumineuses et proposer des optimisations.

Arguments

$ARGUMENTS

Arguments :

  • (Optionnel) Mode : full, dependencies, chunks

Exemple : /react:bundle-analyze ou /react:bundle-analyze dependencies

MISSION

Étape 1 : Outils d'Analyse

# Webpack Bundle Analyzer
npm install --save-dev webpack-bundle-analyzer

# Pour Vite
npm install --save-dev rollup-plugin-visualizer

# Pour Next.js
npm install --save-dev @next/bundle-analyzer

# Source Map Explorer (alternative)
npm install --save-dev source-map-explorer

Étape 2 : Configuration

Webpack (CRA / Custom)
// webpack.config.js
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
  plugins: [
    new BundleAnalyzerPlugin({
      analyzerMode: 'static',
      reportFilename: 'bundle-report.html',
      openAnalyzer: false,
      generateStatsFile: true,
      statsFilename: 'bundle-stats.json',
    }),
  ],
};
// package.json
{
  "scripts": {
    "analyze": "npm run build && npx webpack-bundle-analyzer build/bundle-stats.json",
    "analyze:server": "BUNDLE_ANALYZE=true npm run build"
  }
}
Vite
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';

export default defineConfig({
  plugins: [
    react(),
    visualizer({
      filename: 'bundle-report.html',
      open: true,
      gzipSize: true,
      brotliSize: true,
    }),
  ],
});
Next.js
// next.config.js
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
});

module.exports = withBundleAnalyzer({
  // Next.js config
});
// package.json
{
  "scripts": {
    "analyze": "ANALYZE=true next build"
  }
}

Étape 3 : Lancer l'Analyse

Read the full file on GitHub · 475 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 · 475 lines · 4 tokens per session scan A 9e86382ddb54

Subscribe to this mod's changes

bundle-analyze is a command published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 2d ago), licensed MIT. It adds 4 tokens to every session and 2,869 once invoked, about $0.0000 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-09-03.