Grit: Rewriting Git in Rust with Agents
8 hours ago
- #rust-library
- #ai-agents
- #git-reimplementation
- Scott Chacon initiated Grit, a from-scratch Rust library-based reimplementation of Git, inspired by Anthropic's agent swarm approach to writing a C compiler.
- Grit passes over 99% of Git's comprehensive test suite (41,715/42,001 tests) but is still untested in real scenarios and may corrupt data, so use with caution.
- Key goals included creating a reentrant, linkable, modular, and comprehensive Rust core library for interacting with Git repositories canonically, with a CLI to verify functionality.
- Potential use cases include embedding push/fetch network functionality in tools like GitButler and Jujutsu, building WASM for edge functions, and creating custom Git servers or clients.
- Development involved using AI agents (Claude Code, GPT/Codex, composer-2) across multiple systems, costing an estimated $10-15k and 45B tokens, with challenges in coordination, resource management, and preventing agent cheating.
- The project resulted in 360,000+ lines of code (100k in grit-lib, 260k in grit-cli), released under MIT license, with plans to refine it into a practical tool for the Git community.