Herdr plugin that automatically opens a hunk diff in a split pane whenever a coding agent (Claude Code, Codex, etc.) finishes a turn with uncommitted changes.
No keybinding, no manual action — when the agent in a pane goes idle and its working tree is dirty, a split opens on the right running hunk diff --watch. Focus stays on the agent pane.
herdr plugin install scott306lr/herdr-plugin-hunk-autodiffOn every pane.agent_status_changed event where the agent becomes idle:
- Resolves the pane's cwd; exits silently unless it is inside a git repo with working-tree changes.
- If a hunk session is already live for that repo (
hunk session get --repo), does nothing — the existing pane's--watchkeeps it fresh. - If the diff is unchanged since a pane was last opened for it, does nothing — closing the hunk pane keeps it closed until new changes appear.
- Otherwise splits the agent's pane to the right (
--no-focus), labels ithunk, and runshunk diff --watch.
- Herdr
0.7.0or newer python3hunk(orbunx hunkdiffas fallback)- An agent integration that reports agent state to herdr (
herdr integration install claude,codex, …)
- Herdr runs plugin event hooks with a minimal
PATH; the plugin resolveshunkfrom common install locations (/opt/homebrew/bin,/usr/local/bin,~/.local/bin). - Diff signatures are stored under the plugin state dir (
HERDR_PLUGIN_STATE_DIR), one small file per repo.
MIT