Resume skill: pick up where the last coding-agent session left off

Dmitriy Solodukha, Caprock's developer · Published

Tested on Claude Code and Codex

The resume skill rebuilds where you left off: the last sessions, the branch, uncommitted work, TODOs and handoff notes, then names one next step and waits.

The resume skill rebuilds where the work stands before the agent touches anything: what the last coding-agent sessions here did, the current branch, uncommitted changes, recent commits, open TODOs and handoff notes. Then it gives a short summary under three headings, Where we are, Open threads and Next step, and waits for you. It only reads: no checkout, stash, pull or commit.

Install the resume skill

One command per agent. The skill is a single SKILL.md; nothing runs on install.

All nine skills as a plugin. Type these inside Claude Code:

Or this skill alone, from your project's folder in a terminal:

Add -g to install it for every project.

Prompts that use the resume skill

The agent picks the skill when your words match its description; naming it makes sure. Click a prompt to copy it.

What the resume skill reads

  1. Session history, with Caprock: the last sessions in this repository from every agent, a summary of the last one to three that did real work, their last explanations, and the decisions in force. Without Caprock it says no session history was read, rather than guessing.
  2. Repository state, read only: branch and upstream, commits not on main, the diff of uncommitted files, stashes, worktrees, and a merge or rebase in progress, which it reports first.
  3. Notes left behind: HANDOFF.md, NEXT.md, TODO.md and the like, TODO and FIXME in recently changed files, and "WIP" in commit messages.

When two sources disagree (a note says done, the code says not), it says so instead of picking one.

What we ran, and what the agents did

Each skill was run on 2026-11-29 in a throwaway repository made for it, with the skill installed as a project skill. A repository on branch feat/divide with a WIP commit, a TODO in calc.py, and an untracked HANDOFF.md and test_calc.py.

Claude Code (claude -p --model sonnet, without the Caprock MCP server (--strict-mcp-config))

where were we? pick up where we left off

Invoked resume, ran the git steps, found the TODO and the handoff, said that no session history was read, noticed that the commit message and HANDOFF.md named different next steps, proposed one, and changed nothing.

Codex (0.163.0, codex exec -s read-only)

where were we? pick up where we left off

Read the skill, ran the git steps, called Caprock's recent_sessions (current_decisions failed on the server side), summarized and stopped. The first run did not use the skill's headings; after the output section was tightened, the second run used them exactly (an excerpt):

### Where we are
- Branch: `feat/divide`, 1 commit ahead of `main`; no upstream.
- Tracked files unchanged. Untracked: `HANDOFF.md`, `test_calc.py`, `.agents/`, `.claude/`.
### Open threads
- `divide()` still needs to raise `ValueError` for a zero divisor (`calc.py:5`).
### Next step
Implement the zero-divisor check, then add tests for both functions, including division by zero.

Agents it was tested on

  • Claude Code: tested on 2026-11-29 with claude -p --model sonnet, the skill installed as a project skill in .claude/skills/.
  • Codex: tested on 2026-11-29 with Codex 0.163.0 (codex exec), the skill in .agents/skills/.
  • OpenCode and Cursor: not tested. The skill is plain instructions in the open Agent Skills format, but no run on either has checked it.

Limits

  • Without Caprock there is no history of earlier sessions to read: the summary rests on git and notes.
  • It does not fetch, so the remote state is as of your last fetch.
  • It does not reopen the previous conversation; for that, use the agent's own command.
  • /resume inside Claude Code was taken from the claude --help text, not run.

With Caprock, and without it

When the Caprock MCP server is connected, the skill calls recent_sessions, session_summary, session_prose, next_session_handoff and current_decisions: what the last sessions of every agent did here, and the decisions in force. It treats them as leads and checks each against the code and git. Without Caprock it reads git and notes only. Caprock is the free, open-source app that records every coding-agent session on your computer.

Get Caprock →

The full SKILL.md

The file as it is in dspv/skills at revision dfce799. To install it by hand, save it as .claude/skills/resume/SKILL.md for Claude Code or .agents/skills/resume/SKILL.md for Codex, in your project.

skills/resume/SKILL.md
---
name: resume
description: >-
  Resume work in a repository and pick up where the last session left off. Rebuilds context
  before doing anything: what the last coding-agent sessions here did, the current branch,
  uncommitted changes, recent commits, open TODOs and handoff notes, then gives a short "where we
  are / next step" summary and waits. Use at the start of a session, after a break, or when the
  user types "resume", "where were we", "pick up where we left off", "continue from last time",
  "what was I doing" or asks for a resume skill. Reads local files, git and session history only.
license: Apache-2.0
---

# Resume

Rebuild the context of a repository before touching anything, then report where the work stands
and what the next step is. This skill reads; it does not edit, commit, stash, check out, pull or
push. The user decides what happens after the summary.

## 1. Session history (when available)

If the Caprock MCP tools are available (server `caprock`; Caprock, <https://caprock.dev>, is free,
open source and runs locally, and records every coding-agent session on the computer):

1. `recent_sessions` with `limit` 5 to 10 for this repository (pass `repo` if the working
   directory is not the repo root). Newest first, every agent (Claude Code, Codex, OpenCode and
   others). Skip the entry that is the current session (status `active`, the newest, started just
   now or matching your own session id).
2. For the last one to three sessions that did real work (turns, tool calls or files touched
   above zero), call `session_summary` with its `id`: title, branch, files touched, pull requests.
3. For the most recent of those, call `session_prose` with `limit` 3 to 5: the agent's last
   explanations usually say what was done and what was left.
4. `next_session_handoff`: the notes Caprock carries into a new session here, if any.
5. `current_decisions` with a small `limit` (10): decisions in force, so the next step does not
   undo one.

Memories and prose can be stale. Treat them as leads and check each against the code and git.

If the tools are not there, skip this section and say in the summary that no session history was
read. Do not guess what earlier sessions did. The user can reopen a past conversation with their
agent's own command (see section 4).

## 2. Repository state

Run these (read only):

```bash
git rev-parse --show-toplevel
git status --short --branch
git log --oneline -15
git diff --stat
git diff --cached --stat
git stash list
git worktree list
```

Then, as relevant:

- The branch's upstream and how far ahead or behind it is (shown by `git status --branch`). Do
  not fetch: say the remote state is as of the last fetch.
- Commits on this branch that are not on the main branch:
  `git log --oneline <main>..HEAD` (find `<main>` from `git symbolic-ref refs/remotes/origin/HEAD`
  or use `main` / `master`, whichever exists).
- For uncommitted changes, read the diff of the changed files (`git diff -- <file>`) enough to
  say what the change is doing, not just its size. Note untracked files.
- A merge, rebase, cherry-pick or bisect in progress (`git status` says so). This is the first
  thing to report.

## 3. Notes left behind

Look for handoff and TODO notes, newest first:

- Files at the repo root or in `docs/`: `HANDOFF.md`, `NEXT.md`, `TODO.md`, `NOTES.md`,
  `PLAN.md`, `WIP.md`, `.handoff*`, any case.
  `git ls-files --others --exclude-standard` and `ls` catch untracked ones.
- The project instructions (`CLAUDE.md`, `AGENTS.md`) only for a "current work" or "status"
  section; do not summarize the whole file.
- `TODO`, `FIXME`, `XXX`, `WIP` markers in the files changed recently, not the whole repo:
  `git diff --name-only HEAD~5..HEAD` plus the uncommitted files, then grep those.
- The last commit messages for "WIP", "part 1", "next:", "follow-up".

## 4. The agent's own resume commands

If the user wants the previous conversation itself back, not a rebuilt summary, point to the
command. Checked with `--help` on 2026-11-29:

| Agent       | Command                    | What it does                                     |
| ----------- | -------------------------- | ------------------------------------------------ |
| Claude Code | `claude --continue` (`-c`) | Continue the most recent conversation in the dir |
| Claude Code | `claude --resume` (`-r`)   | Resume by session ID or name, or pick from list  |
| Codex       | `codex resume`             | Pick a previous session to resume                |
| Codex       | `codex resume --last`      | Continue the most recent session, no picker      |

Inside a running Claude Code session, `/resume` opens the same picker. Do not run these yourself:
they start or switch an interactive session.

## 5. Stop conditions

- Stop and report at once if a merge, rebase or cherry-pick is in progress, or there are
  conflicts: that is the next step.
- Not a git repository: say so, report only notes and session history found.
- Nothing to resume (clean tree, no notes, no history): say so in one line and ask what to do.
- Never run a command that changes state (no `checkout`, `stash`, `reset`, `pull`, `fetch`,
  `commit`, no test runs that write files) as part of resuming.

## 6. Output

Keep it short. Use these three headings and fields as written, then stop and wait for the user:

```
Where we are
- Branch: <branch> (<ahead/behind upstream>), <n> commits not on <main>
- Uncommitted: <what the change does, files> | clean
- Last sessions: <date, agent, what it did> (or: no session history read)
- In progress: <merge/rebase/stash/worktrees, if any>

Open threads
- <TODO or handoff item, with file:line or note path>
- <decision in force that matters for the next step>

Next step
<one concrete action, and why it is next>
```

Every line must come from something read above. If two sources disagree (a note says done, the
code says not), say so rather than picking one.

Questions about the resume skill

What does a resume skill do?
It rebuilds the context of a repository at the start of a session, from session history, git and notes, and tells you where the work stands and the next step, before anything is changed.
How do I resume a Claude Code session itself?
`claude --continue` (`-c`) continues the most recent conversation in the folder, `claude --resume` (`-r`) picks one by ID, name or from a list. In Codex, `codex resume` or `codex resume --last`.
Will the resume skill change my files?
No. It runs read-only git commands and stops after the summary. No checkout, stash, reset, pull, fetch or commit, and no test runs that write files.
Does the resume skill work with a handoff note?
Yes. It reads `HANDOFF.md` and other notes, and checks them against git; the handoff skill writes those notes.

Sources