CCG: Claude + Codex + Gemini Multi-Model AI Workflow
Comprehensive Overview of CCG (Claude + Codex + Gemini Multi-Model Collaboration Workflow)
Introduction to CCG: A Unified AI Development Framework
CCG (Claude + Codex + Gemini) is a revolutionary multi-model collaboration development system designed to streamline software development by leveraging the strengths of three leading AI models—Claude Code, Codex, and Gemini. Unlike traditional monolithic workflows, CCG introduces an intelligent routing mechanism that automatically assigns tasks based on their nature: frontend tasks are directed to Gemini, backend tasks to Codex, while Claude orchestrates the entire process, ensuring security, efficiency, and seamless integration.
This framework eliminates manual model switching, enforces a security-by-design approach by restricting external models from direct write access (they only return patches that Claude reviews), and provides an extensive set of slash commands (/ccg:) for rapid development workflows. CCG also integrates with OPSX, a specification-driven architecture, to transform vague requirements into executable constraints, reducing AI improvisation.
Core Philosophy and Key Features
1. Zero-Config Model Routing
CCG’s primary innovation is its automatic task routing system, which ensures:
- Frontend tasks (e.g., UI/UX logic, frontend frameworks) are handled by Gemini.
- Backend tasks (e.g., databases, APIs, server-side logic) are delegated to Codex.
- Claude acts as the central orchestrator, reviewing patches before applying them.
This eliminates the need for manual model selection, reducing cognitive load and improving developer efficiency.
2. Security by Design
A critical aspect of CCG is its security model:
- External models (Gemini/Codex) cannot write directly to codebases; they only generate patches.
- Claude reviews these patches before applying them, ensuring no unauthorized modifications.
- This prevents malicious or unintended changes, making the system inherently secure.
3. Extensive Slash Command Integration
CCG provides 27+ slash commands, enabling seamless workflow automation across development phases:
| Category | Commands |
|----------------------------|------------------------------------------------------------------------------|
| Development Workflow | /ccg:workflow, /ccg:plan, /ccg:execute, /ccg:codex-exec, /ccg:feat |
| Analysis & Quality | /ccg:analyze, /ccg:debug, /ccg:optimize, /ccg:test, /ccg:review |
| Spec-Driven Development| /ccg:spec-init, /ccg:spec-research, /ccg:spec-plan, /ccg:spec-review|
| Agent Teams (v1.7.60+) | /ccg:team-research, /ccg:team-plan, /ccg:team-exec, /ccg:team-review |
| Git Tools | /ccg:commit, /ccg:rollback, /ccg:clean-branches, /ccg:worktree |
These commands cover everything from planning and execution to debugging, optimization, and code review, ensuring a cohesive development experience.
Architecture Overview
1. Centralized Orchestration
The system follows a layered architecture:
Claude Code (Orchestrator) │
┌───────────┐ ┌─────────────┐ └───────────────────────┐
│ │ │ │ │
│ Codex │ │ Gemini │ Unified Patch │
│ Backend │ │ Frontend │ (Reviewed by Claude) │
│ Tasks │ │ Tasks │ │
│ │ │ │ │
└───────────┘ └─────────────┘ └───────────────────────┘
- Claude acts as the central controller, managing model interactions.
- Codex handles backend logic (e.g., databases, APIs).
- Gemini processes frontend tasks (e.g., React/Vue components).
2. External Model Restrictions
External models (Gemini/Codex) are restricted to:
- Generating code patches.
- Sending feedback for Claude’s review. Claude ensures only approved changes are applied, maintaining system integrity.
Quick Start: Installation and Prerequisites
1. System Requirements
To begin using CCG, developers must meet the following prerequisites:
| Dependency | Requirement | Notes |
|----------------------|-------------------------------------|---------------------------------------------------------------------------|
| Node.js | ≥ 20+ | Required for ora@9.x compatibility. Older versions (Node 18) may cause syntax errors. |
| Claude Code CLI | Installed via npx ccg-workflow | Follow the installation guide. |
| jq | Installed | Used for auto-authorization hooks. Install via: brew install jq (macOS) or sudo apt install jq (Linux). |
| Codex CLI | Optional | Enables backend routing. |
| Gemini CLI | Optional | Enables frontend routing. |
2. Installation Steps
- Run the Initial Setup:
npx ccg-workflow
- Select your preferred language (English/Chinese).
- The preference is saved for future sessions.
- Install
jq(if not already installed):
# macOS
brew install jq
# Linux (Debian/Ubuntu)
sudo apt install jq
# Windows (Chocolatey)
choco install jq
- Install Claude Code:
npx ccg-workflow menu
- Select "Install Claude Code" using the provided options (
npm,brew,curl, etc.).
Core Workflows
1. Development Workflow
CCG’s development workflow is divided into six phases, each handled by different models:
| Phase | Command | Description |
|-----------------|---------------------------|-------------------------------------------------------------------------------|
| Planning | /ccg:plan | Multi-model collaborative planning (frontend/backend logic). |
| Execution | /ccg:execute | Fine-grained control via Claude’s refactoring. |
| Codex Full Exec | /ccg:codex-exec | Efficient backend execution with minimal Claude token usage. |
Example Workflow:
# 1. Plan user authentication logic
/ccg:plan implement user auth
# 2. Review the plan (editable)
# Plan saved to .claude/plan/user-auth.md
# 3a. Execute via Claude refactoring
/ccg:execute .claude/plan/user-auth.md
# 3b. Execute via Codex (full backend logic)
/ccg:codex-exec .claude/plan/user-auth.md
2. Spec-Driven Development with OPSX
CCG integrates OPSX, a specification-driven architecture, to transform vague requirements into executable constraints:
| Command | Description |
|---------------------------|--------------------------------------------------------------------------------|
| /ccg:spec-init | Initialize OPSX environment. |
| /ccg:spec-research | Research → Constraints (e.g., "implement user auth"). |
| /ccg:spec-plan | Parallel analysis → Zero-decision plan. |
| /ccg:spec-impl | Execute the plan and archive results. |
Example Workflow:
/ccg:spec-research implement user auth
/ccg:spec-plan
/ccg:spec-impl
/ccg:spec-review # Independent review anytime.
3. Agent Teams (Parallel Development)
For complex tasks, CCG supports Agent Teams (introduced in v1.7.60+), enabling parallel coding:
| Command | Description |
|---------------------------|--------------------------------------------------------------------------------|
| /ccg:team-research | Requirements → Constraints (parallel exploration). |
| /ccg:team-plan | Constraints → Parallel implementation plan. |
| /ccg:team-exec | Spawn Builder teammates for parallel coding. |
| /ccg:team-review | Dual-model cross-review. |
Example Workflow:
/ccg:team-research implement kanban API
/clear # Clear context between steps.
/ccg:team-plan kanban-api
/ccg:team-exec # Builders code in parallel.
/ccg:team-review
Configuration and Directory Structure
1. Key Directories
CCG organizes files into structured directories for efficient management:
~/.claude/
├── commands/ccg/ # 26 slash commands
├── agents/ccg/ # Sub-agents
├── skills/ccg/ # Quality gates + multi-agent orchestration
├── bin/codeagent-wrapper # Wrapper scripts
└── .ccg/
├── config.toml # CCG configuration
└── prompts/ # Expert prompts for Codex/Gemini
├── codex/ # 6 Codex expert prompts
└── gemini/ # 7 Gemini expert prompts
2. Environment Variables
CCG allows customization via environment variables stored in ~/.claude/settings.json:
| Variable | Description |
|----------------------------------|--------------------------------------------------------------------------------|
| CODEAGENT_POST_MESSAGE_DELAY | Wait time after Codex completion (default: 5 sec). Set to 1 if delays occur. |
| CODEX_TIMEOUT | Wrapper execution timeout (default: 7200 sec = 2 hours). Increase for long tasks.|
| BASH_DEFAULT_TIMEOUT_MS | Claude Code Bash timeout (default: 120,000 ms = 2 min). Increase if commands time out. |
| BASH_MAX_TIMEOUT_MS | Max Bash timeout (default: 600,000 ms = 10 min). Use for long builds. |
Example settings.json:
{
"env": {
"CODEAGENT_POST_MESSAGE_DELAY": "1",
"CODEX_TIMEOUT": "7200",
"BASH_DEFAULT_TIMEOUT_MS": "600000",
"BASH_MAX_TIMEOUT_MS": "3600000"
}
}
3. MCP (Model Context Provider) Configuration
CCG supports multiple MCP tools for code retrieval:
| Option | Description |
|--------------------------|--------------------------------------------------------------------------------|
| ace-tool | Recommended: Code search via search_context. Official here. Third-party proxy available. |
| fast-context | Windsurf Fast Context (AI-powered search without full-repo indexing). Requires a Windsurf account. |
| ContextWeaver | Local hybrid search; requires SiliconFlow API Key (free). |
Installation:
npx ccg-workflow menu # Select "Configure MCP"
Utility Commands and Tools
1. Git Tools
CCG provides powerful Git-related commands:
| Command | Description |
|---------------------------|--------------------------------------------------------------------------------|
| /ccg:commit | Smart commit (conventional format). |
| /ccg:rollback | Interactive rollback of commits. |
| /ccg:clean-branches | Clean merged branches. |
| /ccg:worktree | Worktree management (e.g., .context/init, log, compress, history). |
2. Project Context Management
CCG manages project context via the .context/ directory:
# Initialize context
/ccg:context init
# Log changes
/ccg:context log
# Compress context
/ccg:context compress
# View history
/ccg:context history
3. Additional Utilities
ccusage: Tracks Claude Code usage analytics.CCometixLine: Git status bar tool for tracking changes.
Troubleshooting and FAQs
Common Issues & Fixes
| Issue | Solution |
|--------------------------------------------------|------------------------------------------------------------------------------|
| Codex CLI 0.80.0 process does not exit | Set CODEAGENT_POST_MESSAGE_DELAY=1 in environment variables. |
| Node.js < 20 compatibility errors | Upgrade to Node.js ≥ 20 or use --legacy-peer-deps. |
Contributing to CCG
CCG is an open-source project, and contributions are welcome! Key resources:
- CONTRIBUTING.md – Guidelines for contributors.
- Good first issues: Label
good first issue.
Conclusion: Why CCG Stands Out
CCG represents a paradigm shift in AI-driven software development by: ✅ Automating model routing (no manual switching). ✅ Enforcing security-by-design (external models only return patches). ✅ Integrating OPSX for spec-driven workflows, reducing AI improvisation. ✅ Supporting parallel Agent Teams for complex tasks. ✅ Providing 27+ slash commands for seamless development.
Whether you're a solo developer or part of a large team, CCG’s modular architecture and intelligent automation make it one of the most powerful tools in modern AI-assisted coding.
Final Thoughts
CCG is designed to eliminate friction in software development by leveraging the strengths of multiple AI models while maintaining security and efficiency. Its slash command system, spec-driven workflows, and parallel Agent Teams make it ideal for both small projects and large-scale applications.
For further exploration, refer to the GitHub repository or reach out via:
- Email: fengshao1227@gmail.com
- Issues/Discussions: GitHub Discussions
Note: For the most up-to-date features, always check the latest version of CCG (v1.7.83 as of October 2023). The system continues to evolve with new integrations and optimizations.
Visual Representation (Conceptual Flowchart)
(Since I cannot generate images directly, here’s a textual representation of key workflows:)
┌───────────────────────────────────────────────────┐
│ CCG Multi-Model Workflow │
├─────────────┬─────────────────┬───────────────────┤
│ Claude │ Codex │ Gemini │
│ (Orchestrator)│ (Backend Logic) │ (Frontend Logic) │
├─────────────┼─────────────────┼───────────────────┤
│ /ccg:plan │ /ccg:backend │ /ccg:frontend │
│ (Planning) │ (Backend Tasks) │ (Frontend Tasks) │
├─────────────┼─────────────────┼───────────────────┤
│ /ccg:execute│ /ccg:codex-exec │ │
│ (Claude Refactoring)│ (Full Backend Exec) │
└─────────────┴─────────────────┴───────────────────┘
End of Description. For any specific query or deeper exploration, feel free to ask!
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/fengshao1227/ccg-workflow
GitHub - fengshao1227/ccg-workflow: CCG: Claude + Codex + Gemini Multi-Model AI Workflow
Comprehensive Overview of CCG (Claude + Codex + Gemini Multi-Model Collaboration Workflow) – a revolutionary multi-model collaboration development system design...
github - fengshao1227/ccg-workflow