kizu
Realtime diff monitor + inline scar review TUI for AI coding agents — Claude Code, Cursor, Codex, Qwen Code, Cline, Gemini.

What it does
While a terminal AI coding agent (Claude Code, Cursor, …) edits files in one pane, kizu sits in another and shows you what changed in real time. When something looks wrong, you press one key and a @kizu[ask|reject|free]: comment is written into the source file at the change site. The agent picks it up on its next read — or on the next Stop hook firing — and fixes it without you having to type a sentence.
kizu is designed around three frictions of watching an agent stream output out of the corner of your eye:
- You miss the detail. Streaming output flies by; the moment you think "wait, what?" the line is already gone.
- Articulating the problem is annoying. You feel something is wrong but you can't put it into words quickly enough.
- Even when you do articulate it, the agent fixes the wrong thing. Vague human prose becomes vague agent interpretation.
kizu's answer is the precision of pointing: capture every change, let the human point with one keystroke, and the language problem disappears.
Status
Alpha (v0.3). TUI, scar review, multi-agent hook integration + init/teardown, stream mode, --attach terminal auto-split, ~/.config/kizu/config.toml, scar undo, and a Claude Code plugin are all implemented. Roadmap and phase history live in docs/SPEC.md.
Install
From crates.io
From source
Requirements
- Rust 1.94+ (edition 2024)
gitCLI onPATH- macOS or Linux. Windows is untested.
--attachfor Ghostty is macOS-only (AppleScript); tmux / zellij / kitty splits work on both macOS and Linux.
Quickstart
Start by running kizu as a passive observer — no hooks, no scars, just a diff pane that follows your working tree.
Let your agent edit files in another pane; kizu redraws on every change. Press q to quit.
That's the v0.1 value proposition: you stop losing the "wait, what?" moments. Once that feels useful, wire up the scar workflow so you can react to a change in one keystroke (see AI agent integration below).
Usage
Three views
kizu is a single TUI with three modes. Tab toggles between Main and Stream; Enter zooms into File.
| Key | View | What you see |
|---|---|---|
| (default) | Main diff | Per-file hunks based on git diff <session-baseline>. Added lines on dark green, deleted on dark red. Hunks are merged the way git sees them. |
Tab |
Stream mode | Per-operation history of what the agent actually did, one entry per Write/Edit/MultiEdit tool call. Backed by the hook-log-event JSON log, not by git. |
Enter |
File view | The whole file under the cursor, with added lines highlighted inline. Useful when hunk context isn't enough. Enter / Esc closes. |
Scars
A scar is an inline comment kizu writes directly into your source file, using the target language's comment syntax:
// @kizu[ask]: why is this null-safe?
# @kizu[reject]: revert this change — we shouldn't be touching this file
<!-- @kizu[free]: elaborate on the edge case here -->
Three kinds:
ask(a) — a question. The agent is expected to answer inline and resume.reject(r) — a veto. The agent is expected to undo the change.free(c) — freeform text. You type the body; anything goes.
Scars are idempotent — pressing a twice on the same line is a no-op. u undoes the last scar you wrote in this session.
The feedback path back to the agent has two channels:
- PostToolUse hook fires after each edit. If the just-edited file contains a scar, the hook surfaces it to the agent as
additionalContextso the agent sees it on its very next step. - Stop hook fires when the agent tries to finish its turn. If any unresolved scar remains in the repo, the hook exits non-zero and the agent is forced to keep working.
More
--attach— runkizu --attachfrom inside an agent pane to auto-split the terminal (tmux / zellij / kitty / Ghostty) and launch kizu in the new pane. Detection falls back to$TMUX→$ZELLIJ→$KITTY_LISTEN_ON→$TERM_PROGRAM=ghostty; override with[attach].terminalin the config.- Search (
/nN) — smart-case search across the current view,n/Njump between matches with wrap-around. - Scar undo (
u) — a session-local stack that reverses just the most recent scar write, matching text-editor undo ergonomics. - Baseline reset (
R) — rebinds the diff baseline to the currentHEAD. Useful after you commit mid-session and want kizu to forget the already-reviewed changes. - Follow (
f) — toggles whether kizu auto-scrolls to the newest change vs. keeps the cursor pinned.
Keybinds
Scar
| Key | Action |
|---|---|
a |
Insert @kizu[ask]: scar above the current line |
r |
Insert @kizu[reject]: scar |
c |
Open comment input and insert a freeform @kizu[free]: scar |
x |
Revert the current hunk (git checkout -- <file> at hunk scope) |
e |
Open $EDITOR at the current hunk |
Space |
Mark the current hunk as "seen" (dim it without writing a scar) |
u |
Undo the most recent scar insertion |
Navigation
| Key | Action |
|---|---|
j / ↓ |
Next line (adaptive: snaps through runs of unchanged lines) |
k / ↑ |
Previous line |
J |
Down one line (fine-grained) |
K |
Up one line |
g |
Top of diff |
G |
Bottom of diff |
h |
Previous file |
l |
Next file |
s |
Open file picker |
Search
| Key | Action |
|---|---|
/ |
Open search input (smart-case) |
n |
Next match (wraps) |
N |
Previous match |
View
| Key | Action |
|---|---|
Tab |
Toggle Main diff ↔ Stream mode |
Enter |
Open File view for the current file |
Esc |
Close File view / cancel input |
w |
Toggle line wrap |
z |
Toggle cursor placement style |
f |
Toggle follow (auto-scroll) |
Session
| Key | Action |
|---|---|
R |
Reset diff baseline to current HEAD |
q / Ctrl-C |
Quit |
Configuration
kizu reads ~/.config/kizu/config.toml (override with $KIZU_CONFIG). Every field is optional — a partial TOML merges cleanly with the defaults below.
# ~/.config/kizu/config.toml — all defaults shown
[]
= "a"
= "r"
= "c"
= "x"
= "e"
= " "
= "f"
= "/"
= "n"
= "N"
= "s"
= "R"
= "z"
= "w"
= "u"
[]
= [10, 50, 10] # dark green, delta-style
= [60, 10, 10] # dark red
[]
= 300 # worktree file changes
= 100 # HEAD / refs / packed-refs
[]
= "" # empty = use $EDITOR
[]
= "" # empty = auto-detect; "tmux" | "zellij" | "kitty" | "ghostty"
Non-character keys (Enter, Tab, arrows) are not remappable in v0.3.
AI agent integration
kizu wires itself into an agent's hook system with one command:
The interactive flow detects installed agents, asks which scope to install into (project-local, project-shared, or user), and writes the hook config into the right settings file. Non-interactive usage:
kizu teardown removes everything kizu installed, across all agents and scopes.
Supported agents
| Agent identifier | Notes |
|---|---|
claude-code |
PostToolUse + Stop hooks, session binding, pre-commit scar block |
cursor |
PostToolUse + Stop hooks via the session_id binding |
codex |
PostToolUse + Stop hooks |
qwen |
PostToolUse + Stop hooks |
cline |
Config-dir detection, PostToolUse + Stop hooks |
gemini |
PostToolUse + Stop hooks |
See docs/deep-research-ai-agent-hooks.md for the full per-agent survey and docs/claude-code-hooks.md for the Claude Code hook schema and infinite-loop pitfalls.
Hook roles
kizu init installs up to three hooks per agent:
- PostToolUse →
kizu hook-post-tool(per-file scar notification) +kizu hook-log-event(async event log that feeds Stream mode). - Stop →
kizu hook-stopscans tracked + untracked files; any unresolved@kizu[...]blocks the agent from finishing. - Git
pre-commit→kizu hook-pre-commitblocksgit commitwhen staged files still contain scars, so reviews can't escape into a commit by accident.
Stack
- Rust 2024 edition
- ratatui + crossterm for the TUI
- notify + notify-debouncer-full for filesystem watching
gitCLI shelled out for diff computation (git diff --no-renames <baseline> --) — see ADR-0001
Development
Local workflow is driven by just; see justfile for all recipes.
Raw cargo commands work too:
Architecture, design decisions, and the canonical specification:
docs/SPEC.md— full specification (v0.1 → v0.3, architecture, TUI/hook layer schemas)docs/adr/— Architecture Decision Records for non-reversible design choices (git CLI shell-out, notify-debouncer-full, tuistory e2e, stream mode, …)docs/inline-scar-pattern.md— the file-write + Stop-hook async review pattern (kizu's core mechanism)docs/related-tools.md— survey of diffpane / diffwatch / revdiff / watchexec+delta / hwatch / Claude Code Hooks pipelines
Issues and PRs welcome.
License
MIT. See LICENSE.