Skip to main content

Subagent orchestration for Claude Code

Project description

scope

PyPI Python License CI

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 top watches for changes and updates instantly

See docs/02-architecture.md for technical details.

Philosophy

  1. Transparency over magic — No black boxes. The subagent's state is your state.
  2. Control over autonomy — Intervention is a first-class feature.
  3. Contracts over conversations — Inputs and outputs are explicit.
  4. 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

scopeai-0.1.2.tar.gz (388.6 kB view details)

Uploaded Source

Built Distribution

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

scopeai-0.1.2-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file scopeai-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for scopeai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 14cae073d42517743d170f818fe53ba736469a1ec41ef1c3a33e97e011686306
MD5 7f5c2a64e27180adfec973db60cd3d86
BLAKE2b-256 f5a8f11db4613048a209828259e866d06dc4dc4728f861951581bd75dfcda8f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopeai-0.1.2.tar.gz:

Publisher: publish.yml on adagradschool/scope

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

File details

Details for the file scopeai-0.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for scopeai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7eeea7d5e139eb82501b0b13bd33f8c7fc4fc11ffa614e5107eb929b2d8fab5
MD5 b41cc343a97bf1461af194fbae919e1d
BLAKE2b-256 98d64a360c182e5141d70cb34bfad669508edf21cc496b50475f304fd271b661

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopeai-0.1.2-py3-none-any.whl:

Publisher: publish.yml on adagradschool/scope

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