简体中文 | English
A multi-model collaboration development system where Claude Code orchestrates Codex + Gemini. Frontend tasks route to Gemini, backend tasks route to Codex, and Claude handles orchestration and code review.
- Zero-config model routing — Frontend tasks automatically go to Gemini, backend tasks to Codex. No manual switching.
- Security by design — External models have no write access. They return patches; Claude reviews before applying.
- 27 slash commands — From planning to execution, git workflow to code review, all accessible via
/ccg:*. - Spec-driven development — Integrates OPSX to turn vague requirements into verifiable constraints, eliminating AI improvisation.
Claude Code (Orchestrator)
│
┌───┴───┐
↓ ↓
Codex Gemini
(Backend) (Frontend)
│ │
└───┬───┘
↓
Unified Patch
External models have no write access — they only return patches, which Claude reviews before applying.
| Dependency | Required | Notes |
|---|---|---|
| Node.js 20+ | Yes | ora@9.x requires Node >= 20. Node 18 causes SyntaxError |
| Claude Code CLI | Yes | Install guide |
| jq | Yes | Used for auto-authorization hook (install) |
| Codex CLI | No | Enables backend routing |
| Gemini CLI | No | Enables frontend routing |
npx ccg-workflow
On first run, CCG prompts you to select a language (English / Chinese). This preference is saved for all future sessions.
# macOS
brew install jq
# Linux (Debian/Ubuntu)
sudo apt install jq
# Linux (RHEL/CentOS)
sudo yum install jq
# Windows
choco install jq # or: scoop install jq
npx ccg-workflow menu # Select "Install Claude Code"
Supports: npm, homebrew, curl, powershell, cmd.
| Command | Description | Model |
|---|---|---|
/ccg:workflow |
Full 6-phase development workflow | Codex + Gemini |
/ccg:plan |
Multi-model collaborative planning (Phase 1-2) | Codex + Gemini |
/ccg:execute |
Multi-model collaborative execution (Phase 3-5) | Codex + Gemini + Claude |
/ccg:codex-exec |
Codex full execution (plan → code → review) | Codex + multi-model review |
/ccg:feat |
Smart feature development | Auto-routed |
/ccg:frontend |
Frontend tasks (fast mode) | Gemini |
/ccg:backend |
Backend tasks (fast mode) | Codex |
| Command | Description | Model |
|---|---|---|
/ccg:analyze |
Technical analysis | Codex + Gemini |
/ccg:debug |
Problem diagnosis + fix | Codex + Gemini |
/ccg:optimize |
Performance optimization | Codex + Gemini |
/ccg:test |
Test generation | Auto-routed |
/ccg:review |
Code review (auto git diff) | Codex + Gemini |
/ccg:enhance |
Prompt enhancement | Built-in |
| Command | Description |
|---|---|
/ccg:spec-init |
Initialize OPSX environment |
/ccg:spec-research |
Requirements → Constraints |
/ccg:spec-plan |
Constraints → Zero-decision plan |
/ccg:spec-impl |
Execute plan + archive |
/ccg:spec-review |
Dual-model cross-review |
| 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 |
Prerequisite: Enable Agent Teams in
settings.json:CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
| Command | Description |
|---|---|
/ccg:commit |
Smart commit (conventional commit format) |
/ccg:rollback |
Interactive rollback |
/ccg:clean-branches |
Clean merged branches |
/ccg:worktree |
Worktree management |
| Command | Description |
|---|---|
/ccg:init |
Initialize project CLAUDE.md |
/ccg:context |
Project context management (.context/ init, log, compress, history) |
# 1. Generate implementation plan
/ccg:plan implement user authentication
# 2. Review the plan (editable)
# Plan saved to .claude/plan/user-auth.md
# 3a. Execute (Claude refactors) — fine-grained control
/ccg:execute .claude/plan/user-auth.md
# 3b. Execute (Codex does everything) — efficient, low Claude token usage
/ccg:codex-exec .claude/plan/user-auth.md
Integrates OPSX architecture to turn requirements into constraints, eliminating AI improvisation:
/ccg:spec-init # Initialize OPSX environment
/ccg:spec-research implement user auth # Research → constraints
/ccg:spec-plan # Parallel analysis → zero-decision plan
/ccg:spec-impl # Execute the plan
/ccg:spec-review # Independent review (anytime)
Tip:
/ccg:spec-*commands internally call/opsx:*. You can/clearbetween phases — state is persisted in theopenspec/directory.
Leverage Claude Code Agent Teams to spawn multiple Builder teammates for parallel coding:
/ccg:team-research implement kanban API # 1. Requirements → constraints
# /clear
/ccg:team-plan kanban-api # 2. Plan → parallel tasks
# /clear
/ccg:team-exec # 3. Builders code in parallel
# /clear
/ccg:team-review # 4. Dual-model cross-review
vs Traditional Workflow: Team series uses
/clearbetween steps to isolate context, passing state through files. Ideal for tasks decomposable into 3+ independent modules.
~/.claude/
├── commands/ccg/ # 26 slash commands
├── agents/ccg/ # Sub-agents
├── skills/ccg/ # Quality gates + multi-agent orchestration
├── bin/codeagent-wrapper
└── .ccg/
├── config.toml # CCG configuration
└── prompts/
├── codex/ # 6 Codex expert prompts
└── gemini/ # 7 Gemini expert prompts
Configure in ~/.claude/settings.json under "env":
| Variable | Description | Default | When to change |
|---|---|---|---|
CODEAGENT_POST_MESSAGE_DELAY |
Wait after Codex completion (sec) | 5 |
Set to 1 if Codex process hangs |
CODEX_TIMEOUT |
Wrapper execution timeout (sec) | 7200 |
Increase for very long tasks |
BASH_DEFAULT_TIMEOUT_MS |
Claude Code Bash timeout (ms) | 120000 |
Increase if commands time out |
BASH_MAX_TIMEOUT_MS |
Claude Code Bash max timeout (ms) | 600000 |
Increase 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"
}
}
npx ccg-workflow menu # Select "Configure MCP"
Code retrieval (choose one):
- ace-tool (recommended) — Code search via
search_context. Official | Third-party proxy - fast-context (recommended) — Windsurf Fast Context, AI-powered search without full-repo indexing. Requires Windsurf account
- ContextWeaver (alternative) — Local hybrid search, requires SiliconFlow API Key (free)
Optional tools:
- Context7 — Latest library documentation (auto-installed)
- Playwright — Browser automation / testing
- DeepWiki — Knowledge base queries
- Exa — Search engine (requires API Key)
CCG automatically installs a Hook to auto-authorize codeagent-wrapper commands (requires jq).
Manual setup (for versions before v1.7.71)
Add to ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.command' 2>/dev/null | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || true",
"timeout": 1
}
]
}
]
}
}
npx ccg-workflow menu # Select "Tools"
- ccusage — Claude Code usage analytics
- CCometixLine — Status bar tool (Git + usage tracking)
# Update
npx ccg-workflow@latest # npx users
npm install -g ccg-workflow@latest # npm global users
# Uninstall
npx ccg-workflow # Select "Uninstall"
npm uninstall -g ccg-workflow # npm global users need this extra step
In --json mode, Codex does not automatically exit after output completion.
Fix: Set CODEAGENT_POST_MESSAGE_DELAY=1 in your environment variables.
We welcome contributions! See CONTRIBUTING.md for guidelines.
Looking for a place to start? Check out issues labeled good first issue.
fengshao1227 |
RebornQ |
23q3 |
MrNine-666 |
GGzili |
- cexll/myclaude — codeagent-wrapper
- UfoMiao/zcf — Git tools
- GudaStudio/skills — Routing design
- ace-tool — MCP tool
- Email: fengshao1227@gmail.com — Sponsorship, collaboration, or development ideas
- Issues: GitHub Issues — Bug reports and feature requests
- Discussions: GitHub Discussions — Questions and community chat
MIT
v1.7.83 | Issues | Contributing