feat: in-session compaction distiller subagent + advisory (0.25.0)#44
Merged
Conversation
One-shot claude -p calls now pass --disallowed-tools (we never use tools), keeping built-in tool schemas out of the prompt — roughly halves the harness overhead. Stats lead with the real dollar cost for claude -p (its token counts are muddy: a big prompt lands in cache_creation, not input_tokens) and show clean tokens only for API backends; sizes scale to M. A tip points at --backend anthropic (~50× cheaper) / ollama (free) when a cost-reporting backend is used. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…dvisory New task-journal-distiller subagent (Haiku, background:true): reads a just-compacted conversation segment from the transcript file and backfills the missed decisions/rejections/findings for the active task via the journal MCP, never closing it. In-session → no separate claude -p call (~5k vs ~46k overhead), non-blocking. After a compaction the SessionStart hook adds a short advisory to delegate to it (hooks can't spawn subagents, so it's advisory; deterministic catch-up stays the net). TJ_DISTILLER_HINT=0 disables the hint. Platform constraints verified via claude-code-guide; see .docs/plans/2026-06-13-compaction-distiller.md. Worker-reliability fix and SessionEnd(clear) catch-up tracked as follow-ups. claude-memory-80f Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
When a conversation compacts, the segment's reasoning should land in the journal as typed events — so
completelater leaves open only genuinely-unfinished tasks, not ones that merely look interrupted by a compaction. The user's constraint: do it in-session (no separately-billedclaude -p) and without blocking the main chat.Design (verified against platform limits)
Confirmed via claude-code-guide:
PreCompactdecision:blockblocks compaction but does not force a model turn (onlyStopdoes — and even mempalace defaults to non-blocking).background: true— in-session (subscription, not separately billed), ~5k token overhead vsclaude -p's ~46k.So the closest achievable:
task-journal-distillersubagent (plugin/agents/, Haiku,background: true): reads the active task's events + the transcript segment, records the missed decisions/rejections/findings via the journal MCP, never closes, dedup-aware.SessionStartadds a short note suggesting the main agent delegate the segment to the distiller (TJ_DISTILLER_HINT=0to disable). Advisory because hooks can't force it.Honest gaps (tracked follow-ups)
/clearfiresSessionEnd(clear), not Stop → needs a SessionEnd catch-up (claude-memory-mgc).Tests
session_startcompact test asserts the distiller advisory appears; startup test asserts it does not. Full local gate green (fmt,clippy -D warnings,test --workspace).🤖 Generated with Claude Code