t3-fork
Installation
SKILL.md
t3-fork
Creates a new T3 Code thread whose Claude Code session is a copy of an existing conversation. The new thread starts with the full prior context. Optionally cut the copy after the n-th user turn to branch from an earlier point. When forking the live conversation (--current), the last user turn is the command that triggered the fork itself, so it is dropped by default.
How it works
- Reads the Claude session id behind a T3 thread from
~/.t3/userdata/state.sqlite(read only). - Copies the transcript
~/.claude/projects/<slug>/<session>.jsonlto a new session id. Subagent transcripts are copied too. - Registers the copy through T3's own transcript importer (
agentSessions.importover the local WebSocket RPC), so the conversation history is visible in the new thread. The importer is all-or-nothing per project, so the script shields every other Claude and Codex transcript of the project with temporary runtime bindings during the call and removes them right after. The first message in the new thread resumes the copied session.
T3 Code must be running. Requires bun.
Commands
Script: scripts/fork.ts next to this file. Run it with bun run.
# fork the conversation this agent is running inside
bun run <skill-dir>/scripts/fork.ts --current