Replies: 1 comment
|
built and merged in #271, shipping in the next release. the read was right on both counts: capture and restore live entirely inside the app, so no external process can rewrite the seam, and a static wrapper can't help either because with
it's a tri-state on one field: absent = today's auto-capture, timing is as described: write-now, consume-next-launch. Setting it never touches the running session, and the pin is sticky, it fires again on every launch until cleared. A two details that came out of building it and aren't obvious from the proposal: the override obeys the a split hidden at quit drops its pin rather than keeping it. A hidden split comes back with no right pane and is never rebuilt, so a kept pin would be a value idea 2 stayed out for the reason given earlier, the skip half already exists as the denylist. the offer to test builds is welcome, the edge worth hammering is a fork chain over several restarts. |
Uh oh!
There was an error while loading. Please reload this page.
Context. Heavy user of "Restore running commands on restart" with Claude Code sessions; I also maintain a tool that maps agterm sessions to Claude sessions via
tree --jsonforeground argv.Problem. Restore re-runs the captured foreground command verbatim. Perfect for idempotent commands (
claude --resume <uuid>reattaches the same session every time), but it breaks down for:claude --resume <uuid> --fork-sessioncreates a new Claude session (new uuid) each run. Every agterm restart mints another fork: the session I was actually working in (yesterday's fork child) is not resumed, and transcripts accumulate near-identical copies. Real data point: after a couple of restarts I found 6 sessions with the same title, 3 of them created in the same second — the restart moment.claude -r/ bareclaude --resumecapture no session id; restore lands in the interactive picker, not in the session that was open.Not agterm's fault — it can't know which commands are idempotent. But agterm is the only layer where the user (or tooling) could fix it.
Ideas (the first seems cleanest):
agtermctl session restore-command set|clear <cmd>+ read side intree --json. On restart the override wins over the captured foreground. Agent tooling could then register the idempotent form — e.g. a Claude CodeSessionStarthook knows the real current uuid, so the override would stay accurate even for forked or picker-resumed sessions.--fork-session").restore clearexists, but it's global and one-shot).Happy to expand or test builds.
All reactions