Skip to main content
command CX Codex

improve — Claude Code command: what it does, how to install

improve removes technical debt, tunes execution speed, and patches vulnerabilities in your project. Useful for component refactoring and enforcing code standards.

MIT ★ 23,950 updated 2026-09-27

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

What improve does

The command inspects your codebase across five stages: analysis, planning, code modification, validation, and documentation. It coordinates specialized personas for architecture, performance, and security. Routine chores apply automatically. These include cleaning unused variables, ordering imports, and fixing syntax formatting.

For deep analysis, the command taps into Sequential MCP and consults Context7 MCP for framework conventions. If these servers are missing, work continues without interruptions. The tool gracefully switches to native reasoning and online documentation lookups.

Structural changes never happen silently. The command stops and prompts for approval before altering application logic, public signatures, or cross-file structures unless you pass --force. Existing functionality stays intact.

What it helps with

  • clean up technical debt across legacy modules
  • identify runtime bottlenecks and optimize function speed
  • fix security vulnerabilities without breaking existing logic
  • organize imports and remove unused variables automatically

Example prompts for the agent

  • Run a safe refactor on project files: /sc:improve src/ --type quality --safe
  • Tune API performance interactively: /sc:improve api-endpoints --type performance --interactive
  • Harden authentication routes against vulnerabilities: /sc:improve auth-service --type security --validate

How to install improve

Manually: put the files in place

.claude/commands/improve.md

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

Questions about improve

How do I install improve in Claude Code?

Place the command file at .claude/commands/improve.md inside your repository.

What does the improve command do?

It audits source files, optimizes performance bottlenecks, eliminates code debt, and applies security hardening across structured phases.

Are Sequential and Context7 MCP servers strictly required?

No, they are optional dependencies. If they are not running, the command falls back to native model reasoning and official documentation searches.

Source text

improve.md · MIT
---
name: improve
description: "Apply systematic improvements to code quality, performance, and maintainability"
category: workflow
complexity: standard
mcp-servers: [sequential, context7]
personas: [architect, performance, quality, security]
---

# /sc:improve - Code Improvement

## Triggers
- Code quality enhancement and refactoring requests
- Performance optimization and bottleneck resolution needs
- Maintainability improvements and technical debt reduction
- Best practices application and coding standards enforcement

## Usage
```
/sc:improve [target] [--type quality|performance|maintainability|style] [--safe] [--interactive]
```

## Behavioral Flow
1. **Analyze**: Examine codebase for improvement opportunities and quality issues
2. **Plan**: Choose improvement approach and activate relevant personas for expertise
3. **Execute**: Apply systematic improvements with domain-specific best practices
4. **Validate**: Ensure improvements preserve functionality and meet quality standards
5. **Document**: Generate improvement summary and recommendations for future work

Key behaviors:
- Multi-persona coordination (architect, performance, quality, security) based on improvement type
- Framework-specific optimization via Context7 integration for best practices
- Systematic analysis via Sequential MCP for complex multi-component improvements
- Safe refactoring with comprehensive validation and rollback capabilities

## MCP Integration
- **Sequential MCP**: Auto-activated for complex multi-step improvement analysis and planning
- **Context7 MCP**: Framework-specific best practices and optimization patterns
- **Persona Coordination**: Architect (structure), Performance (speed), Quality (maintainability), Security (safety)
- **Availability fallback**: The MCP servers named here are preferred tooling, not hard requirements — when one is not installed, degrade gracefully (native reasoning in place of Sequential, official docs via web lookup in place of Context7, native tools otherwise) instead of routing work to absent servers.

## Tool Coordination
- **Read/Grep/Glob**: Code analysis and improvement opportunity identification
- **Edit/MultiEdit**: Safe code modification and systematic refactoring
- **TodoWrite**: Progress tracking for complex multi-file improvement operations
- **Task**: Delegation for large-scale improvement workflows requiring systematic coordination

## Key Patterns
- **Quality Improvement**: Code analysis → technical debt identification → refactoring application
- **Performance Optimization**: Profiling analysis → bottleneck identification → optimization implementation
- **Maintainability Enhancement**: Structure analysis → complexity reduction → documentation improvement
- **Security Hardening**: Vulnerability analysis → security pattern application → validation verification

## Examples

### Code Quality Enhancement
```
/sc:improve src/ --type quality --safe
# Systematic quality analysis with safe refactoring application
# Improves code structure, reduces technical debt, enhances readability
```

### Performance Optimization
```
/sc:improve api-endpoints --type performance --interactive
# Performance persona analyzes bottlenecks and optimization opportunities
# Interactive guidance for complex performance improvement decisions
```

### Maintainability Improvements
```
/sc:improve legacy-modules --type maintainability --preview
# Architect persona analyzes structure and suggests maintainability improvements
# Preview mode shows changes before application for review
```

### Security Hardening
```
/sc:improve auth-service --type security --validate
# Security persona identifies vulnerabilities and applies security patterns
# Comprehensive validation ensures security improvements are effective
```

## Boundaries

**Will:**
- Apply systematic improvements with domain-specific expertise and validation
- Provide comprehensive analysis with multi-persona coordination and best practices
- Execute safe refactoring with rollback capabilities and quality preservation

**Will Not:**
- Apply risky improvements without proper analysis and user confirmation
- Make architectural changes without understanding full system impact
- Override established coding standards or project-specific conventions

## AUTO-FIX VS APPROVAL-REQUIRED

**Auto-fix (applies automatically)**:
- Style fixes (formatting, naming conventions)
- Unused variable removal
- Import organization
- Simple type annotations

**Approval Required (prompts user first)**:
- Architectural changes
- Logic refactoring
- Function signature changes
- Removing code used by public APIs
- Changes affecting multiple files

**Explicitly Will NOT** (without `--force` flag):
- Make architectural decisions
- Refactor code structure without confirmation
- Remove functionality

© 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 →
troubleshoot troubleshoot diagnoses runtime errors, build failures, performance bottlenecks, and deployment bugs. It inspects the system state and never modifies files unless passed --fix. CX Codex +1 ★ 23,950repo stars spawn spawn — a command that breaks down large multi-domain operations into hierarchical task plans with dependencies and delegation. Analyzes scope, decomposes work, and assigns executors—it plans rather than implements. CX Codex +1 ★ 23,950repo stars cleanup The cleanup command for Claude Code finds dead code, removes unused imports, and tidies project structure without breaking public APIs. CX Codex +1 ★ 23,950repo stars deep-research-agent The deep-research-agent subagent investigates complex questions, checks sources, and turns findings into a cited report. Use it for current topics or when information needs careful synthesis. CX Codex ★ 23,950repo stars estimate This command estimates development time, effort, or complexity and returns a breakdown with risks. Use it to scope work before implementation begins. CX Codex +1 ★ 23,950repo stars implement The /sc:implement command coordinates feature development in Claude Code using specialist personas and MCP tools. It handles planning, code generation, and test prep. CX Codex +1 ★ 23,950repo stars task task — a slash command for multi-stage project execution with seven expert personas, intelligent MCP server routing, and cross-session context preservation. User-invoked, runs to completion, then stops. CX Codex +1 ★ 23,950repo stars workflow workflow parses PRDs and feature requirements to generate structured implementation plans with dependency mapping. It plans the execution without touching your code. CX Codex +1 ★ 23,950repo stars

Project sponsors

Companies that keep this analytics open