Skip to content

Status Hooks

Status hooks let you run custom commands when a session’s state changes. This is useful for notifications, logging, or triggering automations.

You can configure hooks for each state transition:

HookTriggers When
On IdleSession finishes working and is ready for input
On BusySession starts processing a request
On Waiting InputSession needs your confirmation or input
On Pending Auto-ApprovalSession is being evaluated for auto-approval

The WebUI makes it easy to set up status hooks:

  1. Click the gear icon in the header to open Settings
  2. Select Status Hooks from the sidebar
  3. Enter a shell command for each state you want to hook
  4. Toggle the hook on with the checkbox
  5. Click Save Changes
Screenshot: Settings → Status Hooks panel with notification commands configured

Your hook commands have access to these variables:

VariableDescription
CACD_WORKTREE_PATHPath to the session’s worktree
CACD_WORKTREE_BRANCHBranch name of the worktree
CACD_GIT_ROOTRoot of the Git repository
CACD_SESSION_IDUnique ID of the session
CACD_OLD_STATEPrevious state (idle, busy, waiting_input)
CACD_NEW_STATENew state

Get notified when a session needs attention:

Terminal window
osascript -e 'display notification "Session needs input" with title "CACD"'
Terminal window
notify-send "CACD" "Session needs input"

Log state changes to a file:

Terminal window
echo "$(date): $CACD_SESSION_ID changed from $CACD_OLD_STATE to $CACD_NEW_STATE" >> ~/.cacd-log.txt
Terminal window
afplay /System/Library/Sounds/Ping.aiff
Terminal window
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"CACD session waiting for input"}' \
YOUR_WEBHOOK_URL
  • Keep hooks fast - slow commands will delay state updates
  • Hook failures don’t break CACD, but check your commands work standalone first
  • Use On Waiting Input for notifications - that’s when you need to act
  • Combine with terminal multiplexers or window managers to auto-focus CACD when needed