Claude Code hook

Claude Code Prompt Optimizer

AI-powered prompt optimization hook for Claude Code. Transforms simple prompts into comprehensive, structured instructions using Claude Opus 4.6's advanced reasoning capabilities.

49 stars 4 forksHooks Source

Install

Inside Claude Code
/plugin marketplace add 0-to-1-Labs/claude-marketplace

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/0-to-1-Labs/claude-code-prompt-optimizer.git

From the README

Claude Code Prompt Optimizer

A Claude Code hook that transforms simple prompts into detailed, structured instructions. Add  to any prompt and it'll expand your request into something Claude can really sink its teeth into.

What It Does

When you tag a prompt with , 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:

- Specific implementation steps
- Error handling considerations
- Testing requirements
- Edge cases to watch for

Basically, it does the prompt engineering for you.

Requirements

- Claude Code CLI installed and logged in (claude login)
- Node.js 18+

API-credit users can use ANTHROPIC_API_KEY instead; see Authentication.

Quick Install

Plugin marketplace (recommended)

In Claude Code:

Then restart Claude Code. The plugin registers the hook for you and installs its
dependencies the first time you use  (about 200 MB, kept across plugin
updates). If you are logged into Claude Code, auth already works.

Keep the plugin updated

Claude Code can update this plugin automatically. Auto-update is off by default for third-party marketplaces, so turn it on once:

1. Run /plugin.
2. Open the Marketplaces tab and select 0-to-1-labs.
3. Choose Enable auto-update.

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:

Alternative: standalone install (no marketplace)

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…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
TypeScript
License
MIT
Last updated
30 September 2026
Topics
aianthropicclaudeclaude-codedeveloper-toolshooksopusprompt-optimizationtypescript

FAQ

What is Claude Code Prompt Optimizer?

AI-powered prompt optimization hook for Claude Code. Transforms simple prompts into comprehensive, structured instructions using Claude Opus 4.6's advanced reasoning capabilities. It is a hook for Claude Code, from 0-to-1-Labs/claude-code-prompt-optimizer on GitHub.

How do I install Claude Code Prompt Optimizer?

Run /plugin marketplace add 0-to-1-Labs/claude-marketplace inside Claude Code, then follow the setup in the README.

Is Claude Code Prompt Optimizer popular?

0-to-1-Labs/claude-code-prompt-optimizer has 49 GitHub stars and 4 forks. It was last updated on 30 September 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.