Checkpoint

From dtiger1889-ops/claude-harness-toolbox · View interactive version

Checkpoint is an AI agent skill from the GitHub repository dtiger1889-ops/claude-harness-toolbox. Updates the current project's CHECKPOINT.md in place so another session can resume from verified state. Use for /checkpoint, "save progress", "update checkpoint", a completed unit of work, or impending compaction; never ask whether to checkpoint, just do it. Preserves history, records unfinished wor

How to use this skill

Skill file

Checkpoint

The CHECKPOINT is state, not a spec: a cold session must be able to resume from it alone. Update existing state in place; do not create timestamped handoffs or replace a project's established schema. Honor an explicit stop after saving the requested partial state.

Resolve <skill-dir> to the directory containing this loaded SKILL.md, including plugin installations. Bundled helpers require PowerShell 5.1+ or pwsh 7+ (and Python 3.8+ for the optional JSONL changelog). Run them through native PowerShell, not a PowerShell command string nested inside another shell, which can eat $.

1. Read and choose depth

Light close (the default when this session already edited the file and its content is in context). Do not re-read or re-verify what you just changed:

Full review only on a cold start (no read or edit of the file this session), when the stamp is older than 30 days, or when asked. Locate the nearest project CHECKPOINT.md and read it to EOF, continuing targeted reads if output is truncated. Read applicable project instructions. Verify every claim you carry forward against the relevant artifacts; never carry forward a claim you did not re-check. Recheck stale claims without resurfacing a settled decision as a live problem, resolve relative dates ("tonight's run") to absolute dates, and label uncertainty. A current stamp is not proof that every claim has been tested.

2. Reconcile live state

Preserve the existing sections. Each answers one question; keep them from leaking into each other:

Sweep the session before you write, because corrections hide in throwaway lines: (a) every correction or pushback the user made; a standing one goes to the project's instructions, a session-scoped one to Key decisions; (b) every approach tried and rejected, under Failed approaches: with its evidence and "fixable if X" when the reason is fixable; (c) a constraint stated once still governs; recency is not importance. Everything recorded must trace to the session; only explicit or established standing preferences belong in permanent instructions.

Remove completed open items after ensuring they have a durable record: if the substance is not already recorded, fold a one-line record into the changelog first. Relocating content (a hardened rule to instructions, a closed decision or old changelog to an archive) moves it for real; never silently discard useful state.

What is not a thread. A passive watch, a "confirm it still works", or a standing condition is not a thread. A verification the model invented to reassure itself (spot-check, re-test, "verify next run") is dropped, not written as a thread. Keep a watch the user set up, and a real problem whose cause is unknown (its next action is "find the cause"). Every thread names a concrete next action, never "keep an eye on it".

A self-runnable check is never deferred. If the session can run it (a test, a probe, reading a log or the live file), run it now and record the verdict in the changelog. If it truly cannot be resolved this session, close it out of Open threads with a changelog entry a cold session could re-run from. Other unfinished work goes into Open threads or the project's tracker in this rewrite, never as a spoken "next session" promise.

Thread shape. A thread is one short line: what it is in plain words, a link to where the detail lives (spec, decision record, note), then its tags. Commands, test counts, evidence and past-step dates go in the linked file, moved there first; aim under 250 characters. A thread with no spec or supporting doc is the only record, so it carries everything a cold session needs (next action, evidence, options, who decided what), however long.

3. Tag actionable threads

End each top-level open bullet with a gate tag, then a complexity tag:

Optional [gates: go] or [blocked-by: dependency] tags precede the final pair. Sub-bullets need no tags. Don't sort by hand: the finisher sorts owner-low, owner-high, agent-low, agent-high and regenerates the optional Owner-gated / Agent-side sub-headers. Model selection still follows the host's policy; these tags are planning hints.

4. Preserve history

Every completed unit gets a changelog entry, even research-only or "one-off" work. The entry goes in one place: a new ### YYYY-MM-DD -- summary (vN) block at the top of Harness changelog (newest first), never in the Last updated: line or Status. If the project uses a different history store or append helper, follow it.

Existing entries are immutable, including entries added earlier this session: never summarize, shorten, merge or tidy them, especially not to fit a cap. You may correct a factual error, stating so in the new entry. Do not pass old entries through the model: restructure the live sections and prepend the new entry with surgical edits, carrying the old body byte-identical. Archive old entries only for overflow, using the bundled byte-preserving mover.

JSONL mode (optional). A project is in it when changelog.jsonl sits beside its CHECKPOINT.md: history lives in that file, one JSON object per line, oldest first, append-only, and the CHECKPOINT's Harness changelog holds exactly the newest entry plus an Older entries: changelog.jsonl ... pointer. Opt in once with python <skill-dir>/changelog_jsonl.py convert --checkpoint <CHECKPOINT.md> --archive <archive/harness_changelog.md> --out <changelog.jsonl> (it verifies a byte-identical round trip before keeping the file). In this mode never Edit the entry into the CHECKPOINT or open the JSONL in an editor: write the new heading and body to a scratch file, then run

python "<skill-dir>/changelog_jsonl.py" append --jsonl "<project>/changelog.jsonl" --entry-file "<entry.md>" --checkpoint "<checkpoint path>"

It locks the file, validates the JSON, refuses a heading or date+title equal to the last line, appends one line, and swaps the inline entry (re-read before your next edit). Exit 1 means refused and nothing written: fix what it names. Look history up with render --jsonl <file> --grep <pattern> (newest first).

5. Validate before finishing

& "<skill-dir>/verify_checkpoint_claims.ps1" -Checkpoint "<checkpoint path>"

Run it on every close, light closes included. Exit 2 blocks completion; fix each named failure and rerun until it exits 0:

The REVIEW block (live git state against the file's unpushed or uncommitted claims) and the advisory prompts are judgment items to reconcile in the rewrite: stale or owner-gated threads; tag pairs and order; defect on owner (an [owner] thread about the workspace's own broken tool with no owner-only step: retag it [agent] or name that step); attribution (a verdict with no author or date); attribution source (a line new since git HEAD credits the owner with no quote of their words, no source and no "evidence unavailable", or credits them with a hold, pause, skip or cancel without their own action word in a quote: add the source or relabel the line as the model's; a scoped instruction is recorded with its scope, never as a decision about the thing); note decision (a pointed-at note's "Decision" heading with no owner-decision tag reads as a model draft); jargon; and verified claims (a Status or Key decisions line saying verified, tested, passes or confirmed with no run name plus date or test count: add what was run and when). These prompts are addressed to the model; do not relay them as the user-facing report.

Configuration:

These checks detect structural claims and date patterns, not semantic correctness. Read and assess the evidence yourself. verify_checkpoint_claims_tests.ps1 beside the verifier exercises each check.

5b. Close finished tracker rows

If the project uses a tracker with rows tied to it, find the rows whose work this session finished. Give each a dated reply (YYYY-MM-DD -- closed at checkpoint: <what shipped, one clause, pointer>) and mark it done. Never delete a row, never write in the user's own notes field, and never touch a row this session did not finish. A row whose agent share is done closes even when an owner step remains; that step lives in a CHECKPOINT thread the reply names. No matching rows is the normal case.

6. Finish and enforce limits

& "<skill-dir>/finish-checkpoint.ps1" -Checkpoint "<checkpoint path>"

Run once per file per close, when that file is final; never restamp after intermediate edits (the only sanctioned rerun is after compressing an over-cap file). A close that touched several projects' checkpoints runs it once for each; never hand-stamp a sibling file. The helper stamps actual UTC, preserves the existing bare version tag, sorts threads, and measures limits. Update a changed version tag before running. Re-read before any later edit: the helper rewrites the file on disk.

Default limits are 120 lines and 30 KB; live sections are terse pointers and narrative lives in the changelog. Section guidance: Status one line/about 300 characters, Goal three lines, Next step two lines/about 350 characters. An Open-threads bullet over 350 characters that links a spec or doc gets a warning (the detail belongs in that doc); a bullet with no supporting doc may run long. Section budgets are advisory unless <!-- checkpoint-budgets: strict --> appears in the first five lines.

On overflow in inline mode, the finisher archives oldest changelog entries byte-verbatim to archive/harness_changelog.md, keeps the newest two inline, and maintains an Older entries pointer. In JSONL mode it skips archiving (the mover refuses too), so over cap means compressing live sections. If it still exits 2, re-read the file, relocate live detail to its owner, tighten live sections, and rerun once; if still over, ask before overflowing. Never ship an over-cap file silently or claim successful completion.

For rare manual archive ranges, use the bundled archive-changelog.ps1 with -Checkpoint, -Archive, -FromLine, -ToLine, and -AtTop, once, after reading its parameter help (it fails closed on a bad range). Verify the pointer afterward and rerun the finisher. Never use model regeneration for the move. For a fixed checklist with a stable item set, keep per-item done state in a JSON sidecar and the prose in the markdown twin.

7. Report

One line: what changed, plus the new line count and byte size. Include material open work or validation limitations. Nothing the helpers printed goes into it (near-cap advisories, re-read reminders, archive traces, exit codes); the caps are housekeeping, not the user's concern.

Restricted runtimes

Use a connected filesystem, checking reachable roots at the moment of need. Do not assume a container shell reaches the user's disk, and re-read a file that looks truncated before writing.

Without PowerShell, reconcile state manually, stamp with a real UTC clock, measure line and byte counts with available tools (count lines with a method that includes the last line), and preserve history exactly. Record "helpers not run" and the missing validation in the new entry. If a byte-preserving archive move is unavailable, leave history intact and record the overflow blocker rather than approximate the move or claim success. In JSONL mode without Python, replace the inline entry by hand, write "JSONL append owed" in it, and never hand-edit changelog.jsonl; the next local close's verifier flags the mismatch, which the append script fixes when given that inline entry as --entry-file.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.