Skip to main content

hubtree

Running agents is easy. Managing them is where almost everyone struggles.

hubtree puts every Claude Code session you run into one tree. Each child knows its parent, its task, its budget and what it waits for, and its result comes back up to you to accept or send back.

What it does

  • A tree, not a list. Every session knows the session that started it. A folder row counts the sessions below it that are stuck or wait for you.
  • Work goes down with a task file. /spawn writes the goal, the done test and the budget into a file first, then starts the child in a new tab or in the background.
  • Results come back up. A child posts a result. You accept it, ask for a change, or reject it.
  • Cost per sub-tree, and budgets. A child pauses at 100% of its budget, and its parent gets one message.
  • Dependencies and a queue. "Start B when A has released", with limits per folder and in total.
  • Group actions. Pause, resume, stop or message a whole sub-tree.
  • Health marks. YOU (waits for you), STUCK (busy with no output past a time limit), died (stopped in the middle of a turn).
  • Long sessions continue. A new session with the same name takes over near the context limit, and a session continues by itself after a usage limit resets.

Claude Code has its own agent view (claude agents), which shows what runs and what needs you. hubtree uses the same sessions and adds who started what, what it cost, what waits on what, and what came back.

Install

You need Python 3.11 or newer, Claude Code, and a terminal back end: Windows Terminal on Windows, tmux on macOS and Linux.

pipx install git+https://github.com/dev-kewlani/hubtree
cd ~/projects               # the folder whose sub-folders become the tree
hubtree init

hubtree init does these steps and prints one line for each:

  1. Writes ~/.hubtree/hubtree.toml. The tree root is the folder where you ran init (--root DIR sets another one).
  2. Copies your Claude Code settings.json to ~/.hubtree/backup/ before it changes anything.
  3. Adds 6 hook entries to settings.json (session start and end, prompt, stop, pre-compact, and file writes). Each one runs python -m hubtree hook <event>.
  4. Installs the side pane as a Claude Code plugin from ~/.hubtree/pane (--no-pane skips it).
  5. Copies the /spawn and /where skills into ~/.claude/skills/. It never overwrites a skill with the same name.

The small daemon (hubtree daemon) starts with your next Claude Code session. It starts queued children, checks budgets and continues sessions after a usage limit.

Check the install with hubtree doctor.

Use

  • Use Claude Code as normal. Every session joins the tree. A session in ~/projects/work/api sits under the node work/api.
  • /spawn in a session starts a child: in a new tab, or in the background with --auto.
  • hubtree opens the tree app in the terminal. hubtree work shows only the work sub-tree.
  • /where (or hubtree where) prints the tree as text.
  • /tree opens or closes the side pane in a Claude Code session.
  • hubtree web serves a local page on 127.0.0.1 with a token login. It is off by default ([web] enabled in hubtree.toml).

Nothing leaves your machine. hubtree has no account and no server. It reads the transcripts that Claude Code already writes under ~/.claude/projects.

A short replay (stand-in names)

you      > /spawn "add rate limits to the api" --budget-usd 5
           started work/api/rate-limits in a new tab (task file written)
you      > /spawn "write the load test" --auto --after work/api/rate-limits
           queued work/api/load-test: waits for rate-limits (released)
...      rate-limits posts a result: "limits on 4 routes, tests pass, commit 3f2c1a9"
you      > hubtree      (the row shows "result ready"; press A to accept)
           accepted; load-test starts in the background
...      load-test reaches 80% of its budget: one message to its parent

Configuration

~/.hubtree/hubtree.toml holds every setting, with comments. The main keys:

Key Default Meaning
[hubtree] root the folder of hubtree init The folder whose sub-folders become the nodes
[hubtree] levels 2 How many folder levels below the root make a node
[hubtree] terminal auto wt, tmux or auto (wt on Windows, tmux elsewhere)
[hubtree] claude_args [] Extra arguments for every session that hubtree starts
[tree] stuck_min 20 Minutes with no output while busy before a row shows STUCK
[swarm] max_working_per_node 3 Background children that work at once per node; more wait in the queue
[swarm] max_working_total 8 Background children that work at once in total
[web] enabled false Keep the local page running

hubtree starts sessions with your normal Claude Code permission settings. It adds no permission flag by itself. To add one, put it in claude_args.

Uninstall

hubtree uninstall           # --purge also removes ~/.hubtree (the tree state)
pipx uninstall hubtree

hubtree uninstall stops the daemon, removes the plugin and the skills it copied, and removes its hook entries. When you made no other change to settings.json since init, the file is byte for byte the same as the backup. When you did make other changes, it keeps them and removes only the hubtree entries.

Platforms

Windows (Windows Terminal), macOS and Linux (tmux). Tested with Claude Code 2.1.330.

License

MIT

Metadata

Release files for hubtree 1.0.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 hubtree 1.0.0
File Size Uploaded Provenance Actions
hubtree-1.0.0.tar.gz 163.7 kB Without provenance Details for hubtree-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 310.1 kB

Release files / hubtree-1.0.0.tar.gz

Download URL hubtree-1.0.0.tar.gz
Size 163.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4efedc8a8879dad7857192d0af6b4b7edcf79d4d4591a758a640784fcf823606
BLAKE2b-256 checksum
How to use checksums
46869de12db840de2d5028b127d5415fc7d955613af4f9e4a720282c41e0fe4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / hubtree-1.0.0-py3-none-any.whl

Download URL hubtree-1.0.0-py3-none-any.whl
Size 146.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ad49cea9aeccdb4ecc3f0c57ab08a3eebaf5e714eb6f32e34976b4c038ad3a7
BLAKE2b-256 checksum
How to use checksums
96668a4c3c56cbed1517fe565e83eb2b79242a73a98917c96742dba02e07504b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for hubtree 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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