a better git interface for agents
- 121 git compatible commands
- ~50% smaller output that doesn't overflow context windows
- 1.5-2x faster than git in all implemented commands
- Agent friendly features like
fork,promptandguardrails - Git passthrough for non implemented commands
curl -fsSL zagi.sh/install | shThis downloads the binary and sets up git as an alias to zagi. Restart your shell after installation.
git clone https://github.com/mattzcarey/zagi.git
cd zagi
zig build -Doptimize=ReleaseFast
./zig-out/bin/zagi alias # set up the aliasUse git as normal:
git status # compact status
git log # concise commit history
git diff # minimal diff format
git add . # confirms what was staged
git commit -m "x" # shows commit statsAny commands or flags not yet implemented in zagi pass through to git. zagi also comes with its own set of features for managing code written by agents.
zagi ships with a wrapper around worktrees called fork:
# Create named forks for different approaches your agent could take
git fork nodejs-based
git fork bun-based
# Work in each fork
cd .forks/nodejs-based
# ... make changes, commit ...
cd .forks/bun-based
# ... make changes, commit ...
# Compare results, then pick the winner
cd ../..
git fork # list forks with commit counts
git fork --pick bun-based # merge fork into base (keeps both histories)
git fork --promote bun-based # replace base with fork (discards base commits)
# Clean up
git fork --delete-allSet ZAGI_AGENT to enable agent-specific features.
export ZAGI_AGENT=claude-codeThe value can be any string describing your agent (e.g. claude-code, cursor, opencode) - this will be used in future features for agent-specific behavior.
This enables:
- Prompt tracking:
git commitrequires--promptto record the user request that created the commit - Guardrails: Blocks destructive commands (
reset --hard,checkout .,clean -f,push --force) to prevent data loss
git commit -m "Add feature" --prompt "Add a logout button to the header.."
git log --prompts # view promptsTo prevent child processes from overriding ZAGI_AGENT, make it readonly:
# bash/zsh
export ZAGI_AGENT=claude-code
readonly ZAGI_AGENTRemove Co-Authored-By: lines that AI tools like Claude Code add to commit messages:
export ZAGI_STRIP_COAUTHORS=1
git commit -m "Add feature
Co-Authored-By: Claude <[email protected]>" # stripped automaticallyCommands zagi doesn't implement pass through to git or use -g to force standard git output:
git -g log # native git log output
git --git diff # native git diff outputStandard git log:
commit abc123f4567890def1234567890abcdef12345
Author: Alice Smith <[email protected]>
Date: Mon Jan 15 14:32:21 2025 -0800
Add user authentication system
zagi log:
abc123f (2025-01-15) Alice: Add user authentication system
Requirements: Zig 0.15, Bun
zig build # build
zig build test # run zig tests
cd test && bun i && bun run test # run integration testsSee AGENTS.md for contribution guidelines.
MIT