Nit: A Git Replacement in Zig Optimized for AI Agent Token Efficiency

Nit is a Git replacement written in Zig that's optimized for AI coding agents by reducing token consumption and improving execution speed. The tool was created after analyzing 3,156 real coding sessions where Git accounted for roughly 459,000 tokens of output (7.4% of all shell commands).
Performance Improvements
Token savings with nit's compact mode versus Git default:
status: ~125 tokens → ~36 tokens (71% savings)log -20: ~2,273 tokens → ~301 tokens (87% savings)diff: ~1,016 tokens → ~657 tokens (35% savings)show --stat: ~260 tokens → ~118 tokens (55% savings)
Across real session data, nit's compact defaults would save 150-250K tokens. Performance benchmarks from 100 hyperfine runs on a real repo:
status: 13.7ms → 8.4ms (1.64x faster)diff: 14.3ms → 9.9ms (1.44x faster)show: 10.2ms → 7.3ms (1.39x faster)
Technical Implementation
Nit uses Zig's zero-cost C interop to @cImport libgit2 headers and call functions directly, eliminating subprocess overhead and text parsing. It reads the Git object database natively. For commands nit hasn't optimized yet, it falls through to Git via execvpe(), replacing the nit process entirely with zero wrapper overhead.
This passthrough design makes alias git=nit safe - you never lose functionality, and as more commands get native implementations, the passthrough shrinks automatically.
Key Design Decisions
The most controversial design decision was reducing diff context from 3 lines (Git's default) to 1 line (U1). Testing with 27 trials of multi-file diffs, nested control flow, code moves, and ambiguous similar blocks showed Claude scored 4/4 at U0, U1, and U3 contexts. Analysis of 561 Git diff/show calls from actual Claude Code sessions showed only 3.9% of agents read the source file immediately after diffing, suggesting the diff itself provides sufficient context.
Nit offers two modes:
- Compact (default): Machine-optimized output with just the data
- Human (
-H): Colored, grouped output for human readability
Development Challenges
The hardest part was conformance testing - Git has decades of edge cases including detached HEAD, merge commits, renamed files, binary diffs, and submodules. The developer wrote 78 conformance tests covering all these cases, fixing output divergences from Git where meaningful.
Installation: brew install fielding/tap/nit
Usage examples:
- For agents:
nit log - For humans:
nit log -H - Full replacement:
alias git=nit
📖 Read the full source: HN AI Agents
👀 See Also

Benchmark shows context engine reduces AI coding agent costs by 3x on SWE-bench
A benchmark of 4 coding agents using Claude Opus 4.5 on SWE-bench Verified shows a context engine achieved 73% pass rate at $0.67/task, while other agents cost up to $1.98/task for similar or lower performance.

Building a Full Production App with Claude: What Actually Worked and What Didn't
A senior backend dev with zero Flutter experience shipped a full production app (iOS + Android) using Claude as primary tool over 2.5 months. Details the workflow, failures, and why tests were the quality gate.

AI Team OS: Self-Driving Organization Layer for Claude Code
AI Team OS is an operating system layer for Claude Code that creates autonomous workflows where the system continues working without waiting for user prompts. It includes 22 specialized agent templates, 40+ MCP tools, and runs entirely within Claude Code subscription without external API costs.

Local voice-to-text transcription for OpenClaw using Parakeet TDT 0.6b v3
A developer has converted NVIDIA's Parakeet TDT 0.6b v3 model to run locally via ONNX on CPU, supporting 25 European languages. The model provides an OpenAI-compatible API endpoint through a Docker container, allowing integration with OpenClaw for audio file transcription.