Skill resume: continue de onde a última sessão do agente de programação parou

Dmitriy Solodukha, desenvolvedor do Caprock · Publicado em

Testado em no Claude Code e no Codex

A skill resume reconstrói onde você parou: sessões, branch, trabalho sem commit, TODOs e notas de handoff; depois indica uma próxima etapa e espera.

A skill resume reconstrói o estado do trabalho antes de o agente tocar em qualquer coisa: o que fizeram as últimas sessões de agentes de programação aqui, a branch atual, alterações sem commit, commits recentes, TODOs em aberto e notas de handoff. Depois, apresenta um resumo curto sob três títulos, Where we are, Open threads e Next step, e espera por você. Ela só lê: sem checkout, stash, pull ou commit.

Instale a skill resume

Um comando por agente. A skill é um único SKILL.md; nada é executado na instalação.

Todas as nove skills como plugin. Digite isto dentro do Claude Code:

Ou apenas esta skill, em um terminal na pasta do seu projeto:

Adicione -g para instalar em todos os projetos.

Prompts que usam a skill resume

O agente escolhe a skill quando suas palavras correspondem à descrição dela; citar seu nome garante isso. Clique em um prompt para copiá-lo.

O que a skill resume lê

  1. Histórico de sessões, com o Caprock: as últimas sessões de todos os agentes neste repositório, um resumo de uma a três das sessões mais recentes que fizeram trabalho real, suas últimas explicações e as decisões em vigor. Sem o Caprock, informa que nenhum histórico de sessões foi lido, em vez de adivinhar.
  2. Estado do repositório, somente leitura: branch e upstream, commits que não estão na main, o diff dos arquivos sem commit, stashes, worktrees e um merge ou rebase em andamento, que é relatado primeiro.
  3. Notas deixadas: HANDOFF.md, NEXT.md, TODO.md e similares, TODO e FIXME em arquivos alterados recentemente, e "WIP" em mensagens de commit.

Quando duas fontes discordam (uma nota diz que está pronto, o código diz que não), ela informa isso em vez de escolher uma delas.

O que executamos e o que os agentes fizeram

Cada skill foi executada em 29 de novembro de 2026 em um repositório descartável criado para ela, com a skill instalada como skill de projeto. Um repositório na branch feat/divide com um commit WIP, um TODO em calc.py e HANDOFF.md e test_calc.py não rastreados.

Claude Code (claude -p --model sonnet, sem o servidor MCP do Caprock (--strict-mcp-config))

where were we? pick up where we left off

Invocou resume, executou os passos de git, encontrou TODO e o handoff, disse que nenhum histórico de sessões foi lido, percebeu que a mensagem de commit e HANDOFF.md indicavam próximos passos diferentes, propôs um e não alterou nada.

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

where were we? pick up where we left off

Leu a skill, executou as etapas de git, chamou recent_sessions do Caprock (current_decisions falhou no lado do servidor), resumiu e parou. A primeira execução não usou os títulos da skill; depois que a seção de saída foi refinada, a segunda execução os usou exatamente (um trecho):

### 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.

Agentes em que foi testada

  • Claude Code: testado em 29 de novembro de 2026 com claude -p --model sonnet, com a skill instalada como skill de projeto em .claude/skills/.
  • Codex: testado em 29 de novembro de 2026 com Codex 0.163.0 (codex exec), a skill em .agents/skills/.
  • OpenCode e Cursor: não testado. A skill contém instruções simples no formato aberto Agent Skills, mas nenhuma execução em qualquer um dos dois a verificou.

Limites

  • Sem Caprock, não há histórico de sessões anteriores para ler: o resumo se apoia em git e nas notas.
  • Ela não faz fetch, então o estado remoto é o do seu último fetch.
  • Ela não reabre a conversa anterior; para isso, use o comando do próprio agente.
  • /resume dentro do Claude Code foi extraído do texto de claude --help, não executado.

Com e sem Caprock

Quando o servidor MCP do Caprock está conectado, a skill chama recent_sessions, session_summary, session_prose, next_session_handoff e current_decisions: o que as últimas sessões de cada agente fizeram aqui e as decisões em vigor. Ela trata isso como pistas e confere cada uma com o código e o git. Sem Caprock, lê apenas git e notas. Caprock é o app gratuito e open source que registra todas as sessões de agentes de programação no seu computador.

Obtenha o Caprock →

O SKILL.md completo

O arquivo como está em dspv/skills na revisão dfce799. Para instalá-lo manualmente, salve como .claude/skills/resume/SKILL.md para Claude Code ou .agents/skills/resume/SKILL.md para Codex, no seu projeto.

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.

Perguntas sobre a skill resume

O que faz uma skill resume?
Ela reconstrói o contexto de um repositório no início de uma sessão, a partir do histórico de sessões, git e notas, e informa o estado do trabalho e a próxima etapa antes de qualquer alteração.
Como retomo a própria sessão do Claude Code?
`claude --continue` (`-c`) continua a conversa mais recente da pasta, `claude --resume` (`-r`) escolhe uma por ID, nome ou em uma lista. No Codex, `codex resume` ou `codex resume --last`.
A skill resume vai alterar meus arquivos?
Não. Ela executa comandos git somente de leitura e para após o resumo. Sem checkout, stash, reset, pull, fetch ou commit, nem testes que gravem arquivos.
A skill resume funciona com uma nota de handoff?
Sim. Ela lê `HANDOFF.md` e outras notas e as confere no git; a skill handoff escreve essas notas.

Fontes

O app em si está em inglês.