Custody without wiring: keep every session, read it back by id #86
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/claude-code-query!86
Loading…
Reference in a new issue
No description provided.
Delete branch "transcript-custody"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The slice
Goal (the use). I run Claude Code sessions through the SDK without wiring anything for custody, and I can open any of them by its session id after the vendor has deleted its copy.
Fit test (close gate). In a
proceduresworktree built against a locally published0.7.0-SNAPSHOT, the worker'sClaudeCode.session(options)call stays as it is — no custody argument. Run a real worker session, move its vendor transcript tree aside, open that session's page by its id, put the tree back.Fit passed (2026-10-13, read by Michal): a worker session in the offline harness, kept with no custody argument, opened whole on its page after its vendor project directory left
~/.claude-gladys/projects. Card:project-management/efforts/transcript-custody/slices/01-custody-without-wiring/card.md.What ships
ClaudeCode.query(options, archive: Custody = Custody.Keep)andClaudeCode.session(...)keep every session they run.Custody.KeepUnder(root)keeps elsewhere,Custody.Offkeeps nothing.CLAUDE_CONFIG_DIRfrom the session's options, else the inherited environment, else~/.claude. Records go to$XDG_DATA_HOME/agent-transcripts/claude-code/<installation key>/as<id>.jsonl,<id>/and<id>.custody.json, beside aninstallationmarker that refuses a second installation with the same lossy key.ZioSessionCatalog.default(cwd); the vendor tree resolves first when a cwd is known, the kept copy by id alone.ConversationArchive/ZioConversationArchiveare renamedSessionCatalog/ZioSessionCatalog.4f80c8c), and a close killed the CLI before it could write its tail — it now waits for the exit up toSessionProcess.CloseTimeout, and a Stop still kills at once (3f9a359).Review
Ten review skills, run on the whole diff; report in
slices/01-custody-without-wiring/review-slice-20261012-1215.md. One critical finding —TestSystem's environment is one map per spec, so the suites that name their own data home now run sequentially — plus nine warnings closed in-loop: the guarded custody-facts write, the installation claim made atomic, symlink refusal on the marker and the facts file, bounded log values, one owner for the kept-directory arithmetic, and the documentation gaps (theArchiveConfigupgrade shape, the installation-wide read scope, both close ceilings).Gate:
./mill __.compile + __.test + __.checkFormatgreen.Follow-ups (not in this PR)
project-management/efforts/transcript-custody/FOLLOW-UPS.md, grouped by where the fix lands:ArchiveMirror—claimKeptDirthrows where the signature promises a report; the marker and facts file are written with the umask; a directory at the facts path counts as written;mirrorwould read as five steps./.ui.demohost with an open follow stream never exits (diagnosed, cause not found)../mill __.testprints a duplicate-logback.xmlwarning (not from this branch).Next in the effort map:
open-a-session-from-custody(re-enter a kept session, not only read it),custody-for-direct-and-effectful,move-kept-transcripts, andprocedures-on-0.7— the live dashboard, whose change is written and green in a worktree but needs a published 0.7.0 and the old records copied first.🤖 Generated with Claude Code