Skip to main content
Hadley: agent colony control, a multi-agent orchestrator for Claude Code

Hadley

Hand a big task to a crew of AI agents. Then go to sleep.

Mother plans. The androids hunt the bugs 👾. Nobody needs to watch.

CI PyPI Python 3.10+ License: MIT Status: alpha Linux | macOS

What it solves · Install · Quick start · Core ideas · Commands · Project file · How it works · Safety

▌ HADLEY ─ STATUS REPORT ─────────────────────────────────────────────────────
▌ MOTHER ........... online. Holds the plan, gives the orders.
▌ CREW ............. Ash · Bishop · Call · David · Walter · Andy · Rook
▌ USAGE LIMIT ...... crew hibernates, wakes when the window reopens.
▌ REBOOT ........... state restored from the log. Mission continues.
▌ AIRLOCK .......... each agent gets only its own tools and skills.
▌ MANIFEST ......... one .hadley/ folder. Commit it, and anyone gets the same crew.
▌─────────────────────────────────────────────────────────────────────────────

Hadley is a multi-agent orchestrator for Claude Code. It runs a lead agent, Mother, and the specialist agents she delegates to, unattended. They keep working for hours, through usage limits and reboots, and the whole crew is defined in one YAML file you can share. Named after Hadley's Hope, the colony in Aliens. Agents get android names from the films unless you give them your own.

Mission log

$ hadley run                                   # (output trimmed)
run 3 created for project 'crm' (workdir ~/crm)
    Mother plan     plan updated (6 steps)
    Mother delegate → Ash (architect) #2: Write DESIGN.md for a FastAPI + SQLite CRM…
       Ash done     Ash finished
    Mother delegate → Bishop (coder) #3: Implement contacts with search, following DESIGN.md…
    Bishop delegate → Call (tester) #4: Run the test suite for the contacts router…
      Call done     Call finished
    Bishop limit    paused (usage limit) until 2026-12-02 03:00     ← you are asleep
           info     usage window reopened, resuming
    Bishop done     Bishop finished
    Mother delegate → David (reviewer) #5: Review the contacts feature…
     David done     David finished
    Mother done     Mother finished

run 3 (crm): done

What problem does it solve?

Without Hadley With Hadley
A big task doesn't fit in one chat. You keep re-prompting and copying context around. You write the task once. Mother plans it, splits it up and hands the parts to her team.
One model does everything, from planning to typing code to checking its own work. Each job goes to the agent built for it: a strong model plans and reviews, a cheaper one writes code and tests.
You hit your usage limit at 2 a.m. and nothing happens until you're back. The run pauses and resumes in the same conversations when the window reopens.
A reboot or a closed terminal loses the session. All state is saved. The background service picks the run back up after a restart.
Agents either have no tools, or all of your tools, including your mail. Each agent gets only the MCP servers it needs: a browser for the tester, nothing extra for the coder.
You can't tell what the agents are doing or what's left. Mother keeps a plan (a checklist) that you can read any time and approve before work starts. When she's unsure, she asks you instead of guessing.
Your multi-agent setup is a pile of scripts nobody else can reproduce. The team lives in one .hadley/ folder. Commit it, share it, and others get the same setup.

Who is it for?

  • Developers who want to hand off whole pieces of work, like a small app, a refactor or a test suite, and come back to a result rather than a half-finished chat.
  • Researchers, analysts and writers. The research team (researcher, writer, reviewer) can investigate a topic, compare options or draft a report. Agents are not just for code.
  • People designing agent teams, who want to try "planner + coder + reviewer" setups and share them as a file.

You need a Claude Code setup: a Claude subscription or an API key. Hadley runs locally on Linux or macOS, for you, with your own account.

Not a fit (yet): hosting agents for other people, running on Windows, or many agents working at the same moment (agents take turns for now; see the roadmap).


Install

Requirements: Python 3.10+ and Claude Code, signed in (run claude once and log in).

uv tool install hadley      # or: pipx install hadley
hadley doctor               # checks that everything is in place
Updating, and installing the latest code from GitHub
uv tool upgrade hadley                                       # newest release from PyPI
uv tool install git+https://github.com/josefjadrny/hadley    # latest unreleased code from main

From a local checkout (for development):

git clone https://github.com/josefjadrny/hadley && cd hadley
uv tool install --editable .      # follows the checkout: `git pull` is all you need to update
  • A non-editable install (uv tool install .) copies the code. Update it with uv tool install --force ..
  • hadley version prints the installed version.

Quick start

Run Hadley inside the folder you want the agents to work on: an existing repo or a new folder.

cd my-project
hadley init

hadley init asks for the task and whether you already have a plan, then it goes in this order:

  1. The plan. Mother writes it (or you bring your own) and you approve it. While planning, Mother thinks only about the work, not about who will do it.

  2. The team. Only now: who carries out the plan?

    Who should carry out the plan?
      1) I'll specify the team (opens hadley.yaml in your editor)
      2) Mother specifies the team
    Team [1-2, Enter = 1]:
    

    Either way you see the whole tree (agents, models, who calls whom) and approve it. If Mother proposes the team, you can tell her what to change.

  3. The work. Mother assigns each step of the plan to an agent and delegates. She never does the work herself.

  • Mother is unsure? She asks you right there in the terminal, then continues. (For background runs: hadley status shows her question and hadley answer "…" replies.)

Your answers are saved in .hadley/hadley.yaml, so the next run is just hadley run. Prefer to write the file yourself? Press Enter at the first question, then edit goal: and use hadley validate and hadley run.

  • Want a ready-made team in the file from the start? hadley init -t coding (coder, reviewer, tester) or -t research (researcher, writer, reviewer). You still confirm it after the plan.
  • Want your own team? Edit agents: in .hadley/hadley.yaml. See the project file.
  • Want an agent to use a browser or another tool? Add an MCP server under mcp_servers and list it in that agent's mcp. See the project file.
  • Want to change the plan before approving? Answer "n" when Mother shows it, edit .hadley/plan.md, then approve with hadley resume. (plan_approval: true in the project file turns this review on; hadley init sets it for you.)
  • Bringing your own plan later? hadley run --plan my-plan.md.
  • Want to stop? Press Ctrl-C at any time. Everything is saved, and hadley resume continues where the agents stopped.
  • Want it to run unattended, in the background and after reboots? Install the service once, then start runs with -d. Nobody is there to pick the team, so the project file must already have one (from an earlier run, -t, or your own agents:):
hadley service install        # Linux: systemd user service · macOS: launchd agent
hadley run -d                 # hand the run to the service and get your terminal back
hadley tui                    # live dashboard: p = pause, r = resume, a = approve plan, q = quit

Linux: the user service starts when you log in. To start it at boot without logging in, run sudo loginctl enable-linger $USER once.

Everything lives in .hadley/

my-project/                 ← your project; the agents work here
├── .hadley/                ← everything Hadley keeps in your project
│   ├── hadley.yaml         ← the team and the task
│   ├── skills/             ← skills for your agents (optional)
│   ├── plan.md             ← the plan of the current run (yours or Mother's)
│   ├── runs/<id>/          ← archive: plan.md and report.md of each finished run
│   └── .gitignore          ← ignores runs/
├── src/ ...
  • Keep Hadley private: add .hadley/ to your project's .gitignore.
  • Share the team and the plan: commit .hadley/. The run archive stays ignored.
  • Commands find the project the way git does, from the project folder or any subfolder.
  • Running hadley init again lists what's in .hadley/ and asks before replacing it.
  • Run state (runs, logs, the service's work queue) is kept outside your project, in Hadley's state folder (see Configuration).

Core ideas

Concept Meaning
Project A folder with a .hadley/ inside. You can have as many as you like, and different projects can run at the same time.
Mother The root agent and team lead. She receives the task (goal), plans, delegates every piece of work to her team, checks the results, asks you when she's unsure, and writes the final report. She never works alone.
Team The other agents, each with a purpose, model, effort, skills, MCP servers and permissions.
Plan Mother's checklist of steps and who does them, kept in .hadley/plan.md. Only Mother can change it (other agents get no plan tools), and you can read or edit it.
can_call Who may delegate to whom. Hadley enforces it: an agent cannot reach anyone outside its list.
Run One execution of a project's task. It can be paused, resumed, retried or cancelled. One project runs one task at a time, because runs share the project's workdir.
Job One agent working on one task inside a run. Delegation creates child jobs, so a run is a tree of jobs.

Agent names. Every agent has an id (its key in the file) and a display name, alias. Without an alias, the root is Mother and the others are named, in file order, after the androids of the Alien films in release order: Ash, Bishop, Call, David, Walter, Andy, Rook (then Ash-2, …). Names come from the file, so everyone who opens a shared project sees the same names. Agents can delegate by id or by name.


Commands

Inside a project folder, commands act on that project. Elsewhere they act on all projects. You can always pass a run number explicitly.

Command What it does
hadley init [dir] [-t coding|research] [-g TASK] [--plan FILE] [--no-input] Create .hadley/hadley.yaml, ask for the task and an optional plan, and start: plan, then team, then work. -t puts a ready-made team in the file; --no-input only creates the file
hadley validate [dir] Check the project file, show the agent tree, and check Claude Code and MCP variables
hadley run [dir] [-g TASK] [-d] [--plan FILE] [--from-plan] Start a run. -g overrides goal:, -d hands it to the service, --plan starts from your own plan, --from-plan carries out .hadley/plan.md (both count as approved)
hadley plan [run] Show Mother's plan
hadley answer ["TEXT"] [-r RUN] Answer Mother's question (asks for it if left out); the run continues
hadley status [run] [-a] List runs (-a: all projects), or show one run's job tree and cost
hadley logs [run] [-f] [-n N] Show the last N events; -f keeps following
hadley pause [run] Pause a run (agents stop; nothing is lost)
hadley resume [run] [-d] Resume a paused or interrupted run; approves a plan that's waiting; retries a failed run
hadley cancel RUN Cancel a run for good
hadley tui [run] Live terminal dashboard
hadley service install|uninstall|status Manage the background service
hadley daemon Run the service's engine in the foreground (for debugging)
hadley doctor Check the setup
hadley version Print the version

The project file

The project file is .hadley/hadley.yaml. Here is an example with every option. Only name, agents and each agent's purpose are required; everything else has a sensible default.

version: 1
name: crm
description: A small self-hosted CRM.
goal: |                        # the task you hand to Mother
  Build a CRM web app with contacts, a deals pipeline and a dashboard.
workdir: .                     # where agents work, relative to the project folder
root: mother                   # which agent is Mother
plan_approval: false           # true: pause after Mother writes her plan until you approve
interactive: true              # Mother may pause to ask you a question (false: she decides alone)

defaults:                      # applied to every agent unless the agent overrides it
  provider: claude-code
  permission_mode: bypassPermissions

mcp_servers:                   # MCP servers agents may use (each agent picks its own below)
  playwright:
    command: npx
    args: ["@playwright/mcp@latest"]
  tracker:
    type: http                   # stdio (default), http or sse
    url: https://tracker.example.com/mcp
    headers: {Authorization: "Bearer ${TRACKER_TOKEN}"}   # ${VAR}: from your environment

limits:
  max_depth: 4                 # how deep delegation may go below Mother
  max_jobs: 100                # agent jobs per run
  retries: 2                   # retries when an agent fails
  max_report_chars: 6000       # longer reports are cut before they reach the caller
  on_usage_limit: pause        # pause until the window reopens, or: fail
  limit_retry_minutes: 15      # wait time when a limit carries no reset time

agents:
  mother:
    purpose: Plan, delegate, verify, report.
    instructions: Do not write code yourself.
    model: opus
    effort: high
    can_call: [coder, reviewer]
  coder:
    alias: Rosie                 # optional display name (default: Ash, Bishop, ...)
    purpose: Implement one scoped task.
    model: sonnet
    effort: medium
    context_window: 200000
    skills:
      - path: ./skills/python-style
        purpose: House style for Python code.
    allowed_tools: ["Bash(npm *)"]
    disallowed_tools: ["WebFetch"]
    can_call: [tester]
  reviewer:
    purpose: Review changes; approve or list required fixes.
  tester:
    purpose: Test the app in a real browser and report failures.
    mcp: [playwright]            # only the tester gets a browser

A full working example is in examples/crm/.hadley. Try it with cp -r examples/crm ~/crm && cd ~/crm && hadley run. Its tester uses Playwright, which needs Node.js (npx).

Agent options reference
Field Default Meaning
purpose (required) What the agent is for. Shown to the agent and to everyone who can call it.
alias Mother / Ash, Bishop, … Display name, unique within the project.
instructions – Extra text added to the agent's system prompt.
provider claude-code Which backend runs the agent.
model your Claude Code default Alias (opus, sonnet, haiku, fable) or a full model id.
effort your Claude Code default low, medium, high, xhigh or max.
context_window Claude Code default auto or a token count of 100000 or more. Sets when the agent compacts (summarises) its context.
skills – Skill folders (each with a SKILL.md), as a path or {path, purpose}. Paths are relative to .hadley/.
can_call – Agents this one may delegate to. A shared callee is fine; cycles are allowed and are limited by max_depth. Mother must have at least one: she never works alone.
mcp – MCP servers from mcp_servers this agent gets.
inherit_mcp false Also load your own Claude Code MCP servers and claude.ai connectors (Gmail, Drive, …).
permission_mode Claude Code default acceptEdits, auto, bypassPermissions, manual, dontAsk or plan.
allowed_tools / disallowed_tools – Tool rules passed to Claude Code, e.g. "Bash(git *)".

Notes:

  • defaults is merged into every agent, and an agent's own value wins.
  • MCP servers are isolated per agent. An agent gets only the servers in its mcp list, plus Hadley's own tools. Your personal MCP servers and claude.ai connectors are left out unless the agent sets inherit_mcp: true. So a shared project brings its servers along, and no agent can reach your mail unless you allow it.
  • ${VAR} in MCP server settings is read from the environment. The background service doesn't see your shell's variables, so put them in Hadley's env file (see Configuration). hadley validate and hadley run report missing variables.
  • Agents also load your normal Claude Code setup: user-level settings, skills, plugins, and any CLAUDE.md in the workdir or its parent folders. Hadley adds each agent's own skills on top. Skills are copied for each agent, so an agent sees only its own.
  • hadley run refuses to start while goal is still the placeholder text from hadley init, unless you start from a plan (--plan, --from-plan); the goal is then "Carry out the plan."

How it works

          hadley run  /  hadley service
                    │
              ┌─────▼─────┐        SQLite: runs, jobs, events
              │  engine   │◄───────────────────────────────────┐
              └─────┬─────┘                                    │
   starts the official `claude` CLI for each job (headless)    │
                    │                                          │
   Mother ── delegate(agent, task) ──► Hadley's tools (MCP) ───┘
     ▲                                  records a child job, waits
     └────────── the child's report ◄── for it, returns its report
  1. Each job is a Claude Code session. Hadley starts the unmodified claude CLI with the agent's model, effort, system prompt, skills, MCP servers and permissions, and reads its output stream.
  2. Delegation is a tool. Agents with a can_call list get one extra tool, delegate. It checks the rules, creates a child job and returns that agent's final report. The child sees only the task text, so agents are told to write self-contained tasks.
  3. Everything is saved. Runs, jobs, session ids and a log of events live in a local SQLite database. Each agent's conversation is saved by Claude Code itself.
  4. Mother keeps the plan and talks to you. She gets plan_read and plan_write, which store the plan in .hadley/plan.md, and ask_user for questions (when interactive is on). No other agent gets these tools: the others report to whoever called them.
  5. Each agent gets only its own tools. It sees the MCP servers in its mcp list and its own skills, and nothing from .hadley/.
  6. Agents take turns. Within a run, one agent works at a time; its callers wait for its report. A second delegate call is refused while the first agent still works, and an agent never finishes while one of its agents is still working: it waits and continues with the report. A delegate call never times out, however long the work takes.

What happens when…

Situation What Hadley does
You hit your usage limit Claude Code reports when the window reopens. The run pauses until then, and each agent resumes in the same conversation.
The machine restarts or crashes With the service installed, the run continues after the restart. Without it, hadley status flags the run and hadley resume continues it.
An agent was mid-step That one step is lost; finished work and files are kept. The agent is told it was interrupted and checks the workdir.
A restart hit while a parent waited on a child The child continues first. Then the parent is resumed and given the child's report, so the delegation is not repeated.
A delegate call is cut off before the report arrives The report is not lost. It comes with the agent's next call to a Hadley tool, or, if the agent ends its turn first, Hadley resumes it with the report once the child finishes.
An agent fails It is retried (limits.retries) in the same session. After that the job fails, and the parent receives the error and decides what to do.
An agent runs out of context Long conversations are summarised automatically (context_window sets when). If one still outgrows the model, Hadley starts that agent in a new session with its original task and a note to continue from the files already in the workdir. Mother re-reads her plan first.
A report is very long Agents are asked to keep reports short and put details in files. Anything over limits.max_report_chars is cut off, so one report can't fill Mother's context.
You press Ctrl-C or hadley pause Agents stop and nothing is lost. hadley resume continues.
Mother has a question (interactive: true) The run pauses. In hadley run you answer right in the terminal; otherwise hadley status shows the question and hadley answer "…" replies. Mother continues in the same conversation. With interactive: false she never asks and lists her assumptions in the report.
plan_approval is on Mother writes the plan and the run pauses; nothing is delegated before you approve. In hadley run she shows it and Enter approves; otherwise hadley resume (or a in the TUI) approves. She re-reads the plan, including your edits.
A run finishes or is cancelled Its plan and final report move to .hadley/runs/<id>/, so the next run starts fresh. Reuse an old plan with hadley run --plan .hadley/runs/<id>/plan.md. A failed run keeps its plan in place: hadley resume retries it, hadley run --from-plan starts over from it.

Accounts, terms and safety

Hadley is a local tool. You run it on your own machine, with your own account.

  • It never touches your credentials. Hadley runs the unmodified claude binary, which signs in through Anthropic's own flow (your Claude subscription or ANTHROPIC_API_KEY). Hadley does not read, store or forward tokens, and there is no hosted version.
  • Your provider's terms apply. Anthropic's Claude Code legal and compliance page says subscription usage limits "assume ordinary, individual usage". For heavy or continuous automation, use an API key instead of a subscription. Don't share accounts or run Hadley for other people on your subscription.
  • It respects usage limits. When a limit is hit, Hadley waits for the window to reopen. It never works around a limit.
  • .hadley/ is kept away from agents. Agents are told not to touch it, and Claude Code permission rules block the file tools (Read, Edit, Write) there. That prevents accidents, but a shell command could still reach the folder. Only a sandbox gives hard isolation.
  • Agents only get the MCP servers you give them. Your own servers and connected accounts (mail, drive, calendar) stay out of reach unless an agent sets inherit_mcp: true.
  • ⚠ Agents act as your user. Unattended agents can't answer permission prompts, so the starter file uses permission_mode: bypassPermissions, which lets agents run any command your user can. Run Hadley in a VM, a container or a dedicated user account, or narrow it down with permission_mode, allowed_tools and disallowed_tools.

Hadley is an independent open-source project, not affiliated with or endorsed by Anthropic.

Configuration

Environment variable Default Meaning
HADLEY_HOME ~/.local/share/hadley (Linux) · ~/Library/Application Support/hadley (macOS) Where state lives: database, logs, per-run files
HADLEY_CLAUDE_BIN claude Path to the Claude Code binary

$HADLEY_HOME/env (optional): KEY=VALUE lines with variables for ${VAR} in MCP server settings, for the background service in particular. Variables set in your environment take precedence. The file is outside your projects, so secrets never end up in .hadley/.

Development

git clone https://github.com/josefjadrny/hadley && cd hadley
uv venv && uv pip install -e '.[dev]'
.venv/bin/pytest                  # uses a fake `claude`, so no usage is spent
.venv/bin/ruff check src tests

Adding a provider (OpenAI, Gemini, another CLI, …): implement the Provider protocol in src/hadley/providers/base.py, a run coroutine that returns an Outcome (done, limit with a reset time, context when the conversation outgrew the model, or error), and register it in providers/__init__.py.

Releasing: bump __version__ in src/hadley/__init__.py, commit, then git tag vX.Y.Z && git push origin vX.Y.Z. The publish workflow checks the tag matches the version, builds the package and uploads it to PyPI.

Roadmap

  • Agents working in parallel, each in its own git worktree
  • More providers: Anthropic API, OpenAI, Gemini; other CLIs such as Codex and Gemini CLI
  • Web UI on top of the same state
  • Budgets per run and per agent; approval gates for risky actions
  • Moving a run to another machine (export / import)
  • Optional database backends (e.g. Postgres)

License

MIT

Metadata

Release files for hadley 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hadley 0.8.0
File Size Uploaded Provenance Actions
hadley-0.8.0.tar.gz 69.2 kB Without provenance Details for hadley-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hadley 0.8.0
File Interpreter ABI Platform Actions
hadley-0.8.0-py3-none-any.whl Python 3 none any Details for hadley-0.8.0-py3-none-any.whl

Total release size: 132.7 kB

Release files / hadley-0.8.0.tar.gz

Download URL hadley-0.8.0.tar.gz
Size 69.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d6a2dd22d73de8f4ad27222945a8bd9547852603ca217e3485d0c508c07ca078
BLAKE2b-256 checksum
How to use checksums
d91f91328a487ffe76edfe1002a9670db965de5b87d5c3fed03b7d2841c0c3ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hadley-0.8.0-py3-none-any.whl

Download URL hadley-0.8.0-py3-none-any.whl
Size 63.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c042e15b9313b918b50e96c3ee1b59dfdc75500f39daddb08d107d29d043a364
BLAKE2b-256 checksum
How to use checksums
a557b7e39c840c3cb9b716e28bae74ccfabc413118caa21ba95a5d4cb2d9eeef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hadley 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page