Skip to content
Agentmart
Submit a tool

endsession

Close the session.

Skill by spinlockdevelopment

IndexedMIT
Write a review

Chalk Labs

Need help deploying endsession?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/spinlockdevelopment-endsession

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Close the session. Writes Rules and Next into the context file, then commits, pushes (PR if needed), ships per `## Done` when the work is complete, prints a plain summary, stops. Hard stop — final message, no follow-ups. User-invoked only.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/endsession

What's inside

Skill name
endsession
Description
Close the session. Writes Rules and Next into the context file, then commits, pushes (PR if needed), ships per `## Done` when the work is complete, prints a plain summary, stops. Hard stop — final message, no follow-ups. User-invoked only.
License
MIT
Instructions
108 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • openai.yaml · agents/

SKILL.md (first lines)

# End session — final message

Do the pass, print the summary, stop. No offers, no "next I could", no new
work. Anything in `$ARGUMENTS` that is a task goes under `## Next`, not done now,
except the token `auto` (the session band's timed run): it means skip shipping.

This pass is deliberately light: context is at its largest now, so every extra
step is expensive. The full context file review runs at the start of a later
session, on a fresh context, when the SessionStart hook asks for it.

## Context file

Root `AGENTS.md` (Git root, or the session working directory outside Git);
`CLAUDE.md` is only the `@AGENTS.md` stub. Codex invokes this as `$endsession`.

## Questions

Ask only about destructive prunes, max 3, in one batch before any file is
written: dropping or merging a Rule or a P1 Next item that would destroy
information you cannot recover from the code, git, or this session, when you
cannot tell whether it still matters. Clearly stale → drop without asking.
More undecidable items than slots → keep them, list them in the Next backlog
as `P3 — confirm: <item>`. Never ask whether to commit or push: invoking
`/endsession` is the yes.

## Pass

1. No context file, or `CLAUDE.md` is not the stub → run `/lean-and-mean`,
   then continue.
2. **Rules** — scan this session for corrections the user made, approaches
   that failed, commands that didn't exist, wrong assumptions. Each becomes one
   line under `## Rules`: `- <imperative>. <why — the cost>. <YYYY-MM-DD>`.
   Same area as an existing rule → tighten it. Over 15 → merge the two weakest.
   Nothing learned → add nothing.
3. **Auto memory** — Claude Code only. Built-in memory files for this project
   (`~/.claude/projects/<project>/memory/`) of type `feedback` or `project`
   → promote each into a Rule or Next line, then delete the file and its
   `MEMORY.md` line: the committed context file is the one memory. Leave
   `user` and `reference` memories alone.
4. **Done?** — read `## Done`; missing → add it before `## Rules` as
   `- Committed and pushed; PR open if the branch needs one.` plus Next item
   `P3 — confirm: define ## Done (merge? deploy command?)`. The session is
   complete only if all hold: what the user asked this session is finished; the
   `## Commands` test/lint passed this session (not run → run once now); no open
   question; `$ARGUMENTS` is not `auto`. Ambiguous → not complete.
5. **Next** — rewrite the top of `## Next` to the real next action. Not
   complete and `## Done` lists more than the push → first line
   `Not done: <remaining Done items> — <why>`. In the backlog below it, delete
   finished items, add newly required ones, keep it sorted P1 → P3. A leftover
   `## Todo` section → merge its items into that backlog.
6. **Review flag** — this session changed something the context file describes
   outside Rules/Next (layout, commands, stack, conventions) → add
   `<!-- lean-and-mean: review -->` as the last line of the context file, once
   (skip if already there). The next session start runs the full pass and
   removes it. Do not do that pass now.
7. **Commit** — not a git repo or nothing changed → skip. Otherwise stage the
   session's changes plus the context file and commit, after the edits above.
   Full-English message in the project's commit format. Never stage files that
   look like secrets (`.env`, keys, credentials); leave them out and name them
   in the summary.
8. **Push** — no remote → skip. Use the push command the context file names,
   if any, else `git push` (`-u origin <branch>` when no upstream).
   - On a non-default branch: push, then open a PR with `gh pr create --fill`
     unless one is already open for the branch.
   - On the default branch: push. Rejected as protected or requiring a PR →
     create `session/<YYYY-MM-DD>-<short-topic>`, push it, open a PR.
   - Rejected as behind the remote → stop and report; never force-push or
     rebase.
   - Any other failure (auth, network) → one attempt only; report it and put
     `Unpushed: <branch> — <reason>` as the first line of `## Next`, amending
     the commit.
9. **Ship** — complete only. Run the `## Done` items in order, using only
   commands written in `## Done` or `## Commands`; never infer a merge or
   deploy from CI files or scripts. Merging a PR: `gh pr merge` with the
   strategy `## Done` names (default `--squash`) and `--delete-branch`, then on
   the default branch `git pull`, `git fetch --prune`, and `git branch -d`
   (never `-D`) every local branch `git branch --merged` lists, except the
   default; a `-d` refusal goes in the summary, never stops the chain.
   Squash-merged older branches and other remote branches stay. Any other
   failure stops the chain: write `Not done: <remaining items> — <error>` as
   the first line of `## Next`, commit it as a new commit, push per step 8.

No session log: history is `git log`. Do not write SUMMARY.md.

## Summary

Plain, simple language. Full sentences, no jargon, no fragments. This is the
final output.

```
Session closed.

Done this session:
- <what was built or fixed, one line each>

Updated:
- <selected filename>: <rules added or tightened, Next changes, review flagged>
- Committed: <short hash and subject>
- Pushed: <branch>, PR <url>, or "Not pushed: <reason>"
- Shipped: <merged PR, branches deleted, deployed where>, or "Not done: <what remains and why>"

Next time:
- <the first thing to do, from ## Next>
```

Omit any line that would say "nothing". Then stop.

From spinlockdevelopment/lean-and-mean, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 8, 2026 (23 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from spinlockdevelopment

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get endsession running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying endsession?

CallGet help
Cite this page

endsession skill. Agent Mart. https://agentmart.dev/skills/spinlockdevelopment-endsession (last updated 2026-10-24)