CCG - Claude + Codex + Gemini Multi-Model Collaboration

July 4, 2026 · View on GitHub

CCG Workflow

GitHub stars NPM Downloads npm version License: MIT Claude Code Tests Follow on X star Docs

简体中文 | English | Documentation

302.AI

302.AI is a pay-as-you-go enterprise AI resource hub that offers the latest and most comprehensive AI models and APIs on the market, along with a variety of ready-to-use online AI applications.


NotebookLM Remover

NotebookLM Remover — Free browser-local AI watermark remover. Remove NotebookLM watermarks across every format — video, PDF, PPTX, infographic, podcast, and more. 100% private, works offline.


CCG is a workflow engine for Claude Code that orchestrates multiple AI models (Codex, Gemini, Claude) with hook-based state tracking, automatic strategy selection, and Agent Teams parallel execution.

What's new in v3.0

v3.0 is a ground-up rewrite. One command replaces 29.

  • /ccg:go — Describe what you want in plain language. The engine analyzes your intent, picks the right strategy, and executes it.
  • Hook engine — Per-turn state injection keeps Claude on track even after context compaction. Session-start hooks inject full project context on every new session.
  • Task persistence — Medium+ complexity tasks create .ccg/tasks/ with persistent state. Phase gates enforce HARD STOP checkpoints.
  • Agent Teams — Large tasks spawn parallel Builder teammates via TeamCreate. Each Builder gets isolated file ownership.
  • Quality gatesverify-security, verify-quality, verify-change run as Skill invocations inside strategy verification phases.
  • Domain knowledge hooks — When your message mentions security, caching, RAG, etc., the relevant knowledge file is auto-injected into context.
  • Codex-Led Mode — Use Codex CLI as the lead orchestrator. Codex writes code directly and dispatches analysis/review to Gemini + Claude via codeagent-wrapper. Install via menu option X.

Quick Start

npx ccg-workflow

Requires Node.js 20+ and Claude Code CLI. Codex CLI and Gemini CLI are optional (enable multi-model features).

The installer walks through 4 steps: API config, model routing, MCP tools, performance mode. New users get a streamlined 2-step flow with sensible defaults.

How it works

You: /ccg:go add JWT authentication to this API

CCG Engine:
  1. Reads project context (git status, tech stack, file structure)
  2. Classifies: feature / L complexity / backend / high risk
  3. Selects strategy: full-collaborate
  4. Creates .ccg/tasks/add-jwt-auth/task.json
  5. Launches dual-model analysis (Codex + Gemini in parallel)
  6. Produces plan → HARD STOP for your approval
  7. Spawns Agent Teams Builders for parallel implementation
  8. Runs quality gates + dual-model cross-review
  9. Reports results

Every turn, a hook injects:
  <ccg-state>
  Task: add-jwt-auth (in_progress)
  Strategy: full-collaborate
  Phase: 4-implementation
  Next: Layer 1 Builders executing
  </ccg-state>

Strategies

The engine picks a strategy based on task type and complexity:

StrategyWhenExternal modelsTeams
direct-fixSimple bug, single fileNoNo
quick-implementSmall feature, clear scopeNoNo
guided-developMedium feature, needs planningSingle modelNo
full-collaborateComplex feature, multi-moduleDual model parallelYes
debug-investigateComplex bug, unknown causeDual model diagnosisNo
refactor-safelyCode restructuringDual model reviewNo
deep-researchTechnical research, comparisonDual model explorationNo
optimize-measurePerformance optimizationOptionalNo
review-auditCode reviewDual model cross-reviewNo
git-actioncommit, rollback, branchesNoNo

Simple tasks run fast with no overhead. Complex tasks get the full engine.

Commands

v3.0 default install: 13 commands. Legacy mode adds 18 more.

Core

CommandDescription
/ccg:goSmart entry — describe what you want, engine handles the rest

Git

CommandDescription
/ccg:commitSmart conventional commit
/ccg:rollbackInteractive rollback
/ccg:clean-branchesClean merged branches
/ccg:worktreeWorktree management

Project

CommandDescription
/ccg:initInitialize project CLAUDE.md
/ccg:contextProject context management

OpenSpec

CommandDescription
/ccg:spec-initInitialize OPSX environment
/ccg:spec-researchRequirements → constraints
/ccg:spec-planConstraints → zero-decision plan
/ccg:spec-implExecute plan + archive
/ccg:spec-reviewDual-model cross-review

Hook Engine

CCG installs 4 hooks into ~/.claude/settings.json:

HookEventPurpose
workflow-state.jsUserPromptSubmitInjects task state breadcrumb every turn
session-start.jsSessionStartInjects full project context on session start/clear/compact
subagent-context.jsPreToolUse (Bash/Agent)Injects spec + task context: directly into Team member prompt via updatedInput, into lead context for codeagent-wrapper calls
skill-router.jsUserPromptSubmitAuto-injects domain knowledge when keywords detected

Hooks are JavaScript, zero dependencies, silent on failure.

Task System

Medium+ complexity tasks create a persistent task directory:

.ccg/tasks/add-jwt-auth/
├── task.json         # Status, strategy, current phase, gate
├── requirements.md   # Enhanced requirements (full-collaborate)
├── plan.md           # Approved implementation plan
├── context.jsonl     # Spec files for sub-agent injection
├── review.md         # Review results
└── research/         # Persisted research findings

The workflow-state hook reads task.json every turn and injects the current state. If context gets compacted, session-start re-injects the full task context. No state is lost.

Spec System

Project-level coding standards in .ccg/spec/:

.ccg/spec/
├── backend/index.md    # Backend conventions
├── frontend/index.md   # Frontend conventions
└── guides/index.md     # Cross-module guidelines

The subagent-context hook reads context.jsonl and injects relevant spec files into every codeagent-wrapper call and Agent Team spawn. Sub-agents follow your project's standards without being told.

Configuration

~/.claude/
├── commands/ccg/          # Slash commands
├── hooks/ccg/             # Hook scripts (4 files)
├── .ccg/
│   ├── config.toml        # Model routing, MCP, performance
│   ├── engine/            # Strategy files + model router
│   └── prompts/           # Expert prompts (codex/gemini/claude)
├── skills/ccg/            # Quality gates + domain knowledge
└── bin/codeagent-wrapper  # Multi-model execution bridge

Environment Variables

Set in ~/.claude/settings.json under "env":

VariableDefaultDescription
CODEX_TIMEOUT7200Wrapper timeout (seconds)
CODEAGENT_POST_MESSAGE_DELAY5Post-completion delay (seconds)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSunsetSet to 1 to enable Agent Teams parallel execution

Update / Uninstall

npx ccg-workflow@latest     # Update
npx ccg-workflow            # Select "Uninstall" from menu

Credits

Contributors

fengshao1227
fengshao1227
SXP-Simon
SXP-Simon
RebornQ
RebornQ
Sakuranda
Sakuranda
Mriris
Mriris
23q3
23q3
MrNine-666
MrNine-666
GGzili
GGzili

Contact

Star History

Star History Chart

License

MIT


v3.1.9 | Issues | Contributing