Skip to content

Enhancement: Adopt Claude Code monitors manifest key for Beads-state file watcher #48

@cofin

Description

@cofin

Background

Claude Code's plugin manifest (.claude-plugin/plugin.json) supports a monitors key that registers background monitors auto-armed at session start or on skill invocation. This is a real, documented field as of April 2026 (plugins-reference).

Proposed use for Flow

Wire a Beads-state monitor that:

  • Watches .beads/state.json (or the active backend's state file) for changes during an active Claude session
  • On change, automatically runs /flow-sync to keep spec.md aligned with Beads — eliminating the current MANDATORY-but-easily-forgotten manual sync step after every Beads state change
  • No-ops when Flow is not active in the current project (no .agents/ directory)

Why now

The repo's CLAUDE.md and skill rules mark /flow-sync after Beads state changes as CRITICAL. Today this discipline depends on the agent (or user) remembering. A monitors entry would convert the discipline into a passive guarantee.

Out of scope for this issue

  • Cross-host parity. Codex / OpenCode / Gemini do not currently expose an equivalent monitor primitive — this is Claude-only, evaluated as part of the broader April 2026 host-mandate audit (see commit history of fix/codex-marketplace branch).

Acceptance criteria

  • .claude-plugin/plugin.json declares a monitors entry for the Beads state file
  • Monitor handler runs /flow-sync (or the equivalent skill action) only when .agents/ exists in the project root
  • Idempotent on rapid file changes (debounce or coalesce)
  • Documented in README and skills/flow/references/setup.md
  • Covered by a test that simulates a Beads state mutation and verifies sync invocation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions