session-management
Skill708 starsChanged 5 months agoMITView on GitHub
Context preservation, tiered summarization, resumability
17 other projects use a version of this.
Adopted by
Most recently taken up by
- mahumadad/quarrytheir own version, first seen Nov 8, 2026
- cooneycw/claude-power-packtheir own version, first seen Nov 7, 2026
- zai-org/ZCodetheir own version, first seen Nov 2, 2026
- srivardhan113/SRIFT-Open_Sourcetheir own version, first seen Nov 1, 2026
- skillpie/ZCodeOnlinetheir own version, first seen Nov 1, 2026
- drvoss/everything-copilot-clitheir own version, first seen Oct 26, 2026
Used with
Projects with it also use e2e-case-lifecycle, zcode-large-task-fixture and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ZCodium-projectSkille2e-case-lifecycle
Plan, maintain, replay, and promote ZCode desktop E2E cases and their fixtures, coverage matrices, and CI admission evidence.
Also in 3 projects that use this
ZCodium-projectSkillzcode-large-task-fixture
Generate, verify, or remove large synthetic ZCode task fixtures in local ~/.zcode persistence for UI/session performance testing. Use when testing big conversation/task rendering, task list performance, snapshot recovery, tool-call rendering, reasoning, patches, todos, and model usage without spending time chatting manually.
Also in 3 projects that use this
betacatslingSkilldep-refs
Use when needs to inspect TypeScript export references in the z-code workspace, list exports from a file, verify whether an export is unused before deletion, investigate who imports a symbol during refactors, or combine pnpm knip unused-export results with pnpm dep:refs symbol-level reference tracing.
Also in 3 projects that use this
betacatslingSkillfeature-boundary-planner
Map a ZCode behavior change to current UI surfaces, state owners, protocol commands, persistence, and validation. Use for impact analysis, product-boundary planning, or an implementation handoff grounded in the checked-out source.
Also in 3 projects that use this
Cartograf666Skillarchitecture-governance
Bootstrap, document, enforce, and review a project's architecture through layer responsibilities, dependency direction, architecture manifests, legacy baselines, Change Envelopes, cross-layer approval policy, and deterministic architecture checks. Use when starting a project, auditing an existing codebase, planning cross-layer work, preventing architecture erosion, reviewing structural changes, or deciding whether implementation may expand into another layer.
Also in 3 projects that use this
VercelSkillelectron
Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 1
- alinaqi/maggy★ 711100% same
Edited · 0
None found.
Wrote their own version · 16
- zai-org/ZCode★ 8.6ksame name
- ZCodium-project/ZCodium★ 248same name
- Resgrid/Core★ 238same name
- drvoss/everything-copilot-cli★ 48same name
- cooneycw/claude-power-pack★ 21same name
- conorbronsdon/agent-skills★ 10same name
- skillpie/ZCodeOnline★ 3same name
- EndogenAI/dogma★ 2same name
- gmanch94/claude-code-aidlc-template★ 2same name
- KaanBicaklar/mona-sast-skills★ 2same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository75 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- aeo-optimizationSkill
- agentic-developmentSkill
- agent-teamsSkill
- ai-modelsSkill
- android-javaSkill
- android-kotlinSkill
- autonomous-testingSkill
- aws-auroraSkill
- aws-dynamodbSkill
- azure-cosmosdbSkill
- baseSkill
- build-in-publicSkill
- cloudflare-d1Skill
- code-deduplicationSkill
- code-graphSkill
- code-reviewSkill
- codex-reviewSkill
- commit-hygieneSkill
- context-shuntSkill
- council-reviewSkill
- cpg-analysisSkill
- credentialsSkill
- cross-agent-delegationSkill
- database-schemaSkill
- dataforseoSkill
- demo-videoSkill
- existing-repoSkill
- external-model-delegationSkill
- firebaseSkill
- flutterSkill
- gemini-reviewSkill
- icpgSkill
- iterative-developmentSkill
- klaviyoSkill
- llm-patternsSkill
- maggySkill
- medusaSkill
- mnemosSkill
- model-routingSkill
- ms-teams-appsSkill
- nodejs-backendSkill
- playwright-testingSkill
- polyphonySkill
- posthog-analyticsSkill
- project-toolingSkill
- pwa-developmentSkill
- pythonSkill
- react-nativeSkill
- react-webSkill
- reddit-adsSkill
- reddit-apiSkill
- security-auditSkill
- securitySkill
- shopify-appsSkill
- site-architectureSkill
- supabase-nextjsSkill
- supabase-nodeSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 20 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Trigger: After completing any small task or todo item
- Distinctive: line 28
Action: Update "Active Task", "Progress", and "Next Steps" sections
- Distinctive: line 33
After completing a feature or significant change
- Distinctive: line 34
After any architectural/library decision
- Distinctive: line 35
After ~20 tool calls during active work
- Distinctive: line 36
When switching to a different area of the codebase
- Distinctive: line 41
Update files being modified table
- Distinctive: line 47
Before a significant context shift
- Distinctive: line 48
When context feels heavy (~50+ tool calls)
- Very specific: line 51
Create archive entry: archive/YYYY-MM-DD[-topic].md
- Distinctive: line 54
Update code-landmarks.md if new patterns introduced
- Very specific: line 89
_project_specs/session/current-state.md: - Update every 15-20 minutes or after significant progress. - Distinctive: line 259
Add this section to CLAUDE.md:
- Distinctive: line 332
When compressing, use this format:
- Distinctive: line 355
After significant work or at session end, create archive:
- Distinctive: line 413
When completing a todo:
- Distinctive: line 423
Add to project scripts or aliases:
- Distinctive: line 464
After completing any task, Claude should ask:
- Distinctive: line 473
When starting a session, Claude must:
- Very specific: line 474
Check if current-state.md exists and read it
- Distinctive: line 479
Every ~20 tool calls, Claude should check:
- Distinctive: line 496
Overly verbose state: - Keep it scannable, not a novel
- Distinctive: line 497
Stale state files: - Update regularly or they become useless
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Management Skill
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.mdCurrent 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 HS256Decision 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 filesCode 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 actionableCompression 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
- tests/auth/refresh.test.ts - Token refresh tests
## Open Items Carried Forward
- [Anything not finished, now in active.md]
## Session Stats
- Duration: ~3 hours
- Tool calls: ~120
- Files modified: 8
- Tests added: 12Integration with Todo System
Link Todos to Sessions
In active todos, reference session context:
## [TODO-042] Implement token refresh
**Status:** in-progress
**Session Context:** See current-state.md
### Progress Notes
- 2025-01-15: Started implementation, base structure done
- 2025-01-15: Added rotation logic, need error handlingAuto-Update on Todo Completion
When completing a todo:
- Mark todo complete in active.md
- Update current-state.md progress
- Log any decisions made
- Update code-landmarks.md if new patterns introduced
Quick Commands
Add to project scripts or aliases:
# Show current session state
alias session-status="cat _project_specs/session/current-state.md"
# Quick edit session state
alias session-edit="$EDITOR _project_specs/session/current-state.md"
# View recent decisions
alias decisions="tail -100 _project_specs/session/decisions.md"
# Create session archive
session-archive() {
cp _project_specs/session/current-state.md \
"_project_specs/session/archive/$(date +%Y-%m-%d).md"
echo "Archived to _project_specs/session/archive/$(date +%Y-%m-%d).md"
}Enforcement Mechanisms
1. CLAUDE.md as Entry Point
CLAUDE.md must reference session-management.md in the Skills section. Claude reads CLAUDE.md first, which directs it to follow session rules.
2. Session File Headers with Reminders
Include enforcement reminders in session file headers:
current-state.md header:
<!--
CHECKPOINT RULES (from session-management.md):
- Quick update: After any todo completion
- Full checkpoint: After ~20 tool calls or decisions
- Archive: End of session or major feature complete
-->3. Self-Check Questions
After completing any task, Claude should ask:
□ Did I make a decision? → Log it
□ Did this take >10 tool calls? → Full checkpoint
□ Is a feature complete? → Archive
□ Am I ending/switching context? → Archive + handoff4. Session Start Verification
When starting a session, Claude must:
- Check if
current-state.mdexists and read it - Announce what it found: "Resuming from: [last state]"
- Confirm next steps before proceeding
5. Periodic Self-Audit
Every ~20 tool calls, Claude should check:
- Is current-state.md up to date?
- Are there unlogged decisions?
- Is context getting heavy?
6. User Prompts
Users can enforce by asking:
- "Update session state" → Triggers checkpoint
- "What's the current state?" → Claude reads and reports
- "End session" → Triggers archive + handoff
- "Resume from last session" → Claude reads state files first
Anti-Patterns
- No state tracking - Flying blind, can't resume
- Overly verbose state - Keep it scannable, not a novel
- Stale state files - Update regularly or they become useless
- Missing decisions - Future you won't remember why
- No code landmarks - Wastes time re-discovering the codebase
- Never archiving - Session files become cluttered
- Ignoring compression signals - Context overload degrades performance
- Skipping checkpoint after decisions - Key context lost
- No handoff at session end - Next session starts blind
Quick Reference
Checkpoint Decision Tree
Task completed?
│
├── Decision made? ──────────────────→ Log to decisions.md
│
├── >10 tool calls OR significant? ──→ Full Checkpoint
│
├── Major feature done? ─────────────→ Archive
│
└── Otherwise ───────────────────────→ Quick UpdateFiles at a Glance
| File | Update Frequency | Purpose |
| current-state.md | Every task | Live state, next steps |
| decisions.md | When deciding | Architectural choices |
| code-landmarks.md | When patterns change | Code navigation |
| archive/*.md | End of session/feature | Historical record |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

