Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By 0-to-1-Labsv2.2.1MITIn 1 marketplace
Rewrites any prompt wrapped in an optimize tag into a fuller, structured instruction before Claude sees it. A hook on every prompt sends tagged ones to your session's model and needs Node.js 18+ plus a Claude login or ANTHROPIC_API_KEY.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.

A Claude Code hook that transforms simple prompts into detailed, structured instructions. Add <optimize> to any prompt and it'll expand your request into something Claude can really sink its teeth into.
When you tag a prompt with <optimize>, this hook intercepts it and sends it to the same model your session is running, with a rewrite-only system prompt and no tools. The result is a fleshed-out version of your original request with:
Basically, it does the prompt engineering for you.
claude login)API-credit users can use ANTHROPIC_API_KEY instead; see Authentication.
In Claude Code:
/plugin marketplace add 0-to-1-Labs/claude-marketplace
/plugin install claude-code-prompt-optimizer@0-to-1-labs
Then restart Claude Code. The plugin registers the hook for you and installs its
dependencies the first time you use <optimize> (about 200 MB, kept across plugin
updates). If you are logged into Claude Code, auth already works.
Claude Code can update this plugin automatically. Auto-update is off by default for third-party marketplaces, so turn it on once:
/plugin.0-to-1-labs.Claude Code then checks for new versions after each session start and installs them. Restart Claude Code to load an update.
To update by hand:
claude plugin marketplace update 0-to-1-labs
claude plugin update claude-code-prompt-optimizer@0-to-1-labs
git clone https://github.com/0-to-1-Labs/claude-code-prompt-optimizer.git
cd claude-code-prompt-optimizer
npm run install-hook
The installer installs dependencies, links the repo into ~/.claude/hooks, registers
the hook in ~/.claude/settings.json with the right timeout, and verifies the fast path.
Use one method, not both. The installer refuses to run when the plugin is already installed, and the hook skips a duplicate run if both copies do fire, but two registrations still cost a process launch per prompt.
The hook runs the Agent SDK, which checks for credentials in this order:
| Priority | Method | Variable | Best For |
|---|---|---|---|
| 1 | OAuth token | CLAUDE_CODE_OAUTH_TOKEN | Automation outside a login |
| 2 | API key | ANTHROPIC_API_KEY | API credit users |
| 3 | Stored OAuth | (none — uses claude login) | Everyone else |
For most users, claude login is all that is needed. Do not paste tokens or keys
into your shell profile for this plugin; a long-lived credential in ~/.zshrc is
exported to every process you start. If you need ANTHROPIC_API_KEY, set it the way
you already do for other tools.
Auth resolution is adaptive and can be forced with OPTIMIZER_AUTH:
OPTIMIZER_AUTH | Behavior |
|---|---|
auto (default) | An explicit CLAUDE_CODE_OAUTH_TOKEN wins. Inside a Claude Code session with no token, the (often invalid) parent-injected API key is stripped so the CLI uses your stored claude login. Outside Claude Code, a real ANTHROPIC_API_KEY is honored. |
oauth | Always strip API keys and use OAuth / stored login. |
apikey | Always keep ANTHROPIC_API_KEY (for pure API-credit users). |
If you prefer to configure things yourself instead of using npm run install-hook:
git clone https://github.com/0-to-1-Labs/claude-code-prompt-optimizer.git
cd claude-code-prompt-optimizer
npm install --omit=dev
Run claude login if you have not already.
Add the hook to ~/.claude/settings.json. The timeout matters: Claude Code
lowers the UserPromptSubmit default to 30 s, which is shorter than a rewrite on a
large model.
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "/path/to/claude-code-prompt-optimizer/src/hooks/optimize-prompt.sh",
"timeout": 120
}
]
}
]
}
}
chmod +x src/hooks/optimize-prompt.sh
Test it:
<optimize> write a function to calculate fibonacci numbers
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
claude-code-prompt-optimizer@0-to-1-labs is listed by 0-to-1-labs/claude-marketplace — review the source before installing
npx claudepluginhub 0-to-1-labs/claude-marketplace --plugin claude-code-prompt-optimizerPlugins from other owners that cover similar ground