gitagent
MCP-first agent workspace manager: shared worktree, pheromone edit tracking, semantic intents, per-file locks, partial snapshots.
gitagent v0.6.3 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
mainis 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_filerecords(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 → informedrejectedresponse with the currentread. - Informed reads:
read_filereturns content + sha256 +base_sha+edits[](each withop,role,intent,ts) + intentwarning— no fat diff payload. The git diff lives insnapshot_status. - Auto STALE_WRITE: gawt remembers each agent's last read per file (
last_reads) and rejects a write withSTALE_WRITEif 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_sessioncommits part of the worktree onto the target branch via a detached temp worktree, without touching the live worktree. Per-filesnapshot_progresstracks each session's frontier. - Crash reconciliation:
snapshot_statusinserts syntheticadjustedrows for disk changes with no pheromone entry, soreplaynever 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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gawt-0.6.4.tar.gz | 47.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gawt-0.6.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.6 kB
Release files / gawt-0.6.4.tar.gz
| Download URL | gawt-0.6.4.tar.gz |
|---|---|
| Size | 47.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a365f554dc936ea9574f6901955e401121cbafb659523ced791aa172c6eefaa
|
|
BLAKE2b-256 checksum How to use checksums |
751edbad3b4000774ce2ca146882cba4d339b9ef52c95edc05b9c4ae4080b0b1
|
| 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 24, 2026.
Transparency logRelease files / gawt-0.6.4-py3-none-any.whl
| Download URL | gawt-0.6.4-py3-none-any.whl |
|---|---|
| Size | 31.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc20a7f871ec78c42e2ef6facde14f15b98aff84f7e781a0c4aef319a4ff7f66
|
|
BLAKE2b-256 checksum How to use checksums |
6c501dcdffb46d21625cf0562d577243b79a068121b8bb22119e8f146921ea4e
|
| 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 24, 2026.
Transparency log