3.4 KiB
3.4 KiB
| description | argument-hint | model | allowed-tools | |
|---|---|---|---|---|
| Review last commit and branch changes |
|
haiku | Bash(git status:*), Bash(git log:*), Bash(git show:*), Bash(git diff:*), Bash(git branch:*), Read |
Catchup Command
Smart review of recent changes: reviews working tree changes if present, otherwise reviews the last commit. Can also review specific commits when provided.
Purpose
This command helps bring Claude up to speed after a session restart (/clear) by:
- Without arguments:
- If working tree has changes → Review current working changes (modified, staged, and untracked files)
- If working tree is clean → Review the last commit (HEAD)
- With commit-ref: Analyze the specified commit
Arguments
commit-ref(optional) - Git commit reference to analyze- If omitted: Check working tree status and review accordingly
- If provided: Analyze the specified commit
- Examples:
HEAD,HEAD~1,abc123,main~2
Workflow
Step 1: Determine what to review
- Run
git status --porcelainto check working tree status - If no argument provided ($1 is empty):
- If output is empty (clean working tree) → Set target to
HEAD - If output has changes → Review working changes only
- If output is empty (clean working tree) → Set target to
- If argument provided → Use $1 as target
Step 2: Review target commit (if applicable)
- If reviewing a commit (HEAD or specific ref):
- Use
git log -1 --stat <ref>to see commit message and files changed - Use
git show <ref>to see the actual changes (diff)
- Use
Step 3: Review working changes (if applicable)
- If working tree has changes:
- Parse
git status --porcelainoutput - For modified/staged files (
M,M,MMprefix): Usegit diff HEADto see changes - For untracked files (
??prefix): Read each file to understand new additions
- Parse
Step 4: Provide summary
- Summarize what was found based on what was reviewed
Usage
Run this command after:
- Starting a new session
- Using
/clearto reset context - Switching to a different branch with existing work
Examples
/catchup- Smart review: working changes if present, otherwise last commit/catchup HEAD- Review last commit only/catchup HEAD~1- Review previous commit only/catchup abc123- Review specific commit by hash only
Implementation
Step 1: Check working tree status
- Run
git status --porcelainto get current status - Store the output to determine if working tree is clean
Step 2: Determine review target
- If
$1is empty (no argument provided):- If status output is empty → Review HEAD commit
- If status output has changes → Review working changes only
- If
$1is provided → Review the specified commit
Step 3: Review commit (if applicable)
- When reviewing a commit (either HEAD or specified ref):
- Run
git log -1 --stat <ref>to see commit summary - Run
git show <ref>to see detailed diff
- Run
Step 4: Review working changes (if applicable)
- When working tree has changes:
- Parse
git status --porcelainoutput - For modified/staged files: Run
git diff HEADto see changes - For untracked files (
??prefix): Read each file content
- Parse
Step 5: Summarize
- Provide concise summary of findings:
- If reviewed commit: What was accomplished and why
- If reviewed working changes: Current modifications and additions
- State clearly which mode was used
Important: Do not make any modifications - this is a read-only analysis