archive-session
Suggest archiving completed work when PRs are merged or work is completed. Triggers when user asks to merge a PR ("merge it", "merge the PR"), after successful gh pr merge, or mentions completion ("shipped", "done with X", "merged to main"). Does NOT archive automatically - suggests running /archive-session.
When & Why to Use This Skill
This Claude skill optimizes developer workflows by intelligently managing session lifecycles and workspace organization. It monitors GitHub Pull Request (PR) activities and completion signals to suggest archiving finished work, ensuring that the AI's active context remains focused and the project directory stays clutter-free.
Use Cases
- Post-Merge Cleanup: Automatically detects a successful 'gh pr merge' and prompts the user to archive the session, preventing completed code from cluttering the active workspace.
- Context Optimization: Identifies completion triggers such as 'shipped' or 'done' to help developers transition out of finished tasks, effectively managing the AI's token usage and focus.
- Workflow Verification: Cross-references session notes with real-time GitHub PR states to provide intelligent recommendations on whether a project is ready for archiving or requires further follow-up.
| name | archive-session |
|---|---|
| description | Suggest archiving completed work when PRs are merged or work is completed. Triggers when user asks to merge a PR ("merge it", "merge the PR"), after successful gh pr merge, or mentions completion ("shipped", "done with X", "merged to main"). Does NOT archive automatically - suggests running /archive-session. |
| allowed-tools | Read, Glob, Bash(gh:*) |
Archive Session Awareness
This skill detects when session work may be ready for archiving and suggests the appropriate action.
When to Use This Skill
Trigger when:
- User asks to merge: "merge it", "merge the PR", "go ahead and merge", "ship it"
- After you successfully run
gh pr merge - User mentions completion: "PR merged", "shipped", "done with X", "finished"
- User references merged state: "merged to main", "closed the issue"
Instructions
If user asks to merge a PR:
- Perform the merge as requested
- On success, continue to step 2
- On failure, help resolve the issue (don't suggest archiving)
After a successful merge, read
.sessions/index.mdto assess work stateIf user provided a PR URL/number (or you just merged one), verify:
gh pr view [URL/number] --json state,mergedAt,titleAssess if work appears complete:
- PR merged?
- Related tasks marked done in session notes?
- No obvious follow-up work mentioned?
If work appears complete, suggest archiving:
"PR merged successfully. This session's work looks complete - want me to archive it? Run
/archive-sessionto move completed work to the archive."If there's more work in the session:
"PR merged. I see there's still [X, Y] in the session notes - want to continue with those or archive what's done so far?"
Important
- This skill suggests archiving, it does NOT archive automatically
- User must explicitly run
/archive-sessionto perform the archive - Trigger AFTER merge succeeds, not before
- Multiple PRs may be part of one logical session - check context