Reads recent git commit diffs to reconstruct session context at the start of a new conversation. Accepts an optional commit count parameter (default: 5). Use when the user says 'recall', 'what did we do', 'refresh context', or starts a session with a brief summary request.
Reconstructs working context from local git history so the user does not need to explain what was done in a previous session.
Read the argument the user provided (e.g. /dev-recall 10).
git rev-parse --is-inside-work-tree 2>/dev/null
true: proceed to Step 3.No git repository found in the current working directory (<pwd>).
dev-recall requires a local git repository. Navigate to a project directory and try again.
Run these commands:
git branch --show-current
git remote get-url origin 2>/dev/null
git status --short --branch
Present a one-line header before the recap:
Repo: <origin url or folder name if no remote> · Branch: <branch> · <ahead/behind info from --branch if available>
git status --short
git diff HEAD
If there are any staged, unstaged, or untracked changes, include a WIP section at the top of the recap before the commit list:
### WIP — uncommitted changes
**Status:** list of changed/staged/untracked files from git status
**What changed:** plain-English summary of the in-progress work inferred from the diff.
If the working tree is clean, skip this section silently.
git log --oneline -N
For each commit, run:
git show --stat --patch <commit-hash>
Collect all output. If the total diff is very large (more than ~500 lines), fall back to --stat only and note that detailed diffs were omitted:
git show --stat <commit-hash>
Present a structured recap (newest commit first, matching git's natural order):
## Session Recap — last N commits
### <date> · <short-hash> · <subject>
**Files changed:** list from --stat
**What changed:** 2–4 sentence plain-English summary of what was done and why, inferred from the diff and commit message.
### <next commit> ...
Rules for the summary:
After the recap, ask:
Ready to continue. What would you like to work on?
Do not auto-start any other workflow — wait for the user's instruction.
| Rule | Detail |
|---|---|
| Default N = 5 | Always apply when no argument is given |
| WIP check is mandatory | Always run Steps 4 before the commit log — uncommitted work is the most recent context |
| No speculation | Only describe what the diff actually shows — do not invent intent not visible in the code |
| Large diff fallback | If --patch output exceeds ~500 lines total, fall back to --stat summaries and tell the user |
| Git repo check is mandatory | Never skip Step 2 — always verify before running git commands |