Skip to main content

/wrap-up Command

End your Claude Code session with intention. The /wrap-up command runs a comprehensive checklist to audit changes, verify quality, capture learnings, and prepare for the next session.

Syntax

/wrap-up
No arguments required.
The /wrap-up command is a ritual, not just a checklist. Make it habitual at the end of every session.

The 5-Step Checklist

1

Changes Audit

Review all modified files:
git status
git diff --stat
Questions:
  • What files were modified?
  • Any uncommitted changes?
  • Any TODOs left in code?
Action:
  • Commit or stash uncommitted work
  • Remove or ticket TODOs
2

Quality Check

Run full quality gates:
npm run lint 2>&1 | head -20
npm run typecheck 2>&1 | head -20
npm test -- --changed --passWithNoTests
Action:
  • Fix any failures before ending
  • Don’t leave broken tests
3

Learning Capture

Identify corrections and patterns:Questions:
  • What corrections did you make this session?
  • Any new patterns learned?
  • Any mistakes to avoid next time?
Action:
  • Format learnings as: [LEARN] Category: Rule
  • Save to database with /learn-rule
4

Session Summary

Document what was accomplished:
Session Summary
===============
Duration: 2h 15m
Commits: 4
Files changed: 12

Completed:
- Added rate limiting to login endpoint
- Fixed null handling in session middleware
- Added tests for auth flows

In Progress:
- Refactoring database connection pooling (60% done)

Next Session:
- Complete connection pooling refactor
- Add monitoring for rate limiter
- Deploy to staging
Action:
  • Save summary to notes or project log
  • Create handoff doc if handing off to someone else
5

Context Cleanup

Prepare for next session:Actions:
  • Compact context if >70% full
  • Clear dead MCP connections
  • Close unused worktrees
/context  # Check usage
/compact  # If >70%

Example Flow

> /wrap-up

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        PRO WORKFLOW SESSION WRAP-UP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[1/5] Changes Audit
───────────────────

git status:
  M src/auth/login.ts
  M src/auth/session.ts
  M tests/auth.test.ts
  
No uncommitted changes.

TODO check:
 No TODOs found

[2/5] Quality Check
──────────────────

Running lint...
 Lint: PASS

Running typecheck...
 Types: PASS

Running tests...
 Tests: 42/42 PASS (4.2s)

[3/5] Learning Capture
─────────────────────

Corrections this session:
  1. Fixed Redis connection handling (retry logic)
  2. Changed rate limit window from fixed to sliding
  
Suggested learnings:
  [LEARN] Rate Limiting: Use sliding window over fixed window for smoother rate limiting
  [LEARN] Redis: Always implement retry logic with exponential backoff
  
Save these learnings? (y/n)
> y

 Saved 2 learnings to database

[4/5] Session Summary
────────────────────

Session Stats:
  Duration: 2h 15m
  Commits: 4
  Files changed: 12
  Corrections: 2
  Context usage: 67%
  
Completed:
 Added rate limiting to login endpoint
 Fixed null handling in session middleware
 Added comprehensive auth tests
  
Next Session:
 Complete connection pooling refactor (60% done)
 Add monitoring for rate limiter
 Deploy to staging environment
  
[5/5] Context Cleanup
────────────────────

Context usage: 67% (healthy)
 No cleanup needed

MCP connections:
 8 active servers (healthy)
  
Worktrees:
 1 active worktree
  
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        WRAP-UP COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Good session! See you next time.

Configuration

Wrap-up behavior is configurable in config.json:
{
  "wrap_up": {
    "check_uncommitted": true,
    "verify_tests": true,
    "update_claude_md": true,
    "create_summary": true
  }
}

Options

OptionDefaultDescription
check_uncommittedtrueCheck for uncommitted changes
verify_teststrueRun quality gates
update_claude_mdtrueSuggest CLAUDE.md updates
create_summarytrueGenerate session summary

When to Use /wrap-up

End of every session:
  • Before closing Claude Code
  • After completing a feature
  • Before switching to different work
  • At the end of the workday
Make it habitual. Rituals compound.

Integration with Hooks

Wrap-up integrates with the hook system:

SessionEnd Hook

Auto-run wrap-up when closing Claude Code:
{
  "hooks": {
    "SessionEnd": {
      "script": "${CLAUDE_PLUGIN_ROOT}/scripts/auto-wrap-up.js"
    }
  }
}

PreToolUse Hook

Remind about wrap-up before git push:
{
  "hooks": {
    "PreToolUse": {
      "Bash": {
        "matcher": "git push",
        "message": "Did you run /wrap-up before pushing?"
      }
    }
  }
}
See Custom Hooks for details.

Best Practices

Make It Habitual

Run /wrap-up at the end of every session, no exceptions. Rituals compound over time.

Capture All Learnings

Don’t skip learning capture. Every correction is a future improvement.

Fix Before Closing

Don’t leave broken tests or failing quality gates. Fix before wrap-up completes.

Document Next Steps

Always note what’s next. Future you (or your teammate) will thank you.

Troubleshooting

If quality gates fail:
  1. Fix the failures before ending:
    npm run lint -- --fix
    npm run typecheck
    npm test
    
  2. If hotfix needed, skip gates:
    /wrap-up --no-verify
    
  3. Create TODO to fix later:
    // TODO(you): Fix flaky test before next session
    
If context >70% during wrap-up:
  1. Run compact:
    /compact
    
  2. Or start fresh session:
    • Save handoff doc first
    • Close and restart Claude Code
    • Resume from handoff
If no corrections were made:
  • That’s fine! Not every session has learnings
  • Focus on documenting what was completed
  • Note patterns observed for future reference

/learn-rule

Capture specific learning rule

/handoff

Generate detailed handoff document

/insights

View session analytics

Wrap-Up Skill

Deep dive on wrap-up patterns

Next Steps

Build docs developers (and LLMs) love