M33: Claude Code conversations as blocks (index, read, continue, fork) #72
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Depends on: S20 (done 2026-10-02,
spikes/s20-conversations, no ticket).Conversations track. Every Claude Code conversation on a machine, from a terminal or the desktop app's Code tab, shows up in illogical as a block you can read and continue. Claude Desktop chats are out of scope (they live on claude.ai).
Most of it exists: an agent block whose config holds a
session_idresumes that session, andStoppedis a block with no process. A past conversation is a stopped Claude agent block with that id and a transcript read from its jsonl. The plan's M33 section (PLAN.md, "Conversations track") is the full spec; S20's README has the evidence andfixtures/the test data.~/.claude/projects(or$CLAUDE_CONFIG_DIR/projects) with inotify. Index each session's id, cwd (from its lines; the directory slug is lossy), git branch, entrypoint, title, first prompt, last activity, message count and size.custom-titleoragent-name, else the latestai-title, else the first prompt.relocatedmoves the cwd;continued-inandforkedFromlink sessions (the picker shows a fork under its original).listSessionsdoes. Keep the index in the state directory, keyed by path with mtime and size, so a restart only rereads files that changed. The index builds in the background and never delays startup.cli), desktop (claude-desktop; title, model andisArchivedfrom the app'slocal_*.jsonbycliSessionId, archived ones hidden like missing folders) and other./tmp/ilg-*sessions disappear, except desktop ones (their scratch workspace is deleted with the session; Continue creates the folder again, empty). Show all brings these back.~/.claude/sessionsholds it and that pid is still alive (procStartmust equal field 22 of/proc/<pid>/stat, so a reused pid doesn't count)./proc/<pid>/cgroupthen names its scope;illogical-pane-<N>-….scopeis pane N. If it is, the pane'sPaneInfogets the session id, and the conversation says Live in pane %N.transcript::Entry).parentUuidchain (S20). A prompt whose parent already had a later child is a rewind and gets aNotebefore it.usertext becomesUser, with a leading<system-reminder>(the desktop app puts one on the first prompt) removed.assistantcontent becomesAgentfor text,Thoughtfor thinking, andToolfor a tool_use (name, title, and for Bash the command). Atool_resultfills in that tool's output and its status (completed, or failed whenis_erroris set). A compaction becomes aNote("Conversation compacted"); its summary line (isCompactSummary) is skipped. Slash-command lines (<command-name>,<local-command-stdout>,<local-command-caveat>) become oneNote(/model haiku), and the adapter's own/modellines are dropped. Lines of one API response sharemessage.id; a subagent call is aToolwhose output is the agent's answer (its own transcript stays insubagents/).Stopped. Its config holdscwd,session_idandimported: true, and its transcript comes from the converter. No process starts, so opening costs only the reading.capture --text,historyandsearchwork on it like any agent block.claude-agent-acpthrough the existing start path. The block already has a transcript, so it sendssession/resumewith no replay. The block's log begins with the imported entries as oneimportedrecord, so a restart or reboot restores the block as M6b does.session/fork, thensession/resumeon the new id (fork doesn't open it), and the block'ssession_idbecomes the fork's. The original is left alone. Continuing is offered again once that process exits. There's no Continue anyway: S20 lost a writer's turns that way.settingSources: ["user","project","local"]andsettings: {disableAllHooks: true}(S20 item 3), and set the session's last model (the last assistant line'smessage.model) after resuming, since a resume resets it.illogical claude ls [--cwd D] [--live] [--json];illogical claude open <id|prefix>prints the block id;illogical agent --resume <id>and--fork <id>continue a conversation directly.list_conversationsandopen_conversation.Tests:
~/.claudeand the fake ACP agent: opening starts no process, Continue sendssession/resumewith the id, Fork sendssession/fork, and the block restores after a restart;web/e2e/conversations.spec.ts: a seeded~/.claudeshows up in the picker, opens and continues. Dev and test daemons always pass--socket.Done when:
claude --resume <id>in a terminal then shows the new turns;Not in M33:
Done and on main (
e702056:f9011bb,15be04c). PLAN.md's M33: as built has what landed, the decisions and what isn't covered; follow-ups are filed separately.