Skip to main content
command CX Codex

analyze — Claude Code command: code analysis and setup

analyze reviews code for quality, security, performance, and architecture. Use it for a whole project or a selected directory.

MIT ★ 23,950 updated 2026-09-27

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/analyze.md
Open on GitHub

What analyze does

The /sc:analyze command discovers source files, identifies their languages, and maps the project structure. It then applies checks for the selected domains, rates each finding by severity and impact, and turns the results into concrete recommendations.

Run it across a repository or point it at one directory. Use --focus for quality, security, performance, or architecture; choose quick or deep with --depth, then select text, json, or report through --format. Glob, Grep, and Read handle discovery and inspection, while Bash can run external checks and Write stores reports and metrics.

The command does not perform runtime analysis that depends on compilation or execution. It also leaves source files unchanged without consent and only examines external dependencies through their imports and usage patterns.

What it helps with

  • review code quality across a project
  • scan authentication code for vulnerabilities
  • locate performance bottlenecks
  • assess architecture and technical debt
  • prioritize findings for remediation

Example prompts for the agent

  • Run /sc:analyze and produce a report for the entire project.
  • Use /sc:analyze src/auth --focus security --depth deep to assess the authentication code.
  • Check component quality with /sc:analyze src/components --focus quality --depth quick.

How to install analyze

Manually: put the files in place

.claude/commands/analyze.md

Call it with /analyze. For all projects use ~/.claude/commands/

Questions about analyze

How do I install analyze in Claude Code?

Place the command file at .claude/commands/analyze.md.

What does analyze do?

It reviews code across quality, security, performance, and architecture, then reports severity-ranked findings with practical recommendations.

Can analyze apply fixes to the code?

No. It does not modify source files without explicit consent. Use /sc:improve after reviewing the recommendations.

Source text

analyze.md · MIT
---
name: analyze
description: "Comprehensive code analysis across quality, security, performance, and architecture domains"
category: utility
complexity: basic
mcp-servers: []
personas: []
---

# /sc:analyze - Code Analysis and Quality Assessment

## Triggers
- Code quality assessment requests for projects or specific components
- Security vulnerability scanning and compliance validation needs
- Performance bottleneck identification and optimization planning
- Architecture review and technical debt assessment requirements

## Usage
```
/sc:analyze [target] [--focus quality|security|performance|architecture] [--depth quick|deep] [--format text|json|report]
```

## Behavioral Flow
1. **Discover**: Categorize source files using language detection and project analysis
2. **Scan**: Apply domain-specific analysis techniques and pattern matching
3. **Evaluate**: Generate prioritized findings with severity ratings and impact assessment
4. **Recommend**: Create actionable recommendations with implementation guidance
5. **Report**: Present comprehensive analysis with metrics and improvement roadmap

Key behaviors:
- Multi-domain analysis combining static analysis and heuristic evaluation
- Intelligent file discovery and language-specific pattern recognition
- Severity-based prioritization of findings and recommendations
- Comprehensive reporting with metrics, trends, and actionable insights

## Tool Coordination
- **Glob**: File discovery and project structure analysis
- **Grep**: Pattern analysis and code search operations
- **Read**: Source code inspection and configuration analysis
- **Bash**: External analysis tool execution and validation
- **Write**: Report generation and metrics documentation

## Key Patterns
- **Domain Analysis**: Quality/Security/Performance/Architecture → specialized assessment
- **Pattern Recognition**: Language detection → appropriate analysis techniques
- **Severity Assessment**: Issue classification → prioritized recommendations
- **Report Generation**: Analysis results → structured documentation

## Examples

### Comprehensive Project Analysis
```
/sc:analyze
# Multi-domain analysis of entire project
# Generates comprehensive report with key findings and roadmap
```

### Focused Security Assessment
```
/sc:analyze src/auth --focus security --depth deep
# Deep security analysis of authentication components
# Vulnerability assessment with detailed remediation guidance
```

### Performance Optimization Analysis
```
/sc:analyze --focus performance --format report
# Performance bottleneck identification
# Generates HTML report with optimization recommendations
```

### Quick Quality Check
```
/sc:analyze src/components --focus quality --depth quick
# Rapid quality assessment of component directory
# Identifies code smells and maintainability issues
```

## Boundaries

**Will:**
- Perform comprehensive static code analysis across multiple domains
- Generate severity-rated findings with actionable recommendations
- Provide detailed reports with metrics and improvement guidance

**Will Not:**
- Execute dynamic analysis requiring code compilation or runtime
- Modify source code or apply fixes without explicit user consent
- Analyze external dependencies beyond import and usage patterns

**Output**: Analysis report containing:
- Severity-rated findings
- Code quality metrics
- Security vulnerabilities
- Performance issues
- Recommendations

**Next Step**: After review, use `/sc:improve` to apply recommended fixes or `/sc:cleanup` for dead code removal.

© SuperClaude-Org · MIT · SuperClaude-Org/SuperClaude_Framework

Similar slash commands

All slash commands for Code review and refactoring →

From the same set56

The whole set →
test Execute unit, integration, and e2e tests with code coverage analysis and quality reporting. Auto-detects test frameworks and supports watch mode for continuous testing during development. CX Codex +1 ★ 23,950repo stars python-expert python-expert writes production Python code guided by SOLID principles and clean architecture. Useful when you need test-driven development, 95%+ test coverage, and OWASP security. CX Codex ★ 23,950repo stars document document builds inline comments, API references, component guides, and user manuals directly from code analysis. CX Codex +1 ★ 23,950repo stars build Handles building, compiling, and packaging projects with automatic error detection and artifact optimization. Runs from Claude Code with configurable environments and build types. CX Codex +1 ★ 23,950repo stars load Loads project context via Serena MCP and restores cross-session memory. Runs at session start or when switching between projects. CX Codex +1 ★ 23,950repo stars design design plans system architecture, API specifications, and database schemas before coding starts. Useful for creating technical contracts and component diagrams. CX Codex +1 ★ 23,950repo stars save save preserves session context, discoveries, and recovery points through Serena MCP. Use it when work needs to continue across sessions. CX Codex +1 ★ 23,950repo stars select-tool select-tool is a Claude Code command that routes operations to Serena or Morphllm based on complexity, balancing accuracy and speed. CX Codex +1 ★ 23,950repo stars

Project sponsors

Companies that keep this analytics open