Allow hooks to spawn Monitor or invoke tools directly

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened Apr 16, 2026 · closed Apr 16, 2026

Feature Request: Allow hooks to spawn Monitor (or invoke tools)

Problem

Today, hooks can only output text that becomes system reminders. If a hook detects a meaningful event (e.g. git push to a branch with an open PR), the only way to start background monitoring is through an indirect pipeline:

  1. Hook outputs a reminder
  2. Claude reads the reminder
  3. Claude invokes a skill
  4. The skill tells Claude to call Monitor

This works but has friction: it depends on Claude interpreting the reminder correctly every time, it consumes context window, and the user has no guarantee the Monitor actually starts.

Proposed Solution

Allow hooks to return a structured response that directly spawns a Monitor (or more generally, invokes a tool). For example, a PostToolUse hook could return:

{
  "tools": [
    {
      "name": "Monitor",
      "input": {
        "command": "bash ~/.claude/skills/watch-pr-checks/scripts/poll-checks.sh 123",
        "description": "PR #123 CI checks",
        "persistent": true,
        "timeout_ms": 3600000
      }
    }
  ]
}

Use Case

I built a watch-pr-checks skill that monitors GitHub CI checks for the current PR via Monitor. A PostToolUse hook detects git push and gh pr create and should automatically start the monitor. Today the hook can only suggest that Claude start the monitor; it can't guarantee it.

This pattern generalizes: any hook that wants to start a background watcher, trigger a build, or kick off a long-running process after detecting a specific event would benefit from direct tool invocation.

Alternatives Considered

  • Hook reminder → Skill → Monitor: Current approach. Works but is indirect and fragile.
  • Hook starts a background process directly: The process runs outside Claude's context, so Monitor notifications don't reach the conversation.

View original on GitHub ↗

3 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/34104
  2. https://github.com/anthropics/claude-code/issues/26112
  3. https://github.com/anthropics/claude-code/issues/43671

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

emmahyde · 6 months ago

Duplicate of #34104 — closing in favor of the existing request.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.