Skip to main content

gitagent

MCP-first agent workspace manager: shared worktree, pheromone edit tracking, semantic intents, per-file locks, partial snapshots.

gitagent v0.6.0 is a total rewrite. The CLI is gone — all operations are exposed as MCP tools over stdio. Multiple sessions share ONE global worktree. Every edit is tracked in SQLite with full attribution (the pheromone). Coordination — no inbox — emerges from the edit log. Writes acquire per-file locks and reject informed on conflict; orchestrators publish their part via partial snapshots.

Install

# from GitHub
pip install "git+https://github.com/david-fm/gawt"

# local development
git clone https://github.com/david-fm/gawt && cd gawt
pip install -e ".[dev]"

Requires Python 3.11+ and a working git on PATH.

Quick start

# Orchestrator: start a session (creates/reuses the shared worktree)
sess_a = start_session(feature="auth-rate-limiting")
sess_b = start_session(feature="tests-for-limiter")   # same worktree, 2nd session

# Register + route agents (session_id required with 2+ open sessions)
register_agent(role="implement limiter", session_id=sess_a["session_id"])
register_agent(role="write tests", session_id=sess_b["session_id"])

# Agents set intent and edit files (pheromone + lock)
start_intent(agent_id="a_3f2c", intent="implement rate limiter")
edit_file(agent_id="a_3f2c", file="src/auth.py", old_string="...", new_string="...")

# Orchestrator: inspect shared state, pick a frontier
snapshot_status(session_id=sess_a["session_id"])      # whole worktree vs target
list_edits(limit=50)

# Orchestrator: publish only its part (live worktree stays)
snapshot_session(session_id=sess_a["session_id"], message="feat(auth): rate limiter",
                 files=["src/auth.py"])
# → 1 commit on target branch; other sessions keep the worktree

# Orchestrator ends the session
abort_session(session_id=sess_a["session_id"])        # removes worktree only if last open

Architecture

Host (Claude Code / opencode)
  → spawns: gitagent mcp (stdio)
    → .gitagent/state.db (sqlite)
    → .gitagent/worktree/ (ONE shared detached worktree)
  • Multiple sessions open at once, each with its own agents.
  • One worktree per repo, reused across sessions. Snapshots never delete it.
  • Target branch fixed per worktree (the first session picks it).
  • User's checkout on main is never touched.

MCP Tools

Category Tools
Sessions start_session, abort_session, get_session, list_sessions
Snapshots snapshot_session, snapshot_status, list_snapshots
Agents register_agent, unregister_agent, list_agents
Intent start_intent, repurpose, get_current_intent
Editing edit_file, write_file, read_file, delete_file
Observability list_edits, list_intents

All editing/intent tools require agent_id per call.

How it works

  • Shared worktree: one detached worktree at .gitagent/worktree/, shared by all sessions and their agents.
  • Pheromone: every edit_file / write_file / delete_file records (agent_id, session_id, file, intent_id, op, ts) in SQLite — a traceable "I edited this, with this intent".
  • Per-file locks: writes acquire a lock first and always release it in finally (TTL default 15s reclaims orphans). A fresh foreign lock → informed rejected response with the current read.
  • Informed reads: read_file returns content + sha256 + base_sha + diff + edits[] + intent warning.
  • Atomic writes: all writes go through temp + os.replace (POSIX-atomic); disk is the source of truth.
  • Partial snapshots: snapshot_session commits part of the worktree onto the target branch via a detached temp worktree, without touching the live worktree. Per-file snapshot_progress tracks each session's frontier.
  • Crash reconciliation: snapshot_status inserts synthetic adjusted rows for disk changes with no pheromone entry, so replay never fails on crash residue.

Layout

<repo>/.gitagent/
├── state.db              # sqlite: sessions, agents, intents, edits, snapshot_progress, locks, snapshots
├── worktree/             # ONE shared detached worktree (all open sessions)
├── _snapshot_temp/       # temp worktree during a snapshot commit (auto-cleaned)
└── log.jsonl             # append-only audit trail

Development

pip install -e ".[dev]"
PYTHONPATH=src pytest tests/ -v

License

MIT © David Florez Mazuera

Release files for gawt 0.6.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 gawt 0.6.0
File Size Uploaded
gawt-0.6.0.tar.gz 42.3 kB Details

Built distribution (wheel)

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

Total release size: 71.8 kB

Release files / gawt-0.6.0.tar.gz

Download URL gawt-0.6.0.tar.gz
Size 42.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4d4e1eedcf90794bdc06f1a9309a8c502e6d57bf9e693a5c13218e898ee1dd34
BLAKE2b-256 checksum
How to use checksums
5cb456137c1cc240f48b81c6cca0a0c39c4ca5eab6517029b14a6ebe5b5c9e26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / gawt-0.6.0-py3-none-any.whl

Download URL gawt-0.6.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
757657065e4662afec80244ee7a2b223a4e7b4852fc77c65d82aa21a77f258fe
BLAKE2b-256 checksum
How to use checksums
fdc06bbe606b763667e49d9783534f1aac602c107b01043bd4ef7aa3dbb7e949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

This release

0.6.0 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release 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