
One command that closes a Claude Code session: commit only its own files, check them, update the docs and say what is not live yet. With a prompt to build your own.
At the end of almost every Claude Code session I typed the same request: commit, push, update the docs. In one month of my own sessions (late August to late September 2026) I typed it by hand in 114 of 296. So I turned it into one command, ship. This post explains what it does and why each step is there. At the end there is a prompt you can paste into Claude Code to build your own version, fitted to your setup.
What ship does
Ship is a Claude Code skill: a short instruction file that Claude loads when I type "ship" or "commit and push". It runs seven steps in order:
- List the files this session changed.
- Check them for syntax errors.
- Commit only those files.
- Push the branch.
- Route what was learned into the docs and the todo list.
- Report what is not live yet.
- Recap in a few lines.
It never runs on its own. Commits stay opt-in.
Commit only what this session touched
I often run several sessions on one server, and they share one working tree and one git index. A plain git add -A then picks up another session's half-finished work and ships it under the wrong message. That is the main problem ship solves.
The command does not trust Claude's memory of what it changed. It reads the session's own transcript instead. Every file edit is recorded there with its path, and the transcript survives when a long conversation is summarised. A small helper script groups those paths per repository into three lists:
- Mine, uncommitted: commit these.
- Mine, clean: already committed, nothing to do.
- Not mine, changed: another session's or my own manual work. Never revert it, never fold it into my commit.
The commit then names its files explicitly:
git add -- src/Price.php src/price.js
git commit -m "Fix price rounding on the coin page" -- src/Price.php src/price.js
A hook in Claude Code backs this up. Before any shell command runs, it refuses git add -A, git add ., git stash, git reset --hard, git commit --amend and a commit without paths. The skill says plainly: do not look for a way around it.
There is one blind spot. A file changed through a shell command (a search-and-replace, a build step, a minifier) does not show up as an edit in the transcript. The skill tells Claude to add those by hand.
Another session's complete, intentional change gets its own commit with an accurate message, after mine. If it looks half-finished, it stays where it is and the recap says so.
Check before committing
Each file type gets its cheapest syntax check, on my files only: php -l for PHP, bash -n for shell scripts, python3 -m py_compile for Python, node --check for JavaScript. On top of that come the rules of my own project, such as a minified file that must be rebuilt and committed together with its source.
A failed check stops the ship for that repository. Claude reports the error and does not commit around it.
Push, but do not deploy
Ship pushes the current branch and stops there. If the push is rejected because another session pushed first, it rebases only when my commit is the only local one. Otherwise it stops and tells me. Merge requests and production deploys are separate steps. Ship names them as pending, but never runs them unasked.
Route what was learned
This is the step that pays back most over time. A session often finds a trap or a rule along the way. Ship puts each kind of output where it belongs:
- A lesson or gotcha goes into the topic doc, and into a comment at the risky line of code.
- A closed task moves to the done list with a date.
- New work goes into the todo list with a created date.
- A finished plan gets a status line. It is never deleted, because the plan is the only record of why.
The doc edits are commits too, in the same run. Next month, the next session reads them instead of finding the same trap again.
Say what is not live yet
A commit is not a release. Before it says "done", ship answers four questions with evidence, not memory:
- Did a rendered page change, and was its cache cleared and checked?
- Is a change merged but not deployed?
- Is a monitoring check I fixed still red?
- Was anything skipped, such as tests or a language version of a page?
"Done" means that list is empty. The recap then shows the commit per repository, whether it was pushed, which docs changed, what was left alone and why, and what is still open.
Build your own
My version is full of rules for my own servers, so copying it would not help you. Paste this prompt into Claude Code inside your project instead. Claude inspects your setup, asks about what it cannot find, and writes a ship skill that fits.
Build me a Claude Code skill called "ship" in .claude/skills/ship/SKILL.md that closes out a session's work.
First inspect this environment and ask me about anything you cannot find: my repositories and branches, whether several sessions share one working tree, my languages and their syntax checks, generated files that must be committed with their source, where I keep docs, todos and plans, and how I deploy and clear caches.
The skill must:
1. List the files this session edited, read from the session transcript, grouped per repository into mine-uncommitted, mine-clean and not-mine-changed, using a small helper script. Note that shell edits are not in that list.
2. Run a syntax check per file type on my files only, and stop that repository on a failure.
3. Commit only my paths with "git commit -- <paths>", one commit per repository. Never git add -A, stash, reset --hard or amend.
4. Push the current branch. Never merge or deploy unless I ask.
5. Route lessons into the right docs, move closed todos to a done list with dates, add new todos.
6. Check with evidence what is not live yet: deploys, caches, monitoring, skipped tests.
7. End with a short recap I can read on its own.
Also write a PreToolUse hook that blocks the forbidden git commands. Show me both drafts before you save them. Trigger the skill only when I say "ship" or "commit and push".
Run ship once on a small change and read the recap. Adjust the skill where it guessed wrong.
What I do not know yet
- Shell edits. The transcript misses files changed through shell commands. Claude usually remembers them, but not always.
- Teams. I built this for one person with many sessions on one server. With several people on separate clones, the "not mine" list matters less and the push rules matter more. I have not tested that.
- Doc growth. Routing every lesson into docs keeps them current, but I do not yet know whether they stay readable after a year.
Frequently asked questions
Does ship commit without being asked?
No. It runs only when I type "ship" or "commit and push". Claude Code does not commit by default either, and I want to keep it that way.
Why not let Claude commit everything that changed?
Because not everything that changed is from this session. Another session, or I myself, may have work in progress in the same tree. A commit with explicit paths ships exactly what this session did.
Is it useful with only one session at a time?
Yes. The checks, the doc routing and the "not live yet" list help with one session too. The file list just has fewer surprises in it.
What to do first
- Count how often you type "commit and push" at the end of a session this week.
- Paste the prompt above into Claude Code inside your project.
- Answer its questions and read the draft skill and hook before you save them.
- Run ship on one small change and check the commit it made.
- Add one rule to the skill each time it gets something wrong.
More on running Claude Code sessions side by side: Letting parallel Claude Code sessions talk to each other.