Claude Code Prompt Optimizer — AI skill for Claude Code
AI-powered prompt optimization hook for Claude Code.
How to install Claude Code Prompt Optimizer
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open johnpsasser/claude-code-prompt-optimizer and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code Prompt Optimizer does
AI-powered prompt optimization hook for Claude Code. Transforms simple prompts into comprehensive, structured instructions using Claude Opus 4.6's advanced reasoning capabilities.
Alternatives in AI
- System Prompts Leaks — Extracted system prompts from ChatGPT (GPT-5.4, GPT-5.3, Codex), Claude (Opus 4.6, Sonnet 4.6, Claude Code), G 38.6k ★
- Prompt Master — A Claude skill that writes the accurate prompts for any AI tool 4.9k ★
- Golutra — Multi-agent AI orchestration platform for automation, workflows, and developer tools 3.8k ★
README
Claude Code Prompt Optimizer

[](https://opensource.org/licenses/MIT) [](https://nodejs.org) [](https://www.anthropic.com)
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 runs it through Claude's extended thinking mode. 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
- Node.js 18+
- One of the following:
CLAUDE_CODE_OAUTH_TOKEN(Claude Pro/MAX subscribers)ANTHROPIC_API_KEY(API credit users)- Stored OAuth from
claude login
Quick Install
git clone https://github.com/johnpsasser/claude-code-prompt-optimizer.git
cd claude-code-prompt-optimizer
npm run install-hook
The installer handles dependencies, auth setup, hook configuration, and verification.
Authentication
The Agent SDK checks for credentials in this order:
| Priority | Method | Variable | Best For |
|---|---|---|---|
| 1 | OAuth token | CLAUDE_CODE_OAUTH_TOKEN |
Claude Pro/MAX subscribers |
| 2 | API key | ANTHROPIC_API_KEY |
API credit users |
| 3 | Stored OAuth | (none — uses claude login) |
Already logged in |
If `CLAUDE_CODE_OAUTH_TOKEN` is set, the API key is ignored. If neither env var is set, the Agent SDK falls back to stored OAuth credentials from `claude login`.
Setting Up OAuth To
Related Skills
Prompt Engineering Expert
This skill equips Claude with deep expertise in prompt engineering, custom instructions design, and prompt opt
Prompt Optimizer Skill
🚀 2,200+ curated AI prompt templates with auto-optimization. Works with OpenClaw, Claude Code, Cursor, Gemini
Groq Prompt Scorer
Claude Code hook that uses Groq free LLM API to catch vague prompts before they waste tokens
Promptdiff
Git for prompts. Semantic diff, lint, score & Claude Code hook for LLM prompt files.
Source To Prompt Tui
TUI for combining source code files into LLM-ready prompts: tree explorer, syntax preview, token estimation, a
Prompt Tower.Nvim
⚡ Turn your codebase into AI-ready context in seconds – the Neovim plugin that bridges the gap between your co
Related Agents
Prompt Optimizer
Use when the user gives a vague, one-liner, or under-specified task description and is about to delegate it to
Opus Answer
A simple question-answering agent that responds naturally like a standard LLM. No special research context, no
Prompt Engineer Agent
Specialist in crafting, testing, and systematically optimizing prompts for LLMs — turning vague instructions i