feat: split into three independently-installable plugins (context-guard, refine-gate, statusline)#9
Merged
Merged
Conversation
…lugins One marketplace, three plugins a user can install in any subset: - plugins/context-guard — Stop-hook context budget (stop-context-guard.py), the memory-writer checkpoint agent, and the SubagentStop spend tracker (subagent-tracker.py + tools/subagent_usage.py). Checkpoint protocol + spend context belong together. - plugins/refine-gate — UserPromptSubmit prompt-binding gate (refine_gate.py) + the /refine skill and its overhead-measurement tool. - plugins/statusline — renderer + cost/telemetry helpers + config under assets/, a proper install skill (preflight, asset placement with backup/preserve rules, settings.json statusLine wiring, verification), and a SessionStart auto-update hook, following the pictet-tech/claude-statusline pattern. Root keeps a deprecated session-optimizer meta plugin as a migration shim: no functional hooks (no double registration), only a SessionStart notice telling existing installs to switch to the three plugins. Decouple the checkpoint protocol from the private memory ecosystem: - new hooks/checkpoint_protocol.py owns the Stop guard's instruction text; detect_memory_tool() probes tools/memory-tool.sh (project root or ~/.claude/tools/) per invocation and the hook emits the scoped-store wording (memory verbs, MEMORY_AGENT_ID, remember endpoint) ONLY when the layer is installed — the default variant references vanilla Claude Code tools only (stub-file protocol). - memory-writer agent rewritten generic-first: stub file is the default path, the scoped store an explicitly runtime-detected extension; fixed frontmatter to a YAML block scalar (was silently unparseable). - refine gate / skill wording now says "your memory layer's recall tool when one is installed" instead of naming cortex tools unconditionally. The context-guard <-> statusline threshold coupling stays a shared-file convention (~/.claude/ctxguard-thresholds.json, seeded by the statusline install skill, embedded fallbacks in both consumers) and is documented in both plugins' READMEs. Tests stay at the repo root and now target the plugin paths; CI shellchecks the moved renderer and validates every plugin/hook/marketplace manifest. All suites pass (18 pytest + 22 shell) and `claude plugin validate --strict` passes on each plugin and the marketplace root. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The monolith becomes three plugins under one marketplace — users install exactly what they want:
Root plugin becomes a deprecation shim (SessionStart notice only — existing installs learn about the split instead of silently losing hooks; no double registration).
Ecosystem decoupling: context-guard now detects the Cortex memory layer at runtime per invocation — outside users get a generic stub-file checkpoint protocol referencing only vanilla Claude Code tools; the cortex-scoped wording appears only when the memory tool is present. Both variants verified end-to-end with synthetic transcripts.
Bonus fix: memory-writer agent frontmatter was broken YAML (unquoted
:— loaded with empty metadata); now a block scalar.Test plan
claude plugin validate --strictpasses on all three plugins and the marketplace root🤖 Generated with Claude Code