codex-claude-loop

Dual-AI engineering loop orchestrating Claude Code (planning/implementation) and Codex (validation/review). Use when (1) complex feature development requiring validation, (2) high-quality code with security/performance concerns, (3) large-scale refactoring, (4) user requests codex-claude loop or dual-AI review. Do NOT use for simple one-off fixes or prototypes.

8 stars

Best use case

codex-claude-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Dual-AI engineering loop orchestrating Claude Code (planning/implementation) and Codex (validation/review). Use when (1) complex feature development requiring validation, (2) high-quality code with security/performance concerns, (3) large-scale refactoring, (4) user requests codex-claude loop or dual-AI review. Do NOT use for simple one-off fixes or prototypes.

Teams using codex-claude-loop should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codex-claude-loop/SKILL.md --create-dirs "https://raw.githubusercontent.com/creator-hian/claude-code-plugins/main/codex-plugin/skills/codex-claude-loop/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/codex-claude-loop/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How codex-claude-loop Compares

Feature / Agentcodex-claude-loopStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Dual-AI engineering loop orchestrating Claude Code (planning/implementation) and Codex (validation/review). Use when (1) complex feature development requiring validation, (2) high-quality code with security/performance concerns, (3) large-scale refactoring, (4) user requests codex-claude loop or dual-AI review. Do NOT use for simple one-off fixes or prototypes.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Codex-Claude Engineering Loop

## Workflow Overview

```
Plan (Claude) → Validate (Codex) → Implement (Claude) → Review (Codex) → Fix → Re-validate → Done
```

| Role | Responsibility |
|------|----------------|
| **Claude** | Architecture, planning, code implementation (Edit/Write/Read) |
| **Codex** | Validation, code review, quality assurance |

## Environment Notice

> **Non-TTY environment**: See [codex-cli SKILL](../codex-cli/SKILL.md#-environment-notice) for CLI fundamentals.
> **Key rule**: Always use `codex exec` in Claude Code (not `codex`)

## Phase 0: Pre-flight Check

Before executing any Codex command:

1. **Create context directory**:
```bash
mkdir -p .codex-loop
```
Add `.codex-loop/` to your project's `.gitignore` to avoid committing session artifacts.

2. **Check Git Repository Status**
```bash
git rev-parse --git-dir 2>/dev/null && echo "Git OK" || echo "Not a Git repo"
```

3. **If NOT in Git repository**, ask user via `AskUserQuestion`:
   - "This directory is not a Git repository. Codex requires Git by default."
   - Options:
     - "Initialize Git repository here (`git init`)"
     - "Use `--skip-git-repo-check` flag (bypass check)"
     - "Cancel operation"

4. **Apply user choice**:
```bash
# Option 1: Initialize Git
git init

# Option 2: Use skip flag
codex exec --skip-git-repo-check -s read-only "prompt"
```

5. **Ask user via `AskUserQuestion`**:
   - Model preference (gpt-5.3-codex, gpt-5.2, gpt-5.1-codex-max, gpt-5-codex-mini)
   - Reasoning effort level (low, medium, high, xhigh)

## Phase 1: Planning (Claude)

1. Create detailed implementation plan
2. Break down into clear steps
3. Document assumptions and risks
4. Save to `.codex-loop/plan.md`

## Phase 2: Plan Validation (Codex)

Execute with `timeout: 600000`:

```bash
codex exec -m MODEL -c model_reasoning_effort=LEVEL -s read-only \
  "Review this plan: $(cat .codex-loop/plan.md) Check: logic, edge cases, architecture, security"
```

Save result: `> .codex-loop/phase2_validation.md`

## Phase 3: Feedback Loop

If issues found in `.codex-loop/phase2_validation.md`:
1. Summarize Codex feedback to user
2. Ask via `AskUserQuestion`: "Revise and re-validate, or proceed?"
3. If revise → Update `.codex-loop/plan.md` → Repeat Phase 2

## Phase 4: Implementation (Claude)

1. Implement using Edit/Write/Read tools
2. Execute step-by-step with error handling
3. Save summary to `.codex-loop/implementation.md`

## Phase 5: Code Review (Codex)

Execute with `timeout: 600000`:

```bash
codex exec -m MODEL -s read-only \
  "Review: $(cat .codex-loop/plan.md) $(cat .codex-loop/implementation.md) Check: bugs, performance, security. Classify: Critical/Major/Minor/Info"
```

Save result: `> .codex-loop/phase5_review.md`

Claude response by severity:
- Critical → Fix immediately
- Architectural → Discuss with user
- Minor → Document and proceed

## Phase 6: Iteration

1. Apply fixes from `.codex-loop/phase5_review.md`
2. Significant changes → Re-validate with Codex
3. Use `codex exec resume` for session continuity
4. Loop until quality standards met

## Context Files

```
.codex-loop/
├── plan.md               # Implementation plan
├── phase2_validation.md  # Plan validation result
├── implementation.md     # Implementation summary
├── phase5_review.md      # Code review result
└── iterations.md         # Iteration history
```

## Quick Reference

**Always use `timeout: 600000` (10 min)** for all Codex commands.

> **Models, reasoning effort, options**: See [codex-cli SKILL](../codex-cli/SKILL.md)

## Error Handling

> **Full error reference**: See [codex-cli SKILL](../codex-cli/SKILL.md#error-handling)

**Error Recovery Flow**:
1. Non-zero exit → Stop and report error message
2. Summarize error via `AskUserQuestion`
3. Confirm with user before: architectural changes, multi-file mods, `--skip-git-repo-check`

## Timeout Configuration

| Task Type | Recommended Timeout | Claude Code Tool |
|-----------|---------------------|------------------|
| All Codex operations | **10 minutes** | `timeout: 600000` |

> **Approval modes**: See [codex-cli SKILL](../codex-cli/SKILL.md) - valid values: `untrusted`, `on-failure`, `on-request`, `never`

## Best Practices

- **Always use `codex exec`** in Claude Code environment (non-TTY)
- **Always create `.codex-loop/`** directory at start
- **Always save outputs** to context files for traceability
- **Always validate plans** before implementation
- **Never skip review** after changes
- **Default to `-s read-only`** for all reviews
- **Use `resume`** for session continuity
- **Check Git status** before first Codex command
- **Ask user permission** before using `--skip-git-repo-check`
- **Set 10-minute timeout** for all Codex exec commands (`timeout: 600000`)

## References

- **Prompt templates & context file formats**: See [references/prompt-templates.md](references/prompt-templates.md)
- **Codex CLI fundamentals**: See [codex-cli SKILL](../codex-cli/SKILL.md) (models, options, error handling)

Related Skills

gemini-claude-loop

8
from creator-hian/claude-code-plugins

Dual-AI engineering loop orchestrating Claude Code (planning/implementation) and Gemini (validation/review). Use when (1) complex feature development requiring validation, (2) high-quality code with security/performance concerns, (3) large-scale refactoring, (4) user requests gemini-claude loop or dual-AI review. Do NOT use for simple one-off fixes or prototypes.

codex-cli

8
from creator-hian/claude-code-plugins

OpenAI Codex CLI fundamentals for code analysis, review, and validation. Use when (1) executing codex commands for code review/analysis, (2) configuring models (gpt-5.3-codex/gpt-5.2/gpt-5.1-codex-max/gpt-5-codex-mini), sandbox modes (read-only/workspace-write), or reasoning effort (low/medium/high/xhigh), (3) managing Codex sessions with resume, (4) integrating Codex into automation scripts. Do NOT use for orchestration patterns (use codex-claude-loop instead).

ai-orchestration-feedback-loop

8
from creator-hian/claude-code-plugins

Multi-AI engineering loop orchestrating Claude, Codex, and Gemini for comprehensive validation. USE WHEN (1) mission-critical features requiring multi-perspective validation, (2) complex architectural decisions needing diverse AI viewpoints, (3) security-sensitive code requiring deep analysis, (4) user explicitly requests multi-AI review or triple-AI loop. DO NOT USE for simple features or single-file changes. MODES - Triple-AI (full coverage), Dual-AI Codex-Claude (security/logic), Dual-AI Gemini-Claude (UX/creativity).

unity-vcontainer

8
from creator-hian/claude-code-plugins

VContainer dependency injection expert specializing in IoC container configuration, lifecycle management, and Unity-optimized DI patterns. Masters dependency resolution, scoped containers, and testable architecture design. Use PROACTIVELY for VContainer setup, service registration, or SOLID principle implementation.

unity-unitask

8
from creator-hian/claude-code-plugins

UniTask library expert specializing in allocation-free async/await patterns, coroutine migration, and Unity-optimized asynchronous programming. Masters UniTask performance optimizations, cancellation handling, and memory-efficient async operations. Use PROACTIVELY for UniTask implementation, async optimization, or coroutine replacement.

unity-unirx

8
from creator-hian/claude-code-plugins

UniRx (Reactive Extensions) library expert for legacy Unity projects. Specializes in UniRx-specific patterns, Observable streams, and ReactiveProperty. Use for maintaining existing UniRx codebases. For new projects, use unity-r3 skill instead.

unity-ui

8
from creator-hian/claude-code-plugins

Build and optimize Unity UI with UI Toolkit and UGUI. Masters responsive layouts, event systems, and performance optimization. Use for UI implementation, Canvas optimization, or cross-platform UI challenges.

unity-textmeshpro

8
from creator-hian/claude-code-plugins

TextMeshPro (TMPro) expert for Unity text rendering with advanced typography, performance optimization, and professional text effects. Masters font asset creation, dynamic fonts, rich text formatting, material presets, and text mesh optimization. Use PROACTIVELY for text rendering, font management, localization text, UI text performance, or text effects implementation.

unity-testrunner

8
from creator-hian/claude-code-plugins

Unity Test Framework CLI automation and test writing patterns. Masters batchmode execution, NUnit assertions, EditMode/PlayMode testing, and TDD workflows. Use PROACTIVELY for test automation, CI/CD pipelines, or test-driven development in Unity.

unity-r3

8
from creator-hian/claude-code-plugins

R3 (Reactive Extensions) library expert specializing in modern reactive programming patterns, event-driven architectures, and Observable streams. Masters R3-specific features, async enumerable integration, and Unity-optimized reactive patterns. Use PROACTIVELY for R3 implementation, reactive programming, or MVVM/MVP architecture.

unity-performance

8
from creator-hian/claude-code-plugins

Optimize Unity game performance through profiling, draw call reduction, and resource management. Masters batching, LOD, occlusion culling, and mobile optimization. Use for performance bottlenecks, frame rate issues, or optimization strategies.

unity-networking

8
from creator-hian/claude-code-plugins

Implement multiplayer games with Unity Netcode, Mirror, or Photon. Masters client-server architecture, state synchronization, and lag compensation. Use for multiplayer features, networking issues, or real-time synchronization.