dough thread [--store <file>] <command> [...]

The store is --store, otherwise $THREADS_STORE, otherwise ~/.threads/log.jsonl, shared by every project. A thread id can be shortened to any unique prefix. dough thread --help prints the full usage.

import

dough thread import <claude|codex|pi> <transcript.jsonl | session-id> [--project <name>]

Imports a native session as a root thread. Only the active conversation path is imported: Pi and Claude Code transcripts are trees, and abandoned branches are skipped. Claude Code’s meta and sidechain records are skipped too, and so are Codex’s own instructions; context Codex injects (<environment_context>, …) is kept as system events. Running import again adds only new messages.

Where session ids are looked up:

  • Pi: ~/.pi/agent/sessions/*/*_<id>.jsonl
  • Claude Code: ~/.claude/projects/*/<id>.jsonl
  • Codex: ~/.codex/sessions/YYYY/MM/DD/rollout-<time>-<id>.jsonl

Each compaction in the transcript continues in a new continue thread (<harness>:<session>/2, /3, …).

tree

dough thread tree [--project <name>]

Prints each project’s forest. Each thread shows its intent and cutoff (handoff @#42 →), event count, seed size and run status.

show

dough thread show <thread> [--full]

Lists a thread’s events as #n role text, plus its origin and seed size if it’s a child. --full prints every event in full, with its id.

cut

dough thread cut <thread> --task <text>
  [--at last|#n|<event-id>]           # cutoff, default: last
  [--select <spec>]                   # default: last:6
  [--intent continue|branch|handoff]  # default: branch
  [--trigger manual|context_limit]    # default: manual
  [--title <text>]                    # default: first line of the task
  [--yes]

Without --yes, cut prints the preview and saves nothing. With --yes it commits that exact seed. Committing is idempotent. The selection syntax is in concepts > Selecting events.

seed

dough thread seed <thread>

Prints the exact first prompt a child is (or was) launched with.

open

dough thread open <thread>

Reopens a thread’s conversation interactively, in the harness it ran in (claude --resume, codex resume or pi --session) and from the directory it ran in, so you can pick it up where you left off. Works for any thread that has a conversation: one you had directly, or a child that was launched or opened. A child that hasn’t started yet has nothing to reopen: start it with /threads:open or launch.

launch

dough thread launch <thread> --harness <claude|codex|pi> [--cwd <dir>] [-- <harness args>...]

Starts the child in a fresh native session, waits for it to finish, captures its transcript, and prints the reply. Anything after -- is passed to the harness unchanged, for example -- --model sonnet.

HarnessCommand
Pipi -p --mode json <args>, prompt on stdin
Claudeclaude -p --output-format json <args>, prompt on stdin
Codexcodex exec --json --skip-git-repo-check <args> -, prompt on stdin

While a launch is in flight, tree shows it as ▶ <harness> running since <time>, and a second launch is refused. A launch is also refused while a previous run’s outcome is unknown: its launcher exited without recording one. See reconcile below. A child is launched once: after it has a session, use open or sync.

capture

dough thread capture <claude|codex|pi>   # hook input JSON on stdin

For harness hooks: reads the hook’s JSON (session_id, transcript_path) on stdin and records that session, creating its root thread the first time and appending new messages after that. Each compaction continues in a new thread. It never fails the harness: problems are printed to stderr and it exits 0. Codex uses it for live capture:

// ~/.codex/hooks.json
{ "hooks": {
  "SessionStart": [{ "hooks": [{ "type": "command", "command": "dough thread capture codex" }] }],
  "Stop": [{ "hooks": [{ "type": "command", "command": "dough thread capture codex" }] }]
} }

Codex runs a new hook only after you trust it in Codex.

sync

dough thread sync <thread>

Appends new messages from the thread’s native session, for example after you’ve kept working in it.

reconcile

dough thread reconcile <thread> --session <id>     # the launch did create this session
dough thread reconcile <thread> --failed <reason>  # it didn't; allow a new launch

Resolves a launch whose outcome is unknown: the run was recorded as started but never finished. Use --session to attach the session that was created and import it. Use --failed to mark the run failed so the thread can be launched again. A launch that’s still running can’t be reconciled.

view

dough thread view [--port <n>] [--open]

Serves the visualiser on 127.0.0.1. The default port is 4747. If that port is taken, it opens on a free one and prints which.

Environment

VariableUsed byMeaning
THREADS_STOREallStore file, instead of ~/.threads/log.jsonl
THREADS_HOMEallFolder for the store and plugin state, instead of ~/.threads
THREADS_PI_ARGSplugins, visualiserExtra arguments for background Pi launches (space-separated)
THREADS_CLAUDE_ARGSplugins, visualiserExtra arguments for background Claude Code launches
THREADS_CODEX_ARGSplugins, visualiserExtra arguments for background Codex launches
THREADS_CONTEXT_WARNPi extensionContext-usage percentage that triggers the warning (default 80)