By saadjs
Refines Claude Code prompts into precise coding-agent specs using Codex app-server.
Refine a rough coding request using current repository context, then execute the refined spec in the same turn.
Refine a rough coding request into a precise spec using current repository context before Claude Code executes it.
Use when the user wants to refine, sharpen, improve, rewrite, or turn a rough coding request into a precise actionable spec before Claude Code executes it.
Codex Advisor is a Claude Code plugin that asks codex app-server to rewrite a rough request into a precise coding-agent spec.
The default path is the refine command. All three skills are manually invoked only (disable-model-invocation: true) — Claude never triggers them on its own. That keeps the user in the loop before Claude acts on the rewritten prompt and avoids adding a Codex round trip to every message.
The refine-with-context command adds a repo-inspection pass first: file tree, current git status and diff, and ripgrep matches for likely relevant terms. It uses gpt-5.4-mini by default for a faster context-aware refinement pass.
Install from GitHub:
claude plugin marketplace add saadjs/codex-advisor
claude plugin install codex-advisor@codex-advisor
Or load a local checkout for development:
claude --plugin-dir /path/to/codex-advisor
Then invoke the command:
/codex-advisor:refine add retry logic to the uploader
The skill runs:
node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-refine.mjs"
with the request on stdin. It prints a rewritten spec and asks whether to run it, revise it, or stop.
For a context-aware refinement pass, invoke the command:
/codex-advisor:refine-with-context add retry logic to the uploader
It runs:
node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-refine.mjs" --with-context <<'CODEX_ADVISOR_REQUEST'
add retry logic to the uploader
CODEX_ADVISOR_REQUEST
The bridge reads bounded repository context before starting the Codex turn, then asks Codex to replace speculative ASSUMPTIONs with concrete file paths, symbols, commands, tests, and current-diff references where the context supports them.
To refine with context and run the result automatically — without the confirmation stop — invoke:
/codex-advisor:refine-and-run add retry logic to the uploader
It performs the same context-aware refinement as refine-with-context, prints the spec for the record, and then implements it in the same turn instead of asking whether to run, revise, or stop.
hooks/hooks.example.json contains an optional UserPromptSubmit hook. Rename or copy it to hooks/hooks.json only if you want automatic prompt refinement on every sufficiently long prompt.
Current Claude Code hook docs describe systemMessage as the standard way to pass context from UserPromptSubmit. The script uses that by default. If you need the older hookSpecificOutput.additionalContext shape from earlier examples, pass:
node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-refine.mjs" --hook --hook-output=both
Useful environment variables:
CODEX_ADVISOR_MODEL=gpt-5.5
CODEX_ADVISOR_CONTEXT_MODEL=gpt-5.4-mini
CODEX_ADVISOR_EFFORT=low
CODEX_ADVISOR_TIMEOUT_MS=90000
CODEX_ADVISOR_MIN_CHARS=40
CODEX_ADVISOR_DISABLE=1
CODEX_ADVISOR_CODEX_BIN=codex
CODEX_ADVISOR_CONTEXT_SEARCH_TERMS=8
CODEX_ADVISOR_CONTEXT_FILE_TREE_LINES=250
CODEX_ADVISOR_CONTEXT_DIFF_CHARS=20000
The CODEX_ADVISOR_CONTEXT_* variables tune the bounded repository context collected for --with-context runs: the number of ripgrep search terms, the file-tree line cap, and the character budget for the gathered git diff. Non-numeric values fall back to the defaults shown above.
CODEX_ADVISOR_EFFORT sets the Codex reasoning effort. For the default models (gpt-5.5 / gpt-5.4-mini), accepted values are low, medium, high, xhigh (default low). Unknown custom models pass the effort through to codex app-server, which remains the authoritative validator.
The bridge also accepts per-invocation flags: --model <name> and --effort <level> override the model and reasoning effort for a single run, and --out <file> writes the refined spec to a file in addition to stdout (text mode only).
The Codex turn is started with approvalPolicy: "never" and a read-only sandbox policy so the refinement pass cannot request interactive approvals or make changes.
npm test
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub saadjs/codex-advisor --plugin codex-advisorComprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Develop, test, build, and deploy Godot 4.x games with Claude Code. Includes GdUnit4 testing, web/desktop exports, CI/CD pipelines, and deployment to Vercel/GitHub Pages/itch.io.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
Design fluency for frontend development. 1 skill with 23 commands (/impeccable polish, /impeccable audit, /impeccable critique, etc.) and curated anti-pattern detection.
UI/UX design intelligence. 67 styles, 161 palettes, 57 font pairings, 25 charts, 15 stacks (React, Next.js, Vue, Svelte, Astro, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, Nuxt, Jetpack Compose). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls