Agent skill

Session Management

by Resgrid in Resgrid/Core

End-to-end session lifecycle management for .NET projects. An agent skill from Resgrid/Core.

Apache-2.0Auto-check passedBackend & APIs

Install Session Management

skills CLI
$ npx skills add Resgrid/Core --skill session-management -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Resgrid/Core session-management --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Resgrid/Core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.forge/skills/session-management .claude/skills/session-management && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
session-management
GitHub stars
229
Token cost
~3.4k tokens
SKILL.md length
510 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
Apache-2.0

At a glance

End-to-end session lifecycle management for .NET projects. An agent skill from Resgrid/Core.

  • Works in 5 steps: Sessions start with context, not from… → Sessions end with capture, never… → Context preservation is a chain —… → …
  • Says new session
  • SKILL.md covers Core Principles, Patterns, Anti-patterns and Decision Guide
  • Calls git

What it does

Session Management is an agent skill from Resgrid/Core. End-to-end session lifecycle management for .NET projects. Handles session start (load handoff, MEMORY.md, instincts, detect .NET solution), session end (capture completed work, persist learnings, write handoff), and context preservation across sessions. Load this skill when starting a new session, ending a session, when the user says "new session", "pick up where we left off", "what were we working on", "session start", "session end", "handoff", "context", "resume", or when Claude needs to bootstrap itself in an…

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Authentication. It works with .NET. The repository describes itself as: The Open Source Computer Aided Dispatch (CAD), Personnel, Shift Management, Automatic Vehicle Location (AVL) and Emergency Management Platform that powers Resgrid.com. The licence is Apache-2.0.

When your agent uses it

  • Says new session
  • Pick up where we left off
  • What were we working on
  • Claude needs to bootstrap itself in an unfamiliar project

Example prompts

  • “new session”
  • “pick up where we left off”
  • “what were we working on”
  • “/session-management”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Sessions start with context, not from scratch — Every session begins by loading three files: .claude/handoff.md (pending work), MEMORY.md…
  2. Sessions end with capture, never abruptly — When a session ends, three things are captured: what was DONE, what is PENDING, and what was…
  3. Context preservation is a chain — Handoff files pass state session-to-session. MEMORY.md accumulates permanent rules. Instincts track…
  4. Solution detection enables tooling — .NET MCP tools (get_diagnostics, find_symbol, get_project_graph) require a loaded solution. Detecting…
  5. Graceful degradation over hard failure — If no handoff file exists, start clean. If no MEMORY.md exists, offer to create one on first…

What it can do on your machine

Read from SKILL.md and the folder at commit a31015f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Session Management loads about 3.4k tokens when it runs. Until then it costs about 139 tokens; SKILL.md has 510 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~139
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Resgrid/Core at commit a31015f, republished under its Apache-2.0 licence (© Resgrid). 510 words, ~3,383 tokens.

Download SKILL.mdSave it as .claude/skills/session-management/SKILL.md (or your agent's skills folder).
name
session-management
description
End-to-end session lifecycle management for .NET projects. Handles session start (load handoff, MEMORY.md, instincts, detect .NET solution), session end (capture completed work, persist learnings, write handoff), and context preservation across sessions. Load this skill when starting a new session, ending a session, when the user says "new session", "pick up where we left off", "what were we working on", "session start", "session end", "handoff", "context", "resume", or when Claude needs to bootstrap itself in an unfamiliar project.

Session Management

Core Principles

  1. Sessions start with context, not from scratch — Every session begins by loading three files: .claude/handoff.md (pending work), MEMORY.md (permanent rules), and .claude/instincts.md (learned patterns). Then detect the .NET solution so MCP tools are connected. A session that starts blind wastes the first 10 minutes re-discovering what was already known.

  2. Sessions end with capture, never abruptly — When a session ends, three things are captured: what was DONE, what is PENDING, and what was LEARNED. This is non-negotiable. Context lost between sessions is context the user must re-provide, which wastes their time.

  3. Context preservation is a chain — Handoff files pass state session-to-session. MEMORY.md accumulates permanent rules. Instincts track emerging patterns. Git commits preserve code state. Together, these four mechanisms create continuity that no single mechanism can provide alone.

  4. Solution detection enables tooling — .NET MCP tools (get_diagnostics, find_symbol, get_project_graph) require a loaded solution. Detecting the .slnx/.sln file on session start ensures these tools are available from the first prompt, not discovered mid-conversation.

  5. Graceful degradation over hard failure — If no handoff file exists, start clean. If no MEMORY.md exists, offer to create one on first learning. If no solution file is found, work without MCP tools. Never block a session because a context file is missing.

Patterns

Session Start Protocol

Execute this sequence at the beginning of every session:

STEP 1: Load Handoff
  → Check for .claude/handoff.md
  → If found: read and summarize pending work
  → If not found: note "No handoff file — starting fresh"

STEP 2: Load Memory
  → Check for MEMORY.md (project root or .claude/)
  → If found: scan for rules relevant to the likely task
  → If not found: note "No memory file — will create on first learning"

STEP 3: Load Instincts
  → Check for .claude/instincts.md
  → If found: load instincts at 0.7+ into active context
  → If not found: note "No instincts file — will create on first observation"

STEP 4: Detect .NET Solution
  → Search for .slnx files in current directory
  → If not found, search for .sln files
  → If not found, search parent directories (up to 3 levels)
  → If not found, search child directories (1 level)
  → If found: confirm MCP tools are connected
  → If not found: warn "No solution detected — MCP tools unavailable"

STEP 5: Present Summary
  "Session context loaded:
   - Last session: [summary from handoff or 'no previous session']
   - Pending tasks: [list from handoff or 'none']
   - Active rules: [count from MEMORY.md]
   - Active instincts: [count at 0.7+]
   - Solution: [solution name and path, or 'not detected']
   Ready to continue. What would you like to work on?"
Session End Protocol

Execute this sequence when the session is ending:

STEP 1: Review Accomplishments
  → List everything completed this session with file paths
  → Include line numbers for significant changes

STEP 2: Check for Uncommitted Changes
  → Run git status
  → If uncommitted changes exist:
    "You have uncommitted changes. Want me to commit before wrapping up?"
  → If clean: note "All changes committed"

STEP 3: Write Handoff
  → Write .claude/handoff.md using the Handoff File Template (see below)

STEP 4: Extract Learnings
  → Review session for corrections from the user
  → Generalize corrections into rules (via self-correction-loop)
  → Write to MEMORY.md under appropriate category

STEP 5: Update Instincts
  → Review any new patterns observed during the session
  → Update confidence scores in .claude/instincts.md
  → Promote any instincts that reached 0.9 (via instinct-system)

STEP 6: Confirm
  "Session wrapped up:
   - Handoff written to .claude/handoff.md
   - [N] learnings added to MEMORY.md
   - [N] instincts updated
   Next session will pick up right where we left off."
Solution Detection Strategy

Find the .NET solution for MCP tool connectivity:

SEARCH ORDER:
1. Current directory: *.slnx, *.sln
2. Parent directory: *.slnx, *.sln (common in src/ subdirectory layouts)
3. Grandparent directory: *.slnx, *.sln (up to 3 levels)
4. Child directories: */**.slnx, */**.sln (1 level deep)

PREFERENCE:
- .slnx over .sln (modern format)
- If multiple solutions found, prefer the one matching the directory name
- If still ambiguous, list all and ask the user

AFTER DETECTION:
- Confirm MCP connection by running get_project_graph
- If MCP returns "loading", wait briefly and retry (solution may be initializing)
- Cache the solution path for the session — don't re-detect on every tool call
Context Preservation Architecture

Four mechanisms work together to prevent context loss:

FILE                    SCOPE       LIFETIME        PURPOSE
.claude/handoff.md      Session     Overwritten      Pass state between sessions
MEMORY.md               Project     Permanent        Store confirmed rules
.claude/instincts.md    Project     Evolving         Track emerging patterns
Git commits             Code        Permanent        Preserve code state

FLOW:
  Session N ends → writes handoff.md, updates MEMORY.md, updates instincts.md
  Session N+1 starts → reads handoff.md, MEMORY.md, instincts.md
  Result: zero context loss between sessions
Handoff File Template

The standard format for .claude/handoff.md:

markdown
# Session Handoff

> Generated: 2025-07-15 | Branch: feature/order-validation

## Completed
- [x] Added FluentValidation to CreateOrder command
  - File: `src/Orders/Features/CreateOrder.cs` (lines 15-35)
  - Validator: non-empty CustomerId, at least 1 item, positive quantities
- [x] Fixed N+1 query in GetOrderDetails
  - File: `src/Orders/Features/GetOrderDetails.cs` (line 28)
  - Added `.Include(o => o.Items)` to the query

## Pending
- [ ] Add validation to UpdateOrder command (same pattern as CreateOrder)
  - Start from: `src/Orders/Features/UpdateOrder.cs`
  - Reference: CreateOrder validator for the established pattern
- [ ] Run full test suite — last run had 2 unrelated failures in Catalog module

## Learned
- FluentValidation validators must be registered in the module's DI setup
- The N+1 in GetOrderDetails was hidden because test data seeds only 1 item per order

## Context
- Branch: feature/order-validation
- Last commit: "Add CreateOrder validation + tests"
- Uncommitted changes: no
- Solution: src/MyApp.slnx
Resuming from Handoff

When a handoff file exists, present a clear summary and let the user decide:

SESSION RESUME FLOW:
1. Read .claude/handoff.md
2. Summarize concisely:
   "Last session (2025-07-15) on branch feature/order-validation:
    - Completed: CreateOrder validation, N+1 fix in GetOrderDetails
    - Pending: UpdateOrder validation, test suite failures
    Shall I continue with the UpdateOrder validation?"
3. Wait for user direction — never auto-start pending work
4. If the user wants something different, acknowledge and proceed
   "Got it, setting aside the pending tasks. What would you like to work on?"
First Session Bootstrap

When no context files exist (brand new project or first Claude session):

BOOTSTRAP PROTOCOL:
1. No handoff.md → "No previous session found. Starting fresh."
2. No MEMORY.md → "No project memory found. I'll create one when we discover
   project-specific rules."
3. No instincts.md → "No instincts file. I'll start tracking patterns
   as we work together."
4. Detect solution → Run full detection, report findings
5. Offer convention scan:
   "This is our first session. Want me to scan the codebase to learn
    the project's conventions? (Uses the convention-learner skill)"
Multi-Developer Handoff

When the handoff might be read by a different developer or Claude session:

ENHANCED HANDOFF (add when multiple developers use Claude on the project):

## Decisions Made
| Decision | Choice | Rationale |
|----------|--------|-----------|
| Validation library | FluentValidation | Already used in Catalog module |
| Error format | ProblemDetails | RFC 7807, consistent with API standard |

## Open Questions
- Should we validate product existence at command level or handler level?
  - Current: handler level (after DB lookup)
  - Trade-off: invalid product IDs return 500 instead of 400

## Dependencies
- Requires FluentValidation 11.x NuGet package (already referenced)
- No new infrastructure dependencies
Show full SKILL.md (198 more words)Show less

Anti-patterns

Starting Blind
# BAD — ignoring existing context
*Session starts*
Claude: "How can I help you today?"
*User: "Continue the order validation work"*
Claude: "What order validation work? Can you tell me what files to look at?"
*User wastes 5 minutes re-explaining*

# GOOD — loading context automatically
*Session starts*
Claude: "Last session completed CreateOrder validation. Pending: UpdateOrder
         validation (start from src/Orders/Features/UpdateOrder.cs).
         Shall I continue with that?"
Ending Without Capture
# BAD — session ends, context evaporates
User: "Thanks, that's all for today!"
Claude: "You're welcome! Happy to help anytime."
*Next session starts from scratch*

# GOOD — capture before closing
User: "Thanks, that's all for today!"
Claude: "Before we wrap up, let me save our progress to .claude/handoff.md
         so the next session picks up right where we left off."
*Writes handoff, extracts learnings, updates instincts*
# BAD — silently overwriting an existing handoff with different pending tasks
*Previous handoff has 3 pending tasks from another developer*
*This session worked on something different*
*Overwrites handoff, losing the other developer's pending tasks*

# GOOD — check before overwriting
"There's an existing handoff from [date] with pending tasks:
 - [task 1], [task 2], [task 3]
 These appear unrelated to our session. Should I:
 a) Merge our session with existing pending tasks
 b) Overwrite (their tasks are done or no longer relevant)
 c) Skip writing handoff this time"
Skipping Solution Detection
# BAD — trying to use MCP tools without a loaded solution
Claude: "Let me check diagnostics..." *tool fails*
Claude: "Let me find the symbol..." *tool fails*
Claude: "I'll just read the files manually" *misses project-wide context*

# GOOD — detect solution on start, verify MCP connectivity
*Session start*
Claude: "Detected solution at src/MyApp.slnx. MCP tools connected.
         Project graph shows 5 projects with 3 test projects."
*All MCP tools work throughout the session*
Bloated Handoffs
# BAD — handoff file is 500 lines with every detail
## Completed
- Changed line 15 in file A from X to Y because Z and also considered W...
*So long that the next session's context window is wasted on the handoff*

# GOOD — concise, actionable handoff
## Completed
- [x] Added CreateOrder validation (src/Orders/Features/CreateOrder.cs:15-35)
*Reference the diff or commit for full details, don't duplicate them*
Context File Sprawl
# BAD — multiple context files with overlapping purposes
.claude/
  handoff.md
  handoff-backup.md
  session-notes-july.md
  session-notes-august.md
  todo.md
  context.md
*6 files, unclear which is authoritative*

# GOOD — exactly 3 context files, each with a clear purpose
.claude/
  handoff.md       ← session-to-session state (overwritten each time)
  instincts.md     ← emerging patterns (evolving)
MEMORY.md          ← permanent rules (append-only, audited)

Decision Guide

ScenarioAction
Starting a new sessionRun full Session Start Protocol (5 steps)
User says "wrap up" / "done" / "that's all"Run full Session End Protocol (6 steps)
No handoff.md existsStart clean, create on first session end
No MEMORY.md existsOffer to create on first correction or learning
No solution file foundWarn user, work without MCP tools, suggest creating one
Multiple solution files foundList all, ask user which to use
Handoff has pending tasks from another devAsk before overwriting: merge, overwrite, or skip
User wants to resume pending workSummarize and confirm before starting
User wants something different from handoffAcknowledge, proceed with new task, update handoff at end
Session had user correctionsExtract to MEMORY.md before ending
Session discovered new patternsUpdate instincts.md before ending
First-ever session on a projectRun bootstrap protocol, offer convention scan
Solution is still loading (MCP returns "loading")Wait 5 seconds, retry once, then proceed without MCP
Mid-session context getting largeOffload research to subagents, keep main context focused
User asks "what were we working on?"Read handoff.md and summarize

© Resgrid, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .forge/skills/session-management of Resgrid/Core.

Open the folder on GitHubat commit a31015f

Compare with similar skills

Session Management next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Session Management compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Session Management this skillResgrid/Core229—~3.4kAutomated safety check: PassApache-2.0
Msal Client CredentialsAzureAD/microsoft-authentication-library-for-dotnet1.5k—~1.1kAutomated safety check: PassMIT
Verify Authendpointsmadeyoga/AuthEndpoints121—~2.6kAutomated safety check: PassMIT
Dotnet APInovotnyllc/dotnet-artisan233—~1.6kAutomated safety check: PassMIT
.NET Core ExpertJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
Blazor AuthenticationNethereum/Nethereum2.3k—~1.8kAutomated safety check: PassMIT

Similar skills

  • Msal Client Credentials

    AzureAD/microsoft-authentication-library-for-dotnet

    Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement

    1.5k GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Verify Authendpoints

    madeyoga/AuthEndpoints

    Drive the AuthEndpoints HTTP API via the in-repo test host (cookie sessions, Identity bearer, Simple JWT, CSRF, ReAuth).

    121 GitHub stars~2.6k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Dotnet API

    novotnyllc/dotnet-artisan

    Builds ASP.NET Core APIs, EF Core data access, gRPC, SignalR, and backend services with middleware, security (OAuth, JWT, OWASP), resilience, messaging, OpenAPI, .NET Aspire, Semantic Kernel…

    233 GitHub stars~1.6k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • .NET Core Expert

    Jeffallan/claude-skills

    Guides building .NET 8 services with minimal APIs, clean architecture, Entity Framework Core, MediatR CQRS and JWT authentication, with build and test checks.

    12k GitHub stars~1.3k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Blazor Authentication

    Nethereum/Nethereum

    Implement Sign-In with Ethereum (SIWE / EIP-4361) authentication in Blazor with JWT tokens, session management, and AuthorizeView (.NET/C).

    2.3k GitHub stars~1.8k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Dotnet Backend

    davila7/claude-code-templates

    Build ASP.NET Core 8+ backend services with EF Core, auth, background jobs, and production API patterns.

    32k GitHub starsUsed in 5 repos~1.9k tokens
    Backend & APIsAuto-check passed

More from Resgrid/Core

All 23 skills in this repo
  • 80 20 Review

    Resgrid/Core

    Focus code review effort on the 20% of code that causes 80% of issues.

    229 GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Autonomous Loops

    Resgrid/Core

    Autonomous iteration loops for .NET development: build-fix, test-fix, refactor, and scaffold loops.

    229 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Learning Log

    Resgrid/Core

    Auto-document insights and discoveries during development sessions.

    229 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Logging

    Resgrid/Core

    Observability for .NET 10 applications. An agent skill from Resgrid/Core.

    229 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Model Selection

    Resgrid/Core

    Strategic Codex model selection for .NET development workflows.

    229 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Model Selection

    Resgrid/Core

    Strategic Claude model selection for .NET development workflows.

    229 GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Session Management

What does Session Management do?

End-to-end session lifecycle management for .NET projects. An agent skill from Resgrid/Core. Session Management is an agent skill from Resgrid/Core.NET projects.

When should I use Session Management?

Session Management fits situations like: says new session; pick up where we left off; what were we working on; Claude needs to bootstrap itself in an unfamiliar project.

How do I install Session Management in Claude Code?

Run `npx skills add Resgrid/Core --skill session-management -a claude-code`. Or copy the skill folder (.forge/skills/session-management in Resgrid/Core) into .claude/skills/session-management in your project. Claude Code loads it when a task matches its description.

How do I install Session Management in Codex?

Run `npx skills add Resgrid/Core --skill session-management -a codex`. Or copy the skill folder (.forge/skills/session-management in Resgrid/Core) into .agents/skills/session-management in your project. Codex loads it when a task matches its description.

Can I use Session Management in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Resgrid/Core --skill session-management -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/session-management, .gemini/skills/session-management, .github/skills/session-management and .opencode/skills/session-management in your project.

What does Session Management need to run?

Going by SKILL.md and its folder, Session Management needs the command-line tools its instructions call (git).

Does Session Management access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Session Management safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Session Management use?

Session Management is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Session Management use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Session Management?

Skills that share tags, products or a category with Session Management: Msal Client Credentials (AzureAD/microsoft-authentication-library-for-dotnet, 1.5k stars), Verify Authendpoints (madeyoga/AuthEndpoints, 121 stars), Dotnet API (novotnyllc/dotnet-artisan, 233 stars) and .NET Core Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Session Management?

Resgrid (a GitHub organization) maintains it in Resgrid/Core, which has 229 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 7, 2026.

Source: Resgrid/Core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.