Session management

From athola/claude-night-market · View interactive version

Session management is an AI agent skill from the GitHub repository athola/claude-night-market. Manages Claude Code sessions with naming, checkpointing, and resume strategies. Use when organizing long-running work or resuming across sessions.

How to use this skill

Skill file

Session Management

When To Use

When NOT To Use

Overview

Claude Code supports named sessions for better workflow organization. Use this skill to manage complex, long-running work across multiple sessions.

Available Commands

| Command | Description |

|---------|-------------|

| /rename | Name the current session (auto-generates name if no argument given, 2.1.41+) |

| /resume | Resume a previous session (REPL) |

| claude --resume <name> | Resume from terminal |

Workflow Patterns

1. Debugging Sessions

Name debug sessions for easy resumption:

# Start debugging
/rename debugging-auth-issue

# ... work on the issue ...

# If you need to pause, session is auto-saved
# Resume later:
claude --resume debugging-auth-issue

2. Feature Development Checkpoints

Create checkpoints during long feature work:

# After completing milestone 1
/rename feature-x-milestone-1

# Continue in new session
# Reference old session if needed

3. PR Review Sessions

For complex PR reviews that span multiple sittings:

# Start review
/rename pr-review-123

# Take breaks without losing context
# Resume:
claude --resume pr-review-123

4. PR-Linked Sessions (Claude Code 2.1.27+)

Sessions are automatically linked to PRs when created via gh pr create. Resume PR-specific sessions later:

# Resume session for a specific PR
claude --from-pr 156
claude --from-pr https://github.com/org/repo/pull/156

# Workflow: review → pause → resume with full context
/rename pr-review-156
# ... review work ...
# Later:
claude --from-pr 156

5. Investigation Sessions

When investigating issues that may require research:

# Start investigation
/rename investigate-memory-leak

# Pause to gather more info externally
# Resume with full context:
claude --resume investigate-memory-leak

Resume Screen Features

The /resume screen provides:

6. Resume Hint on Exit (Claude Code 2.1.31+)

Claude Code now shows a resume hint when you exit, displaying the command to continue your conversation. This makes session resumption more discoverable: users no longer need to know about --resume beforehand.

Best Practices

Naming Conventions

Use descriptive, hyphenated names:

| Pattern | Example | Use Case |

|---------|---------|----------|

| debugging-<issue> | debugging-auth-401 | Bug investigation |

| feature-<name>-<milestone> | feature-search-v2 | Feature development |

| pr-review-<number> | pr-review-156 | PR reviews |

| investigate-<topic> | investigate-perf | Research |

| refactor-<area> | refactor-api-layer | Refactoring work |

When to Name Sessions

Name sessions when:

Session Cleanup

Unnamed sessions are eventually garbage collected. Named sessions persist longer. Periodically clean up old named sessions you no longer need.

Integration with Sanctum

Combine session management with other Sanctum skills:

  1. Before starting: Run Skill(sanctum:git-workspace-review) to capture context
  2. Name the session: /rename <descriptive-name>
  3. Work: Use appropriate skills for the task
  4. Resume if needed: claude --resume <name>

Troubleshooting

Session Not Found

If a named session isn't appearing in /resume:

Duplicate Sessions in VS Code

If you see duplicate session entries when resuming in VS Code:

Lost Context After Resume

If context seems incomplete or resume is slow:

macOS Orphaned Processes (Claude Code 2.1.46+)

Previously, disconnecting from a terminal on macOS could leave orphaned Claude Code processes running. This is now fixed in 2.1.46+. If you encounter stale CC processes on older versions, manually check and kill them:

# Find orphaned claude processes
ps aux | grep -i claude | grep -v grep

7. Automatic Memory (Claude Code 2.1.32+)

Claude now automatically records and recalls memories as it works. Session summaries, key results, and work logs are captured implicitly and recalled in future sessions. This provides passive cross-session continuity without manual checkpoint management.

8. Agent Persistence on Resume (Claude Code 2.1.32+)

--resume now re-uses the --agent value from the previous conversation by default. Agent-specific workflows that are resumed will continue with the same agent configuration without needing to re-specify it.

# Start with a specific agent
claude --agent my-agent

# Resume later — my-agent is automatically used
claude --resume

See Also

Exit Criteria

matching one of the documented patterns (e.g. debugging-*,

feature-*, pr-review-*)

prior context (verified by presence of earlier conversation)

with troubleshooting steps (check typos, session expiry)

<number>` correctly reopens the session associated with that PR

git-workspace-review)` is re-run and its output confirms current

repo state

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.