Threads
Composer, turns, load problems, protection, session imports, history and compaction.
A thread is a conversation backed by a pi session. It belongs to a project, runs in a working directory, and keeps its model, effort, protection mode and history. Session branches are alternate paths in the conversation; they are not Git branches.
Create a thread#
Choose + in the sidebar (⌘N). In a Git repository, the row above the composer sets where the thread runs:
| Option | Directory |
|---|---|
| Local | The project checkout, on the branch you choose. |
| Worktree | A new linked checkout, created when you send the first message. See Worktrees. |
Name the files, the behavior and the checks you want:
Add validation to the settings form using the existing component patterns. Add a focused test and run it.
Composer#
| Input | Does |
|---|---|
@ | Attach a file. |
/ | Run a command or pick a skill or prompt template. |
!command | Run a shell command in the thread's directory; the output goes into the context. |
!!command | Run a shell command; the output stays out of the context. |
| Paste or drop an image | Attach it to the message. |
Selected skills and prompts appear as chips. A pinned chip applies to every later message in the thread; an unpinned one only to the next. See Skills and packages.
Read what a turn did#
The work before an answer collapses into one line, such as Ran 6 tool calls, or Working · 3 tool calls so far while it runs. Show what pi did expands it into one row per thought, tool call or interim message. Messages from background agents fold in the same way.
Click an image in a message or in the attachment queue to open it full size. Esc closes it.
Load problems#
When pi has trouble opening a thread, a banner at the end of the transcript says pi reported a problem while opening this thread and lists each problem with an Info, Warning or Error badge. It covers:
- extensions that fail to load, and package warnings;
- providers that fail to register;
- a saved model that could not be restored.
Messages are redacted. Dismiss hides that set of problems; a different set shows again.
While a run is going#
Messages you send during a run either steer it while it works or queue as a follow-up for after it. The queue bar has Steer now. Settings → General → Runs sets how steering and follow-up messages are delivered, and retries on provider errors.
Tools and extensions can ask for a confirmation, a choice or text. Answer in the block in the transcript. Threads that wait for you are listed under Needs you in the sidebar. Stop (Esc) interrupts a run.
Protection#
The lock next to the model and effort controls sets the thread's protection:
| Mode | Behavior |
|---|---|
| Bypass (default) | Tools run on your computer with your permissions. |
| Sandboxed | File, search and shell tools, including ! and !!, run in a restricted worker. On macOS and Linux, network access is denied and credentials and files such as .env are hidden. On Windows the sandbox is experimental and does not fully isolate network or reads. Browser, computer-use and unsupported MCP tools are refused. |
Each thread has its own mode; forks and background agents inherit it. Changing it needs an idle thread with no running background agents, and a confirmation. Paired phones can see the mode but not change it. Extensions still load on the host, so trust them first.
Sandboxing uses Anthropic Sandbox Runtime:
| Platform | Needs |
|---|---|
| macOS | ripgrep. |
| Linux | bubblewrap and socat. On Ubuntu 24.04 and later, choose Set up Linux sandbox once; it asks for your password and installs pi-kit's own copy of bubblewrap with an AppArmor profile. |
| Windows | A Windows build with MXC BaseContainers, and accepting its limits once. Experimental: network and read isolation are not guaranteed, and MSYS2 programs such as Git Bash do not start. |
The lock's tooltip shows the sandbox's state: Sandbox starts before the next run, Sandbox starting, Sandbox active, Sandbox experimental, Sandbox unavailable, Linux sandbox needs setup or Sandbox recovery required. When the sandbox is unavailable or needs recovery, tools are blocked; nothing falls back to running on the host.
A thread needs recovery when pi-kit quit or crashed while its sandbox ran. Check that no command of that thread still runs (Activity Monitor,
ps), then choose a mode in the lock's popover and tick the recovery confirmation.Import Claude Code or Codex sessions#
Settings → Projects → (project) → Import sessions → Check for new sessions lists the project's local Claude Code and Codex sessions as New, Changed since import or Already imported. Select some and choose Import selected; Open copy opens an imported thread.
An import is an independent pi copy. Replies do not sync back, tool calls become text, and attachments stay in the original session. Compact after import summarizes older context with your model; if it fails, the import is kept and Retry compaction tries again.
Session history#
Open Tree from the side-panel buttons, or type
/tree. It lists turns, branches and compactions. Select a turn to inspect it; editing an earlier prompt creates a sibling branch.Moving to an earlier turn does not restore files. Check the checkout with Changes or Git before you continue from there.
Context and compaction#
Files, tool output, instructions and messages fill the context window. Compaction summarizes older messages when the thread nears the model's limit. Turn it on or off under Settings → General → Preferences → Context.
Click the context ring in the composer:
- Inspect the context breaks it down: system prompt, tool definitions, compaction summaries, skills, your messages, model text and thinking, tool calls and results, and extension notes. Counts are estimates.
- Compact now compacts at once.
Put instructions that must outlast a conversation in project files or skills.
Continue in the pi CLI#
Sessions are pi's own files. In the thread's directory,
pi -c continues the latest session; for a worktree thread, use the worktree's directory. Do not drive one session from two clients at once.