You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hooks: an end-of-session event (lane-stop output, session-end deferred to the next start) #462
ADR-0094 gives a skill two events: session-start and prompt-submit. A routine that belongs to the end of a session has neither. Our case: a work-session skill stops a time-tracking timer and then runs a short session review as the last action. Today the only mechanical trigger is a prompt-submit hook with match on closing words ("done", "wrap up", "lane stop", in our language). That is a heuristic:
a session that ends without such a word (window closed, /exit, Ctrl+C, the user just walks away) gets nothing;
a closing word in the middle of a session ("is this done?") fires early.
What would help
Two additive events, in the spirit of ADR-0094 (text only, no commands from the skill):
lane-stop: when the agent itself runs devstack lane stop (CLI or MCP lane_stop) in a working tree, devstack appends the matching hook texts to the command's output. The agent reads that output, so the text arrives exactly at the moment the work is being torn down, without depending on the model choosing a skill. This covers the common "finish ticket, tear down the lane" path, and it needs no agent-side hook support.
session-end, deferred to the next start: Claude Code has a SessionEnd hook (exit, clear, logout); text added there never reaches the model, because the session is over. Instead the dispatcher could only record that a session in this working tree ended (agent, session id/transcript path, time), and the next session-start of the same tree passes on a hook text such as "the previous session ended without closing; review it now", with the recorded reference. A skill opts in with event = "session-end"; its text is given at the following session start, once.
Codex: whether it has an end-of-session event is unchecked; (1) works for it regardless, because it only relies on command output.
Contract sketch
[[hook]]
event = "lane-stop"# text appended to the output of `devstack lane stop` / MCP lane_stopupstream = "time-tracking"# as todaycontext = "..."
[[hook]]
event = "session-end"# recorded at the end, given once at the next session-start in the same treecontext = "..."
Both are additive to the ADR-0094 format (event gets two new values), so older coordinators can keep ignoring them.
Activity
feat: hooks for the end of a session, lane-stop and session-end