Skip to main content

Multi-agent framework for Claude Code

Project description

Supercharge-AI

Python tools and hooks for Claude Code.

Inspired by Recursive Language Models (RLM) and Confucius Code Agent (CCA) — recursive self-delegation from RLM, persistent note-taking and hierarchical orchestration from CCA.

Installation

claude plugin install supercharge-ai --plugin-dir ~/.claude/Supercharge-AI

On first session start, the plugin auto-installs uv and the supercharge CLI if missing. Prompts are injected automatically via SessionStart and SubagentStart hooks.

Recommended: After installing, run supercharge init in each project to add the SuperchargeAI @path include to your CLAUDE.md. This ensures Claude Code prioritizes SuperchargeAI methodology over its default patterns.

Architecture

Three-layer system:

  1. Orchestrator - Top-level Claude Code session with Task tool for native subagents
  2. Agents - Native .claude/agents/*.md for high-level coordination
  3. Workers - Claude Agent SDK (Python) for low-level execution

Workers use Agent SDK instead of claude -p for:

  • Direct API calls (no subprocess overhead)
  • Session resumption across context resets
  • Custom tool configurations per agent type
  • Recursion depth tracking via environment variables

Commands

supercharge init

Add SuperchargeAI @path include line to the project's CLAUDE.md. Idempotent — skips if already present. Use --project-dir to target a specific project.

supercharge deinit

Remove the SuperchargeAI include line from CLAUDE.md.

supercharge task init <agent_type>

Create a new task workspace. Prints the UUID.

supercharge subtask init <agent_type> <prompt>

Spawn a new Agent SDK worker on a task. Returns JSON {worker_id, result}.

Options:

  • --task-uuid UUID — parent task UUID (agents pass this; workers get it from SUPERCHARGE_TASK_UUID env var automatically)
  • --model MODEL — model override (sonnet, opus, haiku)

supercharge subtask resume <worker_id> <prompt>

Resume a worker that stopped with Questions. Looks up session from worker file.

Recursion Depth

Workers can spawn sub-workers recursively (RLM-style). A countdown mechanism prevents infinite recursion.

How it works

Two environment variables control depth:

Variable Set by Purpose
SUPERCHARGE_MAX_RECURSION_DEPTH User (settings.json) Initial budget for the first subtask init call
SUPERCHARGE_RECURSION_REMAINING CLI (internal) Countdown passed to each child worker

Heuristic in subtask init:

  1. SUPERCHARGE_RECURSION_REMAINING is set → we're inside a worker → use it
  2. Not set → we're at the first call (orchestrator/agent level):
    • SUPERCHARGE_MAX_RECURSION_DEPTH is set → use it as initial budget
    • Not set → default to 5

Each subtask init call decrements the remaining count by 1 and passes it to the child via ClaudeAgentOptions(env=...). When remaining reaches 0, the CLI refuses to spawn and returns an error.

Example chain (default 5):

Agent calls subtask init          → remaining=5, child gets 4
  Worker calls subtask init       → remaining=4, child gets 3
    Sub-worker calls subtask init → remaining=3, child gets 2
      ...
        Worker at remaining=0     → CLI refuses: "Max recursion depth reached"

The worker's initial prompt includes its recursion budget so it knows whether it can delegate.

Configuration

Set SUPERCHARGE_MAX_RECURSION_DEPTH in your project's Claude Code settings to override the default:

.claude/settings.json (checked into repo, shared with team):

{
  "env": {
    "SUPERCHARGE_MAX_RECURSION_DEPTH": "3"
  }
}

.claude/settings.local.json (gitignored, personal override):

{
  "env": {
    "SUPERCHARGE_MAX_RECURSION_DEPTH": "8"
  },
  "permissions": {
    "allow": ["..."]
  }
}

The env field in Claude Code settings sets environment variables for the entire session. These propagate through Bash commands and Agent SDK subprocesses automatically.

Precedence (highest wins):

  1. SUPERCHARGE_RECURSION_REMAINING (already inside a worker)
  2. SUPERCHARGE_MAX_RECURSION_DEPTH (user-configured in settings.json)
  3. Default: 5

Fast Model Configuration

SUPERCHARGE_FAST_MODELS controls which models use fast (fire-and-forget) mode. Comma-separated, case-insensitive. When set, replaces the default entirely.

Variable Default Example
SUPERCHARGE_FAST_MODELS haiku haiku,sonnet
{
  "env": {
    "SUPERCHARGE_FAST_MODELS": "haiku"
  }
}

Set to empty string to disable fast mode for all models.

Agent Types

Agent Purpose
plan Decompose requests into structured task lists
code Implement features, fix bugs, write tests
document Update documentation to reflect changes
research Search the web, gather external context
review Code review of completed work
consistency Check for contradictions, broken references, duplication
memory Maintain project and methodology memory

Worker Modes

Model determines mode: opus/sonnet → deep (context file, resume, recursion), haiku → fast (fire-and-forget). See protocol.md for agent-facing details.

Worker Context File

Deep workers get a context file at workers/<worker_id>.md with these sections:

Section Purpose
Assignment Pre-filled by CLI. Do not modify.
Progress Updated as worker works.
Result Final deliverable. Agent reads this.
Files Every file created or modified.
Questions Blocks progress. Agent answers and resumes.
Errors Problems encountered (not all require stopping).
Memory Optional. Patterns, gotchas, instruction gaps for the memory agent.

Per-Agent Tool Permissions

Workers get tool access scoped by agent type. Two mechanisms:

  1. allowed_tools — coarse filter: which tools a worker can see at all
  2. can_use_tool callback — fine-grained: path-based Write/Edit scoping (deep workers only; fast workers don't support callbacks)

Tool allowlists

Agent Deep worker tools Fast worker tools
code Read, Write, Edit, Bash, Glob, Grep Read, Glob, Grep
plan Read, Write, Glob, Grep Read, Glob, Grep
review Read, Write, Bash, Glob, Grep Read, Glob, Grep
document Read, Write, Edit, Glob, Grep Read, Glob, Grep
research Read, Write, Glob, Grep, WebSearch, WebFetch Read, Glob, Grep, WebSearch, WebFetch
consistency Read, Write, Glob, Grep Read, Glob, Grep
memory Read, Write, Glob, Grep Read, Glob, Grep

All deep workers get Write for their context file. The can_use_tool callback then scopes where they can write.

Write scopes (deep workers)

Scope Agents Write/Edit allowed
project code, document Anywhere in project root
memory memory Memory dir + context file
context plan, review, research, consistency Context file only

Architectural enforcement

The can_use_tool callback also blocks supercharge task init in Bash for all workers — only the orchestrator creates task workspaces.

Developer Docs

See docs/stack-propagation.md for details on how env vars, context, and identifiers flow through the orchestrator → agent → worker → sub-worker stack.

TODO

  • CLAUDE_PROJECT_DIR not available in Bash environment — Resolved: _project_dir() falls back to git rev-parse --show-toplevel → cwd. _build_options() resolves and propagates CLAUDE_PROJECT_DIR to all child workers.
  • Env var propagation for task UUID — Resolved: SUPERCHARGE_TASK_UUID propagated via env dict; agents pass --task-uuid flag, workers inherit from env automatically.
  • End-to-end integration test
  • CLI test suite

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supercharge_ai-0.1.1.tar.gz (60.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supercharge_ai-0.1.1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file supercharge_ai-0.1.1.tar.gz.

File metadata

  • Download URL: supercharge_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 60.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for supercharge_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 11e99d5dac1deb1b71ed232d472ce3cd5e7c3e7338d59c6dbdd67a5c9028f68b
MD5 9efc8bc9f532416dcb8601970e6ed84d
BLAKE2b-256 735dc4cde6f098c0f41ebaa439d99c37ef6bf34fac56e82715f8ddd304e4b12c

See more details on using hashes here.

Provenance

The following attestation bundles were made for supercharge_ai-0.1.1.tar.gz:

Publisher: publish.yml on ac8ai/Supercharge-AI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file supercharge_ai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: supercharge_ai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for supercharge_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63add96d3c8f3f376896429b6774b429844237faba1830a2203ad3b2d849669a
MD5 581ed28ddacc7bd1d145a347b8403024
BLAKE2b-256 6067551c1900a9a1d3c9d1a4d50824b63f6a2565e1c592ae411374bda0b56d02

See more details on using hashes here.

Provenance

The following attestation bundles were made for supercharge_ai-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ac8ai/Supercharge-AI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page