A web-based GUI that orchestrates Claude Code sessions to enable perpetual autonomous task execution across context window boundaries.
β Recommended: Use the Web GUI for the best experience
Start the GUI: cc-daemon gui
Table of Contents
- Overview
- Requirements
- Installation
- Quick Start
- CLI Commands
- Web GUI
- Architecture
- Development
- Documentation
- Tech Stack
CC-Daemon enables long-running autonomous AI tasks by automatically managing session rotation when context limits are approached. It provides:
- π₯οΈ Web-based GUI - Full-featured visual interface for task management (primary interface)
- π Perpetual Ralph Loop - Automatic session rotation when context fills up
- π Real-time Monitoring - Context usage, token consumption, and cost tracking
- β Independent Verification - Clean session verification of completed tasks
- π Embedded Terminal - Connect to tmux sessions directly in your browser
- Node.js 18+ and npm
- Claude Code - Install and configure Claude Code
- tmux - Required for full functionality (see below)
# macOS
brew install tmux
# Linux
sudo apt-get install tmux # Debian/Ubuntu
sudo yum install tmux # RHEL/CentOSTmux mode enables the full power of CC-Daemon. Without tmux, the following features are unavailable:
| Feature | Tmux Mode | Standard Mode |
|---|---|---|
| True context rotation | β Yes | β Simulated only |
| Session verification with fix cycles | β Yes | |
| Attach to running sessions | β Yes | β No |
| Embedded terminal in GUI | β Yes | β No |
| Auto-trigger monitor (continue automation) | β Yes | β No |
| Real-time session monitoring | β Yes |
Bottom line: Install tmux and use --tmux mode for production tasks. The GUI creates tasks with tmux enabled by default.
npm install
npm run build
npm link # Makes cc-daemon available globally# 1. Install tmux (if not already installed)
brew install tmux # macOS
sudo apt-get install tmux # Linux
# 2. Start the GUI (recommended)
cc-daemon gui
# 3. Open browser to http://localhost:9876
# Create tasks with tmux enabled by default, monitor sessions, view context
# CLI also available (tmux mode recommended)
cc-daemon ralph "Build a REST API" --tmuxπ‘ Tip: The Web GUI provides all these features and more. Use
cc-daemon guifor the best experience!
| Command | Description |
|---|---|
cc-daemon gui |
Start the web GUI (recommended!) |
cc-daemon ralph <goal> --tmux |
Start a Ralph Loop with tmux (recommended for full features) |
cc-daemon create-task <goal> |
Create a new task (add --tmux for full functionality) |
cc-daemon list |
List all tasks |
cc-daemon status [taskId] |
Show task status and progress |
cc-daemon resume <taskId> |
Print resume instructions for a task |
cc-daemon verify <taskId> |
Verify task completion (tmux mode enables auto-fix cycles) |
cc-daemon cancel <taskId> |
Cancel a task |
| Command | Description |
|---|---|
cc-daemon context |
Show real-time context usage |
cc-daemon tmux-sessions |
List active tmux sessions |
--tmux- Use tmux mode for full functionality (enables true rotation, verification fix cycles, embedded terminal, auto-trigger)--working-dir <path>- Working directory for the task (tmux mode only)--verify- Enable automatic verification after completion (tmux mode adds auto-fix cycles)-p, --completion-promise <promise>- Set completion promise string-t, --threshold-percent <p>- Context threshold for rotation (default: 80%)-m, --max-iterations <n>- Maximum total iterations (default: 100)
Start the GUI with cc-daemon gui (default port 9876).
The dashboard provides an at-a-glance overview of all your tasks with statistics:
Create new tasks with rich configuration options including dependencies, tags, and execution modes:
Monitor all active tmux sessions with context usage percentages:
View detailed token usage and context consumption for each session:
Connect directly to tmux sessions from your browser:
Configure refresh intervals, thresholds, and default task options:
Toggle between light and dark themes:
- Task creation, monitoring, and management
- Real-time context usage monitoring
- tmux session viewer with attach commands
- Dashboard with statistics (active/completed/failed/cancelled counts, total tokens and cost)
- Task search, filtering by status/tags, and sorting (newest, oldest, cost, tokens)
- Batch operations (cancel/delete selected) and data export (JSON/CSV)
- WebSocket real-time updates with connection status indicator
- Dark/light theme toggle
- Embedded terminal (xterm.js) for connecting to tmux sessions directly in browser
- Task templates (save and load task configurations)
- Task tagging and tag-based filtering
- Task dependencies (chain tasks to run after others complete)
- Auto-Trigger Monitor (automatically sends "continue" when Claude is waiting for input)
- Session classification (work sessions vs other sessions)
- Configurable settings (refresh interval, context warning thresholds, default task options)
- Keyboard shortcuts (N: new task, R: refresh, D: toggle theme, E: export, S: select mode, ?: help)
CC-Daemon uses a file-based task protocol with three files per task:
~/.cc-daemon/tasks/<task-id>/
βββ plan.md # Immutable task plan and acceptance criteria
βββ progress.md # Mutable state and session history
βββ metadata.json # Task metadata and tracking
The Ralph Loop enables perpetual autonomous execution by rotating sessions before context limits are hit.
RALPH LOOP
+-----------+ +-----------+ +-----------+ +-----------+
| | | | | | | |
| SPAWN |-->| MONITOR |-->| ROTATE? |-->| RESUME |
| Session | | Context | | at 80% | | New Sess |
| | | | | | | |
+-----------+ +-----------+ +-----+-----+ +-----------+
|
v
+-----------+
| |
| SNAPSHOT |
|progress.md|
| |
+-----------+
Detailed Flow:
-
Spawn - Create a new tmux session with Claude Code
- Generate unique session ID
- Bind to
~/.claude/projects/<project>/<session-id>.jsonl - Inject task instructions (plan.md + progress.md)
-
Monitor - Watch token consumption in real-time
- Parse JSONL file for context usage
- Track FR-4 (context window remaining)
- Calculate percentage used
-
Rotate - When context reaches threshold (default 80%):
- Send rotation signal to Claude: "Write state to progress.md"
- Wait for
ROTATION_SNAPSHOT_COMPLETEmarker - Kill current session
-
Resume - Start fresh session with preserved state:
- New session reads
plan.md(original goal) - New session reads
progress.md(current state) - Continue exactly where previous session left off
- New session reads
-
Repeat - Loop continues until:
- Task completion detected
- Max iterations reached (default: 100)
- Manual cancellation
After task completion, optional verification runs in a clean session:
VERIFICATION (tmux mode)
+--------------+ +--------------+ +--------------+
| | | | | |
| VERIFY |--> | PASS? |--> | COMPLETE |
| (clean) | | | | |
| | | | | |
+--------------+ +------+-------+ +--------------+
| NO
v
+--------------+
| |
| GENERATE |
| REVISE PLAN |
| |
+------+-------+
|
v
+--------------+
| |--+
| FIX SESSION | |
| (tmux) | |
+------+-------+ |
| |
+----------+
|
v
(loop back, max 3 cycles)
Verification Steps:
- Verify Phase - Spawn isolated Claude session with verification prompt
- Check Result - Parse output for
VERIFICATION_RESULT: PASS/FAIL - If Pass - Mark task as completed
- If Fail - Generate revise plan, spawn fix session (tmux only), retry
# Build
npm run build
# Test (146 tests)
npm test
# Test with watch mode
npm run test:watch
# Lint
npm run lintsrc/
βββ cli/ # CLI command definitions
βββ session/ # Session management and monitoring
βββ task/ # Task persistence and management
βββ types/ # TypeScript types
βββ utils/ # Utility functions
tests/
βββ unit/ # Unit tests
βββ e2e/ # End-to-end tests
docs/
βββ gui/ # GUI documentation
βββ development/ # Development docs
βββ research/ # Research findings
- CLAUDE.md - Developer guide for working with this codebase
- docs/gui/ - GUI development documentation
- docs/development/ - Development process and iterations
- docs/research/ - Research findings and analysis
- TypeScript
- Commander.js (CLI)
- Vitest (Testing)
- proper-lockfile (File locking)
- chokidar (File watching)
- ws (WebSocket server for GUI real-time updates)
- node-pty (Terminal emulation in GUI)
- @anthropic-ai/claude-agent-sdk (Session control, standard mode)
MIT






