// Enable automated collaboration between Claude Code and Codex CLI using Byterover as shared memory. This skill should be used when architectural review or code validation from Codex is desired before or after implementation. Claude creates plans, directly invokes Codex for expert review via Bash, and implements based on feedback - all automatically without manual user intervention. All context persists in Byterover.
| name | claude-codex-collaboration |
| description | Enable automated collaboration between Claude Code and Codex CLI using Byterover as shared memory. This skill should be used when architectural review or code validation from Codex is desired before or after implementation. Claude creates plans, directly invokes Codex for expert review via Bash, and implements based on feedback - all automatically without manual user intervention. All context persists in Byterover. |
| allowed-tools | ["mcp__byterover-mcp__byterover-store-knowledge","mcp__byterover-mcp__byterover-retrieve-knowledge","Bash","Read","Write"] |
Transfer context between Claude Code and Codex CLI using Byterover as shared memory for collaborative development workflows.
Enable seamless collaboration between two AI agents by using Byterover MCP as a persistent shared memory layer. Claude Code creates architectural plans and implementations, then directly invokes Codex CLI for expert architectural review and code validation. All knowledge persists in Byterover, allowing both agents to access the same context. The entire workflow is automated - Claude Code runs Codex directly via the Bash tool without requiring manual user intervention.
Invoke this skill when:
When the user requests a feature, create a comprehensive architectural plan that includes:
Structure the plan clearly with markdown sections for easy review.
Store the plan using the Byterover MCP tool with rich, searchable content:
mcp__byterover-mcp__byterover-store-knowledge({
messages: `
**ARCHITECTURAL PLAN: [Feature Name]**
Collaboration between Claude Code and Codex CLI
Status: AWAITING_REVIEW
## Problem Statement
[Clear description of what needs to be built and why]
## Proposed Solution
### Technical Approach
[Detailed technical design with code examples]
### Key Decisions
[Important architectural choices and their rationale]
### Technologies
[Libraries, frameworks, and tools being used]
## Questions for Review
1. [Specific question for Codex to address]
2. [Another area where expert feedback is valuable]
## Implementation Plan
[Step-by-step breakdown of how this will be built]
---
Task: [Feature name/description for search retrieval]
Agent: Claude Code
Date: [Current date]
`
})
Key principles:
IMPORTANT: Wait 30 seconds after storing the plan in Byterover before invoking Codex, as Byterover processes memories asynchronously. Inform the user about this wait time.
Then use the Bash tool to run Codex directly from Claude Code:
Bash({
command: `codex exec "Use the byterover-retrieve-knowledge tool to search for the latest architectural plan about [feature description]. Review the technical approach, identify potential issues, and provide detailed feedback. Store your review in Byterover using byterover-store-knowledge."`,
description: "Run Codex to review architectural plan",
timeout: 300000 // 5 minutes for Codex to complete
})
Important considerations:
Codex will automatically:
byterover-retrieve-knowledge to find the planCodex's review typically includes:
After Codex completes (wait another 30 seconds for Byterover to index the feedback), retrieve the feedback:
mcp__byterover-mcp__byterover-retrieve-knowledge({
query: "[feature description] Codex review architectural feedback",
limit: 3
})
Use a descriptive query that combines:
Byterover uses semantic search, so conceptually similar queries will find related memories.
Analyze Codex's feedback and implement the feature incorporating:
Create clean, well-tested code that addresses all concerns raised in the review.
After implementation, store a summary in Byterover:
mcp__byterover-mcp__byterover-store-knowledge({
messages: `
**IMPLEMENTATION COMPLETE: [Feature Name]**
Collaboration between Claude Code and Codex CLI
Status: READY_FOR_VALIDATION
## What Was Built
[Overview of the implementation]
## Files Created/Modified
- path/to/file1.ts - [Description]
- path/to/file2.ts - [Description]
- path/to/test.ts - [Description]
## Codex Feedback Addressed
โ
[Specific concern from review] - [How it was addressed]
โ
[Another concern] - [Solution implemented]
โ
[Recommendation] - [How it was incorporated]
## Key Implementation Details
[Important technical decisions made during implementation]
## Testing
[Test coverage and approach]
---
Task: [Feature name/description for search retrieval]
Agent: Claude Code
Date: [Current date]
`
})
Use the Bash tool to run Codex validation directly:
Bash({
command: `codex exec "Use the byterover-retrieve-knowledge tool to search for the completed implementation of [feature description]. Review the actual code files listed and validate the implementation quality. Store validation results in Byterover using byterover-store-knowledge."`,
description: "Run Codex to validate implementation",
timeout: 300000 // 5 minutes for validation
})
Inform the user that Codex is performing validation in the background.
Codex will automatically:
If Codex identifies issues during validation:
After successful collaboration, extract validated patterns for future reuse:
mcp__byterover-mcp__byterover-store-knowledge({
messages: `
**VALIDATED PATTERN: [Pattern Name]**
Production-Ready Implementation Pattern
Validated through Claude-Codex Collaboration
## Pattern Overview
[Description of the reusable pattern]
## Implementation Code
\`\`\`typescript
[Complete, working code example]
\`\`\`
## Key Decisions
- [Important architectural decision]
- [Best practice applied]
- [Performance consideration]
## Use Cases
- [When to use this pattern]
- [What problems it solves]
## Lessons Learned
[Important insights from the collaboration]
---
Pattern validated by: Codex architectural review
Implemented by: Claude Code
Date: [Current date]
`
})
These patterns become searchable knowledge for future projects.
Create plans that are:
Construct queries that:
Examples:
// Good queries
query: "rate limiting Express API architectural plan"
query: "Codex review authentication implementation"
query: "validated pattern Redis caching"
// Less effective queries
query: "plan" // Too generic
query: "auth" // Too vague
Store memories that are:
If Byterover doesn't return expected results:
limit: 5 or limit: 10When invoking Codex directly via Bash:
Helper script (optional, no longer required for automated workflow):
Since Claude Code now invokes Codex directly via Bash, the helper script is optional. However, it can still be useful for:
Usage examples:
# Generate unique identifier
./collaborate.sh session
# Get Codex review command (for manual use)
./collaborate.sh codex-review [identifier]
# Get Codex validation command (for manual use)
./collaborate.sh codex-validate [identifier]
# Show help
./collaborate.sh help
Complete walkthrough of a realistic collaboration session implementing rate limiting for an Express API. Review this file to see:
Load this reference when users need concrete examples of the collaboration workflow.
Symptoms: Byterover query returns no results or wrong results
Solutions:
limit parameter to see more resultsSymptoms: Codex reports inability to use Byterover tools
Solutions:
codex mcp listSymptoms: Query returns memories from different projects or tasks
Solutions:
Byterover uses semantic search without metadata tags or labels. Work around this by:
Semantic matching may return similar but unintended memories. Mitigate this by:
Memories take 20-30 seconds to become searchable after storage. Handle this by:
This skill enables:
The fully automated collaboration workflow consistently produces better outcomes than either agent working alone, with the added benefit of building a searchable knowledge base of validated architectural decisions and implementation patterns. Users benefit from expert-level code review without any manual handoff steps.