episode_handoff
Retrieve the latest journal takeaways from the previous worktree session to quickly understand what was concluded before continuing work. Use at loop entry to avoid manual memory search.
Instructions
Read the most-recent journal takeaways from a prior session in this worktree. Call this FIRST at a /loop iteration entry: it answers 'what did the last session conclude here?' without memory_search. Episodes are the sibling-to-memory primitive for journal-shaped writes (see episode_write).
When prior_session_id is omitted the handler auto-resolves it from the event log under two implicit filters: caller-worktree strict equality (None matches only None) and the disabled_scopes cascade (a session whose only takeaways are scope-disabled is skipped; surviving episodes are scope-filtered). Pass it explicitly to override.
Returns a dict:
prior_session_id: the resolved session id, or None when no prior session exists in the log.episodes: list of {id, created, takeaway, scopes, provenance} dicts, oldest first, capped atmax_episodes(default 5, cap 50).provenanceis read from the event log:local(an episode_write event names the id),untracked(no event could have) orunaccounted(the file appeared with no event: the planted shape).bodyis present only withinclude_bodies=True(default False) and never for an unaccounted episode; episode_search(ids=[...]) is the explicit read for one body.note(optionalstr): set ONLY when the immediately-prior worktree session left nothing visible; names the cause: floor-only, zero-episode, promoted-out, or all-scope-hidden. The last two DID journal, so anotenever means 'wrote no journal'.episodesMAY be non-empty: the walk rewinds to an older takeaway.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_episodes | No | ||
| include_bodies | No | ||
| prior_session_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||