Series: Ccmanager (9/10)

Status Hooks: Let AI Agents Notify You When They're Done
One of the biggest time sinks when running AI Agents: waiting for them.
The Agent is running. You're sitting there watching. Nothing to do, but you're afraid to switch tasks in case it gets stuck and you miss the signal. This passive waiting kills efficiency — CCManager's Status Hooks exist to solve exactly this.
What Status Hooks Are
Simply put: when an Agent's status changes, automatically run the command you specify.
There are three states:
- idle: Agent is free, ready for a new task
- busy: Agent is currently processing
- waiting (most important): Agent needs your input or confirmation — requires your attention
Each state can have a corresponding hook. When the status transitions, the hook fires automatically.
Configuring Hooks
From the CCManager main menu: Global Configuration → Configure Status Hooks
Set a command for each of the three states:
Idle Hook (fires when Agent goes idle):
noti -t "AI Agent" -m "Task complete, ready for new instructions [$CCMANAGER_WORKTREE_BRANCH]"Waiting Hook (fires when Agent is waiting for you):
noti -t "AI Agent" -m "Your input needed! [$CCMANAGER_WORKTREE_BRANCH]"Busy Hook (fires when Agent starts processing):
noti -t "AI Agent" -m "Agent started working [$CCMANAGER_WORKTREE_BRANCH]"The examples above use noti, a cross-platform desktop notification tool. Install via Homebrew:
brew install notiEnvironment Variables Available in Hooks
Every time a hook fires, CCManager passes in a set of environment variables so you can include context in your notification messages:
| Variable | Description |
|---|---|
$CCMANAGER_OLD_STATE |
The previous state (idle / busy / waiting_input) |
$CCMANAGER_NEW_STATE |
The new state |
$CCMANAGER_WORKTREE_PATH |
Full path to the Worktree |
$CCMANAGER_WORKTREE_DIR |
Worktree directory name (basename) |
$CCMANAGER_WORKTREE_BRANCH |
Git branch name for this Worktree |
$CCMANAGER_SESSION_ID |
Unique identifier for the session |
Branch name is the most useful — when you're running three Agents simultaneously, including the branch name in the notification message tells you at a glance which one is calling for attention.
Advanced: Fire a Slack Webhook
Beyond desktop notifications, you can have Agent state changes send messages directly to Slack:
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"[$CCMANAGER_WORKTREE_BRANCH] Status: $CCMANAGER_NEW_STATE\"}" \
YOUR_SLACK_WEBHOOK_URLReplace YOUR_SLACK_WEBHOOK_URL with your Slack Incoming Webhook URL, and your Slack channel will receive Agent status updates. Great for team workflows, or if you manage all notifications through Slack.
Pairing with the tmux Status Bar
If you're also running tmux alongside CCManager, you can display the Agent's latest status in the tmux status bar:
tmux set -g status-right "Agent: $CCMANAGER_NEW_STATE [$CCMANAGER_WORKTREE_BRANCH]"A Few Practical Tips
Just setting the waiting hook is usually enough — idle and busy notifications tend to become background noise that you quickly learn to ignore. waiting is the only state where you actually need to be woken up.
Test the command in your terminal first before pasting it into the Hook configuration. Hook failures are silent — you won't know if something went wrong.
Hooks run in the Worktree directory — if your scripts use relative paths, account for this.
With notifications configured, you can go do other work and let the Agent come to you when it needs something.
The final article in the series: Multi-Project Mode: Manage All Your Repos from One Interface — if you have multiple repos running at the same time, this feature is worth knowing about.