A Claude Code command for quickly optimizing prompts with systematic analysis and clipboard integration.
In D&D, Metamagic allows sorcerers to alter spells. Here, it alters your prompts.
- Systematic Analysis - Evaluates prompts across 7 dimensions: clarity, completeness, structure, output format, examples, chain-of-thought, and role definition
- Clipboard Integration - Reads from and writes to clipboard automatically (macOS, Linux, Windows/WSL)
- Iterative Refinement - Continue the conversation to further adjust results
git clone https://github.com/Clementtang/metamagic.git ~/metamagic
~/metamagic/install.shUse install.sh --link to symlink instead of copy, so edits to the repo take effect immediately.
# Optimize clipboard content
/op
# Optimize specific text
/op "your prompt here"
# Optimize from file
/op --file path/to/prompt.md## Prompt Analysis
### Original Prompt
[shows original content]
### Issues Found
1. [issue type] [description]
2. [suggestion type] [recommendation]
### Optimized Version
[improved prompt]
The optimized prompt is automatically copied to your clipboard.
After receiving results, you can continue refining:
- "Make it shorter"
- "Add more examples"
- "Rewrite in English"
- "Optimize for Claude"
Every result is also printed in the conversation, so an overwritten clipboard never loses content — but each /op (and each refinement) replaces what's on your clipboard. If you iterate often and want to keep several versions around, pair Metamagic with a clipboard manager:
- macOS — Maccy (free, open source) or Paste
- Windows — built-in clipboard history (
Win+V) - Linux — CopyQ
- Claude Code
- A clipboard tool for your OS: macOS
pbcopy/pbpaste(built in), Linuxwl-copy/wl-pasteorxclip, Windows/WSLclip/Get-Clipboard
MIT