improve

A command for making systematic changes to improve code quality, performance, maintainability, style, or security. Maintainability means how easily developers can understand, change, and safely extend the code.

In plain words
What is it for?
Use it to refactor code, optimize slow areas, simplify legacy modules, apply security improvements, or remove dead code and unused imports.
Why use it?
It provides a way to improve existing code when it is hard to read, slow, complex, or contains unnecessary parts. It can also help clean up unused code and imports.

Command

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/drag88/claude-dev-framework/improve
Clone the repo
git clone --depth 1 https://github.com/drag88/claude-dev-framework
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 742 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 $0.00012 $0.00742
Opus 5 $0.00006 $0.00371
Sonnet 5 $0.00002 $0.00148
Haiku 4.5 $0.00001 $0.00074

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

Security

Grade A, and why

improve 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.

commands/improve.md · 101 lines

How it starts

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

/cdf:improve - Code Improvement

Enhance code quality, performance, and maintainability through systematic improvements.

Quick Start

# Safe quality improvements
/cdf:improve src/ --type quality --safe

# Interactive performance optimization
/cdf:improve api-endpoints --type performance --interactive

# Preview maintainability improvements
/cdf:improve legacy-modules --type maintainability --preview

# Security hardening
/cdf:improve auth-service --type security --validate

When to Use

Use /cdf:improve when:

  • Refactoring code for better quality or readability
  • Optimizing performance in slow areas
  • Enhancing maintainability of complex code
  • Applying security best practices

Don't use this command for: Analyzing code without changes (use /cdf:analyze).

Usage

/cdf:improve [target] [--type quality|performance|maintainability|style|cleanup] [--safe] [--interactive]

Cleanup Mode (--type cleanup)

When --type cleanup is specified, the command operates in cleanup mode (formerly /cdf:cleanup):

  • Dead code detection: Usage analysis and safe removal with dependency validation
  • Import optimization: Unused import removal and organization
  • Structure cleanup: File organization and modular improvements
  • Safety validation: Pre/during/post checks to preserve functionality
# Safe cleanup of source directory
/cdf:improve src/ --type cleanup --safe

# Preview import cleanup without execution
/cdf:improve --type cleanup --interactive

# Aggressive cleanup (use with caution)
/cdf:improve components/ --type cleanup

Behavioral Flow

  1. Analyze: Examine codebase for improvement opportunities and quality issues
  2. Plan: Choose an improvement approach that fits the existing codebase
  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

Read the full file on GitHub · 101 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 · 101 lines · 12 tokens per session scan A 9e23d26539c6

Subscribe to this mod's changes

improve is a command published in the GitHub repository drag88/claude-dev-framework (2 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 742 once invoked, about $0.0001 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-08-31.