recover-context — Claude Code skill: restore session context and install
This skill retrieves the last task from a parent session, along with its status, decisions, and pending work. Use it when continuing from a session lineage.
npx skills add pchalasani/claude-code-tools --skill recover-context -a claude-codeWhat recover-context does
The skill identifies the newest parent session in the lineage and extracts the task in progress, its status, decisions, and remaining steps. It also looks for related material, such as task specs, work logs, and files that were being edited.
To keep a large session file out of the main context, it delegates the search to session-searcher. When sub-agents are unavailable, it uses aichat:session-search instead. The result is a short account of the task, relevant files, and a question about how to proceed. A session lineage must appear in the first user message; otherwise there is no parent session for the skill to select.
What it helps with
- recover the latest task from a parent session
- check whether work is complete, ongoing, or blocked
- locate referenced task specs and work files
- identify decisions and outstanding next steps
Example prompts for the agent
- Recover the last task from the session lineage and list its related files.
- Check the newest parent session and tell me the task status and remaining steps.
- Find the decisions made in the last session, then ask how I want to continue.
How to install recover-context
1Skills CLI (Vercel)
npx skills add pchalasani/claude-code-tools --skill recover-context -a claude-code2Manually: put the files in place
~/.claude/skills/recover-context/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/recover-context/
1Skills CLI (Vercel)
npx skills add pchalasani/claude-code-tools --skill recover-context -a codex2Manually: put the files in place
.agents/skills/recover-context/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add pchalasani/claude-code-tools --skill recover-context -a cursor2Manually: put the files in place
.cursor/skills/recover-context/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install pchalasani/claude-code-tools recover-context2Manually: put the files in place
.github/skills/recover-context/SKILL.md1Skills CLI (Vercel)
npx skills add pchalasani/claude-code-tools --skill recover-context -a gemini-cli2Platform CLI
gemini skills install https://github.com/pchalasani/claude-code-tools --path plugins/aichat/skills/recover-contextManually: put the files in place
.devin/skills/recover-context/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add pchalasani/claude-code-tools --skill recover-context -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about recover-context
How do I install recover-context in Claude Code?
Run npx skills add pchalasani/claude-code-tools --skill recover-context -a claude-code. The skill file is at ~/.claude/skills/recover-context/SKILL.md.
What does recover-context do?
It retrieves the task, current status, decisions, and pending steps from the latest parent session. It also looks for related documents and code files.
Does recover-context need a session lineage?
Yes. The lineage must be present in the first user message so the skill can identify the newest parent session. It searches with session-searcher, or uses aichat:session-search when sub-agents are unavailable.
Source text
SKILL.md · MIT
---
name: recover-context
description: Extract full context of the last task from the most recent parent session
shown in the session lineage. Strategically uses sub-agents to avoid bloating your
own context.
---
# recover-context
Use this skill to extract context from a parent session when a session lineage is
present (shown in the first user message of this conversation).
## Instructions
1. **Identify the most recent parent session** from the lineage chain (the last
file in the chronological list).
2. **Use sub-agents to explore** (to avoid bloating your own context):
- If you have the Task tool with subagent support, use the `session-searcher`
subagent (subagent_type: `session-searcher`) to analyze the most recent session
- If sub-agents are NOT available, use the `aichat:session-search` skill instead
3. **Extract the following from the most recent session:**
- What was the last task being worked on?
- What was the current state of that task (completed, in-progress, blocked)?
- Any pending items or next steps mentioned?
- Key decisions made or approaches chosen
4. **Also check for associated documents:**
- Issue specs or task descriptions referenced in the session
- Any markdown files created during that session (check WORKLOG/, issues/, etc.)
- Code files that were being modified
5. **Report back concisely:**
- State your understanding of the task context
- List any files you found that are relevant
- Ask the user how they'd like to proceed
## Example Sub-agent Prompt
If using the Task tool with `session-searcher` subagent:
```
Analyze the session file at [path from lineage] and extract:
1. The last task being worked on (look at the final 20-30 messages)
2. Current state of that task
3. Any referenced markdown files (issue specs, work logs, etc.)
4. Pending next steps or blockers
Return a concise summary.
```
## Constraints
- Do NOT read large session files directly into your own context
- ALWAYS delegate to sub-agents or the session-search skill
- Keep your summary concise - the user knows what they were working on
- Focus on the LAST task, not the entire session history
© pchalasani · MIT · pchalasani/claude-code-tools