claude-code-analyzer

Analyzes Claude Code usage patterns and provides comprehensive recommendations. Runs usage analysis, discovers GitHub community resources, suggests CLAUDE.md improvements, and fetches latest docs on-demand. Use when user wants to optimize their Claude Code workflow, create configurations (agents/skills/commands), or set up project documentation.

16 stars

Best use case

claude-code-analyzer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyzes Claude Code usage patterns and provides comprehensive recommendations. Runs usage analysis, discovers GitHub community resources, suggests CLAUDE.md improvements, and fetches latest docs on-demand. Use when user wants to optimize their Claude Code workflow, create configurations (agents/skills/commands), or set up project documentation.

Teams using claude-code-analyzer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/claude-code-analyzer/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/claude-code-analyzer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/claude-code-analyzer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How claude-code-analyzer Compares

Feature / Agentclaude-code-analyzerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyzes Claude Code usage patterns and provides comprehensive recommendations. Runs usage analysis, discovers GitHub community resources, suggests CLAUDE.md improvements, and fetches latest docs on-demand. Use when user wants to optimize their Claude Code workflow, create configurations (agents/skills/commands), or set up project documentation.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Claude Code History Analyzer

Complete workflow optimization for Claude Code through usage analysis, community discovery, and intelligent configuration generation.

## Core Capabilities

This skill provides a complete Claude Code optimization workflow:

**1. Usage Analysis** - Extracts patterns from Claude Code history
- Tool usage frequency
- Auto-allowed tools vs actual usage
- Model distribution
- Project activity levels

**2. GitHub Discovery** - Finds community resources automatically
- Skills matching your tools
- Agents for your workflows  
- Slash commands for common operations
- CLAUDE.md examples from similar projects

**3. Project Analysis** - Detects tech stack and suggests documentation
- Package manager and scripts
- Framework and testing setup
- Docker, CI/CD, TypeScript configuration
- Project-specific CLAUDE.md sections

**4. On-Demand Documentation** - Fetches latest Claude Code docs
- Agents/subagents structure and configuration
- Skills architecture and bundled resources
- Slash commands with MCP integration
- CLAUDE.md best practices from Anthropic teams
- Settings and environment variables

## Complete Analysis Workflow

When user asks to optimize their Claude Code setup, follow this workflow:

### Step 1: Run Usage Analysis
```bash
bash scripts/analyze.sh --current-project
```

This automatically:
- Extracts tool usage from JSONL files
- Checks auto-allowed tools configuration
- Analyzes model distribution
- **Searches GitHub for community resources** (always enabled)

### Step 2: Run Project Analysis
```bash
bash scripts/analyze-claude-md.sh
```

This detects:
- Package manager (npm, pnpm, yarn, cargo, go, python)
- Framework (Next.js, React, Django, FastAPI, etc.)
- Testing setup (Vitest, Jest, pytest, etc.)
- CI/CD, Docker, TypeScript, linting configuration

### Step 3: Interpret Combined Results

Combine insights from both analyses:

**Usage patterns** show:
- Tools used frequently but requiring approval → Add to auto-allows
- Auto-allowed tools never used → Remove from config
- Repetitive bash commands → Create slash commands
- Complex workflows → Create dedicated agents
- Domain-specific tasks → Build custom skills

**GitHub discovery** provides:
- Similar configurations from community
- Proven patterns for your tool usage
- Example agents/skills/commands to adapt

**Project analysis** reveals:
- Required CLAUDE.md sections
- Framework-specific conventions to document
- Testing and build commands to include

### Step 4: Fetch Docs and Create Configurations

Based on recommendations, fetch latest docs and create:

**For frequently used tools** → Update auto-allows:
```bash
# Fetch settings docs
web_fetch: https://docs.claude.com/en/docs/claude-code/settings
# Update ~/.claude/settings.json
```

**For repetitive commands** → Create slash command:
```bash
# Fetch slash commands docs
web_fetch: https://docs.claude.com/en/docs/claude-code/slash-commands
# Create .claude/commands/[command-name].md
```

**For complex workflows** → Create agent:
```bash
# Fetch agents docs
web_fetch: https://docs.claude.com/en/docs/claude-code/sub-agents
# Create .claude/agents/[agent-name].md
```

**For reusable domain knowledge** → Build skill:
```bash
# Fetch skills docs
web_fetch: https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview
# Create .claude/skills/[skill-name]/SKILL.md
```

**For project context** → Write CLAUDE.md:
```bash
# Fetch CLAUDE.md best practices
web_fetch: https://www.anthropic.com/engineering/claude-code-best-practices
# Create .claude/CLAUDE.md with detected info
```

## Example: Complete Optimization Session

**User**: "Help me optimize my Claude Code setup"

**Claude executes**:

1. **Analyze usage patterns**
   ```bash
   bash scripts/analyze.sh --current-project
   ```
   Finds: Bash tool used 150 times, Read 80 times, Write 45 times
   Auto-allows: None configured
   GitHub: Discovers community skills for TypeScript testing

2. **Analyze project structure**
   ```bash
   bash scripts/analyze-claude-md.sh
   ```
   Detects: Next.js project with Vitest, npm scripts: dev, build, test, lint
   Missing: CLAUDE.md doesn't exist

3. **Make recommendations**
   "I analyzed your Claude Code usage. Here's what I recommend:
   
   **Auto-Allows**: You use Bash (150×), Read (80×), and Write (45×) constantly. Let me add them to auto-allows.
   
   **Slash Command**: You run tests frequently. I'll create /test command.
   
   **CLAUDE.md**: Your Next.js project needs documentation. I'll create one with your npm scripts and testing setup.
   
   **Community Resource**: I found a TypeScript testing skill on GitHub that matches your workflow."

4. **Fetch docs and create configs**
   
   Fetch settings docs → Update `~/.claude/settings.json`:
   ```json
   {
     "autoAllowedTools": ["Bash", "Read", "Write"]
   }
   ```
   
   Fetch slash commands docs → Create `.claude/commands/test.md`:
   ```markdown
   ---
   name: /test
   description: Run tests for current file or project
   allowed-tools: [Bash]
   ---
   Run tests: !npm test
   ```
   
   Fetch CLAUDE.md best practices → Create `.claude/CLAUDE.md`:
   ```markdown
   # Project Context
   
   ## Commands
   - Dev: `npm run dev` (port 3000)
   - Build: `npm run build`
   - Test: `npm test`
   - Lint: `npm run lint`
   
   ## Tech Stack
   - Next.js 14
   - TypeScript
   - Vitest for testing
   
   ## Testing
   Run tests before commits: `npm test`
   ```

5. **Share GitHub findings**
   "I also found this community skill for TypeScript testing that you might find useful: [GitHub link]"

## When to Use Each Tool

### Use analyze.sh when:
- User asks to "analyze my workflow"
- Optimizing Claude Code setup
- Finding unused auto-allows
- Discovering community resources
- Understanding usage patterns

### Use analyze-claude-md.sh when:
- Creating CLAUDE.md
- Setting up new project
- User asks "what should I document?"
- Need project-specific recommendations

### Fetch docs when:
- Creating any configuration file
- User asks "how do I create an agent/skill/command?"
- Explaining configuration options
- Need current best practices

### Use GitHub discovery for:
- Finding proven patterns
- Learning from community
- Getting configuration examples
- Discovering new approaches

## Critical Documentation URLs

Always fetch latest docs before creating configurations:

| Type | URL |
|------|-----|
| Agents | https://docs.claude.com/en/docs/claude-code/sub-agents |
| Skills | https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview |
| Slash Commands | https://docs.claude.com/en/docs/claude-code/slash-commands |
| Settings | https://docs.claude.com/en/docs/claude-code/settings |
| CLAUDE.md | https://www.anthropic.com/engineering/claude-code-best-practices |

## Key Configuration Facts (from latest docs)

**Agents** (.md files with YAML frontmatter):
- Required: name, description
- Optional: tools (comma-separated), model (sonnet/opus/haiku/inherit)
- Location: `.claude/agents/` (project) or `~/.claude/agents/` (user)
- NOT .yaml files!

**Skills** (directory with SKILL.md):
- Structure: `skill-name/SKILL.md`
- Bundled resources: scripts/, references/, assets/
- Progressive loading: metadata → instructions → resources
- Location: `.claude/skills/`

**Slash Commands** (.md files):
- Required: name (with / prefix)
- Arguments: $ARGUMENTS, $1, $2
- Optional: allowed-tools, model, argument-hint
- Location: `.claude/commands/`

**CLAUDE.md** (project documentation):
- Hierarchical: user-level → parent → project → nested
- Include: commands, style guidelines, testing, issues
- Keep concise and actionable
- Location: `.claude/CLAUDE.md`

## Output Formats

### Usage Analysis JSON
```json
{
  "tool_usage": [{"tool": "Bash", "count": 122}],
  "auto_allowed_tools": [{"tool": "Read", "usage_count": 49}],
  "model_usage": [{"model": "claude-sonnet-4-5-20250929", "count": 634}],
  "github_discovery": {"searches": [...]}
}
```

### Project Analysis JSON
```json
{
  "detected_package_manager": {"type": "npm", "scripts": ["dev", "test"]},
  "testing": {"framework": "vitest"},
  "framework": {"type": "nextjs"},
  "claude_md_suggestions": ["Document npm scripts", "Document testing"]
}
```

## Requirements

- `jq` (install: `brew install jq` or `apt install jq`)
- Claude Code projects at `~/.claude/projects`
- Optional: `gh` CLI for direct GitHub search

## Why This Approach Works

**Comprehensive**: Combines usage analysis + community discovery + project detection
**Current**: Fetches latest docs on-demand, never stale
**Actionable**: Provides specific, implementable recommendations
**Automated**: GitHub discovery runs automatically, no flags needed
**Integrated**: All tools work together for complete workflow optimization

When helping users optimize Claude Code, always run both analyses, interpret results together, fetch latest docs, and create configurations with current best practices.

Related Skills

developing-claude-code-plugins

16
from diegosouzapw/awesome-omni-skill

Build, test, and distribute Claude Code plugins with slash commands, agents, skills, hooks, MCP servers, and LSP servers. MUST be loaded when creating, reviewing, debugging, or distributing plugins. Use PROACTIVELY when user mentions plugins, extensions, marketplaces, or wants to add custom commands/agents to Claude Code.

claude-skill-creator

16
from diegosouzapw/awesome-omni-skill

Guide for creating effective Claude Code skills with proper YAML frontmatter, directory structure, and best practices. Use when creating new skills, updating existing skills, or learning about skill development.

claude-settings-audit

16
from diegosouzapw/awesome-omni-skill

Analyze a repository to generate recommended Claude Code settings.json permissions. Use when setting up a new project, auditing existing settings, or determining which read-only bash commands to allow. Detects tech stack, build tools, and monorepo structure.

claude-plan

16
from diegosouzapw/awesome-omni-skill

Anthropic 風格的專業計畫管理 Skill - 自然語言驅動、預設並行、全自動 GitHub 整合

claude-md-editor

16
from diegosouzapw/awesome-omni-skill

Edit and maintain CLAUDE.md and project documentation files. Use when modifying documentation, asking about best practices, or performing documentation maintenance tasks.

claude-improve-config

16
from diegosouzapw/awesome-omni-skill

Self-reflect on the current session to identify mistakes and propose improvements to .claude configuration (CLAUDE.md, hooks, skills).

claude-hooks-reference-2026

16
from diegosouzapw/awesome-omni-skill

Complete reference for Claude Code hooks system (January 2026). Use when creating hooks, understanding hook events, matchers, exit codes, JSON output control, environment variables, plugin hooks, or implementing hook scripts.

claude-ecosystem

16
from diegosouzapw/awesome-omni-skill

Claude Code ecosystem expertise. Modules: CLI tool (setup, slash commands, MCP servers, hooks, plugins, CI/CD), extensibility (agents, skills, output styles creation), CLAUDE.md (project instructions, optimization). Actions: configure, troubleshoot, create, deploy, integrate, optimize Claude Code. Keywords: Claude Code, Anthropic, CLI tool, slash command, MCP server, Agent Skill, hook, plugin, CI/CD, enterprise, CLAUDE.md, agentic coding, agent, skill, output-style, SKILL.md, subagent, Task tool, project instructions, token optimization. Use when: learning Claude Code features, configuring settings, creating skills/agents/hooks, setting up MCP servers, troubleshooting issues, CI/CD integration, initializing or optimizing CLAUDE.md files.

claude-code

16
from diegosouzapw/awesome-omni-skill

Claude Code CLI and development environment. Use for Claude Code features, tools, workflows, MCP integration, configuration, and AI-assisted development.

claude-code-slash-commands

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "create a command", "write a slash command", "build a plugin command", or wants to add custom commands to Claude Code.

claude-code-meta

16
from diegosouzapw/awesome-omni-skill

Build Claude Code extensions - skills, agents, hooks, plugins, marketplaces, slash commands. Use when creating Claude Code components, building new skills, writing agents, creating hooks, making plugins, setting up marketplaces, writing slash commands, fixing extension configurations, or troubleshooting Claude Code extensions. Includes builder agents for autonomous creation. Not for looking up docs - use claude-code-docs-reference for that.

agentsmd-claudemd-generator

16
from diegosouzapw/awesome-omni-skill

Generate AGENTS.md and CLAUDE.md files for a repository. AGENTS.md provides cross-tool agent instructions (supported by Claude Code, Cursor, Windsurf, Zed, Codex, and others). CLAUDE.md adds Claude-specific configuration and references AGENTS.md via @import. Use when a repo needs agent onboarding or when starting a new project.