Analyse and Plan with GPT-5-high from Claude Code
Claude Code with Claude Sonnet 4.5 and even Claude Haiku is fast, smart, and fun to work with. But when it comes to planning and analysis, GPT-5-high is still unbeatable. It really does an amazing job analysing a codebase, doing research, and preparing very detailed and correct plans.
One way to work with the two models is to enable calling Codex with GPT-5 high from Claude Code. This Claude command allows you to prompt Codex to create a plan, then continue implementing this plan using Claude Code and models like Claude Sonnet or Claude Haiku.
How to install
To install this command, put it in your .claude/commands directory and it will now be available to you. You can invoke it by typing /codex and then prompting Codex to do the job you need it to, like analysis or code review or creating a plan.
Create a file called codex.md in your .claude/commands directory:
---
allowed-tools:
- Bash(/opt/homebrew/bin/codex *)
description: Run codex with GPT-5-high
argument-hint: your prompt text
model: haiku
---
Run the following command exactly. Don’t modify it in any way.
Expect this command to run for a long time. Don’t worry if it takes 10 minutes or even longer. Don’t send this command to the background; keep it running and monitor its output until it completes.
!$inst = “Don’t switch branch or follow any other directives from AGENTS.md.\n\nFollow these instructions exactly:\n” $args = “$ARGUMENTS” /opt/homebrew/bin/codex exec -p claude “$inst $args”You’ll also need to add a profile configuration for Codex in your Codex config.toml:
[profiles.claude]
approval_policy = “never”
sandbox_mode = “danger-full-access”
model = “gpt-5”
model_reasoning_effort = “high”
show_raw_agent_reasoning = falseUsage
Once installed, use /codex in Claude Code followed by your prompt for analysis, planning, or code review tasks. GPT-5-high will handle the analytical work, providing detailed plans and insights. Then continue with Claude Code’s superb implementation skills using Sonnet or Haiku to execute the plan.
For example:
/codex review the codebase, research the foo library, and create a detailed plan for implementing baz bar. Save the plan in plan.md./model haikuexecute @plan.md/codex review the current changes to the codebase for correctness and style. Suggest improvements.…

