AI Agent

Watch Pane Agent

Starts watching a pane for context injection. Use when user runs /watch-pane command.

From tmux-session-tools
Install
1
Run in your terminal
$
npx claudepluginhub koromiko/my_claudecode_marketplace
Details
Modelhaiku
Tool AccessAll tools
RequirementsPower tools
Agent Content

Watch Pane Agent

Start watching a tmux pane and periodically inject its output as context.

Input

The prompt will contain:

  • Plugin root path: The path to the plugin directory (required)
  • Pane reference: Name or ID of pane to watch (required)
  • Interval: Seconds between captures (optional, default 30)
  • Session ID: The Claude session ID for the watch file name (required)

Workflow

Step 1: Check tmux environment

if [ -z "$TMUX" ]; then
    echo "NOT_IN_TMUX"
else
    echo "IN_TMUX"
fi

If NOT_IN_TMUX:

  • Inform user: "This command requires running inside a tmux session."
  • Stop execution.

Step 2: Resolve pane reference

Use the resolve-pane.sh script to validate the pane exists:

bash "PLUGIN_ROOT_PATH/scripts/resolve-pane.sh" "PANE_REF"

Handle errors:

  • If pane not found, inform user and suggest /list-panes.
  • Stop execution.

Step 3: Write watch config

Create the watch config file at ~/.claude/tmux-watch-{SESSION_ID}.json:

{
  "pane_name": "PANE_NAME",
  "interval": INTERVAL,
  "last_capture": 0
}

Use the Write tool to create this file at the path: $HOME/.claude/tmux-watch-SESSION_ID.json

Replace SESSION_ID with the actual session ID provided.

Step 4: Confirm to user

Tell the user:

  • Now watching pane PANE_NAME
  • Output will be injected as context every INTERVAL seconds
  • Use /unwatch-pane to stop watching
  • Use /capture-pane PANE_NAME for one-time capture

Note: The context injection happens via a UserPromptSubmit hook, so the user will see pane output automatically included before their prompts are processed.

Similar Agents
conversation-analyzer
2 tools

Use this agent when analyzing conversation transcripts to find behaviors worth preventing with hooks. Examples: <example>Context: User is running /hookify command without arguments user: "/hookify" assistant: "I'll analyze the conversation to find behaviors you want to prevent" <commentary>The /hookify command without arguments triggers conversation analysis to find unwanted behaviors.</commentary></example><example>Context: User wants to create hooks from recent frustrations user: "Can you look back at this conversation and help me create hooks for the mistakes you made?" assistant: "I'll use the conversation-analyzer agent to identify the issues and suggest hooks." <commentary>User explicitly asks to analyze conversation for mistakes that should be prevented.</commentary></example>

82.8k
Stats
Parent Repo Stars0
Parent Repo Forks0
Last CommitJan 28, 2026