tracegit
Supports local Ollama agent runs and live trace audits, enabling loop-thrash detection, token-waste measurement, and regression gate evaluation for Ollama-based agents.
Supports ingesting and normalizing OpenAI/OpenRouter tool-call traces for commit, diff, bisect, and CI gate analysis of agent execution trajectories.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
tracegit — Git for AI Agent Execution Traces
A small, local prototype for versioning and comparing AI agent tool-call traces.
tracegitstores agent trajectories as commits in a SQLite database (with a SHA-256 Merkle root over steps), and offerslog-,diff- andbisect-style commands built on an edit-distance step alignment (C++20 helper with a pure-Python fallback), a simple n-gram repeated-call detector, a rule-based CI regression gate, and a minimal stdio MCP server exposing these as tools.
Live Trajectory Diff, Bisect & Loop-Thrash Workbench
![]()
Related MCP server: horizon-ledger
Why Developers Install tracegit
GitHub-PR-Style Step Alignment (
diff+bisect): Powered by a nativeC++20(clang++ -O3) Wagner–Fischer dynamic-programming aligner over 64-bitblake2bstep hashes (MATCH,SUBSTITUTE,DELETE_BASE,INSERT_CANDIDATE), pinpointing the exact first divergent tool call between a working run and a failing run.Runaway Retry Loop (
Loop-Thrash) Detector: Sliding-window n-gram (p = 1, 2, 3) cycle detector quantifies exact wasted steps and tokens when an agent gets stuck re-reading or re-grepping the same file.Content-Addressable SQLite + SHA-256 Merkle DAG: Stores normalized Claude Code JSONL, OpenAI/OpenRouter tool traces, and local Ollama runs in
.tracegit/tracegit.dbwith tamper-evident SHA-256 step Merkle roots—100% local, zero cloud lock-in.Drop-In
MCPServer for Claude Code & Cursor: Exposes 4 tools overstdioJSON-RPC 2.0 (tracegit_list_commits,tracegit_diff_commits,tracegit_bisect_failure,tracegit_evaluate_gate) so your coding agent can debug its own trajectory regressions.
Drop-In Claude Code / Cursor .mcp.json Setup (30 Seconds)
Add this to .mcp.json in your repository (or run tracegit mcp-stdio):
{
"mcpServers": {
"tracegit": {
"command": "uvx",
"args": ["tracegit", "mcp-stdio", "--db", ".tracegit/tracegit.db"]
}
}
}Measured Benchmarks
Every metric below is reproducibly measured via CLI (tracegit ...) and pytest + Hypothesis (97.55% line coverage):
Benchmark | Measured Result | Engineering Guarantee |
| Baseline | Exact C++20-vs-Python parity & metric symmetry ( |
| First divergence: | CI Gate BLOCKs regressed candidate ( |
Live | 6 multi-step coding/K8s/CI agent tasks: | Zero duplicate retries; mandatory |
Scope & Limitations
Small codebase: ~1.5k lines of Python in
src/plus a ~180-line C++20 helper (csrc/tracegit_kernels.cpp, loaded viactypes, with an equivalent pure-Python fallback). It is a prototype, not a production-hardened tool.Diff/bisect results are on demo traces: the 5-step vs 8-step diff and the thrash/gate numbers above come from the hand-built traces seeded by
tracegit demo, not from real-world agent logs.The
qwen3.5:4baudit is a small, self-constructed check: 6 hand-written tasks run against a small local 4B model via Ollama (single machine, no GPU cluster). The model only emits a JSON tool-call plan; tools are not executed, and "verified" means the plan passes a structural heuristic (read → edit → test on the target file). The v1 vs v2 difference reflects two prompt styles, and per-step token counts are derived from the model's total output tokens.Simplified storage & alignment: step hashes are 64-bit
blake2bdigests of tool name, status and argument summary; alignment is plain O(n·m) Wagner–Fischer; loop detection is a sliding n-gram (n = 1–3) repeat counter. There is no remote sync, branching/merge semantics, or multi-user concurrency.Integrations are minimal: the trace importers and MCP server (4 tools over stdio JSON-RPC) cover the formats exercised in the tests; they have not been validated against every Claude Code / Cursor / OpenAI trace variant.
Quickstart
# 1. Install Python 3.13 deps & compile C++20 alignment kernel
uv sync --python 3.13 --all-extras
# 2. Run strict lint, typing & Hypothesis test suite (97.55% coverage)
uv run ruff check src tests
uv run mypy src tests
uv run pytest --cov=tracegit --cov-report=term-missing --cov-fail-under=95
# 3. Run demo diff/gate + live Ollama trace audit
uv run tracegit demo
uv run tracegit eval-ollama
# 4. Build interactive Diff Workbench UI & launch server on :8100
cd ui && npm ci && npm run build && cd ..
uv run tracegit serve --host 127.0.0.1 --port 8100Author & License
Designed and engineered by Nagarjuna Kamireddy (@nagarjunak-pixel). Released under the MIT License.
Author & Canonical Portfolio
Engineered by Nagarjuna Reddy Kamireddy (Principal / Lead AI Architect · Dubai, UAE).
Architecture Portfolio & Case Studies: https://nagarjunak-pixel.github.io/
Open-Source Suite: https://nagarjunak-pixel.github.io/projects.html#tracegit
GitHub: @nagarjunak-pixel · LinkedIn: in/nagarjuna-kamireddy
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Git collaboration for AI agents and people: tasks, hand-offs, reviews, teams, shared memory.
Live GitHub repo AST X-Ray, 42 coding-agent DoD gates, Git worktree guards & brownfield baselines.
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI coding agents to retrieve cited git-history explanations for files and tickets, compile a Team Engineering Contract from repository artifacts, and follow guided Understand/Build workflows over MCP stdio. It lets clients such as Grok, Claude Code, Codex, Kiro, and Cursor share the same tools for evidence-backed repository understanding.18 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to read and manage a Git-native decision ledger, providing tools for querying decisions, evidence, cross-repository workspaces, validation, and commit tracing, all operating locally and without a cloud service.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to snapshot workspace states, binary-search recorded trajectory steps, rewind to a prior good step, and retrieve per-step diffs for autonomous regression debugging. It supports self-healing debugging workflows through MCP tools.3MIT
- AlicenseAqualityAmaintenanceLets AI agents query, search and read wiki pages and raw transcripts of past coding sessions, so they can look up prior decisions and fixes before redoing work. It also exposes linting, sync, export and dashboard tools over stdio, with path-traversal guards and no SDK dependency.6441 PyPI2MIT