Чекпоинт или закрытие сессии — зафиксировать состояние, ничего не потеряв. Checkpoint or close a session — reconcile what is proven, rewrite the live HANDOFF state file (§13), statuses and journal. NOT for handing work to another agent or worktree (that is orca-cli/orchestration). Use when the context window is running out, «сохрани состояние сессии», «сделай чекпоинт», «/pf-handoff», перед /compact или /clear, save session state.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pf Handoff?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/turvodnik-pf-handoff)
---
name: pf-handoff
description: Чекпоинт или закрытие сессии — зафиксировать состояние, ничего не потеряв. Checkpoint or close a session — reconcile what is proven, rewrite the live HANDOFF state file (§13), statuses and journal. NOT for handing work to another agent or worktree (that is orca-cli/orchestration). Use when the context window is running out, «сохрани состояние сессии», «сделай чекпоинт», «/pf-handoff», перед /compact или /clear, save session state.
---
# pf-handoff — capture the state, losing nothing
Always communicate with the user in the user's language (Russian in the origin system). The HANDOFF file, its section names, journal and status formats stay exactly as written below.
The live task state is the project's HANDOFF file `.agents/runtime/handoff/YYYY-MM-DD-<slug>.md` (§13). The skill rewrites it whole: fresh, precise, no residue. Two modes: **checkpoint** (work continues) and **close** (session ends). Full context-budget rules (memory layers, window thresholds, subagent swarms, human cheat-sheet) — `references/context-rules.md`.
## Steps
1. Pick the file: the active HANDOFF of this task (`status: active`), or create one from `references/handoff-template.md`; slug — ticket number or topic. `session_id` in the frontmatter — the FULL value from the start hook's line `Сессия: <id>` (Claude Code or Codex with the pf-handoff hooks), never a shortened one: the hooks call a HANDOFF yours only on an exact match (two sessions can share the first 8 characters); an 8-character value left by 2.1.0 still counts as yours only while no other active HANDOFF shares that prefix. No such line (no hooks) — `—`, and the hooks then show the file to a compacted session only as a reference, not as an order to continue. If this session did NOT work the task and the active file belongs to another task/session — that is not a checkpoint: report what you found and ask before rewriting someone else's file (§13: the owner writes, others read).
2. Reconcile before writing: list what is DONE and how it is proven (command output, test, commit — §11). Unproven items do not go into «Состояние» — they go to «Следующий шаг» or «Блокеры».
2a. **Optional Codex pass over uncommitted code.** Only on closing (step 5), and only when the tree holds uncommitted *code* — a checkpoint mid-work is not the place, and a docs-only tail is not worth the quota. This is the exception path, not the norm: a session that followed the pf-do contract has committed its work — and when the session worked outside the main branch, step 6 treats an uncommitted tail as a reason to stop and call the human. The normal place for a review is before the commit (pf-do step 5a); step 2a exists so that a dirty tail left behind is at least looked at before it is handed over. Run it **only** through the companion script `~/.claude/skills/pf-do/scripts/codex-review.sh` (shipped with pf-workflow; if the skills live elsewhere, look for `pf-do/scripts/codex-review.sh` under your skills directory). The script owns the gates — Codex present, project consent in `.agents/codex-review.json`, code in the diff. No such script — skip the step silently; never call `codex` directly instead, that would spend the human's paid quota without their consent. The script exits 1 when a review was attempted but failed — that means "not reviewed", not "clean"; note it and move on. Findings do not become work: a leaving session fixes nothing. Put the report path plus one line of digest into «Следующий шаг», so whoever picks the task up starts with the remarks in hand instead of discovering them after merging.
3. Rewrite the file WHOLE per the template, ≤120 lines: Цель / Состояние / Следующий шаг / Блокеры и вопросы / Ключевые файлы и решения / Не делать. The frontmatter `session_id` gets this session's full id (step 1) on every rewrite — including an own file that still holds `—` or 8 characters: from that checkpoint on the hooks restore it automatically again. Anything stale from the previous version — one line in «Не делать», or out.
4. Refresh `updated` in the frontmatter and the statuses of the affected task packets (§9).
5. Close (session ends, or the human asked): `status: closed`, journal entry §10 (decisions and the handoff, not diffs), a new reusable solution, if any → a line in the SOLUTIONS file: `solutions_path` from `~/.config/pf-handoff/config.json`, or, without that file, the one your rules name (neither — skip this). Commit it by explicit path when it sits in a git repo; push only when `solutions_store` there is `github` (or your rules say so) and you are on that repo's main branch — a repo that merely contains the file (dotfiles) is never pushed; off main — just note it in «Состояние», step 6. Then one line to the human on how to continue: same chat — just continue; new chat — `/pf-resume <slug>`; terminal closed — `claude --continue`.
6. Closing while off main — write the branch, HEAD SHA and «не слито, ждёт приёмки» into «Состояние»; uncommitted changes — stop, tell the human. Never merge, push or delete here: integration is separate, `references/branch-closing.md`.
## Milestone handoff
Window percentages are not visible everywhere (Codex, Antigravity, Grok, ChatGPT, Cursor do not see their own), so the HANDOFF is also rewritten at **milestones** — on every platform.
- **Milestones** (5): a job summary of the autopilot accepted; a subagent or external process launched; before an external action (push, deploy, tag); end of a wave; before starting a long process.
- **Who writes — one rule for every role.** The HANDOFF belongs to the session that owns the shared state: the orchestrator, or the only agent of the session. A packet executor dispatched by an orchestrator (a subagent, a `council.sh run` process, a parallel session under pf-auto) does not create or rewrite any HANDOFF — its progress goes into the packet: status and «Результат» with interim notes, committed as it goes. The one exception is a **standalone executor with no orchestrator** (a human opened a fresh session with «выполни T-###»): that session is the only agent, so it owns its HANDOFF — `task: T-###`, its own `session_id` — and writes checkpoints there by the same rules.
- **Form:** milestone at < 50 % of the window — a short snapshot of about 10 lines (goal, step, what is proven, what not to do; result ≤ 15 lines); at ≥ 50 % or when the percentage is unknown — the full `pf-handoff` (steps above).
- **Launch of a subagent / external process:** rewrite the HANDOFF right after the launch, not at the next summary: the registry row carries the job and its id — `agentId` of the subagent, PID of the process, or the `council.sh` marker. After a compaction the parent links the completion notification to the job only through this row (the start hook prints its wait list from it).
- **Manually:** `/pf-handoff` or the words «сделай хендофф», on any platform. Without hooks — `scripts/pf-handoff.sh`: `--path` prints the active HANDOFF (creates one from the template if none), `--short` prints the short snapshot to fill in, `--touch` refreshes `updated:`. The script only finds files and prints templates; the content is the agent's.
## Forbidden
Appending instead of rewriting; exceeding 120 lines; unproven claims in «Состояние»; retelling tasks already closed in the journal (the journal is the source — HANDOFF gets one line with a pointer); inserting secret values (§5); committing HANDOFF to git (the directory is in .gitignore — long-term history lives in the journal).