zag
Health Warn
- No license — Repository has no license file
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Warn
- Code scan incomplete — No supported source files were scanned during light audit
Permissions Pass
- Permissions — No dangerous permissions requested
An opinionated, composable AI coding agent built in Zig that acts as a full-screen terminal UI. It provides a plugin-based environment to interact with AI models, heavily inspired by the Neovim architecture.
Security Assessment
Risk: High. The built-in agent tools explicitly provide the ability to execute shell commands (`bash`) and read/write local files. It requires outbound network requests to communicate with the Claude API. Although the tool does not request explicit OS permissions and no hardcoded secrets were found, the underlying language could not be automatically scanned for vulnerabilities. The core design involves passing local context and executing commands based on AI responses, which demands high trust. Fortunately, it includes a hook system allowing users to restrict destructive actions (like `rm -rf`) or redact sensitive data before it reaches the model.
Quality Assessment
This is a very new and highly experimental personal project explicitly stated to be in heavy development. It is actively maintained, with repository updates as recent as today. However, it currently has no license, meaning legal rights to use or modify the code are undefined. Additionally, community trust is currently minimal, evidenced by very low visibility and only 5 GitHub stars.
Verdict
Use with caution—while the architecture is intriguing, the experimental status, high system access, unscanned codebase, and lack of a license make it strictly suited for isolated, non-sensitive testing environments rather than production use.
The composable agent development environment. Built in Zig. Modal. Extensible. Everything above the primitives is a plugin.
zag
A composable agent development environment. Built in Zig.
This is a personal, highly opinionated project in heavy development. I'm building it because I want to. It will be slow. It will take time. If you're here, you're early.
What is this
Zag is an AI coding agent where the window system is the platform. Splits, tabs, buffers, and focus are primitives. Everything above that is a plugin.
The session tree, git panel, file browser, even how agent responses render. All plugins. The core just manages composable containers and runs the agent loop.
Think Neovim's architecture, applied to AI agents.
Current state
Full-screen TUI with composable windows, a real Claude API agent with four tools (read, write, edit, bash), structured content as a tree of typed nodes, and vim-style window navigation.
~5,800 lines of Zig. Zero external dependencies. 4.9MB binary.
Hooks
Zag exposes a Neovim-style hook API via zag.hook(event, opts?, fn). Plugins can observe, veto, or rewrite agent events from Lua. Events include UserMessagePre, ToolPre, ToolPost, TurnStart, and TurnEnd. Return { cancel = true, reason = "..." } to veto, return a partial table to rewrite, return nil to observe.
-- Block destructive bash commands
zag.hook("ToolPre", { pattern = "bash" }, function(evt)
if evt.args.command:match("rm %-rf") then
return { cancel = true, reason = "refused destructive rm" }
end
end)
-- Redact API keys from file reads before they reach the model
zag.hook("ToolPost", { pattern = "read" }, function(evt)
local cleaned = evt.content:gsub("sk%-[%w%-]+", "[REDACTED]")
if cleaned ~= evt.content then
return { content = cleaned }
end
end)
-- Log each turn's token usage
zag.hook("TurnEnd", function(evt)
print(string.format("turn %d: %d in / %d out",
evt.turn_num, evt.input_tokens, evt.output_tokens))
end)
More examples in examples/hooks.lua. Design notes in docs/plans/2026-04-16-lua-hooks-design.md.
Modal editing
Zag is modal in the vim sense. Sessions start in insert mode (typing goes straight to the prompt). Press Esc to enter normal mode, where keys fire window bindings instead of appending to the input buffer. Press i to return. The status line carries a clear [INSERT] / [NORMAL] tag and the input line swaps the > prompt for a help hint, so the current mode is impossible to miss.
Default normal-mode bindings:
h/j/k/l— focus the window in that directionv/s— split vertically / horizontallyq— close the focused windowi— back to insert mode
Rebind any key from ~/.config/zag/config.lua:
zag.keymap("normal", "w", "focus_right")
More examples in examples/keymap.lua. Design notes in docs/plans/2026-04-17-modal-keymap-design.md.
Building
zig build # build
ANTHROPIC_API_KEY="..." zig build run # run
zig build test # test
Requires Zig 0.15+.
What's next
- Lua plugin system
- libghostty-vt integration
- Session persistence
- Tree-sitter context
- Multi-provider LLM support
Inspiration
Neovim, Ghostty, pi-mono, Amp.
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found