zagi

by mattzcareyVerified

better git cli for agents

290
Stars
14
Forks
Zig
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/mattzcarey/zagi

Getting Started

Guides for using skills like zagi.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

zagi

a better git interface for agents

Why use zagi?

  • 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 and prompt
  • Three output modes: succinct (default), --compat (git-identical), --json
  • Git passthrough for non implemented commands

Installation

curl -fsSL zagi.sh/install | sh

This downloads the binary and sets up git as an alias to zagi. Restart your shell after installation.

From source

git clone https://github.com/mattzcarey/zagi.git
cd zagi
zig build -Doptimize=ReleaseFast
./zig-out/bin/zagi alias  # set up the alias

Usage

Use 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 stats

Any 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.

Output modes

zagi has three output modes:

Succinct (default) — token-efficient output for agents:

git status
# branch: main
# staged: 2 files
#   A  src/new.ts
#   M  src/main.ts

Compat — identical to git CLI output:

git --compat status
git --compat log --oneline -5
git --compat diff --stat

JSON — structured output for machine parsing:

git --json status
# {"branch":"main","clean":false,"staged":[{"marker":"A","path":"src/new.ts"}],"modified":[],"untracked":[]}

git --json log -n 3
# [{"hash":"abc123f","date":"2025-01-15","author":"Alice","email":"alice@example.com","subject":"Add feature"}]

git --json diff
# {"files":[{"path":"src/main.ts","insertions":5,"deletions":2}]}

Easy worktrees

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-all

Agent mode

Agent mode is automatically enabled when running inside AI tools (Claude Code, OpenCode, Cursor, Windsurf, VS Code). You can also enable it manually:

export ZAGI_AGENT=my-agent

This enables:

  • Prompt tracking: git commit --prompt records the user request that created the commit
  • AI attribution: Automatically detects and stores which AI agent made the commit
git commit -m "Add feature" --prompt "Add a logout button to the header"
git log --prompts   # view prompts
git log --agent     # view which AI agent made commits
git log --session   # view full session transcript (with pagination)

Metadata is stored in git notes (refs/notes/agent, refs/notes/prompt, refs/notes/session) which are local by default and don't affect commit history.

Guardrails

Opt-in protection against destructive commands (reset --hard, push --force, clean -f, etc.):

export ZAGI_GUARDRAILS=1
git reset --hard HEAD~1  # blocked!

To bypass guardrails, set an override secret:

git set-override pineapples
ZAGI_OVERRIDE=pineapples git reset --hard HEAD~1  # allowed

Environment variables

VariableDescriptionDefault
ZAGI_GUARDRAILSBlock destructive git commands. Bypass with ZAGI_OVERRIDE.(unset)
ZAGI_OVERRIDEBypass guardrails with the secret set via git set-override.(unset)
ZAGI_REQUIRE_PROMPT_COMMITRequire --prompt on commits in agent mode.(unset)
ZAGI_STRIP_COAUTHORSStrip Co-Authored-By: lines from commit messages.(unset)

Agent mode is automatically detected when running inside Claude Code (CLAUDECODE=1) or OpenCode (OPENCODE=1).

Strip co-authors

Remove 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 <claude@anthropic.com>"  # stripped automatically

Output comparison

Standard git log:

commit abc123f4567890def1234567890abcdef12345
Author: Alice Smith <alice@example.com>
Date:   Mon Jan 15 14:32:21 2025 -0800

    Add user authentication system

zagi log:

abc123f (2025-01-15) Alice: Add user authentication system

Development

Requirements: Zig 0.15, Bun

zig build                           # build
zig build test                      # run zig tests
cd test && bun i && bun run test    # run integration tests
bash test/conformance.sh ./zig-out/bin/zagi  # run conformance tests

See AGENTS.md for contribution guidelines.

License

MIT

Frequently Asked Questions

What is zagi?

zagi is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by mattzcarey. better git cli for agents. It has 290 GitHub stars.

Is zagi safe to use?

Yes. zagi passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install zagi?

Clone the repository with "git clone https://github.com/mattzcarey/zagi" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is zagi written in?

zagi is primarily written in Zig. It is open-source under mattzcarey on GitHub, so you can review or fork the full source.

Are there alternatives to zagi?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh zagi against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details