{
  "markdown": "# claude-code-notify\n\nSmart desktop notifications for [Claude Code](https://claude.com/claude-code). Get notified when Claude finishes responding — with session name, last message, and tmux context. Focus-aware: won't bother you if you're already looking.\n\n## What It Does\n\nWhen Claude Code stops and is waiting for your input, you get a notification like:\n\n```\n(w:2) my-project\nFixed the authentication bug by updating the session config...\n```\n\n- **Session name** from `/rename` (falls back to directory name)\n- **Last message** — first 80 chars of what Claude said\n- **tmux window index** — so you know where to switch\n- **Focus-aware** — no notification if you're already looking at the session\n\n## Install\n\n### As a Claude Code Plugin\n\n```bash\n# Clone the repo\ngit clone https://github.com/decko/claude-code-notify.git ~/.claude/plugins/claude-code-notify\n\n# Enable in Claude Code\nclaude plugins add claude-code-notify\n```\n\n### Manual\n\nCopy `hooks/stop-hook.sh` and register in your `~/.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"Stop\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash /path/to/stop-hook.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Requirements\n\n- `jq` — JSON parsing\n- `notify-send` (Linux) or `osascript` (macOS) — notifications\n- `tmux` (optional) — focus detection and window index\n- `bash` 4+\n\n### Installing Dependencies\n\n**Fedora/RHEL:**\n```bash\nsudo dnf install jq libnotify\n```\n\n**Ubuntu/Debian:**\n```bash\nsudo apt install jq libnotify-bin\n```\n\n**macOS:**\n```bash\nbrew install jq\n# osascript is built-in\n```\n\n## Configuration\n\nSet environment variables in your shell profile (`.bashrc`, `.zshrc`):\n\n| Variable | Default | Description |\n|---|---|---|\n| `CLAUDE_NOTIFY_CONTEXT` | `false` | Show `[Work]`/`[Personal]` prefix |\n| `CLAUDE_NOTIFY_URGENCY` | `normal` | Urgency: `low`, `normal`, `critical` |\n\nExample:\n```bash\nexport CLAUDE_NOTIFY_CONTEXT=true\nexport CLAUDE_NOTIFY_URGENCY=normal\n```\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `/notify-help` | Show configuration and status |\n| `/notify-test` | Send a test notification |\n\n## Use Cases\n\n- **Multi-session development in tmux** — Running Claude in 3-4 tmux panes working on different tasks (tests, refactoring, docs). Get notified exactly when each session needs your attention, without constantly switching panes to check.\n\n- **Long-running operations** — Kick off a complex task (large codebase refactor, test suite run, dependency upgrade) and switch to other work. The notification tells you when Claude is done and what it said.\n\n- **Code review while Claude works** — Send Claude a task, switch to your browser to review a PR or read docs. The notification pops up when Claude needs your input, with enough context in the body to decide if it's urgent.\n\n- **Pair programming across projects** — Working on a primary project while Claude handles a side task in another session. The window index in the notification (`w:2`) tells you exactly which tmux window to jump to.\n\n- **Meeting multitasking** — Start a Claude task before a meeting, get a notification when it's done. Check it when the meeting ends.\n\n## Focus Detection\n\nThe plugin suppresses notifications when you're already looking at the Claude session:\n\n| Environment | Method | Notes |\n|---|---|---|\n| tmux | Pane + window + terminal focus | Best experience |\n| macOS (no tmux) | Frontmost app check | Detects Terminal, iTerm2, kitty, etc. |\n| Linux (no tmux) | Always notify | Wayland limits focus detection |\n\n## How It Works\n\n1. Claude Code fires the Stop hook when it finishes responding\n2. The hook reads the payload (session ID, last message, transcript path)\n3. Checks if the tmux pane is focused — skips notification if so\n4. Resolves the session name from `/rename` history in the transcript\n5. Sends a notification with session name and last message\n\n## Interaction with Other Plugins\n\nIf another Stop hook (like ralph-loop) continues the conversation, the `stop_hook_active` flag is set and this plugin skips the notification. Due to non-deterministic hook ordering, occasional false-positive notifications may occur when ralph-loop is active.\n\n## License\n\nMIT\n",
  "bytes": 4209,
  "sha": "2f5067fc00404a473c30cc0050b72e26d15dd680e53d4ff9d182d6a766829bc6",
  "repo_slug": "decko/claude-code-notify",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_decko_claude_code_notify_claude_code_not_8a638708/readme"
}