claude-code - 💡(How to fix) Fix Plugin monitors/monitors.json auto-arm silently fails on 2.1.118 [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52245Fetched 2026-04-24 06:12:19
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Claude Code 2.1.118 does not auto-arm monitors declared in a plugin's monitors/monitors.json at session start. The docstring for Monitor tool / plugin loading (in the 2.1.118 binary) states that persistent monitors declared in monitors.json at the plugin root are armed as persistent Monitor tasks at session start. In practice, none of the declared monitors spawn processes. Plugin loading itself works (skills, hooks, MCP servers all load correctly) — only monitor auto-arm is affected.

Error Message

"description": "Build error watcher ...",

Root Cause

Plugin authors relying on monitors.json for observability (vault-watchers, build-watchers, log-tails) silently get no coverage. Because the failure is silent, users tend to work around it by arming monitors from within skills (e.g., inline Monitor tool calls at skill startup), which makes the bug invisible in day-to-day use and hard to discover.

Code Example

{
  "name": "vault",
  "version": "1.0.0",
  "description": "...",
  "skills": "./skills/",
  "hooks": "./hooks/hooks.json",
  "monitors": "./monitors/monitors.json"
}

---

{
  "monitors": [
    {
      "name": "vault-file-changes",
      "description": "Vault file change watcher ...",
      "command": "${CLAUDE_PLUGIN_ROOT}/bin/vault-watch.sh",
      "persistent": true
    },
    {
      "name": "build-watcher",
      "description": "Build error watcher ...",
      "command": "${CLAUDE_PLUGIN_ROOT}/bin/build-watch.sh",
      "persistent": true
    }
    // ...4 more monitors, all persistent or one-shot
  ]
}

---

$ ps -axo pid,ppid,command | grep -E 'vault-watch|build-watch' | grep -v grep
(no output)

---

31696 31687 node /path/to/obsidian-mcp-server/dist/index.js    # MCP server ✓
31697 31687 node /path/to/apple-mail-calendar-mcp/dist/...     # MCP server ✓
31712 31687 node /path/to/tdx-kb-mcp-server/dist/...           # MCP server ✓
RAW_BUFFERClick to expand / collapse

Summary

Claude Code 2.1.118 does not auto-arm monitors declared in a plugin's monitors/monitors.json at session start. The docstring for Monitor tool / plugin loading (in the 2.1.118 binary) states that persistent monitors declared in monitors.json at the plugin root are armed as persistent Monitor tasks at session start. In practice, none of the declared monitors spawn processes. Plugin loading itself works (skills, hooks, MCP servers all load correctly) — only monitor auto-arm is affected.

Environment

  • Claude Code: 2.1.118 (/Users/<user>/.local/bin/claude)
  • Platform: macOS 25.4.0 (darwin arm64)
  • Launched via: --plugin-dir /path/to/plugin

Plugin structure

.claude-plugin/plugin.json:

{
  "name": "vault",
  "version": "1.0.0",
  "description": "...",
  "skills": "./skills/",
  "hooks": "./hooks/hooks.json",
  "monitors": "./monitors/monitors.json"
}

monitors/monitors.json (excerpt — 6 monitors declared):

{
  "monitors": [
    {
      "name": "vault-file-changes",
      "description": "Vault file change watcher ...",
      "command": "${CLAUDE_PLUGIN_ROOT}/bin/vault-watch.sh",
      "persistent": true
    },
    {
      "name": "build-watcher",
      "description": "Build error watcher ...",
      "command": "${CLAUDE_PLUGIN_ROOT}/bin/build-watch.sh",
      "persistent": true
    }
    // ...4 more monitors, all persistent or one-shot
  ]
}

All referenced scripts exist, are executable, and run correctly when invoked directly.

Expected behavior

At session start, Claude Code arms each monitor in monitors.json as a persistent Monitor task (per docstring). ps should show one child process per declared monitor under the claude PID.

Actual behavior

No monitor processes are spawned. After ~3 minutes of session uptime:

$ ps -axo pid,ppid,command | grep -E 'vault-watch|build-watch' | grep -v grep
(no output)

However, other plugin-loaded artifacts do spawn correctly. Under the current claude PID (e.g. 31687):

31696 31687 node /path/to/obsidian-mcp-server/dist/index.js    # MCP server ✓
31697 31687 node /path/to/apple-mail-calendar-mcp/dist/...     # MCP server ✓
31712 31687 node /path/to/tdx-kb-mcp-server/dist/...           # MCP server ✓

…so plugin loading is working. Only monitor auto-arm is silent.

Manually invoking the same monitors via the Monitor tool from within the session works correctly — the scripts run and stream events as expected. The failure is specific to the session-start auto-arm path.

Reproduction

  1. Create a plugin with a valid .claude-plugin/plugin.json declaring "monitors": "./monitors/monitors.json".
  2. Populate monitors/monitors.json with any persistent monitor.
  3. Launch a session with --plugin-dir <plugin>.
  4. After session start, ps -axo pid,ppid,command | grep <monitor-script> — expect one child under claude PID; observe zero.

Impact

Plugin authors relying on monitors.json for observability (vault-watchers, build-watchers, log-tails) silently get no coverage. Because the failure is silent, users tend to work around it by arming monitors from within skills (e.g., inline Monitor tool calls at skill startup), which makes the bug invisible in day-to-day use and hard to discover.

extent analysis

TL;DR

The issue can be fixed by investigating and potentially modifying the plugin loading and monitor auto-arming logic in Claude Code 2.1.118.

Guidance

  • Verify that the monitors.json file is correctly formatted and that the persistent property is set to true for the monitors that should be auto-armed.
  • Check the Claude Code documentation and source code to see if there are any specific requirements or limitations for the monitors.json file or the auto-arming process.
  • Test the plugin with a minimal monitors.json file to see if the issue is specific to the current configuration or if it's a more general problem.
  • Consider adding logging or debugging statements to the Claude Code plugin loading and monitor auto-arming logic to gain more insight into what's happening during the session start process.

Example

No code snippet is provided as the issue seems to be related to the Claude Code plugin loading and monitor auto-arming logic, which is not explicitly shown in the provided code.

Notes

The issue seems to be specific to the Claude Code 2.1.118 version and the plugin loading and monitor auto-arming logic. It's possible that the issue is caused by a bug or a misconfiguration in the Claude Code codebase.

Recommendation

Apply a workaround by manually arming the monitors from within the skills or by using an alternative method to achieve the desired functionality, until the root cause of the issue is identified and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

At session start, Claude Code arms each monitor in monitors.json as a persistent Monitor task (per docstring). ps should show one child process per declared monitor under the claude PID.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Plugin monitors/monitors.json auto-arm silently fails on 2.1.118 [1 participants]