From ee02ed37c1091e189525075e4073f50696f1438d Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 14 Jun 2026 15:41:24 -0400 Subject: [PATCH] =?UTF-8?q?feat(plugin):=20compaction-hygiene=20guidance?= =?UTF-8?q?=20=E2=80=94=20recommend=20safe=20compaction=20at=20seams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #834. The pre-compaction complement to the shipped post-compaction re-grounding banner. Because Scribe records progress as you go (task status, work-logs, decision notes), a compaction at a clean work-seam is lossless — so guide the model to recommend it proactively rather than letting auto-compact fire mid-task. Placed in the ALWAYS-loaded channels (operator wants it consistently in context, not relevance-gated like a skill): MCP _INSTRUCTIONS (every handshake) + the static SessionStart floor (every session, MCP-independent). Behavior: at the end of a block of work in a long session, ensure in-flight state is logged, then tell the operator it's a safe moment to /compact (naming what was logged); recommend at seams, not every turn; the model can't run /compact itself. plugin.json 0.1.8 → 0.1.9 so clients re-pull the static-context change. Co-Authored-By: Claude Opus 4.8 (1M context) --- plugin/.claude-plugin/plugin.json | 2 +- plugin/hooks/scribe_static_context.md | 6 ++++++ src/scribe/mcp/server.py | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index d3c5ec3..eb2d556 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "scribe", "description": "Scribe second brain for Claude Code: MCP tools over your notes/tasks/projects/rules, a session-start push channel that surfaces your always-on rules + active-project context, process-skills (writing-plans, systematic-debugging, verification, brainstorming), and your saved Scribe Processes auto-surfaced as skills (/scribe:sync). Replaces superpowers + file-memory with one app-backed plugin.", - "version": "0.1.8", + "version": "0.1.9", "author": { "name": "Bryan Van Deusen" }, "mcpServers": { "scribe": { diff --git a/plugin/hooks/scribe_static_context.md b/plugin/hooks/scribe_static_context.md index 5b8e602..4f42187 100644 --- a/plugin/hooks/scribe_static_context.md +++ b/plugin/hooks/scribe_static_context.md @@ -23,6 +23,12 @@ for the operator's work, and as your own working memory across sessions. moment it's complete. - Do **not** keep the operator's rules, plans, or project notes in local memory / CLAUDE.md in parallel with Scribe — Scribe holds the single copy. +- **Compact at clean seams** — because you record as you go, a context + compaction is safe: the durable record lives in Scribe, not the transcript. + After finishing a block of work in a long session, make sure in-flight state + is logged to Scribe, then tell the operator it's a good, safe moment to + `/compact` (name what you logged). You can't run it yourself — surface the + recommendation and let them decide. Suggest it at seams, not every turn. If the Scribe tools are unavailable, say so rather than silently falling back to local notes. diff --git a/src/scribe/mcp/server.py b/src/scribe/mcp/server.py index fd24689..0d39ca0 100644 --- a/src/scribe/mcp/server.py +++ b/src/scribe/mcp/server.py @@ -94,6 +94,21 @@ Keep task state honest — this is what makes the project a trustworthy record: (tag it `issue`) so it's findable later — even one solved in passing is worth two lines, so it isn't diagnosed from scratch next time. +Compaction hygiene — recommend compacting at clean seams. Because you record +progress as you go, a context compaction is SAFE: the durable state lives in +Scribe (task status, work-logs, decision notes), not the transcript, so it +survives the summary. Use this rather than letting auto-compaction fire mid-task: +- At the end of a coherent block of work (a task closed, a plan phase finished) + in a long session, first make sure in-flight state is actually in Scribe — + update task status, add a work-log, capture any decision as a note. Surface + the few things worth logging before suggesting the compact. +- Then tell the operator it's a good, safe moment to /compact, naming what you + logged ("logged to #X/#Y — safe to /compact, nothing will be lost"). You + cannot run /compact yourself; surface the recommendation and let them decide. +- Recommend it at genuine seams, not every turn. The next session's start will + prompt you to reload your bearings from Scribe — so a clean-seam compact plus + that reload loses nothing. + Scribe maintains a Rulebook system (Rulebook -> Topic -> Rule). Rules carry an actionable statement plus optional Why and How-to-apply context. At the start of any session that touches Scribe, call list_always_on_rules() to