Back to Projects

dotfiles agent & exit-code hooks

A tmux alert system in my dotfiles: AI coding agents and long commands raise status-bar icons when they need attention or finish, and clear when you switch back.

dotfiles agent & exit-code hooks

Technologies Used

ShellShelltmuxtmuxNeovimNeovim

About the Project

Part of my dotfiles: a hook system that surfaces what's happening in other tmux windows on the status bar. When an AI coding agent (Claude Code, Codex, OpenCode, Copilot) stops and waits for input, a thin wrapper fires, sets a tmux window option, and writes to an alerts file the status bar reads, showing which session needs you. The same machinery handles command exit codes: a zsh precmd hook flags any command that finishes while you're away, highlighting the window tab green or red and showing a pass/fail icon for other sessions. Alerts clear automatically when you switch back, and adding a new agent is just a new pair of wrapper scripts.

Key Features

  • Per-agent status-bar icons and colours for Claude, Codex, OpenCode, and Copilot when an agent waits for input
  • Command exit-code alerts: pass/fail icons and window-tab colours for long commands that finish while you're away
  • zsh preexec/precmd hooks with zero overhead on the command itself
  • Status-bar entries show session:command for context across other sessions; same-session alerts just highlight the tab
  • Alerts clear automatically on switching back to the window
  • Thin wrapper-per-agent design over shared core scripts, so a new agent is a new pair of wrappers
  • Built on plain shell, zsh, and tmux primitives, no daemons or dependencies