Five parts, each usable alone, in the order the loop runs them. S1 exists. S2 to S5 are specified, not built.
/inventory-exit-reason [reason] in a session the person is closing short.
exit block
{kind, reason, given_by, given_at, models: {started, answered}, restart}. kind is one of
aborted, wrong_model, wrong_setup, superseded, other. reason is the person’s text
verbatim. With no text it asks once, with the four kinds as options and free text kept
verbatim. status becomes aborted. Uncommitted files go to artifacts[] with a held
decision. Only the record is committed. The person types /exit.other holding a recurring reason.Most exits happen without the command: 482 sessions have no end line, and a person often says why only later (“I killed that one, it was in the wrong folder”).
inventory.mjs exit --session <id> --kind <kind> --reason "<words>" --by "<person>[, via <seat>]" [--at <ISO>]
exit block to the record when it has none, with source: "after" and
given_at as the time the person said it, not the time the session ended. models is filled
from the interpreter (S3) when it can be. status becomes aborted when it was unreviewed
or in_progress, and stays as it was otherwise.exit block, the words go to exit.later[]
{reason, given_by, given_at}. reason, kind and given_by from the exit stay as written.observations[] line names who gave the reason and through which seat.--reason. A seat relaying the person uses their words, not a
summary.miadi-hooks-interpret exitsThe interpreter is the door the lookup guard names, so the question “how and why did sessions end” gets a verb there.
miadi-hooks-interpret exits [--since <date>] [--until <date>] [--headless | --all] [--json]
ExitEvent below. Sources, all read-only: the binding line for ends,
starts and resumes, each session’s start capture for the model it started on, its transcript
for the models that answered (bounded by --max-bytes), and its inventory record as a dated
snapshot, as join reads it.end_reason: null and
last_seen, so a crash or a killed pane is visible, not dropped.summary in --json): counts by end reason, by
exit.kind, sessions with no end line, sessions whose started model differs from the model
named at launch or from the one most replies came from, sessions resumed after an exit.digest <id> gains model: {launch, started, answered} and
end: {at, reason, captured, exit_kind}, so a single session answers the same question.session_lookup_guard.sh lists exits and the new digest fields in its
refusal text, under “how and why sessions ended, and which model ran”.A seat (the witness seat by default) reads exits and writes patterns. It runs after the nightly pass
(D2 in STATUS), and is built as ../self-improvement-cycle/ S3 and S4 for the scorer exit-reason.
exits --since <last pass> --json.exit.kind, then by the condition they share: launch
alias, mct team or launcher, model named at launch, cwd, account, the mission or request
that started the seat. A group of three or more sessions sharing a condition within fourteen days is a pattern (D2).inferred_kind when the evidence is in the row
(a started model that differs from the launch, a resume into another cwd). These are
listed apart and never join a pattern’s count until a person confirms one.wrong_model: jgwill/Miadi#1060, jgwill/Miadi#1028,
jgwill/Miadi#1008).When a pattern’s change lands, its landed field is filled (by the person or by the seat that
merged it, with the commit or release). Every later pass reports, for that pattern:
landed, and the same count for the same span before it.held when no matching exit occurred over the next window, partly when fewer did, returned
when as many or more did, as ../self-improvement-cycle/ S7 names them. A pattern sharing its
condition that rose over the same span is reported beside it.A returned pattern goes back to S4 step 5 with its new sessions. A held one stays listed with its last count, so it can be reopened.
exits)session_id, tmux, launch_alias, cwd, account_person, teamheadless: true for a claude -p childstarted_at, ended_at (null when no end line), last_seenend_reason: Claude Code’s SessionEnd reason, or nullmodel: {launch, started, answered: {<model>: <replies>}}resumed_after: {count, first_at} of starts with source resume after this endinventory: {file, status, disposition_decided} as readexit: the record’s exit block when present, with source: "command" | "after"id: P1, P2, … kept across passes, shared with ../self-improvement-cycle/kind, title (the condition in plain words), condition (the fields the sessions share)sessions[], count, first_seen, last_seenissue: owner/repo#n or the path of a drafted bodydecided: {by, at, choice} or nulllanded: {at, ref} or nullrecurrence: {since_landed, before_landed, state: held | partly | returned} or nullat, by, window: {since, until}, exits_read, with_reason, inferred[]patterns[]: ExitPattern~/workspace/.mino/exit-investigations/<yyMMddHHmm>.json with a .md beside it,
committed by path in the workspace repository.Creative Advancement Scenario: A seat on the wrong model
User Intent: Guillaume wants the work done on the model it needs and the cause counted.
Current Reality: A seat launched by mctgo answers on Sonnet. He expected Opus.
Natural Progression Steps:
/inventory-exit-reason wrong model, this needed Opus.exit.kind: wrong_model, models.started: claude-sonnet-5-5 and a restart
line with --model claude-opus-5-5. He types /exit and runs the restart line.wrong_model exits that week, all launched by mct new with no
--model, and matches them to jgwill/Miadi#1060.mct new change lands, the pass after counts wrong_model exits from mct
launches since then.
Achieved Outcome: The fix for #1060 is judged by the exits after it, not by memory.
Supporting Features: S1, S3, S4, S5.Creative Advancement Scenario: A reason given the next day
User Intent: Guillaume wants a session he killed yesterday to say why.
Current Reality: The session has no end line and its record is unreviewed.
Natural Progression Steps:
inventory.mjs exit --kind wrong_setup --reason "I killed that one, it was in
the wrong folder" --by "Guillaume, via the witness seat".exits now lists the session with its reason and source: after.
Achieved Outcome: The reason joins the next pass with the same weight as one given at exit.
Supporting Features: S2, S3.Creative Advancement Scenario: The weekly reading
User Intent: Guillaume wants to know, in five lines, why seats ended short this week and what to decide. Current Reality: Reasons are in records, unread together. Natural Progression Steps: