Published dispatch Apr 25, 2026
Pluck context from one session into another
A Pi command that plucks the exact context you want from an older session.
I often need a plan or summary list from one session to start a concurrent session. Pi already gives us `/fork` and `/tree` but they pull over all the context up through a particular point in time. This extension lets you easily pull specific content from one session into another, which turns out to matter a lot once you start letting sessions specialize.
Filed
April 25, 2026
Published on galexc.me/dispatches
Read time
7 min
Coffee-sipping read with a bit of texture.
Tags
Editorial note
Co-authored by Gilman and GalexC.
I'm in the habit of running many agent sessions at a time, some tightly focused, others spread across a few days. Sometimes I want to spin up a parallel session for a subtask or nearby workstream, and in that moment `/fork` and `/tree` can be heavier than what I actually need. Sometimes I just want one useful thing, like a next steps summary, without dragging the rest of the conversation along.
Build something to `pluck` content from one Pi session into another. Also, rank them, let me select the useful excerpts, and import into the current session without triggering an immediate model turn.
This is small enough to sound like a convenience feature, but it changes how comfortable I am letting sessions specialize. If the handoff between sessions is cheap and controlled, I can keep each one cleaner.
What it looks like
The workflow starts in the source session:
/session
Pi prints the current session info in the transcript, so I can copy the exact ID without leaving the session:
File: /Users/galexc/.pi/sessions/2026/04/25/019dd16d-14a7-7754-8e15-a9271395cfaa.jsonl
ID: 019dd16d-14a7-7754-8e15-a9271395cfaa
Messages: 14 user, 22 assistant, 9 tool
Tokens: ↑182k ↓11k R3.4m W96k
Cost: $1.83
In the target session, I can open the browser with just the exact ID:
/pluck 019dd16d-14a7-7754-8e15-a9271395cfaa
If I want the results ranked around a query, I add query text after the ID:
/pluck 019dd16d-14a7-7754-8e15-a9271395cfaa some specific query
The browser opens with ranked excerpts from the source session. I can move through them, preview the selected item, mark the pieces I want, and press enter. The current session receives one visible imported context block, ready for my next instruction.
The distinction matters: the extension imports the selected evidence, not the old conversation as a blob.
Install
The public home for my sharable Pi extensions is pi-extensions-oss:
pi install git:github.com/thegalexc/pi-extensions-oss
Restart Pi or run /reload. Updates come through pi update.
How it works
Session ID as the handoff
The command is anchored on a session’s UUID. Built-in /session already exposes the source ID.
const parsed = parseSessionContextArgs(args);
const targetInfo = await resolveTargetSession(parsed.sessionId);
const targetSession = SessionManager.open(targetInfo.path);
const entries = targetSession.getEntries();
The extension identifies the source session, finds useful candidates, and presents them in a small Pi browser.
Structured extraction before model magic
The session log contains a ton of useful info. Branch summaries, compaction summaries, labels, user goals, assistant plans, assistant conclusions, and non-noisy tool findings are all better starting points than raw transcript search.
const TYPE_WEIGHTS = {
branch_summary: 120,
compaction_summary: 115,
label_checkpoint: 105,
user_goal: 95,
assistant_plan: 90,
};
This first version is deterministic on purpose. I wanted a tool I could understand, test, and trust before adding any model-assisted summarization or reranking.
Selected context lands as one message
The extension formats the chosen chunks and inserts them into the current session as one custom message.
pi.sendMessage(
{ customType: "session-context", content: formatted.content, display: true },
{ deliverAs: "nextTurn" },
);
deliverAs: "nextTurn" is important. The import appears in the transcript and becomes available to the model, but it does not immediately kick off another assistant response. I can look at what came over, add the instruction that gives it purpose, and continue from there.
How I actually use it
The most common case is using some summary state within one session as a tee-off point for a new session. /resume and /fork are great but they pull over all the context up until the selected point. In this scenario, I just want one or two elements.
/pluckgives me a narrow bridge to selectively pull context from another session into any other session.
Why I built it
I was reviewing another extension when I learned that /session printed the session’s ID and wondered what functionality Pi exposed related to sessions (at that point I had no idea; I even filed a PR/Issue to clarify in the readme lol).
i like this. one question: is it possible to intelligently search/select from session so we don’t pollute context by injecting an entire separate session into “this” session but instead only desired parts of it?
It was pretty much as simple as that. From that prompt, GalexC got most of the extension built in one shot. I only had to steer a few follow-up fixes around things like overlay formatting.
The funny part is that the rename from /session-context/pluck happened the same way. Once I saw it in use, the shorter verb just felt better. That conversion in pi-extensions-oss took a few minutes and a single prompt. Also pretty impressive.
It was a really impressive session for me.
More than just this command
This is a great example, to me, of the power of Pi’s extensibility-at-its-core philosophy. It lets the environment around the LLM evolve at the same speed as the workflow. A repeated task or annoyance does not have to become a note, a convention, or a thing I keep re-explaining to agents. It can become part of the shell.
/pluck is useful on its own, and I expect to keep using it, just like my Zero Token Session Notes extension. The broader lesson is that personal AI infrastructure should accumulate small, personal modifications that fit your workflow and preferences.
Have fun!
Source lives in pi-extensions-oss. Use mine if it helps. More importantly, build your own. The best Pi extension is probably the one that removes a workflow tax you have been tolerating for months.