Skip to content

feat(hooks): /experimental-context — keyed <revisit> entries re-injected after compaction - #132

Merged
SSFSKIM merged 1 commit into
mainfrom
revisit-mode
Sep 8, 2026
Merged

SSFSKIM merged 1 commit into
mainfrom
revisit-mode

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Experimental, opt-in mode mirroring /kairos. Motivation is measured, not hypothetical: across the 25 local sessions with 3+ compactions, the longest (42 compactions over a month) lost its governing goal phrase after the 8th compaction and a standing source-of-truth rule after the 3rd, while the transcript on disk kept every message verbatim. Summaries of summaries decay; the transcript does not.

How it works. /experimental-context (or EXPERIMENTAL_CONTEXT=1) puts the session in the mode. The session writes <revisit key="…">…</revisit> entries in its normal messages: governing goal, standing rules, directives, decisions with rejected alternatives, open questions, live handles. Re-emitting a key supersedes it; a self-closing or retired="true" entry drops it. After every compaction and on resume, the SessionStart hook injects the skill body plus the latest value per key, read from transcript_path (verified present on every hook payload in the 2.1.263 bundle), each stamped with its date and compactions-ago so staleness is visible. Sidechain rows and fenced code are ignored; over a size budget only first lines are shown with a grep recipe.

Why keys rather than a ledger file or explicit supersede links. A file needs the post-compaction agent to know which file is its ledger, and that pointer lives in the summary, which is exactly what decays. Explicit links need ids the agent no longer remembers after compaction. A key is the id and is memorable because it is the topic; the supersede chain is implicit in transcript order.

Verification. Hermetic suite tests/claude-code/test-experimental-context-hook.sh (26 checks: env and flag carriers, body verbatim, supersession, retirement from string and block content, sidechain and fence exclusion, first-seen order, missing transcript, budget fallback, sweep, hooks.json wiring) wired into the runner; kairos suite still green; shellcheck clean on the new scripts. The hook parses the real 112 MB, 42-compaction transcript in 0.75 s. Not yet observed in a live compaction; that is the experiment.

Bumps 7.72.9 → 7.73.0 so the plugin cache picks it up.

…njected after compaction

Compaction summaries keep the mechanics and lose the reasons, and a summary
of a summary loses them faster: in a real 42-compaction session on this
machine the governing goal vanished after the eighth compaction and a
standing rule after the third, while the transcript kept every message
verbatim.

/experimental-context (mirroring /kairos) puts a session in a mode where it
writes <revisit key="…">…</revisit> entries in its normal messages —
governing goal, standing rules, directives, decisions, open questions,
live handles. Re-emitting a key supersedes it; a self-closing or
retired="true" entry drops it. After every compaction and on resume the
SessionStart hook injects the skill body plus the latest value per key,
read from transcript_path (present on every hook payload), each stamped
with its date and compactions-ago. Sidechain rows and fenced code are
ignored; over a size budget only first lines are shown with a grep recipe.

Same carriers as kairos: EXPERIMENTAL_CONTEXT=1 in the environment or a
flag file under ~/.claude/experimental-context/<session-id> written by the
UserPromptExpansion toggle. Hermetic test suite wired into the runner.
Bump 7.72.9 → 7.73.0.
@SSFSKIM
SSFSKIM merged commit 96f14de into main Sep 8, 2026
@SSFSKIM
SSFSKIM deleted the revisit-mode branch September 8, 2026 11:06
SSFSKIM added a commit that referenced this pull request Oct 25, 2026
…its decisions

The screening of board #132's 34 candidates on configuration A alone
(44 runs): A answered 41 correctly. Its three failures, one run each,
are two PDFs over 10 MB with no rescue found and one copyrighted spec
the runner declined to quote. A reached the rest by routes around
WebFetch's limits: r.jina.ai, a PDF page rasterizer, other editions of
a document, parallel offsets. 10 of the 44 runs used a third-party
reader or proxy.

- design: "The hard set" under The evals, I4's new fields, the
  discoveries (WebSearch on sol through the gateway, A's routes, the
  1 MB cut applying to HTML only), and two Decision Log entries (the
  harness and reading; how the set was screened).
- report.py: a screening folder counts its extra second runs as part of
  its matrix, and a task's mechanism gets a column in the by-task table.
- 2026-10-25-web-fetch-hard-screening.md: report.py over both screening
  folders.

Sminos-Session: web-fetch-plugin#700c5e84 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 25, 2026
…its decisions

The screening of board #132's 34 candidates on configuration A alone
(44 runs): A answered 41 correctly. Its three failures, one run each,
are two PDFs over 10 MB with no rescue found and one copyrighted spec
the runner declined to quote. A reached the rest by routes around
WebFetch's limits: r.jina.ai, a PDF page rasterizer, other editions of
a document, parallel offsets. 10 of the 44 runs used a third-party
reader or proxy.

- design: "The hard set" under The evals, I4's new fields, the
  discoveries (WebSearch on sol through the gateway, A's routes, the
  1 MB cut applying to HTML only), and two Decision Log entries (the
  harness and reading; how the set was screened).
- report.py: a screening folder counts its extra second runs as part of
  its matrix, and a task's mechanism gets a column in the by-task table.
- 2026-10-25-web-fetch-hard-screening.md: report.py over both screening
  folders.

Sminos-Session: web-fetch-plugin#700c5e84 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 25, 2026
…its decisions

The screening of board #132's 34 candidates on configuration A alone
(44 runs): A answered 41 correctly. Its three failures, one run each,
are two PDFs over 10 MB with no rescue found and one copyrighted spec
the runner declined to quote. A reached the rest by routes around
WebFetch's limits: r.jina.ai, a PDF page rasterizer, other editions of
a document, parallel offsets. 10 of the 44 runs used a third-party
reader or proxy.

- design: "The hard set" under The evals, I4's new fields, the
  discoveries (WebSearch on sol through the gateway, A's routes, the
  1 MB cut applying to HTML only), and two Decision Log entries (the
  harness and reading; how the set was screened).
- report.py: a screening folder counts its extra second runs as part of
  its matrix, and a task's mechanism gets a column in the by-task table.
- 2026-10-25-web-fetch-hard-screening.md: report.py over both screening
  folders.

Sminos-Session: web-fetch-plugin#700c5e84 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 25, 2026
web evals: a hard set that shows B better (board #132)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant