Pull context from another session
Retrieval-on-demand: source sessions need no prep — their transcripts already
live on disk at ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl. This skill
finds the right one, distills it in a subagent (so the large transcript never
enters the current session), and drops the digest into this conversation.
Arguments (free-form, all optional)
- A search term → pre-filter the list (e.g.
/pull-context alerting). --all→ search across every project, not just the current one.verbatim→ pull the literal recent messages instead of a distilled summary.
Steps
List candidates. Run the lister, passing through any search term /
--all:python3 ~/.claude/skills/pull-context/list_sessions.py [term] [--all]It prints rows of
# | age | msgs | topicplus each session's transcript path. If the current project has no match it auto-falls back to all projects and prints a(... showing ALL projects)notice with[project]tags on each row — so you usually don't need to pass--allyourself.Pick the source session.
- If the user already named the topic clearly and exactly one row matches, use it.
- Otherwise show the list and ask which number they want.
- Never pick the current session. Identify it by matching the first user message in this conversation against the topic hints, and exclude it.
Distill (default) — do this in a subagent so the transcript stays out of the main context. Spawn an
Explore(orgeneral-purpose) agent with the chosen transcript path and this instruction:Read this Claude Code session transcript (JSONL, one event per line; user and assistant turns are under
.message.content):<PATH>. Produce a tight digest, no preamble, in this exact structure:- Goal — what that session was trying to accomplish.
- Current state — where it actually ended up (done / in progress / blocked).
- Decisions & why — choices made and the reasoning, including rejected options.
- Key pointers — files, paths, PRs, IDs, commands, dashboards referenced.
- Open questions / next steps — what was unresolved or queued.
Favor specifics (exact file paths, identifiers, values) over narration. Omit a section only if the transcript genuinely has nothing for it.
For
verbatimmode, skip the subagent and run the extractor to pull the last ~15 user/assistant turns (exact text, code, and tool commands preserved):python3 ~/.claude/skills/pull-context/extract_tail.py <PATH> [N](Heavier and noisier than the digest — use only when the user needs literal wording or code from the other session.)
Inject the result into this conversation inside a clearly labeled block so it's obvious where it came from and that it's reference, not new instruction:
--- Pulled context: "<topic>" (session <short-id>, <age>) --- <digest or verbatim slice> --- end pulled context ---Then give a one-line orientation ("That session left off at X; here's how it connects to what we're doing") and ask how they want to use it.
Notes
- The lister marks the current session as
(THIS SESSION — skip)whenCLAUDE_SESSION_IDis set; if it isn't, fall back to topic-matching (step 2). - If the user wants context from several sessions, distill each in its own subagent and inject them as separate labeled blocks.
- Distilling keeps this session's context budget clean — prefer it unless the
user explicitly needs exact wording or code (
verbatim).