johnpsasser

Claude Code Prompt Optimizer — AI skill for Claude Code

AI community

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

![Claude Code Prompt Optimizer](./assets/header.png)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Node Version](https://img.shields.io/badge/node-%3E%3D18.0.0-green)](https://nodejs.org) [![Anthropic API](https://img.shields.io/badge/Anthropic-Claude%20Opus%204.6-blue)](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