Skip to main content

Worktree Controller

Worktree Controller (WC) helps people and AI agents share a Git repository without losing track of who owns each working directory, what it may change, and whether it is safe to close. It checks repository policy before allocating a worktree, grants writing authority to a live process, and records handoff, integration, recovery and release evidence. Git remains the source of truth for files, branches, commits and registered worktrees.

Current release: 1.31.0 · Linux · Python 3.12 · Apache-2.0

Install

Use a virtual environment in a new directory:

python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install worktree-controller==1.31.0
worktree-controller --version
worktree-controller capabilities --json

WC requires Git and readable Linux /proc. Other operating systems and Python versions are not supported by this release. Its one runtime dependency is websockets>=15,<16. On Ubuntu, if creating the environment reports that ensurepip is unavailable, install the distribution's python3.12-venv package first (for example, sudo apt install python3.12-venv). Software version 1.31.0 uses CLI contract 61 and storage layout 5.

Try it in a disposable repository

With the environment above active:

git clone https://github.com/xuanheng-tech/worktree-controller.git wc
cd wc
git checkout v1.31.0
python examples/quickstart.py --workspace "$HOME/wc-first-run"

The workspace path must not exist; its parent must already exist. The example creates its own repository and isolated HOME, uses no credentials or remote, and leaves existing projects alone. It runs a small inspection task: admit a worktree, bind a live writer, check permission, observe an expected wrong-owner refusal, inspect recovery guidance, and formally close the unchanged task. On success it prints PASS, releases the linked checkout through WC, and keeps the repository, branch and command log. On failure it stops and preserves results for inspection.

The getting started guide explains the output and how to proceed to tasks that change files. The example also ships in the source distribution; it requires only WC and Git, with no companion delivery tools.

To actually change a file, publish to a local bare remote, integrate and recover a paused task, follow your first change. That complete example additionally uses public Git Finalizer and Snapshot Runner installations.

Everyday tasks

Use worktree-controller task list to see live checkout tasks and task show --task-key <task> for the recorded owner and next formal step. The everyday task guide covers simpler start, original-task checkpoint/resume, guarded no-change release and exact Finalizer handoff. These CLI 61 entrypoints retain the existing ownership, lease and policy checks.

Use WC in a real project

A governed repository tracks .agents/worktree-policy.toml and registers its checkouts with WC. Start with read-only status and doctor; adopt existing checkouts explicitly rather than assuming that a clean directory is unowned. Follow the operations guide for task admission, writer identity, handoff, integration and safe release.

WC manages checkout authority and lifecycle. It does not implement your task, commit changes or publish a branch. Real handoff and integration flows use separate delivery evidence from Git Finalizer. Context Loader and the maintenance checker are optional. The complete integration example uses Snapshot Runner for the explicit review receipts required by its policy; see optional integrations.

When blocked, run worktree-controller recovery-guide --repo /path/to/repo --path /path/to/checkout --json and follow the state-specific guidance. Preserve unfinished changes and unknown files. At session end, use the full recorded session identity and check every allocation's result; a successful process exit alone does not prove that all worktrees are settled.

Documentation and help

Licensed under the Apache License 2.0.

Metadata

Release files for worktree-controller 1.31.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 worktree-controller 1.31.0
File Size Uploaded Provenance
worktree_controller-1.31.0.tar.gz 531.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for worktree-controller 1.31.0
File Interpreter ABI Platform
worktree_controller-1.31.0-py3-none-any.whl Python 3 none any Details

Total release size: 982.5 kB

Release files / worktree_controller-1.31.0.tar.gz

Download URL worktree_controller-1.31.0.tar.gz
Size 531.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f21a58863b6fbf3537dc62aaa571992106cdebc7d203e0709f3aecd3bff2b376
BLAKE2b-256 checksum
How to use checksums
6df90b19e804f8848063b0b567f3d818efaf485ef9ed37d17c05e8ef3bd1686b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / worktree_controller-1.31.0-py3-none-any.whl

Download URL worktree_controller-1.31.0-py3-none-any.whl
Size 450.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf1eaf1f4cc9e2cf3b93e9b255dbb8dc30686d71f24cc793157be7bf127699c6
BLAKE2b-256 checksum
How to use checksums
0df36f33ac208d511a6e0925ee5737933e51cd99568e3e04ba90e0d0ac702d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for worktree-controller 1.31.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