Skip to content

Instantly share code, notes, and snippets.

@Tmeister
Created July 9, 2025 18:25
Show Gist options
  • Save Tmeister/05a6dc9a9ef91abe55b618453ac9bc9e to your computer and use it in GitHub Desktop.
Save Tmeister/05a6dc9a9ef91abe55b618453ac9bc9e to your computer and use it in GitHub Desktop.
Claude Code Session Commands

End the current development session by:

  1. Check .claude/sessions/.current-session for the active session

  2. If no active session, inform user there's nothing to end

  3. If session exists, append a comprehensive summary including:

    • Session duration
    • Git summary:
      • Total files changed (added/modified/deleted)
      • List all changed files with change type
      • Number of commits made (if any)
      • Final git status
    • Todo summary:
      • Total tasks completed/remaining
      • List all completed tasks
      • List any incomplete tasks with status
    • Key accomplishments
    • All features implemented
    • Problems encountered and solutions
    • Breaking changes or important findings
    • Dependencies added/removed
    • Configuration changes
    • Deployment steps taken
    • Lessons learned
    • What wasn't completed
    • Tips for future developers
  4. Empty the .claude/sessions/.current-session file (don't remove it, just clear its contents)

  5. Inform user the session has been documented

The summary should be thorough enough that another developer (or AI) can understand everything that happened without reading the entire session.

Show help for the session management system:

Session Management Commands

The session system helps document development work for future reference.

Available Commands:

  • /project:session-start [name] - Start a new session with optional name
  • /project:session-update [notes] - Add notes to current session
  • /project:session-end - End session with comprehensive summary
  • /project:session-list - List all session files
  • /project:session-current - Show current session status
  • /project:session-help - Show this help

How It Works:

  1. Sessions are markdown files in .claude/sessions/
  2. Files use YYYY-MM-DD-HHMM-name.md format
  3. Only one session can be active at a time
  4. Sessions track progress, issues, solutions, and learnings

Best Practices:

  • Start a session when beginning significant work
  • Update regularly with important changes or findings
  • End with thorough summary for future reference
  • Review past sessions before starting similar work

Example Workflow:

/project:session-start refactor-auth
/project:session-update Added Google OAuth restriction
/project:session-update Fixed Next.js 15 params Promise issue  
/project:session-end

Show help for the session management system:

Session Management Commands

The session system helps document development work for future reference.

Available Commands:

  • /project:session-start [name] - Start a new session with optional name
  • /project:session-update [notes] - Add notes to current session
  • /project:session-end - End session with comprehensive summary
  • /project:session-list - List all session files
  • /project:session-current - Show current session status
  • /project:session-help - Show this help

How It Works:

  1. Sessions are markdown files in .claude/sessions/
  2. Files use YYYY-MM-DD-HHMM-name.md format
  3. Only one session can be active at a time
  4. Sessions track progress, issues, solutions, and learnings

Best Practices:

  • Start a session when beginning significant work
  • Update regularly with important changes or findings
  • End with thorough summary for future reference
  • Review past sessions before starting similar work

Example Workflow:

/project:session-start refactor-auth
/project:session-update Added Google OAuth restriction
/project:session-update Fixed Next.js 15 params Promise issue  
/project:session-end

Start a new development session by creating a session file in .claude/sessions/ with the format YYYY-MM-DD-HHMM-$ARGUMENTS.md (or just YYYY-MM-DD-HHMM.md if no name provided).

The session file should begin with:

  1. Session name and timestamp as the title
  2. Session overview section with start time
  3. Goals section (ask user for goals if not clear)
  4. Empty progress section ready for updates

After creating the file, create or update .claude/sessions/.current-session to track the active session filename.

Confirm the session has started and remind the user they can:

  • Update it with /project:session-update
  • End it with /project:session-end

session-update.md Update the current development session by:

  1. Check if .claude/sessions/.current-session exists to find the active session
  2. If no active session, inform user to start one with /project:session-start
  3. If session exists, append to the session file with:
    • Current timestamp
    • The update: $ARGUMENTS (or if no arguments, summarize recent activities)
    • Git status summary:
      • Files added/modified/deleted (from git status --porcelain)
      • Current branch and last commit
    • Todo list status:
      • Number of completed/in-progress/pending tasks
      • List any newly completed tasks
    • Any issues encountered
    • Solutions implemented
    • Code changes made

Keep updates concise but comprehensive for future reference.

Example format:

### Update - 2025-06-16 12:15 PM

**Summary**: Implemented user authentication

**Git Changes**:
- Modified: app/middleware.ts, lib/auth.ts
- Added: app/login/page.tsx
- Current branch: main (commit: abc123)

**Todo Progress**: 3 completed, 1 in progress, 2 pending
- ✓ Completed: Set up auth middleware
- ✓ Completed: Create login page
- ✓ Completed: Add logout functionality

**Details**: [user's update or automatic summary]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment