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.2 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 (auto-STALE via last-read tracking) 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 + edits[] (each with op, role, intent, ts) + intent warning — no fat diff payload. The git diff lives in snapshot_status.
  • Auto STALE_WRITE: gawt remembers each agent's last read per file (last_reads) and rejects a write with STALE_WRITE if the disk changed since, or if you never read the file (you must read before touching a file someone else owns). Agents never pass or manage a SHA.
  • 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.2

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.2
File Size Uploaded
gawt-0.6.2.tar.gz 45.4 kB Details

Built distribution (wheel)

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

Total release size: 76.0 kB

Release files / gawt-0.6.2.tar.gz

Download URL gawt-0.6.2.tar.gz
Size 45.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d86ea230938d4b9f21d687bb6b2070ac00bf89cd09f23453ad00a5a65160418c
BLAKE2b-256 checksum
How to use checksums
558f2dfc50c46bde313fab205c94b35544f138d98bc3e6daebec02bdf3c717ee
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 21, 2026.

Transparency log

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

Download URL gawt-0.6.2-py3-none-any.whl
Size 30.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd49484ee3228269c63895595c88ee76ec08d0e9c7917e3bf648938143450874
BLAKE2b-256 checksum
How to use checksums
5d03c6e2f03f360d45fe6e2d1c5b2381aac2f5025b3eaf9d974a8df2b177b2e9
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 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.4

2 release files

0.6.3

2 release files

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

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