Skip to main content

context-garden

Drive autonomous agent development by tending a context garden. You maintain principles, product overviews, phase goals, and specs as Markdown; context-garden turns that context into plans, working code, and reviewed pull requests. As your project grows, you refine the documents that guide the agents, and the agents carry the work through implementation, checks, review, and revision. Your job is to shape the goals, make decisions, and choose what ships.

You can change the direction of the project in the same place you define it. Each worker gets a focused brief built from the shared context, and each phase leaves evidence you can use to improve the next one: what shipped, where agents got stuck, how reviewers responded, and what the work cost.

Context Garden's development loop: tasks return through revision on the left while growing file nodes and code dependencies fill the graph on the right.

Watch Context Garden build itself — one-minute video · Reproduce the film

Features · See it in action · Ontology · Getting started · Operating guide · Contributing · All documentation

The development loop: maintain principles, product context, goals, and specs; plan and approve; build and check; review and merge. Feedback drives revisions, and retrospectives inform the next phase.

What you can do

  • Keep context useful as the project changes. Maintain principles, product overviews, goals, and specs in Git. Each worker's brief includes the shared context and its task's reading list, so the direction you set reaches the work being done.
  • Turn goals into coordinated work. Plan a phase as tasks with acceptance criteria and dependencies. Run agents in parallel worktrees; stack related PRs and advance dependent tasks as changes merge.
  • Close the review loop. Configured tests and lint gate PR creation. Automated reviewers check the task's criteria, and failed checks or review feedback drive bounded revisions. Add persona reviews for another perspective.
  • Handle decisions without losing the thread. Answer a worker's question, approve scope, send a PR back, or recover a stopped task. The task keeps its brief, run output, review evidence, and history together.
  • Watch autonomous work as it happens. Now shows runs in flight, progress excerpts, what is queued next, and where the phase stands. The Board gives you columns, a task list, and a backlog you can reorder across phases.
  • Compare models by the work they get accepted. Inspect cost per accepted task, first-pass approval, revision rounds, and lead time by model and difficulty. Compare per-run costs, run model trials, set budgets, and account for delegated operator spend.
  • Use each phase to improve the next. Retrospectives bring together outcomes, friction, costs, and persona reviews. They can propose follow-up work or identify blockers before a phase closes; you refine the context for what comes next.
  • Bring your existing project and tools. Onboarding drafts context and a first phase from your repository. Use Claude Code, Codex, or a custom CLI harness with your project's setup, test, and lint commands; choose local, SSH, remote lease-based, or manual workers.

The scheduler itself uses no model tokens: it polls, orders tasks, collects results, and advances state in Python. Models do the planning, implementation, reviews, agent-assisted revisions, and retrospectives. A delegated operator session also uses tokens. Waiting for CI does not require an agent to sit in a chat polling it.

Feature tour

Watch the work move

Now is the live view of the loop: workers and reviewers in flight, progress from their output, the next tasks, and phase progress. Open a run to inspect its evidence. Below is the garden developing context-garden itself.

Now showing parallel agent runs, progress excerpts, review work, and the last 24 hours of activity in the real development garden

Handle the decisions that need you

The Inbox brings worker questions, draft approvals, and PR triage together. Answer a question to resume the work, approve the next tasks, or send a draft PR back with feedback.

Example Inbox with a worker question, an answer field, and draft tasks to approve

This small example garden shows a worker asking about export behavior and two tasks awaiting approval.

Shape the plan across phases

The Board backlog puts upcoming work in phase order, with controls to change priority and move tasks between phases. Switch to columns for state or to the list for a compact view of tasks and PRs.

Live Board backlog showing tasks grouped by phase with priorities, state, and reorder controls

See the Board's columns and list views

Columns: scan the work by state, from draft and blocked through running and review. The board scrolls horizontally to show the remaining states.

Live Board columns showing draft, blocked, ready, running, and review work

List: read task titles, state, priority, difficulty, and PR links together.

Live Board list showing tasks by state in a single phase

See which models work well for your tasks

The comparison charts lower down Now connect model choices to outcomes. Cost per accepted task, first-pass approval, revision rounds, and lead time are broken out by difficulty. Cells include sample counts; sparse results are marked so a small sample does not look like a reliable winner.

Now comparison charts showing cost per accepted task, first-pass approval, work-run cost, revision rounds, and median lead time by model and difficulty

The per-run comparison separates work, revision, review, and other activities by harness and model. Use it alongside the outcome charts when tuning model assignments and the amount of review a task needs. The Costs page provides spending history and additional filters.

Now heatmap comparing mean cost per run across activities, harnesses, and models, with totals and sample counts

These are snapshots of this project's development history over the selected 24-hour window, not controlled model benchmarks or estimates for your project.

Keep the context and decisions within reach

The Trellis makes dependencies visible. Task pages keep the brief, acceptance criteria, worker questions, and recorded usage together. Phase pages connect the work to goals and specs; closed phases remain available in the Herbarium.

Explore the Trellis, task page, and phase page

These three captures use the same fictional Fieldnotes project as the Inbox above to make the individual features easy to read.

Trellis showing dependencies across an example project's tasks

Dark task page with a worker question, acceptance criteria, and recorded usage

Example phase page with progress, task status, and its specification

What you maintain

Your garden is a git repository of Markdown files. It holds the context and task history; each product points to its code repository. The garden driving this tool lives at joshmarcus/garden.

my-garden/
  garden.yaml                    # products, harnesses, capacity, checks
  principles/00-index.md          # shared rules included in every brief
  widget/
    product.md                   # product context and development conventions
    phase-01/
      goals.md                   # outcomes, scope, definition of done
      specs/                     # designs and requirements
      tasks/                     # task briefs and scheduler-managed state
  .garden/                       # local run records and working state (gitignored)

Edit and version the context in your usual editor. Use garden commands or the UI for task status changes.

Install

You need Python 3.11+, git, a logged-in Claude Code or Codex CLI, and GitHub access through authenticated gh or GITHUB_TOKEN. Linux and macOS are supported; on Windows, run garden inside WSL. Your product repository needs a committed base branch, a GitHub remote you can push to, and a configured git author identity.

Install the released command and library from PyPI:

python -m pip install context-garden
garden --help

The supported library surface currently consists of the documented modules under garden. For example, task-document tools can parse and render the YAML frontmatter used by a garden:

from garden import __version__
from garden.model import join_frontmatter, split_frontmatter

document = join_frontmatter({"id": "CG-1", "status": "ready"}, "## Goal\n\nShip it.")
metadata, body = split_frontmatter(document)
print(__version__, metadata["id"], body.strip())

Other modules are implementation details unless they are documented here or in the linked guides. Source contributors can instead use an editable checkout:

git clone https://github.com/joshmarcus/context-garden
cd context-garden
uv venv
uv pip install -e .
source .venv/bin/activate
garden --help

Without uv, create the environment with python3 -m venv .venv, activate it, and run python -m pip install -e .. Keep that environment active when you move into your garden directory.

Your first project

The steps below are a compact preview. The getting-started guide adds platform notes, expected outcomes, command explanations, and setup recovery.

1. Create a garden and choose a harness

From the tool checkout, with its environment active:

garden init ../my-garden --name my-garden

The default harness is Claude. To use Codex, set harness: codex in ../my-garden/garden.yaml before onboarding. See Codex setup for authentication and model configuration.

Workers use a private HOME and a scrubbed environment. Saved harness credentials are copied into private directories for each dispatch. If your credentials live elsewhere, configure worker_env.config_dirs; individual approved tool files use worker_env.config_files. Keep secrets out of tracked YAML. See worker environment and configuration.

2. Draft context from your repository

Replace the path below with your project's local checkout:

garden onboard /absolute/path/to/widget --into ../my-garden
cd ../my-garden
git init

Onboarding attempts GitHub discovery and calls the configured planner, so this step uses a model. It infers a product name and creates phase-01 with draft tasks. The examples below assume that name is widget.

Read widget/docs/onboarding.md to see what was found, inferred, or left unresolved. Review widget/product.md, the principles, phase goals, and tasks. Correct the scope and the product's setup.command, setup.test, and setup.lint in garden.yaml. Onboarding does not install project dependencies or prove those commands work; validate them in a disposable checkout before approving work.

Prefer to write the context yourself?

After garden init, enter your garden and scaffold the product and phase:

cd ../my-garden
garden new-product widget --repo /absolute/path/to/widget --base-branch main
garden new-phase widget phase-01

Fill in principles/00-index.md, widget/product.md, widget/phase-01/goals.md, and the specs under widget/phase-01/specs/. Configure the product's setup, test, and lint commands, then run:

garden plan widget/phase-01 --draft

Planning attempts a kickoff review first if none exists. --dry-run prints the planning prompt without calling a model. The onboarding path already creates drafts; it does not need this extra planning call.

3. Review the plan before starting work

Merge these settings into the generated garden.yaml, keeping its product and harness configuration. They make approval explicit and start with one work slot and one review slot:

max_parallel: 1
review_parallel: 1
plan:
  auto_approve: false
discovered:
  auto_approve_blocking: false
review:
  enabled: true
github:
  draft_pr: true
  project_users: [] # additional PR authors to observe; the authenticated user is always included
  automerge: false
  # Tier pools may spread work across harness/model members.
models:
  medium:
    - {harness: claude, model: claude-sonnet-5, weight: 2}
    - {harness: codex, model: gpt-5.6-terra, weight: 1}
dispatch: {spread: quota_aware}   # round_robin | weighted | quota_aware
harnesses:
  claude: {models: {easy: haiku, medium: sonnet, hard: opus}}
  codex:  {models: {easy: gpt-5.6-luna, medium: gpt-5.6-terra, hard: gpt-5.6-sol}}
checks:
  pre_pr: [{name: tests, command: "pytest -q -x"}]

These are suggested first-run settings, not package defaults: planning and blocking discovered work otherwise default to automatic approval. --draft overrides that behavior for one planning call. A phase budget is optional: garden budget widget/phase-01 50 pauses new dispatch at $50; it does not cancel work already running.

garden doctor
garden trellis
garden validate

doctor checks configuration, repositories, the graph, and worker logins. It sends a small harness prompt and executes a configured notification command, so it is not an offline check. Resolve its failures before continuing. validate checks the graph and reading lists; approval also rejects incomplete briefs. Use garden brief ID --stats to inspect a task's context size.

4. Approve work and follow the first PR

garden approve --all widget/phase-01
garden serve

Use garden approve ID instead of --all to start with a single task. Open http://127.0.0.1:8765. serve starts the web UI and the scheduler: approved, unblocked work can now dispatch. For a look around before launching work, use garden serve --no-watch instead.

Follow the task's runs and evidence, answer any questions in the Inbox, and inspect the resulting draft PR and automated review. Mark it ready with the UI or garden triage ID --ready; send it back with garden triage ID --changes "feedback". Once review and CI are satisfactory, merge on GitHub. The next poll records the merge and advances dependent work.

From another terminal with the same environment active, run garden status, garden inbox, or garden observe --profile quiet. garden watch runs the scheduler without the web UI; garden tui opens the terminal interface.

Use the CLI

The CLI operates the same garden as the web UI and TUI. Inspect a plan, follow the workers, handle decisions, and compare outcomes from your terminal:

garden status
garden observe --profile quiet
garden inbox
garden brief WID-003 --stats
garden runs WID-003
garden costs --since 24h --by model
garden metrics widget/phase-01

Run commands from your garden directory with the installed environment active. Replace WID-003 and widget/phase-01 with your task and phase. garden watch runs the scheduler on its own; garden observe --follow follows progress alongside an existing controller. garden --help lists the command groups. Difficulty tiers route each task to a model, so cost follows difficulty. A top-level tier can instead be a pool of harness/model members: round_robin alternates, weighted repeats members by weight, and the default quota_aware behavior halves a member's share for dispatch.quota_window_hours after its usage-limit event, until its probe succeeds, while skipping a paused harness entirely. A task's harness: or model: remains a pin. review.pool accepts the same member list for alternating review accounts, and garden trial -c tier:medium expands a tier pool into contenders. garden.<GARDEN_ENV>.yaml and a gitignored garden.local.yaml layer on top for a work or per-machine setting; examples/garden.work.yaml shows ssh workers, a Jenkins log analyser and a product whose dependencies and tests are not Python.

The CLI guide walks through planning and approval, following runs, answering workers, reviewing PRs, recovering tasks, and exporting JSON for scripts.

Keep the loop running

A dispatch pause still allows collection, checks, reviews, and merges. Installation maintenance uses a separate drain-and-resume protocol. Run one long-lived controller per garden and keep its UI on loopback or behind authenticated access.

The Config page shows effective settings and pending configuration changes.

The operating guide covers merge policy, capacity, remote workers, recovery, maintenance, configuration reloads, GitHub Enterprise, and operator handoffs. The architecture guide explains the full behavior and configuration boundaries.

Development and documentation

For development, follow the contributor guide. Tests use fake harnesses and spend no model tokens.

MIT licensed. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_garden-0.3.1.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

context_garden-0.3.1-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file context_garden-0.3.1.tar.gz.

File metadata

  • Download URL: context_garden-0.3.1.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for context_garden-0.3.1.tar.gz
Algorithm Hash digest
SHA256 10d1928f8ae32d2315c92e08bdfd448e74abc2f9e840f738e44f4d85341116bc
MD5 383162623f84472f53269e5e250c6d90
BLAKE2b-256 3654b6bd19321159dfed5f276d67f2b94513ca44de4d651ce499ceb31ca27ef2

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_garden-0.3.1.tar.gz:

Publisher: publish-pypi.yml on joshmarcus/context-garden

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

File details

Details for the file context_garden-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: context_garden-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for context_garden-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7dd5709db904c4b71455834962be332f0de4a716d938519cc1863b059cde1032
MD5 db5da851cc6797dd4cf3b948cabf2bba
BLAKE2b-256 2fa6d925ebee73483bb1dd56fb6d221ec13aba60d83277a2c3d95709315c6b82

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_garden-0.3.1-py3-none-any.whl:

Publisher: publish-pypi.yml on joshmarcus/context-garden

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

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.3.1 This release

2 files

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