Subagent orchestration for Claude Code
Project description
scope
Your context is rotting. Scope fixes that.
Every task you give Claude Code accumulates context: file contents, failed attempts, exploratory tangents. When compaction kicks in, critical details vanish. Your main session becomes a diluted mess of half-remembered explorations.
Scope solves this by spawning purpose-specific subagents. Each subagent gets a fresh context, does one job, and returns only the relevant result. Your main session stays lean—you orchestrate and synthesize, not accumulate.
The Problem
Main Session Context Over Time:
Start: [████████████████████████████████████████] 100% relevant
After 3 [████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 20% relevant
tasks: ↑ file reads, dead ends, tangents, old completions
After [██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 5% relevant
compaction: ↑ critical details lost in summarization
This is context rot. The more you do in one session, the worse your context-to-relevance ratio becomes. Summarization doesn't help—it discards the wrong things.
The Solution
With Scope:
Main: [████████████████████████████████████████] orchestration + results only
↓ spawn
Subagent: [████████████████░░░░░░░░░░░░░░░░░░░░░░░░] does one job, returns summary
↑ fresh context, focused task, clean result
Each subagent:
- Starts with fresh context (no accumulated baggage)
- Has a single purpose (no scope creep)
- Returns only what matters (you get the result, not the journey)
Your main session becomes a coordinator, not a garbage collector.
Quick Start
# Install
uv tool install scopeai
# Or run directly without installing
uvx scopeai top
# Run setup (installs hooks, checks dependencies)
scope setup
# Launch the dashboard
scope top
That's it. Now from any Claude Code session:
# Spawn a subagent
id=$(scope spawn "implement user authentication")
# Wait for result
scope wait $id
Scope vs Task Tool
| Task Tool | Scope | |
|---|---|---|
| Visibility | Opaque black box | Real-time dashboard |
| Intervention | None—wait and hope | Attach, steer, abort anytime |
| Context | Shares parent context | Fresh context per agent |
| Parallelism | Sequential only | Spawn many in parallel |
| Nesting | Limited | Unlimited hierarchy |
| Debugging | Results only | Full session inspection |
The Task tool is a blind subprocess. Scope gives you a visible, controllable swarm.
Usage
For Humans: scope top
scope top
┌─ scope ────────────────────────────────────────────────── 3 running ─┐
│ │
│ ▼ 0 Refactor auth to JWT ● running waiting on children │
│ ├ 0.0 Extract JWT helpers ● running editing token.ts │
│ └ 0.1 Update middleware ✓ done ─ │
│ ▶ 1 Write tests for user module ● running jest --watch │
│ │
├──────────────────────────────────────────────────────────────────────┤
│ n new ↵ attach x abort d hide done q quit │
└──────────────────────────────────────────────────────────────────────┘
| Key | Action |
|---|---|
n |
New session (opens Claude Code in split pane) |
enter |
Attach to selected session |
x |
Abort selected (and descendants) |
j/k |
Navigate |
h/l |
Collapse/expand |
d |
Toggle completed sessions |
q |
Quit (sessions keep running) |
For Claude Code: Programmatic Interface
# Spawn a subagent
id=$(scope spawn "Write tests for auth module" --input src/auth/)
# Returns: 0
# Check status (non-blocking)
scope poll $id
# Returns: {"status": "running", "activity": "editing test_auth.py"}
# Wait for completion (blocking)
scope wait $id
# Returns: {"status": "done", "result": "..."}
DAG Orchestration
Model complex tasks as a dependency graph:
# Declare the full DAG upfront
scope spawn "research auth patterns" --id research
scope spawn "audit current codebase" --id audit
scope spawn "implement auth" --id impl --after research,audit
scope spawn "write tests" --id tests --after impl
scope spawn "update docs" --id docs --after impl
# Wait only on leaf nodes—dependencies auto-resolve
scope wait tests docs
Nesting
Subagents can spawn children. Nesting is automatic via SCOPE_SESSION_ID:
# Inside session 0, this creates 0.0
scope spawn "Extract JWT helpers"
# Inside session 0.0, this creates 0.0.0
scope spawn "Parse token format"
Why Parallelism is a Bonus
Yes, scope lets you run tasks in parallel. But that's not why you should use it.
You should use scope because single-session context management is fundamentally broken. Even if you only ever run one subagent at a time, you win:
- Fresh context for each task
- Clean results without journey baggage
- Main session stays lean and relevant
- No more losing critical details to compaction
Parallelism just means you can do this faster.
How It Works
- Each session is a real Claude Code process in tmux
- State lives in
.scope/sessions/(inspectable with standard Unix tools) - Hooks track activity automatically (no model self-reporting)
scope topwatches for changes and updates instantly
See docs/02-architecture.md for technical details.
Philosophy
- Transparency over magic — No black boxes. The subagent's state is your state.
- Control over autonomy — Intervention is a first-class feature.
- Contracts over conversations — Inputs and outputs are explicit.
- Minimalism over ceremony — One command to spawn, one interface to observe.
See docs/00-philosophy.md for the full design philosophy.
Requirements
- Python 3.10+
- tmux
- Claude Code
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scopeai-0.1.0.tar.gz.
File metadata
- Download URL: scopeai-0.1.0.tar.gz
- Upload date:
- Size: 387.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bd9fcf07ef00c66866535c121f7dbaee253b95648733c48284a2d35bafbcd70
|
|
| MD5 |
8c1534a7bdc422b48a1059976e72b38e
|
|
| BLAKE2b-256 |
f713c0fc27fd81258a889babdd2829a11697f7c62a828c7de0f62d7133e0318f
|
Provenance
The following attestation bundles were made for scopeai-0.1.0.tar.gz:
Publisher:
publish.yml on adagradschool/scope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scopeai-0.1.0.tar.gz -
Subject digest:
9bd9fcf07ef00c66866535c121f7dbaee253b95648733c48284a2d35bafbcd70 - Sigstore transparency entry: 780481271
- Sigstore integration time:
-
Permalink:
adagradschool/scope@194671b883e042bcdde272890961d9f7d18f7aa1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adagradschool
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@194671b883e042bcdde272890961d9f7d18f7aa1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scopeai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scopeai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b8984592ff9ee3ad6648060efa764010d7eeed1a3b6bf2dc84bd9f32cf144c
|
|
| MD5 |
cbd5cb8b9d7d2739e546568d3d10f0a4
|
|
| BLAKE2b-256 |
509aaaef3b50d311242a72a81c74d540ce43d535cafbd48b4ac99a1eedd26d49
|
Provenance
The following attestation bundles were made for scopeai-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on adagradschool/scope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scopeai-0.1.0-py3-none-any.whl -
Subject digest:
23b8984592ff9ee3ad6648060efa764010d7eeed1a3b6bf2dc84bd9f32cf144c - Sigstore transparency entry: 780481272
- Sigstore integration time:
-
Permalink:
adagradschool/scope@194671b883e042bcdde272890961d9f7d18f7aa1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adagradschool
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@194671b883e042bcdde272890961d9f7d18f7aa1 -
Trigger Event:
push
-
Statement type: