tmux-init
Set up tmux notification system for Claude Code sessions
What this skill does
# tmux-init
Set up a notification system for Claude Code that sends native macOS notifications when sessions need attention, with click-to-navigate support for tmux panes.
## Usage
```bash
/tmux-init # Install notification system
/tmux-init --status # Check installation status
/tmux-init --uninstall # Remove notification system
```
## What Gets Installed
1. **Configuration** in `~/bin/`:
- `hooks.json` - Webhook routing configuration
2. **Webhook service** (LaunchAgent):
- Listens on port 9000 for notification requests
- Auto-starts on login
3. **Shell environment** (added to ~/.zshrc):
- `WS_TMUX_LOCATION` - Current tmux session:window.pane
- `WS_TMUX_SESSION_NAME` - Current session name
- `WS_TMUX_WINDOW_NAME` - Current window name
4. **Claude hooks** (added to ~/.claude/settings.json):
- `Stop` hook - Calls `forge notify hook` when Claude finishes
- `Notification` hook - Calls `forge notify hook` when Claude needs input
5. **Python CLI commands**:
- `forge notify hook` - Sends notifications (called by Claude hooks)
- `forge tmux go` - Navigates to tmux location (called by webhook on click)
## Prerequisites
- macOS
- tmux
- Homebrew (for installing dependencies)
## Execution Instructions
### Parse Arguments
```bash
UNINSTALL=false
STATUS=false
for arg in "$@"; do
case "$arg" in
--uninstall) UNINSTALL=true ;;
--status) STATUS=true ;;
esac
done
```
### If --status: Check Installation Status
```bash
echo "=== Claude tmux Notification System Status ==="
echo ""
# Check dependencies
echo "Dependencies:"
command -v terminal-notifier &>/dev/null && echo " ✅ terminal-notifier" || echo " ❌ terminal-notifier (missing)"
command -v webhook &>/dev/null && echo " ✅ webhook" || echo " ❌ webhook (missing)"
command -v jq &>/dev/null && echo " ✅ jq" || echo " ❌ jq (missing)"
command -v tmux &>/dev/null && echo " ✅ tmux" || echo " ❌ tmux (missing)"
echo ""
# Check configuration and CLI commands
echo "Configuration:"
[ -f "$HOME/bin/hooks.json" ] && echo " ✅ ~/bin/hooks.json" || echo " ❌ ~/bin/hooks.json (missing)"
command -v forge &>/dev/null && echo " ✅ forge CLI" || echo " ❌ forge CLI (missing)"
forge notify hook --help &>/dev/null && echo " ✅ forge notify hook" || echo " ❌ forge notify hook (missing)"
forge tmux go --help &>/dev/null && echo " ✅ forge tmux go" || echo " ❌ forge tmux go (missing)"
echo ""
# Check LaunchAgent
echo "Webhook Service:"
PLIST="$HOME/Library/LaunchAgents/com.claude.webhook.plist"
if [ -f "$PLIST" ]; then
if launchctl list | grep -q "com.claude.webhook"; then
echo " ✅ LaunchAgent installed and running"
else
echo " ⚠️ LaunchAgent installed but not running"
fi
else
echo " ❌ LaunchAgent not installed"
fi
echo ""
# Check webhook port
echo "Webhook Port:"
if curl -s http://localhost:9000/hooks/claude-notify -o /dev/null -w "%{http_code}" | grep -q "200\|405"; then
echo " ✅ Port 9000 responding"
else
echo " ❌ Port 9000 not responding"
fi
echo ""
# Check shell environment
echo "Shell Environment:"
if grep -q "WS_TMUX_LOCATION" "$HOME/.zshrc" 2>/dev/null; then
echo " ✅ tmux env vars in ~/.zshrc"
else
echo " ❌ tmux env vars not in ~/.zshrc"
fi
echo ""
# Check Claude hooks via webhook log
echo "Claude Hooks (check log for activity):"
LOG_FILE="$HOME/Library/Logs/claude-webhook/webhook.log"
if [ -f "$LOG_FILE" ]; then
RECENT_LINES=$(tail -5 "$LOG_FILE" 2>/dev/null)
if [ -n "$RECENT_LINES" ]; then
echo " Recent webhook log entries:"
echo "$RECENT_LINES" | sed 's/^/ /'
else
echo " ⚠️ Log file exists but is empty"
fi
echo ""
echo " To verify hooks are working, trigger a Claude stop event"
echo " and check: tail -f ~/Library/Logs/claude-webhook/webhook.log"
else
echo " ⚠️ No log file yet at ~/Library/Logs/claude-webhook/webhook.log"
echo " Log will be created when first notification is received"
fi
```
Exit after showing status.
### If --uninstall: Remove Installation
```bash
echo "=== Uninstalling Claude tmux Notification System ==="
echo ""
# Stop and remove LaunchAgent
PLIST="$HOME/Library/LaunchAgents/com.claude.webhook.plist"
if [ -f "$PLIST" ]; then
echo "Stopping webhook service..."
launchctl unload "$PLIST" 2>/dev/null || true
rm -f "$PLIST"
echo " ✅ LaunchAgent removed"
fi
# Remove configuration
echo "Removing configuration..."
rm -f "$HOME/bin/hooks.json"
echo " ✅ Configuration removed"
# Note: Don't remove shell env or Claude hooks automatically
echo ""
echo "Manual cleanup (optional):"
echo " - Remove WS_TMUX_* lines from ~/.zshrc"
echo " - Remove Stop/Notification hooks from ~/.claude/settings.json"
echo ""
echo "✅ Uninstallation complete"
```
Exit after uninstalling.
### Install: Full Setup
Run the automated installer:
```bash
forge webhook init
```
This command will:
1. Install dependencies (terminal-notifier, webhook, jq)
2. Create webhook configuration (~/bin/hooks.json)
3. Set up LaunchAgent for webhook service
4. Configure Claude Code hooks to call `forge notify hook`
5. Set up shell environment (tmux env vars)
After installation:
```bash
# Check status
forge webhook status
# Restart your shell
source ~/.zshrc
# Start a new tmux session and run Claude Code
# You'll receive notifications when Claude finishes or needs input
```
## Troubleshooting
### Notifications not appearing
1. Check if webhook is running:
```bash
launchctl list | grep claude.webhook
```
2. Check webhook logs:
```bash
tail -f ~/Library/Logs/claude-webhook/webhook.log
```
3. Test webhook manually:
```bash
curl -X POST -H "Content-Type: application/json" \
-d '{"tmux_location":"test:0.0","hook_event_name":"Stop"}' \
http://localhost:9000/hooks/claude-notify
```
### Click doesn't navigate to pane
1. Ensure tmux env vars are set:
```bash
echo $WS_TMUX_LOCATION
```
2. Test navigation command:
```bash
forge tmux go "session:0.0"
```
### Webhook won't start
1. Check if port 9000 is in use:
```bash
lsof -i :9000
```
2. Try restarting:
```bash
launchctl unload ~/Library/LaunchAgents/com.claude.webhook.plist
launchctl load ~/Library/LaunchAgents/com.claude.webhook.plist
```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.