Claude Code Monitor Examples
An example Claude Code plugin. It ships background monitors
that keep Claude aware of workspace state and signal it when something needs
attention, plus skills, a read-only subagent, and hooks — a skill frontmatter
hook and a hooks/hooks.json with three
context-injection examples plus an agent-scoped
guard. See Design notes for how the hooks are
scoped.
Each monitor runs a shell command for the lifetime of the session and forwards
every stdout line to Claude as a notification. The scripts are change-only:
they stay silent until there is real signal, so every notification means Claude
should act.
Documentation
Requirements
- Claude Code v2.1.105 or later (plugin monitors).
- Monitors run only in interactive CLI sessions, run unsandboxed at hook
trust level, and are skipped where the Monitor tool is unavailable.
- The
deploy-watch auto-detect helpers expect the relevant provider CLI
(gh, flyctl, or vercel) on PATH; otherwise set deploy_status_command.
Install
/plugin marketplace add magic-man-us/claude-code-monitor-examples
/plugin install claude-code-monitor-examples@magic-man-us
You'll be prompted for the configuration options below at enable time (all are
optional or have defaults). Reconfigure later from /plugin.
Monitors
| Monitor | Starts | Watches | Key options |
|---|
git-upstream | always | Current branch drifting ahead/behind its upstream; tells Claude when to pull, push, or reconcile | git_poll_seconds |
error-log | always | Error-like lines in a log file (tail -F, survives rotation, error lines only) | log_file |
disk-usage | always | Workspace disk usage crossing a threshold (warns once, recovers once) | disk_threshold_pct |
deploy-status | always | An HTTP(S) status endpoint changing state | api_endpoint, api_token |
deploy-watch | on /app-deploy | Live deploy tracking — signals when a deploy completes or fails | deploy_status_command, deploy_detect_mode, deploy_poll_seconds, deploy_success_pattern, deploy_failure_pattern |
Monitors whose required option is unset disable themselves quietly with a single
notice (e.g. error-log with no log_file).
Configuration
| Option | Type | Default | Used by |
|---|
git_poll_seconds | number (min 15) | 60 | git-upstream |
log_file | file | — | error-log |
disk_threshold_pct | number (50–99) | 90 | disk-usage |
api_endpoint | string | — | deploy-status |
api_token | string (sensitive) | — | deploy-status |
deploy_status_command | string | auto-detect | deploy-watch |
deploy_detect_mode | string (keywords|exitcode) | keywords | deploy-watch |
deploy_poll_seconds | number (min 5) | 15 | deploy-watch |
deploy_success_pattern | string (regex) | success keywords | deploy-watch |
deploy_failure_pattern | string (regex) | failure keywords | deploy-watch |
Sensitive values (api_token) are stored in the system keychain and passed to
the script as an environment variable, never on the command line. Token-bearing
status checks require https://, except for localhost endpoints.
Live deploy tracking: /app-deploy
Run /app-deploy when you kick off a deployment. That starts the deploy-watch
monitor, which runs a status command on a loop and notifies you when the deploy
completes or fails — no polling. It prefers a scoped .claude/deploy-status.sh,
then auto-detects GitHub Actions / Fly / Vercel, or uses deploy_status_command.
Custom deploy_status_command values are shell commands run unsandboxed on a
loop; prefer a scoped .claude/deploy-status.sh for project-specific tooling.
To track internal or custom tooling, run the deploy-watch-setup skill.
Full details — detection precedence, detect modes (keywords/exitcode), and
the scoped-script contract — are in
docs/deploy-tracking.md.
Design notes & limitations