Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

LifeOSHooks: a session started with /clear has no stamp, so command hooks fall back to typed lines

Open gjaworski86 opened this issue 3 weeks ago • 1 comments

Version

LifeOS 8.761.0 · attestation: not run

What is broken

A session started with /clear has no LifeOSHooks stamp, so the command hooks treat it as a session without the plugin and fall back to typed lines.

sessionStart in skills/LifeOSHooks/hooks/LifeOSHooks.ts stamps the session id it sees at session.start. After /clear the session id changes and no stamp exists for the new id in MEMORY/STATE/function-hooks/. Of six recent interactive sessions on one install, the four without /clear have a stamp and the two that began with /clear have none; in those the hooks ask the model to type the memory line.

Not verified: whether Claude Code emits session.start after /clear.

Where (file:line)

skills/LifeOSHooks/hooks/LifeOSHooks.ts:920

Repro on a clean tree

1. Start an interactive session with the LifeOSHooks plugin loaded and send one prompt. `LIFEOS/MEMORY/STATE/function-hooks/<session-id>.json` exists.
2. Type `/clear`, then send one prompt. The transcript now has a new session id.
3. Run `ls LIFEOS/MEMORY/STATE/function-hooks/<new-session-id>.json`: no such file, and the UserPromptSubmit hooks emit the fallback blocks that ask the model to type the memory line.

Negative control

Probe: n=$(grep -c "\"stamp\", \[s.sessionId\]" skills/LifeOSHooks/hooks/LifeOSHooks.ts); echo "stamp call sites: $n"; grep -n "\"stamp\", \[s.sessionId\]" skills/LifeOSHooks/hooks/LifeOSHooks.ts; grep -n "on(\"session" skills/LifeOSHooks/hooks/LifeOSHooks.ts; test "$n" -gt 1 · exit 1 · captured 2026-11-11T09:02:25.043Z

stamp call sites: 1
953:  await bridge($, s, "stamp", [s.sessionId]);
2118:  on("session.start", sessionStart);
2135:  on("session.measure", sessionMeasure);

Suggested fix

None proposed.

Environment

  • OS: macOS 27.2 (arm64)
  • Harness: claude-code
  • bun: 1.4.4 · git: 2.54.0
  • Doctor broken: none

gjaworski86 avatar Nov 11 '26 09:11 gjaworski86

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @gjaworski86, you were right that /clear never fires session.start, so the new session id had no stamp. The module now re-reads the session id on every prompt and stamps the new one before prompt-context runs (rebindSession in skills/LifeOSHooks/hooks/LifeOSHooks.ts), which also stops closers being voiced twice. It ships in the next public release after 8.761.0.

danielmiessler avatar Nov 12 '26 20:11 danielmiessler