Continuous Claude v3 Documentation

repository·main·Indexed 26 days ago

https://github.com/parcadei/continuous-claude-v3

A persistent, learning, multi-agent development environment built on Claude Code. It features a memory system, specialized agents, and a robust hooks system for automating behaviors via command-line scripts (TypeScript, Python, shell) triggered by lifecycle events like SessionStart, PreToolUse, and UserPromptSubmit. Includes the OPC-Dev workspace with workflows for bug fixing (/fix), feature building (/build), TDD (/tdd), and formal proofs (/prove), as well as the mcp-execution Python package for enhanced code execution with MCP.

Tokens
38K
Snippets
102
Records
210
Agent score
86%

What's inside Continuous Claude

  1. Identify and use specialized agents

    main

    Continuous Claude uses 41 specialized agents categorized by their role. When you trigger a task, the system may spawn one of these agents to handle specific parts of your request.

    Key Agent Groups:

    • Orchestration: maestro (coordination), kraken (TDD/checkpointing).
    • Planning: architect (design), phoenix (refactoring), pioneer (migrations).
    • Exploration: scout (exploration), oracle (research), pathfinder (navigation).
    • Implementation: spark (quick fixes), kraken (full TDD).
    • Debugging: sleuth (investigation), profiler (performance).
    • Validation: arbiter (unit/integration testing), atlas (E2E), validator (plan validation).
    • Review: critic (code review), judge (refactor review), warden (security), surveyor (migration).
    • Specialized: aegis (security), herald (release/changelog), scribe (docs), liaison (API quality).

    Note: All agent outputs are persisted to: .claude/cache/agents/<agent-name>/latest-output.md.

  2. Understand the Continuous Claude Architecture

    main

    Continuous Claude is built on a multi-layered architecture designed to optimize context usage and maintain session continuity. It consists of three primary components:

    • Skills: A library of specialized capabilities (e.g., sleuth, kraken, arbiter).
    • Agents: Orchestrators that use skills to perform complex tasks.
    • Hooks: Mechanisms that trigger actions during the session lifecycle.

    The system uses a TLDR Code Analysis pipeline to reduce token consumption by up to 95%. It processes code through five layers:

    1. L1: AST: Functions, classes, and signatures.
    2. L2: Call Graph: Cross-file dependencies.
    3. L3: CFG: Control flow.
    4. L4: DFG: Data flow.
    5. L5: PDG: Slicing.

    This pipeline compresses ~23,000 raw tokens into approximately 1,200 tokens.

  3. Distinguish between Scripts and Skills

    main

    It is important to understand the difference between the two orchestration formats in this repository:

    FeatureScripts (in ./scripts/)Skills (in .claude/skills/)
    FormatPython with argparseYAML + Markdown (SKILL.md)
    DiscoveryManual (ls, cat)Automatic (Claude Code scans)
    TargetAny AI agentClaude Code only
    PurposeAgent-agnostic CLI workflowsNative Claude Code progressive disclosure

    Note: Skills often reference Scripts for actual execution.

  4. Understand Multi-Session Architecture

    main

    Continuous Claude uses a shared architecture to allow multiple Claude Code instances to work on the same project without duplicating work or losing progress.

    Key distinctions:

    • Handoffs (Shared Workflow State): These are checkpoints representing the overall progress of a workflow. All instances see the same latest handoff in their status line.
    • Conversations (Instance State): The specific active work and context of a single instance live in its own conversation, not in the shared status line.
    • Context Percentage (Per-Instance): Token usage and context window tracking are unique to each individual instance.
  5. Manage Context and Memory

    main

    Use these skills to maintain continuity across long sessions or between different developers/agents:

    • create_handoff: Capture session state for transfer. Use before ending sessions or at phase boundaries.
    • resume_handoff: Resume work from a previous handoff with full context.
    • continuity_ledger: Track state within a long session. Use before /clear or at major milestones.
    • recall: Query semantic memory from past sessions.
    • remember: Store learnings or decisions for future sessions.
  6. Uninstall Continuous Claude

    main

    To remove Continuous Claude while preserving your data, run the setup wizard with the --uninstall flag from the opc/ directory.

    The uninstallation process:

    1. Archives your current setup by moving ~/.claude to ~/.claude-v3.archived.<timestamp>.
    2. Restores your backup (created during installation).
    3. Preserves user data including history.jsonl, mcp_config.json, .env, projects.json, file-history/, and projects/.
    4. Removes all CC-v3 specific additions (hooks, skills, agents, rules).
    cd Continuous-Claude-v3/opc
    uv run python -m scripts.setup.wizard --uninstall
  7. Verify Installation

    main

    After setup, verify the installation by checking the Docker container, testing the learning storage, and testing recall functionality.

    1. Check Docker: Ensure the PostgreSQL container is running.
    2. Test Learning Storage: Store a sample learning using scripts/core/store_learning.py.
    3. Test Recall: Retrieve the stored learning using scripts/core/recall_learnings.py.
    # Check Docker is running
    docker ps | grep postgres
    
    # Test learning storage
    cd opc && uv run python scripts/core/store_learning.py \
      --session-id "quickstart" \
      --type WORKING_SOLUTION \
      --content "Setup complete" \
      --context "Initial installation" \
      --confidence high
    
    # Test recall
    cd opc && uv run python scripts/core/recall_learnings.py --query "setup"
  8. Extend Continuous Claude with new Skills and Agents

    main

    Developers can extend the system's capabilities by adding new definitions to the following locations:

    1. Add a Skill: Create a new directory in .claude/skills/<skill-name>/ containing a SKILL.md file.
    2. Register Skill Triggers: Update .claude/skills/skill-rules.json to define keywords or triggers.
    3. Add an Agent: Create a new markdown definition file in .claude/agents/<agent>.md.
    4. Add a Hook: Implement TypeScript hooks in .claude/hooks/src/*.ts and register them in .claude/settings.json.
  9. Register Hooks in .claude/settings.json

    main

    Hooks are automatic behaviors triggered at specific lifecycle points. They are implemented as command-line scripts (TypeScript, Python, shell) that receive JSON via stdin and return JSON via stdout. To register them, add them to the hooks object in your .claude/settings.json file. You can specify a matcher to target specific tools or event subtypes, the command to execute, and a timeout in seconds.

    {
      "hooks": {
        "SessionStart": [
          {
            "hooks": [
              {
                "type": "command",
                "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-register.sh",
                "timeout": 10
              }
            ]
          }
        ],
        "PreToolUse": [
          {
            "matcher": "Read",
            "hooks": [
              {
                "type": "command",
                "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/tldr-read-enforcer.sh",
                "timeout": 20
              }
            ]
          }
        ]
      }
    }
  10. Solve constraints with Z3

    main

    Use z3_solve.py for constraint satisfaction and SMT solving.

    • Prove inequalities: Use prove with the expression, --vars (space-separated variables), and --type (e.g., real or int).
    # Constraint solver verification (Z3)
    uv run python opc/scripts/z3_solve.py prove "x**2 + y**2 >= 2*x*y" --vars x y --type real
  11. Use the Math and Formal Verification System

    main

    The math system provides two primary entry points for computation and machine-verified proofs.

    Computation with /math

    Use this for symbolic math, constraint solving, and unit conversions. It utilizes SymPy, Z3, and Pint.

    • Symbolic Math: Solve equations, integrals, and matrix operations.
    • Constraint Solving: Prove inequalities and SAT problems.
    • Unit Conversion: Perform dimensional analysis and unit-aware arithmetic.

    Formal Verification with /prove

    Use this for machine-verified proofs using Lean4 and Mathlib. It follows a 5-phase workflow: Research → Design → Test → Implement → Verify.

    1. Research: Search Mathlib with Loogle.
    2. Design: Create a skeleton with sorry placeholders.
    3. Test: Search for counterexamples.
    4. Implement: Fill sorries with compiler feedback.
    5. Verify: Audit axioms and confirm zero sorries remain.

    Prerequisites

    Math features require the following installed via uv or system shell:

    uv pip install sympy z3-solver pint shapely
    
    # For Lean4 (/prove)
    curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
    # Computation examples
    "Solve x² - 4 = 0"
    "26.2 miles to km"
    
    # Formal verification examples
    /prove every group homomorphism preserves identity
    /prove continuous functions on compact sets are uniformly continuous
  12. Perform Risk Analysis with premortem

    main

    The premortem skill performs TIGERS & ELEPHANTS risk analysis to identify high-severity risks before implementation. It is highly recommended to use this before starting significant features to catch potential blockers.

    Usage: Use the command /premortem deep <plan> before implementing any significant feature.