Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Claude-Codex Bridge

A bidirectional skill that enables AI-to-AI code comparison and review between Claude Code and OpenAI's Codex.

Features

Bidirectional - Claude can call Codex, or Codex can call Claude ✅ CLI-based - No API keys or pip dependencies required ✅ Automatic truncation - Handles large contexts gracefully ✅ CLI validation - Checks for tool availability before calling ✅ Configurable timeout - Customize response times ✅ Enhanced error handling - Clear, actionable error messages

Installation

  1. Copy the skill directory to ~/.claude/skills/:

    cp -r codex-compare ~/.claude/skills/
  2. Ensure both CLIs are installed:

  3. Restart Claude Code to load the skill

Usage

When using Claude Code, simply ask:

  • "Compare this with Codex"
  • "Ask Codex to review this code"
  • "What would Codex do differently?"
  • "Get Codex's opinion on this"

Claude will automatically:

  1. Gather the context (task, code, files)
  2. Call Codex CLI
  3. Present a formatted side-by-side comparison

Architecture

codex-compare/
├── SKILL.md                  # Main skill documentation
├── scripts/
│   ├── call_codex.py        # Call Codex from Claude
│   └── call_claude.py       # Call Claude from Codex
└── references/
    └── prompting-guide.md   # Best practices for AI prompting

Examples

Password Validator Comparison

# Claude's approach
def validate_password(password):
    # Simple, readable implementation
    ...

# Codex's feedback
# - Suggests configurability
# - Recommends input validation
# - Proposes using string.punctuation

Key Differences Identified

  • Claude: Prioritizes clarity and simplicity
  • Codex: Emphasizes configurability and robustness
  • Both: Correct implementations with different trade-offs

Configuration

Input JSON format:

{
  "task_description": "Create a function to...",
  "claude_solution": "def my_function()...",
  "file_context": "Optional file context",
  "additional_context": "Optional constraints",
  "timeout": 60
}

Automatic truncation limits:

  • Task description: 2000 chars
  • Code solution: 5000 chars
  • File context: 1000 chars
  • Additional context: 2000 chars

Requirements

  • Claude Code CLI installed
  • Codex CLI installed
  • Python 3.7+ (standard library only)
  • No pip dependencies needed!

How It Works

  1. CLI Detection - Validates that both CLIs are available
  2. Context Gathering - Collects task, code, and relevant context
  3. Truncation - Automatically truncates large inputs to prevent overflow
  4. CLI Execution - Calls the target AI via subprocess
  5. Error Handling - Captures failures with actionable messages
  6. Formatted Output - Presents comparison in readable markdown

Development

Created using the skill-creator workflow with iterative improvements based on Codex's own review of the implementation.

Codex's Review Highlights

  • ✅ Simple, clean architecture
  • ✅ Works as demonstrated
  • ✅ Practical improvements implemented
  • ✅ Avoided over-engineering

License

MIT

Contributing

Issues and pull requests welcome! This skill was collaboratively developed by Claude and refined based on Codex's feedback.


Built with: Claude Code Skill Framework Reviewed by: Codex (meta!)

About

Bidirectional AI code comparison skill for Claude Code and Codex

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages