Requirements
- Node.js 24 or later
- At least one harness to launch threads in: Pi (
pi), Claude Code (claude) or Codex (codex) on yourPATH
Install
npm install -g @techsavvyash/dough-cli # the dough CLI (`dough thread`) and the visualiserTo use it from code, add @techsavvyash/threads to your project instead. See library.
Your first thread
Threads from every project are stored in one log, ~/.threads/log.jsonl, so nothing is written into your repositories. Override this with --store <file> or $THREADS_STORE.
-
Import a conversation as a root thread. Give
importa transcript path or a session id; it searches the harness’s session folders for the id.dough thread import pi ~/.pi/agent/sessions/<project>/<file>.jsonl dough thread import claude 3f1c… # a Claude Code session id dough thread import codex 019a… # a Codex session idRe-running
importadds only the new messages. -
Find the point to cut from.
shownumbers the thread’s events. Those#nnumbers are what--atand--selectuse.dough thread show t-abc # any unique prefix of a thread id works -
Preview the cut. Without
--yes, nothing is saved.dough thread cut t-abc --task "Implement the store from the agreed design" \ --intent handoff --at '#42' --select '#12,#40-#42'The preview is the exact first prompt the new thread will receive, followed by a one-line summary: the child id, the cutoff, the number of excerpts and estimated tokens.
-
Commit it by running the same command with
--yes. Committing is idempotent: the same inputs always produce the same child id, so re-running never creates a duplicate. -
Launch it in a fresh native session:
dough thread launch t-1cc6636e84 --harness claudeThe child’s transcript is captured back into the store. Run
dough thread sync <thread>later to pull in newer messages. -
See the forest:
dough thread tree dough thread view --open # the web visualiser on http://127.0.0.1:4747
Inside an agent
You don’t need the CLI to cut threads. Install one of the plugins and either ask the agent (“hand off the store implementation to a new thread”) or run the wizard yourself:
- Pi extension:
/thread,/threads, and agent tools. - Claude Code plugin:
/threads:thread,/threads:tree, and MCP tools.
Both write to the same store as the CLI and the visualiser.