Skip to content

spike: replace Stop-hook curator with Claude Code monitors-based long-lived curator #65

Description

@ovidb

Motivation

Claude Code v2.1.105 added a top-level monitors key to the plugin manifest: long-lived background processes per plugin whose newline-delimited stdout becomes session notifications. Auto-armed at session start ("when":"always") or first skill invoke ("when":"on-skill-invoke:<skill>"), session-lifetime only. Docs: https://code.claude.com/docs/en/plugins-reference#monitors.

Our current plugin/scripts/stop-curate.sh has to dual-gate (concurrency + frequency) because the Stop hook fires per-turn — a monitor serializes by construction. PR #63 fixed the stampede with a kernel-level concurrency gate, but the underlying architecture is still load-bearing on filesystem gymnastics. A monitor replaces the whole thing with a single tailing process per session.

Goal

Replace the Stop-hook + stop-curate.sh + per-session lockfiles with:

// plugin/monitors/monitors.json
[{
  "name": "curate",
  "command": "${CLAUDE_PLUGIN_ROOT}/scripts/curate-monitor.sh",
  "description": "Incremental rememora curator",
  "when": "always"
}]

…backed by a new streaming producer in the Rust CLI (rememora curate --stream).

Acceptance criteria

  • Replaces Stop hook with a single monitors entry; no per-session lockfiles.
  • ≤1 curate process per session (structural, not via pgrep gate).
  • Monitor handles session rotate + Claude Code restart gracefully.
  • Notification volume ≤1 line / 30s per session (per the output-style budget).
  • Stop hook retained as a narrow final-flush safety net (or explicitly removed if SessionEnd covers it).
  • Full plan + risks in the first comment (per CLAUDE.md).

Out of scope

  • Cross-agent liveness monitor (rememora events --follow) — separate ticket.
  • Skill-scoped ambient search monitor — separate ticket.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions