A slash command for Claude Code that optimizes rough prompts into cleaner, more executable versions.
Requires Claude Code CLI — Run this command inside a Claude Code session
What is Claude Code? Claude Code is Anthropic's official agentic coding CLI. Prompt Smith adds a slash command that rewrites your prompts before execution.
Prompt Smith takes a rough prompt and optimizes it for Claude Code execution:
- Optimize — Rewrite for clarity, structure, and precision
- Preview — Show original and optimized side-by-side with a summary of what changed
- Choose — Pick or switch optimization modes
- Edit — Refine the optimized prompt before executing
- Confirm — Review before execution (or bypass with
--yes) - Execute — Run the optimized prompt immediately after confirmation
# Add the marketplace (one-time)
claude plugin marketplace add maxencemeloni/claude-code-prompt-smith
# Install the plugin
claude plugin install prompt-smith
# Use (in any project)
claude
/prompt Refactor this function to be more readableUpdate:
claude plugin marketplace update prompt-smith-marketplace && claude plugin update prompt-smith@prompt-smith-marketplace
| Command | Purpose |
|---|---|
/prompt |
Optimize a rough prompt with mode selection, preview, and confirmation |
/prompt [--mode default|agentic|compact|strict] [--yes] [--dry-run] [--help] <prompt>
| Flag | Purpose |
|---|---|
--mode <mode> |
Select optimization mode (default, agentic, compact, strict) |
--yes |
Skip confirmation and execute immediately |
--dry-run |
Show optimized prompt without executing (preview only) |
--list-modes |
Show available modes |
--help |
Show usage information and examples |
/prompt Refactor this function to be more readable
/prompt --mode agentic Organize the work in parallel and validate each step
/prompt --mode compact Rewrite this prompt to be shorter
/prompt --mode strict --yes Fix this prompt without changing its intent
/prompt --dry-run Build a REST API with authentication
/prompt --help
- Parse — Extract flags and raw prompt from input
- Select mode — Use explicit
--modeor infer the best fit - Preview — Show mode, rationale, original, optimized prompt, and what changed
- Confirm — Select an action: execute, edit, regenerate in another mode, or cancel
- Execute — Run the optimized prompt in the same session
| Mode | Purpose | Best For |
|---|---|---|
| default | General cleanup | Most prompts |
| agentic | Execution-focused structure | Orchestration, automation, multi-step delivery, repo work |
| compact | Shortest clean version | Utility prompts, when brevity matters |
| strict | Maximum fidelity | Sensitive wording, policy text, minimal rewrite |
Prompt Smith
Mode: agentic
Why this mode: prompt involves multi-step execution and delivery
Available modes:
- default — general cleanup
- agentic — orchestration and execution-focused structure
- compact — shortest clean version
- strict — maximum fidelity
Original prompt:
refactor the auth module, add tests, and make sure nothing breaks
Optimized prompt:
## Objective
Refactor the auth module while preserving all existing behavior.
## Workflow
1. Read and understand the current auth module structure
2. Identify refactoring opportunities (duplication, complexity, naming)
3. Apply changes incrementally
4. Add or update tests to cover refactored code
5. Run the full test suite and verify no regressions
## Constraints
- Do not change the public API surface
- Every refactored path must have test coverage
What changed: restructured into sections, added explicit workflow steps, clarified constraints
┌─────────────────────────────────────┐
│ What would you like to do? │
│ │
│ > Execute │
│ Edit │
│ Regenerate │
│ Cancel │
└─────────────────────────────────────┘| Principle | Meaning |
|---|---|
| Fidelity first | Never silently change the user's intended outcome |
| Claude Code native | Output reads like a terminal instruction, not generic chat |
| Minimal structure | Add structure only when it helps execution |
| Confirm by default | Never execute without consent (unless --yes) |
# 1. Add the marketplace (one-time)
claude plugin marketplace add maxencemeloni/claude-code-prompt-smith
# 2. Install the plugin
claude plugin install prompt-smithWorks on all platforms.
# Update (refresh marketplace first, then update)
claude plugin marketplace update prompt-smith-marketplace
claude plugin update prompt-smith@prompt-smith-marketplace
# Uninstall
claude plugin uninstall prompt-smith@prompt-smith-marketplace- Fork the repo
- Add/modify commands in
commands/ - Validate with
claude plugin validate . - Submit a PR
See CHANGELOG.md for the full changelog.
When working on Prompt Smith with Claude Code, the CLAUDE.md file at the project root provides development context including:
- Design principles — Fidelity first, Claude Code native, minimal structure
- Mode definitions — Rationale for each optimization mode
- Version management — How to bump versions and update documentation
- Local testing — How to test dev vs. plugin commands
- Test prompts — Sample prompts for verifying each mode
This context is only loaded when developing Prompt Smith itself, not when users run the command in their projects.
Use /release <version> <description> to automate the full release flow.
| Plugin | Command | Description |
|---|---|---|
| Agent Smith | /analyze-agent |
Analyzes, validates, and optimizes your Claude Code configuration. Full 7-pillar evaluation with interactive triage and guided fixes. |
Check out Agent Smith for more details
MIT — see LICENSE