Skip to main content

Claude Code tmux watchdog — auto-unblock permission dialogs

Project description

claude-watchdog

English | 中文

Claude Code tmux watchdog — auto-unblock permission dialogs so you don't have to stare at a blocked session.

Only logs hits (blockage detected and cleared), silent otherwise.

Install

pip install claude-watchdog

Usage

# Daemon management
claude-watchdog start              # Start (default: monitor all claude-* sessions)
claude-watchdog stop               # Stop
claude-watchdog restart            # Restart
claude-watchdog status             # Show status + session states

# Log viewer
claude-watchdog log                # Tail -f by default
claude-watchdog log --no-follow    # Show recent N entries, then exit
claude-watchdog log --session claude-tl  # Filter by session

# One-shot check (legacy syntax still works)
claude-watchdog --session claude-tl
claude-watchdog --all --daemon
claude-watchdog --session claude-tl --daemon
claude-watchdog --session claude-tl --daemon --alert-only
claude-watchdog --log
claude-watchdog --log --follow

Notify on hit

When a blockage is detected and cleared, claude-watchdog can notify you. Pass --notify (or -n) to enable. Examples:

# Integrated: via hermes-notify (bus message, silent progress type)
claude-watchdog --session claude-tl --daemon --notify

# DIY: pipe stdout to anything you want

# HTTP webhook (Slack/Telegram/Discord/any API)
claude-watchdog --session claude-tl --daemon | while read line; do
  curl -s -X POST https://hooks.slack.com/services/xxx/yyy/zzz \
    -H "Content-Type: application/json" \
    -d "{\"text\": \"$line\"}"

  curl -s -X POST "https://api.telegram.org/bot<TOKEN>/sendMessage" \
    -d "chat_id=<CHAT_ID>&text=$line"
done

# MCP notification (Model Context Protocol — tools with notifications)
claude-watchdog --session claude-tl --daemon | while read line; do
  curl -s -X POST http://localhost:8080/mcp/notify \
    -H "Content-Type: application/json" \
    -d "{\"jsonrpc\": \"2.0\", \"method\": \"notifications/message\", \
         \"params\": {\"severity\": \"warning\", \"message\": \"$line\"}}"
done

# macOS notification
claude-watchdog --session claude-tl --daemon | while read line; do
  osascript -e "display notification \"$line\" with title \"Watchdog\""
done

# WeChat (via notify-hermes.py)
claude-watchdog --session claude-tl --daemon | while read line; do
  ~/.hermes/scripts/notify-hermes.py --type progress "Watchdog: $line"
done

The --notify flag auto-detects hermes-notify if installed. No hard dependency — without it, --notify is a no-op.

Rules

Pattern Keys Description
Do you want to proceed 1 + Enter Tool confirmation dialog
Do you want to (make this edit|overwrite) Down + Enter Allow all edits this session
accept edits on Enter Accept pending diffs
Detected a custom API key Up + Enter Confirm custom API key
Interrupted 2 + Enter Bypass/continue after interruption
Rate this response / 评价 / 评分 Escape Dismiss evaluation dialog

New patterns can go into ~/.config/claude-watchdog/rules.toml (future).

Log

Hits are logged to ~/.local/share/claude-watchdog/hits.log as JSONL:

{"ts": "2026-05-18 09:15:23", "session": "claude-tl", "rule": "bypass_permissions", "detail": "Permission bypass prompt — confirm bypass"}

Architecture

cli.py ── session/daemon/log ──→ watcher.py ── tmux capture-pane
                                        │
                                        ↓ rules.py
                                   pattern match?
                                   ├─ yes → send-keys + log [+ notify]
                                   └─ no  → silent

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_watchdog-0.1.9.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_watchdog-0.1.9-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_watchdog-0.1.9.tar.gz.

File metadata

  • Download URL: claude_watchdog-0.1.9.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for claude_watchdog-0.1.9.tar.gz
Algorithm Hash digest
SHA256 9ba2426399cd6b10f271e0eebc0c9cf58b7ee30205fea487ca02de4952bfd0b7
MD5 be7ebcbd8ffc5a5e0299b0c7047dd0f5
BLAKE2b-256 52c6c88bc83b82b0204be7f0693814e5d9a108d0186f164561661bbbe6eeb480

See more details on using hashes here.

File details

Details for the file claude_watchdog-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_watchdog-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 18129c29877a9da33d6150868550fcf93c45486f252d1a9ddf133c5f6440ccd1
MD5 a5d59f6d9da6ff1fb7edc0f49b997146
BLAKE2b-256 429263cf8420e8824d360b822995a6112d39937a7069be00940ba71321e6ac0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page