"Codex + Claude Code Parallel Workflow 2026 — Role Division in a Single Repo"

AGENTS.md ↔ CLAUDE.md sharing, strength matrix, explore/implement/review pipelines, avoiding conflicts


핵심 요약

  • Audience: You subscribe to both, or your team is running them in parallel and needs a role division.
  • What you'll get: A strengths/weaknesses matrix based on official docs, same-repo conflict avoidance (directories / instruction files / sandbox), a single-source strategy via @AGENTS.md import from CLAUDE.md, and two concrete pipeline patterns.
  • Prerequisite: Claude Code install and Codex CLI install complete. Basic AGENTS.md and CLAUDE.md knowledge.

1. Why run both

Per official docs, the two tools have different design targets.

Observation Claude Code (official) Codex (official)
Implementation Node / native binary (auto-update) Rust native binary
Default auth Claude Pro/Max/Team/Enterprise or Console ChatGPT Plus/Pro/Business/Edu/Enterprise or API key
Extension system Skills, Hooks, Subagents, Plugins, MCP Skills, Sandbox, MCP (Hooks are experimental via codex_hooks)
Sandbox /sandbox toggle, OS-level (Linux seccomp / macOS sandbox-exec, etc.) 3 modes (read-only/workspace-write/danger-full-access) + Windows native sandbox
Instruction file CLAUDE.md (advisory) AGENTS.md (always injected first turn)
Billing Subscription or pay-as-you-go tokens Subscription or API key
Models Claude (Sonnet / Opus / Haiku) GPT-5, GPT-5-Codex

The conclusion: they're strong in different areas. Parallel use is complement, not competition.


2. Strength matrix (observation-based)

Based on official feature sets plus hands-on experience. Not fully objective — varies by project and task.

Task type Claude Code strength Codex strength
Long exploration / interactive design ✅ Subagents + /compact + Skills Less rich
Precise code edits (specific function/bug) Capable ✅ GPT-5-Codex targets short-form edits
Test/lint automation ✅ Hooks (PostToolUse format/lint) Sandbox auto-run + approval
CI/CD script automation Possible via claude -p codex exec + profiles (built-in)
Plugin / custom skill ecosystem ✅ 5,000+ community skills Limited
Local OSS models (Ollama, etc.) Via MCP ✅ Register local provider in model_providers directly
Windows native dev Supported (needs Git for Windows) ✅ First-class PowerShell + Windows sandbox
Long architecture design ✅ Opus 4.7 + plan mode GPT-5 + plan mode
Fact-check / verification pipeline ✅ Easy to build with Skills Buildable but more effort

Rough rule: exploration, orchestration, long research → Claude Code. Precise code editing, CI automation, Windows native → Codex. Not absolute — test in your context.


3. Conflict points in one repo — checked

Structural conflicts are nearly zero. Each tool uses its own directories and files.

Resource Claude Code Codex Conflict?
Config dir .claude/ .codex/
User dir ~/.claude/ ~/.codex/
Project instructions CLAUDE.md AGENTS.md ❌ (different filenames)
Sessions .claude/sessions/... ~/.codex/sessions/... (SQLite)
MCP config .mcp.json or .claude/settings.json [mcp_servers] in config.toml
Sandbox OS-level TOML-configured ❌ (independent)
/model, /mcp, /config In-session commands In-session commands ❌ (each session independent)

One thing to watch: editing the same file concurrently — the later save wins. Need a rule: don't touch the same file in parallel.


4. Single-source instructions — import AGENTS.md from CLAUDE.md

Official documented approach. Don't maintain duplicates across both files.

4.1 Structure

Use AGENTS.md as the primary instruction source.


## Development rules
- TypeScript strict mode required
- Tests run via `pnpm test` (not npm)
- Commits follow Conventional Commits

## Deploy
- Staging automatic; production requires manual approval

CLAUDE.md imports AGENTS.md first, then appends Claude-Code-specific additions:

@AGENTS.md

## Claude Code specific

Use plan mode for changes under `src/billing/`.
Large refactors: delegate to subagents.

4.2 Remember the loading differences

Claude Code Codex
Directory traversal Walk up from cwd, concat all Walk down from Git root to cwd, one per dir
Priority All files concat (not override) Lower dir overrides upper
Override file CLAUDE.local.md (gitignore) AGENTS.override.md (shareable in git)

Keeping shared content in AGENTS.md and Claude-specific additions below the import reduces confusion.

4.3 .gitignore for team repos

.claude/settings.local.json
CLAUDE.local.md
.codex/sessions/

Share in git: CLAUDE.md, .claude/settings.json, .claude/skills/, AGENTS.md, .codex/config.toml (if project-level).


5. Pipeline A — Explore/Implement split

Hypothesis: Long exploration and planning favor Claude Code. Precise edits favor Codex.

5.1 Workflow

Claude Code (explore, plan)
  ↓ save to docs/spec-XXX.md or a brief
Codex exec (precise auto-edit)
  ↓ diff / commit
Claude Code (review, test)

5.2 Concrete example

Step 1 — Plan with Claude Code

/plan add rate limiting to user auth flow.
Analyze existing auth layer, compare 2-3 strategies, recommend one.
Save to docs/plan/rate-limit.md.

Step 2 — Implement with Codex

codex exec "implement src/auth/rate-limit.ts per docs/plan/rate-limit.md. \
  Add tests. After 100% tests pass, show the diff."

Step 3 — Review with Claude Code

/review
Compare @docs/plan/rate-limit.md against the implementation.
Find 3 missing edge cases.

5.3 Why split like this

  • Exploration reads many files, consuming context → use Claude Code's subagents and /compact
  • Implementation wants precise, narrow diffs → Codex's sandbox + approval keep it safe
  • Review needs wide view again → switch back to Claude Code

6. Pipeline B — Dual review

Hypothesis: Same change reviewed by both tools independently reduces blind spots. Anthropic's best-practices doc recommends a Writer/Reviewer pattern (within one tool, two sessions) for the same reason.

6.1 Workflow

Developer (pushes change)
  ↓
Claude Code: /review (local) — style, bugs, test coverage
Codex: codex exec "review" — different angle: security / performance
  ↓
Compare both reviews → developer fixes

6.2 Concrete commands

claude -p "Review the diff. Focus on bugs and edge cases."

codex exec "Review git diff HEAD~1. Focus on security and performance."

Place both outputs side by side. Shared findings = high priority. One-sided findings = cross-verify before acting.


7. Model routing proposal

Role division considering cost and model strengths.

Step Tool / model Why
Interactive exploration Claude Code + Sonnet 4.6 ($3/$15) Economical for wide-context exploration
Plan (architecture) Claude Code + Opus 4.7 ($5/$25) Strong at long reasoning
Precise edits Codex + GPT-5-Codex Specialized for short-form edits
Routine work (rename, etc.) Codex + smaller model via MCP/OSS Minimize cost
CI lint/format Codex codex exec --profile ci Automation + sandbox safety

Claude Code cost structure: token & cache breakdown.


8. FAQ — "Do I need both subscriptions?"

No absolute answer:

  • Solo developer: Subscribe to one monthly, use the other via pay-as-you-go API key. Light usage adds under $5-20/month.
  • Team: If roles are distinct, assign primary tools per member (half Claude, half Codex). Cross-review at PR time.
  • Enterprise: If Bedrock/Vertex/Azure is already in use, consolidate through that provider.

9. Counter-scenarios — when NOT to parallel

  • Total beginner → learning both at once multiplies confusion. 3 months on one, then add the other.
  • Team already standardized → breaking the standard costs more than it gains. Try in experimental projects only.
  • Workflows that require concurrent edits on the same file → conflict management cost exceeds the gain. Separate by time windows or file scope.
  • Strong model preference → if your preferred model is only on one side, don't mix for the sake of it.

10. Pre-flight checklist

  • [ ] Add .claude/settings.local.json, CLAUDE.local.md, .codex/sessions/ to .gitignore
  • [ ] Make AGENTS.md the primary instruction source; CLAUDE.md does @AGENTS.md import
  • [ ] Team agreement: no concurrent edits on the same file
  • [ ] Each tool's /memory, /mcp, /config verified
  • [ ] Week 1: try the Explore (Claude) → Implement (Codex) pipeline
  • [ ] Weekly cost check via each tool's /usage, /cost

11. What's next

This closes the Codex part of the series. Next up: OpenClaw part.

  1. OpenClaw install → Discord bot in 30 min + 10 safe ClawHub skills (coming soon)
  2. Codex install complete guide — if Codex isn't set up yet.
  3. Codex advanced config — profile switching patterns.

References


This is post 8/15 in the "AI Coding CLI Entry Guide" series. Codex part ends here; the next post starts the OpenClaw part. last verified: 2026-04-25 (Claude Code and Codex official docs. The strength matrix combines official features and observation; not an absolute standard).

댓글

이 블로그의 인기 게시물

Agent Memory Engine (2/10) — Building an AI Agent Memory System with SQLite Alone

"ML Foundations (9/9) — PyTorch vs TensorFlow, and the Road to Local LLMs"

"RAG Core Study (14/26) — Evaluation Sets with RAGAS & DeepEval"

"ML Foundations (8/9) — Deep Learning Architectures: CNN, RNN, Attention"

"ML Foundations (7/9) — Deep Learning Training: Optimizers, Regularization, Initialization"

OpenClaw to Hermes Migration (2/13) — What to Preserve, Partially Port, or Discard

AI Agents I Built (5/7) — Building an Automated Blogger API Publishing System