Resume Work
Gather context on current work and suggest next action.
Arguments
<branch-name>— checkout and resume specific branch<PR#>— resolve branch from PR number- (no args) — use current branch
Steps
1. Resolve Branch
Parse $ARGUMENTS:
- Empty →
git branch --show-current - Numeric → resolve via
gh pr view "$ARGUMENTS" --json headRefName -q .headRefName, then checkout - Otherwise →
git checkout "$ARGUMENTS"
Exit if branch can't be resolved.
2. Gather Context
Run in parallel:
git branch --show-current
git log --oneline -10
git status -sb
gh pr view --json number,title,state,isDraft,reviewDecision,statusCheckRollup,url \
2>/dev/null || echo "No PR"
gh pr checks 2>/dev/null || echo "No PR"
Fetch unresolved review comments (top-level only):
PR_NUM=$(gh pr view --json number -q .number 2>/dev/null)
if [[ -n "$PR_NUM" ]]; then
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
gh api "repos/$REPO/pulls/$PR_NUM/comments" \
--jq '.[] | select(.in_reply_to_id == null) |
"- \(.path):\(.line) (@\(.user.login)): \(.body | split("\n")[0])"' \
2>/dev/null | head -20
fi
Fetch task, team, and plan state:
TaskList()for in_progress/pending tasks- Read
~/.claude/teams/*/config.jsonfor active teams - Determine
<project>:basename $(git rev-parse --show-toplevel 2>/dev/null || pwd) ls -t ~/.claude/plans/<project>/*.md 2>/dev/null | head -5for pending plan filesls -t ~/.claude/plans/<project>/archive/*.md 2>/dev/null | head -5for archived (previously prepared) plans
3. Summarize
Format gathered data as:
**Branch:** `branch-name`
**Commits:** Last 3 commit messages
**PR:** #123 (draft/ready) - title
**Review:** Approved | Changes requested | Pending
**CI:** Passing | Failing (list failures)
**Comments:** N unresolved (summarize key ones)
**Plans:** N pending plan files (list filenames)
**Archived Plans:** N archived plans (list filenames)
**Tasks:** N in progress, M pending, K active teams
4. Suggest Next Action
Pick the first matching condition:
- CI failing → "Fix failing checks: [check names]"
- Changes requested → "
/respondto triage N comments" - Unresolved comments → "
/respondto triage feedback" - Pending plan files → "
/implementto create tasks from [filename], or edit in$EDITORfirst" - Tasks in progress → "Continue: [task subject]"
- Active team → "
/implementto continue team work" - Draft PR, all passing → "Mark PR ready for review"
- Ready PR, approved → "Merge PR"
- No PR → "
/submitto create PR" - All clear → "
/reviewor wait for review"
Notes
- Limit output with
head -Nto prevent context overflow - Only top-level comments (
in_reply_to_id == null)
