session-management
Context preservation, tiered summarization, resumability
Install
mkdir -p .claude/skills/session-management && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6978" && unzip -o skill.zip -d .claude/skills/session-management && rm skill.zipInstalls to .claude/skills/session-management
About this skill
Session Management Skill
Load with: base.md
For maintaining context across long development sessions and enabling seamless resume after breaks.
Core Principle
Checkpoint at natural breakpoints, resume instantly.
Long development sessions risk context loss. Proactively document state, decisions, and progress so any session can resume exactly where it left off - whether returning after a break or hitting context limits.
Tiered Summarization Rules
Tier 1: Quick Update (current-state.md only)
Trigger: After completing any small task or todo item Action: Update "Active Task", "Progress", and "Next Steps" sections Time: ~30 seconds
Tier 2: Full Checkpoint (current-state.md + decisions.md)
Trigger:
- After completing a feature or significant change
- After any architectural/library decision
- After ~20 tool calls during active work
- When switching to a different area of the codebase
Action:
- Update full current-state.md
- Log any decisions to decisions.md
- Update files being modified table
Tier 3: Session Archive (archive/ + full checkpoint)
Trigger:
- End of work session
- Completing a major feature/milestone
- Before a significant context shift
- When context feels heavy (~50+ tool calls)
Action:
- Create archive entry:
archive/YYYY-MM-DD[-topic].md - Full checkpoint
- Clear verbose notes from current-state.md
- Update code-landmarks.md if new patterns introduced
Decision Heuristic
┌─────────────────────────────────────────────────────┐
│ After completing work, ask: │
├─────────────────────────────────────────────────────┤
│ Was a decision made? → Log to decisions.md │
│ Task took >10 tool calls? → Full Checkpoint │
│ Major feature complete? → Archive │
│ Ending session? → Archive + Handoff │
│ Otherwise → Quick Update │
└─────────────────────────────────────────────────────┘
Session State Structure
Create _project_specs/session/ directory:
_project_specs/
└── session/
├── current-state.md # Live session state (update frequently)
├── decisions.md # Key decisions log (append-only)
├── code-landmarks.md # Important code locations
└── archive/ # Past session summaries
└── 2025-01-15.md
Current State File
_project_specs/session/current-state.md - Update every 15-20 minutes or after significant progress.
# Current Session State
*Last updated: 2025-01-15 14:32*
## Active Task
[One sentence: what are we working on right now]
Example: Implementing user authentication flow with JWT tokens
## Current Status
- **Phase**: [exploring | planning | implementing | testing | debugging | refactoring]
- **Progress**: [X of Y steps complete, or percentage]
- **Blocking Issues**: [None, or describe blockers]
## Context Summary
[2-3 sentences summarizing the current state of work]
Example: Created auth middleware and login endpoint. JWT signing works.
Currently implementing token refresh logic. Need to add refresh token
rotation for security.
## Files Being Modified
| File | Status | Notes |
|------|--------|-------|
| src/auth/middleware.ts | Done | JWT verification |
| src/auth/refresh.ts | In Progress | Token rotation |
| src/auth/types.ts | Done | Token interfaces |
## Next Steps
1. [ ] Complete refresh token rotation in refresh.ts
2. [ ] Add token blacklist for logout
3. [ ] Write integration tests for auth flow
## Key Context to Preserve
- Using RS256 algorithm (not HS256) per security requirements
- Refresh tokens stored in HttpOnly cookies
- Access tokens: 15 min, Refresh tokens: 7 days
## Resume Instructions
To continue this work:
1. Read src/auth/refresh.ts - currently at line 45
2. The rotateRefreshToken() function needs error handling
3. Check decisions.md for why we chose RS256 over HS256
Decision Log
_project_specs/session/decisions.md - Append-only log of architectural and implementation decisions.
# Decision Log
Track key decisions for future reference. Never delete entries.
---
## [2025-01-15] JWT Algorithm Choice
**Decision**: Use RS256 instead of HS256 for JWT signing
**Context**: Implementing authentication system
**Options Considered**:
1. HS256 (symmetric) - Simpler, single secret
2. RS256 (asymmetric) - Public/private key pair
**Choice**: RS256
**Reasoning**:
- Allows token verification without exposing signing key
- Better for microservices (services only need public key)
- Industry standard for production systems
**Trade-offs**:
- Slightly more complex key management
- Larger token size
**References**:
- src/auth/keys/ - Key storage
- docs/security.md - Security architecture
---
## [2025-01-14] Database Schema Approach
**Decision**: Use Drizzle ORM with PostgreSQL
**Context**: Setting up data layer
**Options Considered**:
1. Prisma - Popular, good DX
2. Drizzle - Type-safe, SQL-like
3. Raw SQL - Maximum control
**Choice**: Drizzle
**Reasoning**:
- Better TypeScript inference than Prisma
- More transparent SQL generation
- Lighter weight, faster cold starts
**References**:
- src/db/schema.ts - Schema definitions
- src/db/migrations/ - Migration files
Code Landmarks
_project_specs/session/code-landmarks.md - Important code locations for quick reference.
# Code Landmarks
Quick reference to important parts of the codebase.
## Entry Points
| Location | Purpose |
|----------|---------|
| src/index.ts | Main application entry |
| src/api/routes.ts | API route definitions |
| src/workers/index.ts | Background job entry |
## Core Business Logic
| Location | Purpose |
|----------|---------|
| src/core/auth/ | Authentication system |
| src/core/billing/ | Payment processing |
| src/core/workflows/ | Main workflow engine |
## Configuration
| Location | Purpose |
|----------|---------|
| src/config/index.ts | Environment config |
| src/config/features.ts | Feature flags |
| drizzle.config.ts | Database config |
## Key Patterns
| Pattern | Example Location | Notes |
|---------|------------------|-------|
| Service Layer | src/services/user.ts | Business logic encapsulation |
| Repository | src/repos/user.ts | Data access abstraction |
| Middleware | src/middleware/auth.ts | Request processing |
## Testing
| Location | Purpose |
|----------|---------|
| tests/unit/ | Unit tests |
| tests/integration/ | API tests |
| tests/e2e/ | End-to-end tests |
| tests/fixtures/ | Test data |
## Gotchas & Non-Obvious Behavior
| Location | Issue | Notes |
|----------|-------|-------|
| src/utils/date.ts | Timezone handling | Always use UTC internally |
| src/api/middleware.ts:45 | Auth bypass | Skip auth for health checks |
| src/db/pool.ts | Connection limit | Max 10 connections in dev |
CLAUDE.md Session Rules
Add this section to CLAUDE.md:
## Session Management
**IMPORTANT**: Follow session-management.md skill. Update session state at natural breakpoints.
### After Every Task Completion
Ask yourself:
1. Was a decision made? → Log to `decisions.md`
2. Did this take >10 tool calls? → Full checkpoint to `current-state.md`
3. Is a major feature complete? → Create archive entry
4. Otherwise → Quick update to `current-state.md`
### Checkpoint Triggers
**Quick Update** (current-state.md):
- After any todo completion
- After small changes
**Full Checkpoint** (current-state.md + decisions.md):
- After significant changes
- After ~20 tool calls
- After any decision
- When switching focus areas
**Archive** (archive/ + full checkpoint):
- End of session
- Major feature complete
- Context feels heavy
### Session Start Protocol
When beginning work:
1. Read `_project_specs/session/current-state.md`
2. Check `_project_specs/todos/active.md`
3. Review recent `decisions.md` entries if needed
4. Continue from "Next Steps"
### Session End Protocol
Before ending or when context limit approaches:
1. Create archive: `_project_specs/session/archive/YYYY-MM-DD.md`
2. Update current-state.md with handoff format
3. Ensure next steps are specific and actionable
Compression Strategies
When to Compress (Tier 3 Archive)
| Trigger | Action |
|---|---|
| ~50+ tool calls | Summarize progress, archive verbose notes |
| Major feature complete | Archive feature details, update landmarks |
| Context shift | Summarize previous context, archive, start fresh |
| End of session | Full session handoff with archive |
What to Keep vs Archive
Keep in active context:
- Current task and immediate next steps
- Active file list with status
- Blocking issues
- Key decisions affecting current work
Archive/summarize:
- Exploration paths that didn't work out
- Detailed debugging traces (keep conclusion only)
- Verbose error messages (keep root cause only)
- Research notes (keep recommendations only)
Compression Template
When compressing, use this format:
## Compressed Context - [Topic]
**Summary**: [1-2 sentences]
**Key Findings**:
- [Bullet points of important discoveries]
**Decisions Made**:
- [Reference to decisions.md entries]
**Relevant Code**:
- [File:line references]
**Archived Details**: [Link to archive file if created]
Session Archive
After significant work or at session end, create archive:
_project_specs/session/archive/YYYY-MM-DD[-topic].md
# Session Archive: [Date] - [Topic]
## Summary
[Paragraph summarizing what was accomplished]
## Tasks Completed
- [TODO-XXX] Description - Done
- [TODO-YYY] Description - Done
## Key Decisions
- [Reference decisions.md entries made this session]
## Code Changes
| File | Change Type | Description |
|------|-------------|-------------|
| src/auth/login.ts | Created | Login endpoint |
| src/auth/types.ts | Modified | Added RefreshToken type |
## Tests Added
- tests/auth/login.test.ts - Login flow tests
-
---
*Content truncated.*
More by alinaqi
View all skills by alinaqi →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversSupercharge AI tools with Kagi MCP: fast google web search API, powerful ai summarizer, and seamless ai summary tool int
Boost your AI code assistant with Context7: inject real-time API documentation from OpenAPI specification sources into y
Enhance software testing with Playwright MCP: Fast, reliable browser automation, an innovative alternative to Selenium s
Extend your developer tools with GitHub MCP Server for advanced automation, supporting GitHub Student and student packag
Beads — a drop-in memory upgrade for your coding agent that boosts context, speed, and reliability with zero friction.
Connect Blender to Claude AI for seamless 3D modeling. Use AI 3D model generator tools for faster, intuitive, interactiv
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.