Skip to content
PendingRealityPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CCG

CCG v1 is a Tauri/Svelte desktop app for running Claude Code, Gemini CLI, and Codex CLI as managed native CLI agents, with a strong bias toward headless / programmatic turns rather than ordinary interactive CLI use.

It was built as a local orchestration workbench: spawn agents, inject mission context, monitor status, coordinate reviews/workflows, and keep long-running CLI sessions grounded through working docs and anchors. The bundled desktop UI is the main operator surface, but the engine also exposes a localhost HTTP + SSE API so separate local frontends can drive the same managed-agent, Task, and Workflow primitives.

Maintenance status: CCG v1 is published as-is for reference and reuse. It is not expected to receive active maintenance from PendingReality because development effort has moved to a v2 direction.

What CCG does

  • Runs agents you don't have to babysit. Spawn Claude/Gemini/Codex as managed native CLI sessions, primarily through headless/programmatic turns; monitor their state, claim/release them, and assign work.
  • Keeps agents on-mission. Each agent has an anchor — an externalized mission statement in a working doc — re-injected every turn so long-running agents don't drift.
  • Composes per-turn context. Anchors, memory, inbox messages, skills, and protocol are merged into each turn's prompt, with a cacheable/dynamic split.
  • Lets agents coordinate. An inbox delivers agent-to-agent messages; workflows orchestrate multi-step, multi-agent runs (e.g. council planning, spawn chains); a commit lock serializes git across parallel agents.
  • Supports separate local frontends. The localhost /api/v1/* HTTP API plus named SSE events can drive external browser pages or other local UI shells; this repo includes plain HTML reference clients in examples/custom-frontend/ and examples/frontends/.
  • Is scriptable over MCP. CCG exposes an MCP server so external agents (or Claude Desktop) can drive it.

Features

Multi-CLI support

  • Claude Code — session discovery, resume, fork, hooks
  • Gemini CLI — sandbox / YOLO modes
  • Codex CLI — session discovery, resume, --full-auto

Agent lifecycle

  • Spawn (interactive or headless), claim/release, assign tasks, track state (idle → working → complete)
  • Per-agent working docs and mission anchors

Grounding & context

  • Anchor system — mission/intent persisted in a working doc, re-injected each turn
  • Prompt composition — layered context injection (anchor, memory, inbox, skills, protocol) with a system/message caching split
  • Memory — Hindsight integration (pack/hook based)

Coordination

  • Inbox — agent-to-agent notifications with auto-wake
  • Workflows — multi-step orchestration with a visual editor (council planning, spawn chains)
  • Service registry — register/start/stop background processes (dev servers, watchers)
  • Templates — role-based agent configuration (orchestrator, worker, reviewer, …)
  • Hooks — react to CLI lifecycle events (session start/end, stop, tool use)

MCP integration

  • MCP server — run ccg --mcp for external orchestration (stdio transport)
  • MCP registry — per-project MCP servers with per-CLI enablement
  • CLI config sync — sync MCP configs to Claude (settings.json), Gemini (settings.json), Codex (config.toml)

Local HTTP API and custom frontends

  • Tier 1 local API — /api/v1/* routes expose projects, agents, Tasks, Workflows, history, anchors, and stop/send controls
  • Live updates — /api/v1/events streams named SSE events such as agent.output, agent.completion, task.*, and workflow.*
  • Reference clients — examples/custom-frontend/ and examples/frontends/ contain single-file HTML/JS clients that run outside the Tauri app

Architecture

CCG spawns native CLI agents as managed sessions, primarily for headless/programmatic operation, injects mission context into each turn, and monitors them via hooks and output snapshots:

┌──────────────────────────────────────────────────────────────┐
│                        CCG Application                        │
│                                                              │
│   Tauri + Svelte UI            MCP Server (ccg --mcp)        │
│   - Agent dashboard            - spawn / claim / inject      │
│   - Workflow editor            - anchor / inbox / workflow   │
│   - Graph & composition        - service / council tools     │
│                                                              │
│   Local HTTP + SSE API                                      │
│   - /api/v1 agents/tasks/workflows/events                   │
│            │                              │                  │
│            ▼                              ▼                  │
│   ┌──────────────────────────────────────────────────────┐  │
│   │   Agent Lifecycle + Registry  (agent_lifecycle.rs)    │  │
│   └───────────────┬──────────────────────────────────────┘  │
│                   │ spawn (headless / interactive)           │
│   Prompt Composition ──┐              ┌── Hooks + snapshots  │
│   (anchor, memory,     │              │   (lifecycle events, │
│    inbox, skills)      ▼              │    output capture)   │
│            ┌──────────┐  ┌──────────┐  ┌──────────┐         │
│            │ Claude   │  │ Gemini   │  │ Codex    │         │
│            │ CLI      │  │ CLI      │  │ CLI      │         │
│            └──────────┘  └──────────┘  └──────────┘         │
└──────────────────────────────────────────────────────────────┘
  • Spawn — managed agents launched per CLI
  • Ground — prompt composition injects context each turn (system-prompt files + -p)
  • Monitor — hooks report lifecycle events; snapshots capture output
  • Coordinate — MCP tools + inbox + workflows
  • Expose — local HTTP + SSE routes let separate local frontends drive the same engine

MCP server

CCG runs an MCP server for external orchestration. Example Claude Desktop config:

{
  "mcpServers": {
    "ccg": {
      "command": "C:\\path\\to\\ccg.exe",
      "args": ["--mcp"]
    }
  }
}

Representative tools (the orchestrator set is larger):

Tool Description
ccg_spawn_terminal Spawn an agent (claude/gemini/codex)
ccg_list_terminals List active agents and their state
ccg_inject_command Send input/prompt to an agent
ccg_get_snapshot Capture an agent's output
ccg_claim_terminal / ccg_release_terminal Take / release exclusive control
ccg_propose_anchor Set/update an agent's mission anchor
ccg_send_inbox Deliver an agent-to-agent message
ccg_invoke_workflow Run a multi-step workflow
ccg_register_service / ccg_start_service Manage background services

Tech stack

  • Frontend: Svelte 5 + SvelteKit + TailwindCSS
  • Backend: Rust (Tauri v2)
  • MCP: stdio transport (ccg --mcp)

Getting started

Prerequisites

  • Node.js 18+
  • Rust (latest stable)
  • Windows: Visual Studio Build Tools

Development

npm install
npm run tauri dev      # run the desktop app
npm run check          # type-check

Build

npm run tauri build

Project structure

src/                          # Svelte frontend
  lib/
    components/
      AgentDashboard.svelte   # agent cards, anchors, service status
      WorkflowEditor.svelte   # visual workflow editor
      GraphBoard.svelte       # architecture / graph board
      PromptCompositionPanel.svelte
      McpPanel.svelte         # MCP registry
      SettingsPanel.svelte
      ...                     # session/project/template cards & panels
    stores/                   # state management
    types/                    # shared TS types
  routes/
    +page.svelte              # main project / agent view
    dashboard/  graph/  graphboard/

src-tauri/                    # Rust backend
  src/
    lib.rs                    # core Tauri commands, HTTP / MCP routes
    agent_lifecycle.rs        # spawn / claim / assign / state
    headless_commands.rs      # CLI agent spawning, workflow steps
    prompt_composition.rs     # per-turn context injection
    working_doc.rs            # anchors & working docs
    inbox.rs                  # agent-to-agent messages
    workflows.rs              # workflow engine
    workflow_primitive.rs     # workflow step primitives
    tasks.rs                  # task primitive
    services.rs               # service registry
    templates.rs              # role templates
    hooks.rs                  # CLI lifecycle hooks
    cli_integration.rs        # CLI config sync (Claude/Gemini/Codex)
    mcp_stdio.rs              # MCP server (stdio)
    interactive_*.rs          # interactive session management

Docs/                         # internal, agent-facing docs
  00_START_HERE.md            # routing layer
  reference/                  # code-grounded subsystem handrails
guide/                        # user-facing quickstart / concepts / config
examples/                     # workflow JSON + frontend examples

Custom frontends

CCG v1 can be driven by plain local frontends without using the in-app Svelte components. The practical contract is the localhost HTTP API plus named SSE stream:

  • GET /api/v1/projects, GET /api/v1/agents, POST /api/v1/agents/:id/send, POST /api/v1/agents/:id/stop
  • GET /api/v1/tasks, POST /api/v1/tasks, GET /api/v1/workflows, POST /api/v1/workflows/:id/invoke
  • GET /api/v1/events for live agent.*, task.*, and workflow.* updates

See guide/CUSTOM-FRONTENDS.md, examples/custom-frontend/, and examples/frontends/ for the reference clients and the browser/SSE gotchas.

CLI integration

CLI Config Sessions Resume YOLO / Auto
Claude ~/.claude/settings.json ~/.claude/projects/<hash>/sessions/*.jsonl claude --resume <id> --dangerously-skip-permissions
Gemini ~/.gemini/settings.json ~/.gemini/tmp/<hash>/chats/*.json gemini --resume <id> -y
Codex ~/.codex/config.toml ~/.codex/sessions/YYYY/MM/DD/*.jsonl codex resume <id> --full-auto

Related projects

  • Hindsight — long-term episodic memory for agents (pack / MCP integration)

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages