Threads, context, and branches
Thread placement, composer context, input requests, session history, and compaction.
A thread is a conversation backed by a pi session. It has a project, a working directory, a selected model, and a history of messages and tool calls. Session branches record alternate conversation paths; they are separate from Git branches.
Create a thread#
Choose + in the sidebar and select a project. In a Git repository, the placement row offers Local or Worktree before the first message. Local uses the current checkout. Worktree creates a linked checkout when you send.
Check the working directory, model, and effort, then enter a request. Include the files or behavior involved and the checks you want run. For example:
Add validation to the settings form using the existing component patterns. Add a focused test and run it.
The transcript shows tool calls, results, errors, and the model's response. The current layout uses the available chat width with fixed gutters.
Add files, skills, and prompts#
Use
@ to select file context. Select skills and prompt templates through /, the add menu, or the command palette. Selected resources appear as chips in the composer.Pin a skill to include it in subsequent messages in that thread. An unpinned selection applies to the message it accompanies. Skills and packages covers resource installation and scope.
The
! composer syntax runs shell commands in the thread's working directory. It is a command entry mode, not a request for the model to explain a command.Input during a run#
Messages entered during execution can steer the current run or queue a follow-up, according to the selected mode. Settings → General → Runs configures retry and queued-message behavior.
Tools and extensions may request confirmation, a selection, text, or an edited response. Answer in the corresponding block. The sidebar's Needs you section lists waiting threads. Use Stop to interrupt a run rather than waiting for a tool question.
Navigate session history#
Open Tree from the side-panel controls. The graph shows turns, alternate paths, compaction markers, and the selected position. Select an earlier turn to inspect it; editing an earlier prompt can create a sibling path.
Navigating a session does not restore earlier filesystem contents. Use Git or the Changes/review controls to inspect file state before continuing from an earlier conversation point.
Context and compaction#
Files, tool output, instructions, and prior messages contribute to context usage. Compaction summarizes older conversation content when the session approaches the model's limit. Automatic compaction is configured in General → Preferences.
Project files and skills are the appropriate place for instructions that must persist independently of conversation history. Switching to a model with a smaller context window may require compaction or less attached context.
Continue with pi#
Sessions remain compatible with the pi CLI. Run
pi -c in the relevant working directory to continue a session. For a worktree thread, use the worktree directory rather than the main checkout.Avoid issuing competing commands to one session from multiple clients. Separate threads and worktrees are available for concurrent tasks.