agentleFS
nino-chaveznino-chavez/agentic-ways-of-working/skills/session-closeout/SKILL.md

session-closeout

Skill2 starsChanged 58 days agoMITView on GitHub

Preserve durable lessons and produce an archive-safety receipt before ending, clearing, or archiving an agent task. Use without being asked when a task reaches its finish line (its PR merged and its worktree removed, or the deliverable handed over), and when the operator says close out, wrap up, end the session, prepare the task for archive, make it archive-ready, or invokes $session-closeout after substantive work.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep what should survive the task without treating the full transcript as permanent memory.

    line 8
  2. Distinctive:

    Prefer an existing source of truth over a new recap file.

    line 37
  3. Distinctive:

    Do not archive or delete the task.

    line 40
  4. Very specific:

    When the answer is no, the first line names the blocker, and the next step clears it.

    line 64
  5. Distinctive:

    Write it to be read, not parsed:

    line 66
  6. Distinctive:

    When more than about six items landed, list the ones that change behavior and fold the rest into one bullet, such as "Follow-ups, all …

    line 70
  7. Distinctive:

    Use backticks only for a path, SHA, or command the reader would copy.

    line 72

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Session Closeout

Keep what should survive the task without treating the full transcript as permanent memory.

Workflow

  1. Reconstruct the outcome from the workspace and external receipts. Inspect the relevant status, diff, tests, artifacts, and deployment evidence. Treat prior summaries as leads, not proof.
  2. Sort the residue:
    • stable project truth that belongs in an existing canonical document;
    • a reusable method that belongs in the configured memory or recipe store;
    • chronology that can disappear with the transcript;
    • unresolved work, secrets, private material, or unverified claims that block safe archival.
  3. Decide the fate of the workspace this task created. List each linked worktree, branch, file written outside git, and running dev server, database stack, or browser tab the task started (git worktree list, git branch, git status --porcelain in each checkout it wrote to, the session scratchpad, the commands it ran). Give each exactly one disposition and record it:
    • merged into the base branch, or landed by squash or cherry-pick (confirm with git cherry <base> <branch> or a content check): remove the worktree with git worktree remove (no --force) and delete the local branch. If git refuses because the worktree contains submodules, git worktree remove --force is correct once git status --porcelain in it prints nothing. Never run git submodule deinit in a linked worktree: it unregisters the main checkout's submodules too;
    • commits not in the base branch: push the branch so the work is not only on this machine, and name the open PR or the reason it stays open;
    • uncommitted changes: commit them to the task's branch, or state why they are discarded. Never leave them undecided;
    • evidence in an ignored folder that is still needed (.artifacts/, receipts, a backup app): move it to the repository-level .artifacts/ or a canonical document before removing the worktree, and name what was kept;
    • a process the task started: stop it.
    • a file the task wrote outside git (the session scratchpad, /tmp, a notes or handoff folder, an untracked file in a shared checkout, an external drive): delete it, or first move it to a durable home (the repository, a tools folder, or beside the thing it records) and name where. A receipt that memory or a document points to must live somewhere that outlives the session; a scratchpad or an app-managed notes folder does not.
    • a worktree or ignored folder that a build or release depends on: lock it with git worktree lock --reason "<what depends on it>", or move the dependency to the repository-level .artifacts/. A note in memory protects nothing; the reaper and fleet sweeps skip locked worktrees. Touch only what this task created. Leave a worktree held by a live session, a locked one, and the worktree this session is running in (its host removes that one). Report anything you could not decide. Reclaiming build output in idle worktrees is the reaper's job, not this step's.
  4. Scan this session's transcript for credentials. Run it after step 3, so it also covers the commands the closeout ran. In Claude Code:

    python3 "${CLAUDE_SKILL_DIR}/scripts/secret-scan.py" --session-id "${CLAUDE_SESSION_ID}"

    Codex fills in neither variable, so that command fails there. In Codex, run scripts/secret-scan.py from this skill's directory with --session-id "$CODEX_THREAD_ID"; Codex names each rollout file after that thread id. In any other harness, pass --transcript <this session's file>. With no arguments the script takes the newest session for the current folder. In every case, check that the Scanned: line names this session. The scan prints names and line numbers, never values. Do not print or quote a value to judge a finding.

    • Exit 0 is clean. Exit 2 means the scan did not run, which is not clean.
    • live means a credential that is current in this environment was printed into the transcript. You cannot rotate it. Make rotating it the receipt's next step.
    • Any other finding: it was rotated, or it is not a credential (a test fixture, a public client key, documentation). Say which. Otherwise treat it like live.
  5. Prefer an existing source of truth over a new recap file. Update it only when the task already authorized the underlying change. Never manufacture human approval, readiness, or evidence.
  6. Save a reusable recipe only when another task is likely to benefit. Use the project's documented memory command or knowledge store. If ~/.config/session-closeout/recipe-store.md exists, it names this machine's store for each harness; follow it. Keep the entry short, sourced, and free of raw private text. If no durable recipe exists, save none.
  7. Confirm the transcript has been queued or ingested by the configured lifecycle hook. Do not perform mining inside the hook; the hook should enqueue identity and return quickly.
  8. Do not archive or delete the task. Give the operator the receipt and let them take the irreversible action.

Required receipt

The receipt is your closing message, written as Markdown that the reader takes in at a glance. Never wrap it in a code block: a fence renders as one monospace run with no links and no bold. Do not put a recap above it that repeats it. Keep every label, and write "none" or "nothing" instead of dropping one, so the reader can tell an empty answer from a forgotten one.

### Archive-safe: <yes|no>. <For yes, a short reason, such as "Ready to archive." For no, the blocker.>

**Your next step:** <one concrete action, or none>.

**What landed**
- [<repo>#<number>](<full PR URL>): <what it changed, in plain words>

**Still open:** <each claim not yet proven, or item waiting on someone; or nothing>

**Saved for later:** <each canonical document, memory, or recall recipe updated, and what it holds; or nothing new>

**Checks**
- Secret scan: <clean; or each finding (kind and name) with its disposition; or error>
- Evidence: <how you verified what landed>
- Cleanup: <each worktree, branch, process, and file outside git this task created, with its disposition; or none>

When the answer is no, the first line names the blocker, and the next step clears it. Example: ### Archive-safe: no. A live token was printed into this transcript. then **Your next step:** rotate the Cloudflare token.

Write it to be read, not parsed:

  • One item per bullet, about 15 words or fewer after the link. A label with one short answer keeps it on the label's line; two or more become bullets.
  • Link every PR with short text, [repo#number](full URL), then say what it changed. In the desktop app, link text of the form owner/repo#number turns into a wide chip with a truncated commit title and a cached state that can be stale (a merged PR showed as open). Short link text stays a plain link, and the plain clause carries the meaning.
  • When more than about six items landed, list the ones that change behavior and fold the rest into one bullet, such as "Follow-ups, all merged:" and their links.
  • Group cleanup by disposition when several items share one ("4 task branches merged; their worktrees and branches removed").
  • Use backticks only for a path, SHA, or command the reader would copy.
  • The verdict is the only heading: bold barely shows in the app's dark theme, and the heading also marks where the receipt starts. No other headings, no tables (long cells wrap badly in a chat column), no nested lists. Fit the receipt on one screen.

Set Archive-safe: yes only when the durable lesson is stored, the secret scan exited 0 or every finding is rotated or shown not to be a credential, evidence is named, every worktree, branch, process, and file outside git the task created has a recorded disposition, no commit exists only on this machine, nothing still needed lives only in a scratch location, and nothing requires the raw transcript to resume safely.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.