session-management
Session Management
Core Principles
-
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. -
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.
-
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.
-
Solution detection enables tooling — .NET MCP tools (
get_diagnostics,find_symbol,get_project_graph) require a loaded solution. Detecting the.slnx/.slnfile on session start ensures these tools are available from the first prompt, not discovered mid-conversation. -
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: