diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-18 13:38:55 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-18 13:38:55 -0500 |
| commit | 049a9f8ac380df39cac285032cf1fedcb6f566bf (patch) | |
| tree | 10da8947d2bb1d7554358416a2c11c20ba096b56 /claude-templates | |
| parent | 89da216416b39b70d87da7a423b02f177cfdef8b (diff) | |
| download | rulesets-049a9f8ac380df39cac285032cf1fedcb6f566bf.tar.gz rulesets-049a9f8ac380df39cac285032cf1fedcb6f566bf.zip | |
docs(protocols): mechanical primary trigger for session-context writes
The "If this session crashed right now..." heuristic was the trigger. It pushes the decision onto the agent every turn, and the agent's bias is to defer when no obvious milestone just happened. Four recent sessions in the work project showed the same drift. The pattern: substantive work, no mid-session writes, a wrap-time reconstruction afterward.
The new primary trigger is mechanical. A turn that called any state-modifying tool (Edit, Write, Agent dispatch, MCP write, or Bash that mutates state) writes to the Session Log before the closing user-facing message. Pure-read turns (Read, Glob, Grep, read-only Bash) don't trigger. The existing high-loss bullets stay as elaboration. They aren't the trigger.
The 5-turn safety net remains. The judgment heuristic is gone. The primary trigger replaces it.
Diffstat (limited to 'claude-templates')
| -rw-r--r-- | claude-templates/.ai/protocols.org | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/claude-templates/.ai/protocols.org b/claude-templates/.ai/protocols.org index 600ddd6..30b0274 100644 --- a/claude-templates/.ai/protocols.org +++ b/claude-templates/.ai/protocols.org @@ -98,7 +98,11 @@ The Summary lets a future reader scan quickly. The Log preserves the /why/ and t *** When to update (Session Log) -Append to the Session Log at /progress points/ — moments where something has changed that you'd want to recover to if the session crashed right now: +*Primary trigger (mechanical).* A turn that called any state-modifying tool — Edit, Write, Agent dispatch, MCP write, or Bash that mutates state (anything beyond pure reads like =git status=, =ls=, =grep=, =cat=) — writes to the Session Log before the closing user-facing message. This is not a judgment call. If the turn changed state, the turn gets a Session Log entry before the response goes out. The entry can be brief: one short paragraph naming what changed and why. + +Pure-read turns (only Read, Glob, Grep, or read-only Bash) do not trigger. Conversational turns with no tools do not trigger. + +The bullets below are not optional supplements — they all change state and so the primary trigger already covers them. They appear explicitly because they are the high-loss moments where missing the write is most expensive: - A decision was reached ("we agreed on X, not Y") - A workflow phase completed, or a new phase is starting @@ -108,8 +112,6 @@ Append to the Session Log at /progress points/ — moments where something has c - Before long-running or blocking tool calls — agent spawns, builds, rsync/ssh loops, MCP calls to external services. You could be waiting minutes; if anything crashes during the wait, everything since the last save is gone. - Before destructive or irreversible operations — =rm -rf=, =git reset --hard=, force-push, package removal, database drops. If the op succeeds and something breaks afterward, you need to know what state you caused. -Heuristic: /"If this session crashed right now, what would I wish I had written down?"/ If the answer is substantive, append to the Log. - *** Safety net If 5 user turns pass without appending to the Log, save anyway. Semantic triggers should catch most cases; this fallback covers judgment failures. |
