tribecodetribecode
    DocsPricingLogin
    Documentation

    Documentation

    • Getting Started
    • CLI Commands
    • TRIBE API UsageBeta
    • MUSENew
    • CIRCUITNew
      • Core Commands
      • Issue Store
      • Agent Lifecycle
      • Auto-Recovery
    • Self-Hosting
    • API Reference
    • Analytics Dashboard
    • Privacy & Security
    • Troubleshooting
    1. Docs
    2. CIRCUIT

    CIRCUIT

    Autonomous Workers

    Spawn autonomous agents that work through issue queues without human intervention

    πŸ’‘

    Best Way to Use CIRCUIT

    The easiest way to use CIRCUIT is by asking Claude Code or another AI coding agent to run the TRIBE CLI commands for you. Simply describe your issues and let the agent manage the queue.

    Example Prompt

    "Use the tribe CLI to create issues for these bugs: [list bugs]. Then start CIRCUIT in auto mode to have agents work through them autonomously."

    Claude will run tribe circuit add, tribe circuit auto, and monitor progress automatically.

    What is CIRCUIT?

    CIRCUIT (Continuous Issue Resolution Circuit for Unified Intelligent Tasks) spawns autonomous agents that work through an issue queue. Agents pull issues by priority, work independently in isolated git worktrees, and complete without human intervention.

    Issue-Driven
    Work Pattern
    Heartbeat
    Health Monitoring
    Auto-Recovery
    Stuck Agent Handling

    Core Commands

    Agent Management

    tribe circuit list                     # Show all agents
    tribe circuit spawn <issue>            # Spawn for specific issue
    tribe circuit next [--force]           # Spawn for next priority issue
    tribe circuit <number>                 # Attach by index (shortcut)
    tribe circuit status                   # Quick status summary

    Automation

    tribe circuit auto [--interval N]      # Auto-spawn until queue empty
    tribe circuit watchdog [--once]        # Stuck agent recovery

    Monitoring

    tribe circuit monitor                  # Enhanced monitoring
    tribe circuit dashboard [interval]     # Real-time dashboard
    tribe circuit metrics                  # Performance metrics

    Session & Issue Operations

    tribe circuit kill <agent>             # Kill specific agent
    tribe circuit attach <agent>           # Attach to agent session
    tribe circuit restart <agent>          # Restart stuck agent
    tribe circuit heartbeat                # Emit heartbeat
    tribe circuit issue <id>               # View issue details
    tribe circuit logs <agent>             # View agent logs
    tribe circuit sync                     # Sync issue state
    tribe circuit clean --all              # Clean everything

    Issue Store Structure

    CIRCUIT uses a file-based issue store for tracking work:

    .issues/
    β”œβ”€β”€ issues/
    β”‚   β”œβ”€β”€ open/                    # Pending issues
    β”‚   β”‚   β”œβ”€β”€ 001-fix-login.md
    β”‚   β”‚   └── 002-add-tests.md
    β”‚   β”œβ”€β”€ in-progress/             # Being worked
    β”‚   └── closed/                  # Completed
    β”œβ”€β”€ agents/
    β”‚   β”œβ”€β”€ heartbeats/              # Health check files
    β”‚   β”‚   β”œβ”€β”€ circuit-agent-001.json
    β”‚   β”‚   └── circuit-agent-002.json
    β”‚   └── registry.json            # Agent registry
    └── metrics.json                 # Aggregated stats

    Issue Format

    <!-- .issues/issues/open/001-fix-login.md -->
    ---
    priority: 1          # 1=HIGH, 2=MEDIUM, 3=LOW
    status: open
    created: 2024-01-15
    ---
    
    # Fix Login Authentication Bug
    
    ## Description
    Users are getting logged out unexpectedly...
    
    ## Acceptance Criteria
    - [ ] Session persists for 24 hours
    - [ ] Token refresh works correctly

    Agent Lifecycle

    1

    Issue Selection

    Agent picks highest priority issue from .issues/issues/open/

    2

    Session & Worktree Creation

    Creates tmux session circuit-agent-001-fix-login and worktree at .circuit-worktrees/001-fix-login/

    3

    Working with Heartbeat

    Agent works autonomously, emitting heartbeats every 10 seconds for health monitoring

    4

    Completion

    Upon CHANGES_COMPLETE, issue moves to closed/ and metrics update

    Heartbeat System

    Agents emit heartbeats to prove they're alive and making progress:

    Heartbeat Format

    // .issues/agents/heartbeats/circuit-agent-001.json
    {
      "timestamp": "2024-01-15T10:30:00Z",
      "status": "working",
      "issue": "001-fix-login",
      "progress_lines": 142
    }

    Health States

    healthy

    Heartbeat < 120 seconds ago

    stale

    Heartbeat 120-300 seconds ago

    no_heartbeat

    No heartbeat file found

    dead

    tmux session doesn't exist

    Auto-Recovery

    CIRCUIT automatically recovers stuck agents:

    Configuration

    # In circuit.yaml
    circuit:
      stale_threshold: 120    # Seconds without heartbeat
      max_restarts: 3         # Auto-restart attempts
      auto_restart: true      # Enable auto-recovery

    Recovery Flow

    1Detect stale (no heartbeat > 120s)
    2Wait grace period (30s)
    3Kill session if still stuck
    4Restart (if restarts < 3)
    5Mark failed (if restarts >= 3)

    Real-Time Dashboard

    Monitor all agents with the live dashboard:

    $ tribe circuit dashboard 5
    
    ╔══════════════════════════════════════════════════════════════╗
    β•‘              CIRCUIT AGENT DASHBOARD                         β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
    
      Active Agents: 3/5
      Queue Depth: 7 issues
    
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚ Agent           β”‚ Issue      β”‚ Status    β”‚ Runtime  β”‚
      β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
      β”‚ circuit-001     β”‚ fix-login  β”‚ healthy   β”‚ 12m 34s  β”‚
      β”‚ circuit-002     β”‚ add-tests  β”‚ healthy   β”‚ 8m 12s   β”‚
      β”‚ circuit-003     β”‚ refactor   β”‚ stale     β”‚ 45m 22s  β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
      Last check: 2024-01-15 10:30:00
      Press Ctrl+C to exit

    Configuration

    Full Configuration Reference

    # ~/.tribe/circuit.yaml or .tribe/circuit.yaml
    
    circuit:
      max_agents: 5
      issue_store: ".issues"
      log_dir: "logs"
      stale_threshold: 120         # Seconds
      check_interval: 10           # Seconds
      session_prefix: "circuit-agent"
      auto_restart: true
      max_restarts: 3
      heartbeat_dir: ".issues/agents/heartbeats"

    Quick Reference

    Starting Work

    tribe circuit next              # Next issue
    tribe circuit auto --interval 10  # Auto-spawn

    Monitoring

    tribe circuit list
    tribe circuit dashboard 5

    Recovery

    tribe circuit watchdog --once
    tribe circuit restart <agent>

    Cleanup

    tribe circuit clean --all
    tribe circuit clean --dry-run

    Worktree Isolation

    Each CIRCUIT agent works in an isolated git worktree:

    Repository Root/
    β”œβ”€β”€ .circuit-worktrees/
    β”‚   β”œβ”€β”€ 001-fix-login/       # circuit-agent-001
    β”‚   β”‚   β”œβ”€β”€ .git -> ...
    β”‚   β”‚   β”œβ”€β”€ CLAUDE.md
    β”‚   β”‚   └── (full codebase)
    β”‚   └── 002-add-tests/       # circuit-agent-002
    └── (main codebase)

    Orchestrator Integrations

    CIRCUIT agents can be integrated with other orchestration systems for automated issue processing.

    Issue Sync Patterns

    Sync issues from external sources (GitHub, Jira, Linear) into the CIRCUIT issue store:

    # Sync from GitHub Issues
    gh issue list --json number,title,body,labels | \
      jq -r '.[] | "---\npriority: \(if .labels | any(.name=="high-priority") then 1 else 2 end)\nstatus: open\n---\n# \(.title)\n\n\(.body)"' > .issues/issues/open/gh-\$number.md
    
    # Run CIRCUIT auto mode
    tribe circuit auto --interval 30

    Retrieving Results

    Query completed CIRCUIT sessions for reporting and analysis:

    # List CIRCUIT sessions via API
    GET /api/tribes/sessions?subagent_type=circuit
    
    # CLI query for recent completions
    tribe sessions search --subagent-type circuit --since 24h
    
    # Get specific session summary
    tribe recall <session-id>

    Stop Hook Integration

    Use stop hooks to trigger CIRCUIT spawning when issues are detected:

    {
      "hooks": {
        "stop": [
          {
            "name": "circuit-on-error",
            "trigger": "on_error",
            "command": "tribe circuit spawn \"$ERROR_CONTEXT\""
          },
          {
            "name": "circuit-queue-check",
            "trigger": "on_idle",
            "command": "tribe circuit next --force"
          }
        ]
      }
    }

    Related Documentation

    MUSE System

    Interactive leader agent for task decomposition

    CLI Commands

    Complete CLI reference

    API Reference

    REST API documentation for integrations

    Getting Started

    Installation and setup guide

    tribecodetribecode

    Not another agentβ€”a telemetry vault + API you can trust.

    Product

    • Pricing
    • Support

    Developers

    • Documentation
    • API Reference
    • GitHub

    Β© 2026 tribecode. All rights reserved.

    Privacy PolicyTerms of Service