Skip to content

Migrating Between Codex, Cursor, and Claude Code

Your team uses Cursor for daily development, but you just saw a demo where someone fired off five Codex tasks in parallel and reviewed the results in twenty minutes. Or you have been using Codex for async refactoring but need the interactive debugging that Claude Code provides. Or you want to use all three tools for different scenarios — Cursor for IDE work, Claude Code for CLI-heavy operations, and Codex for background tasks — and you need them all reading from the same conventions.

This guide covers every direction of migration between the three tools, including how to run them simultaneously without configuration conflicts.

  • Configuration translation between CLAUDE.md, AGENTS.md, and .cursor/rules/
  • Workflow mapping for common tasks across all three tools
  • Multi-tool setup that keeps conventions synchronized
  • MCP configuration migration between tools
  • Decision framework for which tool to use for which task

The biggest migration task is translating your project instructions between the three formats. Each tool reads conventions from a different location.

ToolConfig LocationFormatScope
Cursor.cursor/rules/*.mdMultiple markdown filesPer-rule files
Claude CodeCLAUDE.md (root)Single markdown fileEntire project
CodexAGENTS.md (root)Single markdown fileEntire project

If you are moving from Codex to Claude Code, your AGENTS.md translates almost directly to CLAUDE.md. The formats are similar — both are markdown files at the repository root that the agent reads at session start.

Terminal window
cp AGENTS.md CLAUDE.md

Then make these adjustments:

# CLAUDE.md adjustments after copying from AGENTS.md
## What to change:
# 1. Add workflow commands that Claude Code can run locally
## Key Commands
- npm run dev # Start dev server
- npm run test # Run test suite
- npm run lint # Check linting
# 2. Remove Codex-specific sandbox instructions
# (Codex runs in an isolated sandbox; Claude Code runs on your machine)
# DELETE: "You are running in a sandboxed environment"
# DELETE: "Do not attempt to access the network"
# 3. Add interactive workflow guidance
# Claude Code supports back-and-forth conversation,
# so add instructions about when to ask for clarification
## Workflow
- For ambiguous requirements, ask for clarification before proceeding
- Use /think for complex architectural decisions
- Run tests after every significant change

Moving from Claude Code to Codex requires making instructions more prescriptive, because Codex runs autonomously without interactive feedback.

Terminal window
cp CLAUDE.md AGENTS.md

Adjustments:

# AGENTS.md adjustments after copying from CLAUDE.md
## What to change:
# 1. Add explicit verification commands
## Verification
- After making changes, run: npm test
- After modifying API routes, run: npm run type-check
- After changing database schemas, run: npm run db:migrate
# 2. Add boundaries for autonomous operation
## Boundaries
- Do not modify files in migrations/ that have already been applied
- Do not delete test files
- Do not change environment variable names without updating .env.example
- Do not install new dependencies without explicit instruction
# 3. Remove interactive instructions
# DELETE: "Ask for clarification if requirements are ambiguous"
# DELETE: "Use /think for complex decisions"
# Codex cannot ask questions mid-task -- it must work with what it has
# 4. Be more explicit about patterns
# Instead of "follow our component pattern", show the exact pattern:
## Component Pattern
Every new component must follow this structure:
```tsx
interface ComponentNameProps {
// props here
}
export function ComponentName({ ...props }: ComponentNameProps) {
// implementation
}
```

From .cursor/rules/ to CLAUDE.md or AGENTS.md

Section titled “From .cursor/rules/ to CLAUDE.md or AGENTS.md”

Cursor uses multiple rule files. Claude Code and Codex use a single file. Consolidate.

Terminal window
# Concatenate all Cursor rules into CLAUDE.md
echo "# Project Instructions" > CLAUDE.md
echo "" >> CLAUDE.md
for file in .cursor/rules/*.md; do
cat "$file" >> CLAUDE.md
echo -e "\n" >> CLAUDE.md
done

Then edit CLAUDE.md to:

  • Remove duplicate headers
  • Organize into logical sections (Architecture, Conventions, Testing, Workflow)
  • Add a Key Commands section
  • Add Claude Code-specific workflow instructions

From CLAUDE.md or AGENTS.md to .cursor/rules/

Section titled “From CLAUDE.md or AGENTS.md to .cursor/rules/”

Going the other direction, split a single file into focused rule files.

Terminal window
mkdir -p .cursor/rules

Create separate files for each concern:

.cursor/rules/
architecture.md # File structure, module boundaries
code-conventions.md # Naming, imports, TypeScript patterns
testing.md # Test file structure, frameworks, coverage
git-workflow.md # Commit messages, PR format, branching
api-patterns.md # Route structure, error handling, auth

MCP servers are configured differently in each tool, but the underlying servers are the same.

Cursor stores MCP configuration in .cursor/mcp.json:

{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://localhost:5432/mydb"
}
},
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}

Use this pattern to translate MCP config between tools:

Terminal window
# Copy Cursor MCP config to Claude Code
cp .cursor/mcp.json .mcp.json
# Copy Claude Code MCP config to Cursor
cp .mcp.json .cursor/mcp.json

The JSON format is compatible between Cursor and Claude Code. Verify that environment variables (API tokens) are set correctly for each tool’s runtime environment.

TaskCursorClaude CodeCodex
Write a new featureAgent Mode in ComposerDescribe in conversationCreate a task
Debug a failing testAgent Mode + terminalConversation + automatic test runsTask with test output
Refactor across filesAgent Mode (auto-edits)Conversation (auto-edits)Task (returns diffs)
Review a PRBugBot or manual reviewclaude "Review PR #123"Task: “Review changes in PR #123”
Generate testsAgent Mode: “Write tests for…""Write tests for…”Task: “Write tests for…”

This is where Codex excels and the other tools have limitations.

Cursor is interactive and single-threaded. You can only run one Agent Mode conversation at a time per window. For parallel work, open multiple Cursor windows.

# Window 1: Feature development
"Implement the user profile page with avatar upload"
# Window 2: Bug fix
"Fix the race condition in the payment processing queue"

This is clunky but works.

Many teams use all three tools simultaneously. The key is keeping configurations synchronized.

Create a script that generates all three configuration formats from a single source of truth:

scripts/sync-ai-config.sh
#!/bin/bash
# Generates .cursor/rules/, CLAUDE.md, and AGENTS.md from a single source
SOURCE="docs/ai-conventions.md"
# Generate CLAUDE.md
echo "# CLAUDE.md - Auto-generated from $SOURCE" > CLAUDE.md
echo "" >> CLAUDE.md
cat "$SOURCE" >> CLAUDE.md
echo "" >> CLAUDE.md
cat docs/claude-code-specific.md >> CLAUDE.md
# Generate AGENTS.md
echo "# AGENTS.md - Auto-generated from $SOURCE" > AGENTS.md
echo "" >> AGENTS.md
cat "$SOURCE" >> AGENTS.md
echo "" >> AGENTS.md
cat docs/codex-specific.md >> AGENTS.md
# Generate Cursor rules
mkdir -p .cursor/rules
cp docs/cursor-rules/*.md .cursor/rules/
echo "AI configurations synchronized from $SOURCE"
Terminal window
# Use a single MCP source and copy to both tools
cp mcp-config.json .cursor/mcp.json
cp mcp-config.json .mcp.json

Skills installed via npx skills add work across Cursor and Claude Code. The skills CLI detects which tools are present and installs to the appropriate locations:

Terminal window
# Installs to both .cursor/rules/ and .claude/skills/
npx skills add vercel-labs/agent-skills

Decision Framework: Which Tool for Which Task

Section titled “Decision Framework: Which Tool for Which Task”
ScenarioBest ToolWhy
Writing new features interactivelyCursorIDE integration, visual feedback, inline edits
Debugging with terminal outputClaude CodeDirect terminal access, automatic command execution
Batch refactoring (5+ independent changes)CodexParallel cloud execution, no local resource usage
Code reviewClaude Code or CursorBoth have strong review capabilities
Quick prototypingCursorFastest feedback loop with inline suggestions
CI/CD debuggingClaude CodeTerminal-native, can run pipelines locally
Documentation generationCodexWell-defined task, does not need interaction
Security auditClaude CodeDeep analysis needs interactive follow-up
Legacy code migrationCodexLarge-scale changes run well in parallel
Pair programmingCursorMost like having a collaborator in the IDE

Adding Codex to an Existing Cursor + Claude Code Setup

Section titled “Adding Codex to an Existing Cursor + Claude Code Setup”

If you already use Cursor and Claude Code and want to add Codex for parallel background work:

  1. Create AGENTS.md. Start from your CLAUDE.md and add Codex-specific instructions (verification commands, boundaries, explicit patterns).

  2. Identify tasks for Codex. Look for well-defined, independent tasks: test generation, documentation updates, linting fixes, dependency upgrades, API client generation.

  3. Start with low-risk tasks. Use Codex for tasks where incorrect output is easy to detect: test generation (run the tests), documentation (review the text), formatting (diff the changes).

  4. Review Codex output carefully. Codex runs autonomously. It does not ask clarifying questions. Double-check that the output matches your expectations before merging.

  5. Scale up gradually. As you learn which tasks Codex handles well, shift more background work to it. Keep interactive and exploratory work in Cursor and Claude Code.

Moving from Codex to Cursor for Daily Development

Section titled “Moving from Codex to Cursor for Daily Development”

If you have been using Codex primarily and want the interactive experience of Cursor:

  1. Install Cursor. Import your VS Code settings if applicable.

  2. Translate AGENTS.md to .cursor/rules/. Split your single instructions file into focused rule files (architecture, conventions, testing, workflow).

  3. Set up MCP servers in Cursor. Copy your MCP configuration, adjusting for Cursor’s .cursor/mcp.json format.

  4. Learn the interactive workflow. Practice with Agent Mode (Cmd+I), Tab autocomplete, and @-mentions. The interactive loop is very different from async task submission.

  5. Keep Codex for background work. You do not have to choose one tool. Use Cursor for interactive development and Codex for parallel batch work.

Moving from Codex to Claude Code for CLI Work

Section titled “Moving from Codex to Claude Code for CLI Work”

If you prefer the terminal and want more interactive control than Codex provides:

  1. Install Claude Code. npm install -g @anthropic-ai/claude-code

  2. Convert AGENTS.md to CLAUDE.md. Remove sandbox-specific instructions, add interactive workflow guidance and key commands.

  3. Migrate MCP configuration. Use claude mcp add or copy to .mcp.json.

  4. Adjust your workflow. Claude Code is synchronous and interactive. Instead of submitting tasks and reviewing later, you have a conversation and guide the work in real time.

  5. Use extended thinking. Claude Code’s /think command gives you the planning capability that Codex handles implicitly. Use it for complex tasks.

Configurations drift between tools. If you update CLAUDE.md but forget to update AGENTS.md and .cursor/rules/, the tools give different results. Use the synchronization script above or add a CI check that verifies the files are in sync.

MCP tokens expire in one tool but not another. Each tool manages MCP authentication independently. When a token expires, you may need to update it in multiple locations. Consider using environment variables that all tools read from the same .env file.

Codex produces different results than Claude Code for the same prompt. The tools use different underlying models (Codex uses codex-mini by default, Claude Code uses Claude). Prompts that work well for one model may need adjustment for another. Be more explicit in Codex prompts since there is no opportunity for clarification.

File conflicts when running tools in parallel. If Cursor and Claude Code are both editing files in the same directory, you will get conflicts. Either work on different areas of the codebase or coordinate which tool is active on which files.

Skills install for one tool but not another. The skills CLI may not detect all tools. Verify installation by checking both .cursor/rules/ and .claude/skills/ after running npx skills add.