Skip to content

03 workflows session management

Doug Beard edited this page Aug 20, 2025 · 2 revisions

Session Management - Context Continuity & Knowledge Preservation

Overview

Effective session management in Coherence APM Framework v4.2.0 maintains unified context through the .apm/session_notes/ directory, preserving work progress and ensuring seamless collaboration across the 11 specialized personas. This workflow ensures no information is lost and every session builds upon previous work through the actual session management features.

🧠 Session Management Philosophy

Core Principles

  1. Unified Context Engineering: Every action documented in .apm/session_notes/ directory
  2. Persistent Context: Work context maintained across sessions and persona transitions using /switch and /handoff commands
  3. Seamless Knowledge Transfer: Information flows between personas through session notes
  4. Voice Integration: Audio notifications confirm session milestones using TTS system
  5. Recovery Capability: Resume work from any point using session note history
  6. Automatic Session Management: Framework automatically creates and manages session files

Session Types

  • Work Sessions: Active development, analysis, or planning work
  • Handoff Sessions: Transitions between personas or team members
  • Review Sessions: Progress review, stakeholder updates, quality assurance
  • Planning Sessions: Sprint planning, architecture design, strategy sessions

📋 Session Note Structure & Standards

Standard Session Note Format

# Session: [Descriptive Title]
Date: YYYY-MM-DD HH:MM:SS
Persona: [Active Persona/Role]
Session Type: [Work/Handoff/Review/Planning]

## Session Objectives
- [ ] Primary objective 1
- [ ] Primary objective 2
- [ ] Primary objective 3

## Context from Previous Session
[Brief summary of relevant context from previous work]

## Work Progress
### [HH:MM] - [Action/Task Description]
- Status: [In Progress/Completed/Blocked]
- Details: [Specific work done]
- Files Modified: [List of changed files]
- Decisions Made: [Important decisions]
- Issues Encountered: [Problems and resolutions]

### [HH:MM] - [Next Action/Task]
[Continue documenting work as it happens]

## Key Decisions Made
1. **Decision**: [What was decided]
   - **Rationale**: [Why this decision was made]
   - **Impact**: [How this affects project]
   - **Alternatives Considered**: [Other options evaluated]

## Issues & Blockers
### Active Issues
- **Issue**: [Description of problem]
- **Impact**: [How it affects work]
- **Resolution Plan**: [Steps to resolve]
- **Owner**: [Who is responsible]

### Resolved Issues  
- **Issue**: [Problem that was solved]
- **Resolution**: [How it was solved]
- **Lessons Learned**: [What we learned]

## Artifacts Created/Modified
- **File**: `/path/to/file.ext`
  - **Changes**: [Description of changes made]
  - **Purpose**: [Why changes were made]

## Next Session Preparation
### Immediate Next Steps
1. [Action item 1 - with owner and timeline]
2. [Action item 2 - with owner and timeline] 
3. [Action item 3 - with owner and timeline]

### Context for Next Session
- **Current State**: [Where things stand now]
- **Priority Items**: [What should be tackled first next time]
- **Known Issues**: [Problems that need attention]
- **Dependencies**: [What we're waiting for]

## Session Metrics
- **Duration**: [How long session lasted]
- **Productivity Score**: [1-10 self-assessment]
- **Objectives Completed**: [X of Y objectives achieved]
- **Blocker Resolution**: [Issues resolved vs. new issues created]

📁 Actual Session Directory Structure

.apm/session_notes/ Directory

The Coherence framework automatically manages session notes in:

.apm/session_notes/
├── session_notes.md                    # Current active session
├── YYYY-MM-DD-HH-mm-ss-Persona-Action.md  # Specific session files
└── pre_compact_archive/                # Archived sessions
    └── YYYY-MM-DDTHH-mm-ss.nnnnnn/    # Timestamped archives
        └── [archived session files]

Automatic Session Note Creation

Framework-Created Files:

  • session_notes.md - Main session file, continuously updated
  • YYYY-MM-DD-HH-mm-ss-Coherence-Orchestrator-Activation.md - Orchestrator sessions
  • Archive files in pre_compact_archive/ when sessions reach capacity

Naming Convention Examples (Actual):

  • 2025-08-16-19-42-03-AP-Orchestrator-Activation.md
  • session_notes.md
  • Pre-compact archives with timestamp directories

🔄 Session Lifecycle Management

1. Session Initialization

Every session must begin with:

  1. Context Check: Read latest session notes for relevant context
  2. Session Note Creation: Create new session note with current timestamp
  3. Objective Setting: Define clear objectives for the session
  4. Previous Work Review: Understand what was accomplished previously

Coherence Session Initialization Pattern:

# 1. Initialize Coherence Orchestrator
/coherence

# 2. Automatic session note creation in .apm/session_notes/
# Framework automatically creates: YYYY-MM-DD-HH-mm-ss-Coherence-Orchestrator-Activation.md

# 3. Check existing session context
LS .apm/session_notes/

# 4. Read current session note (automatically managed)
Read .apm/session_notes/session_notes.md

# 5. Voice notification automatically provided
# Audio: "Coherence Orchestrator activated. Loading unified context engineering system."

Available Session Commands:

  • /session-note-setup - Initialize session management
  • /coherence - Launch with automatic session creation
  • /switch <persona> - Transition with session continuity
  • /handoff <persona> - Transfer with session documentation

2. Continuous Documentation During Session

Document in real-time when:

  • ✅ Starting work on a new task or component
  • ✅ Completing significant work or reaching milestones
  • ✅ Making important decisions or architectural choices
  • ✅ Encountering and resolving issues or blockers
  • ✅ Every 15-20 minutes during active work (progress checkpoints)
  • ✅ Modifying key files like backlog.md, requirements.md, etc.
  • ✅ Before switching contexts or taking breaks

Documentation Update Pattern:

### [10:30] - Started User Authentication Implementation
- Status: In Progress
- Approach: Using JWT tokens with refresh token rotation
- Files: Created `auth.js`, `user-model.js`, `auth-middleware.js`
- Decision: Using bcrypt for password hashing (industry standard)

### [11:15] - Progress Checkpoint
- Status: 60% complete
- Completed: User model, password hashing, basic JWT creation
- Next: Token validation middleware and refresh token logic
- Issues: None currently

### [12:00] - Authentication Module Completed
- Status: Completed
- Files Modified: auth.js, user-model.js, auth-middleware.js, tests/auth.test.js
- Testing: All unit tests passing
- Integration: Ready for integration testing

3. Session Transitions & Handoffs

When switching personas or ending sessions:

  1. Complete Current Work Documentation: Ensure all recent work is documented
  2. Update Project Artifacts: Ensure backlog.md and other key files are current
  3. Handoff Summary: Create clear summary for next session/persona
  4. Context Preservation: Document current state and immediate next steps

Handoff Documentation Pattern:

## Handoff to [Next Persona/Session]
### Current State
- Authentication module implementation: 90% complete
- Remaining work: Integration testing and error handling
- All unit tests passing, ready for system testing

### Immediate Next Steps for [Next Persona]
1. Run integration tests with authentication module
2. Implement error handling for authentication failures  
3. Update API documentation with authentication endpoints

### Context to Preserve
- JWT token expiration set to 15 minutes (security requirement)
- Refresh token rotation implemented per OWASP guidelines
- Database schema includes user roles for future authorization

### Files to Focus On
- `/src/auth/auth.js` - Main authentication logic
- `/tests/auth.test.js` - Unit tests (all passing)
- `/docs/api.md` - Needs update with auth endpoints

4. Session Archiving

When to Archive:

  • Session is complete and documented
  • All handoff information is captured
  • No immediate follow-up work planned
  • Session represents a logical completion point

Archiving Process:

  1. Final Review: Ensure session note is complete and accurate
  2. Move to Archive: Move to /session_notes/archive/ directory
  3. Create Archive Summary: Brief summary of session outcomes
  4. Update Session Index: Maintain searchable index of archived sessions

🎯 Context Preservation Strategies

Strategy 1: Layered Context Architecture

Context Layers:

  1. Immediate Context: Current session work and decisions
  2. Project Context: Overall project status and long-term decisions
  3. Historical Context: Previous sessions and lessons learned
  4. Environmental Context: Technical constraints and dependencies

Strategy 2: Smart Context Retrieval

Context Retrieval Process:

  1. Latest Session Review: Always check most recent session notes
  2. Related Work Search: Find sessions with related work or decisions
  3. Issue History: Review previous solutions to similar problems
  4. Decision History: Understand rationale behind past architectural choices

Strategy 3: Proactive Context Documentation

Context Documentation Points:

  • Decision Rationale: Why decisions were made, not just what was decided
  • Alternative Options: What other approaches were considered
  • Environmental Factors: Technical, business, or resource constraints that influenced decisions
  • Success Criteria: How to measure if decisions/implementations are successful

🔄 Multi-Session Workflows

Pattern 1: Progressive Feature Development

Session 1: Requirements analysis and architecture design Session 2: Core implementation and unit testing Session 3: Integration testing and bug fixes Session 4: User acceptance testing and documentation

Context Flow:

  • Session 1 → Session 2: Architecture decisions and implementation plan
  • Session 2 → Session 3: Implementation details and known issues
  • Session 3 → Session 4: Test results and remaining work

Pattern 2: Cross-Persona Collaboration

Developer Session: Implement core functionality QA Session: Create test framework and execute tests Architect Session: Review implementation against architecture Product Session: Validate against business requirements

Context Handoffs:

  • Developer → QA: Implementation details and test scenarios
  • QA → Architect: Test results and architectural concerns
  • Architect → Product: Technical recommendations and trade-offs
  • Product → Developer: Requirements clarification and priorities

Pattern 3: Iterative Refinement

Analysis Session: Problem analysis and solution options Implementation Session: Initial implementation attempt Review Session: Review results and identify improvements Refinement Session: Implement improvements and finalize

🚨 Session Management Anti-Patterns

❌ What NOT to Do

1. Context Abandonment

  • Problem: Starting new sessions without reviewing previous work
  • Impact: Repeated work, inconsistent decisions, lost progress
  • Solution: Always review recent session notes before starting new work

2. Documentation Debt

  • Problem: Delaying documentation until end of session
  • Impact: Lost details, incomplete context, poor handoffs
  • Solution: Document continuously throughout session

3. Session Sprawl

  • Problem: Single session file becomes too large or unfocused
  • Impact: Difficult to find information, poor organization
  • Solution: Keep sessions focused, create new session for different work

4. Handoff Gaps

  • Problem: Insufficient information for next session/persona
  • Impact: Lost context, repeated analysis, delayed progress
  • Solution: Structured handoff documentation with clear next steps

✅ Best Practices

1. Structured Session Planning

  • Set Clear Objectives: Define what the session should accomplish
  • Time Boxing: Allocate appropriate time for different activities
  • Context Preparation: Review relevant previous sessions before starting
  • Success Criteria: Define how to measure session success

2. Real-Time Documentation

  • Continuous Updates: Document as work happens, not afterward
  • Decision Capture: Record rationale behind decisions when made
  • Issue Tracking: Document problems and solutions immediately
  • Progress Markers: Regular checkpoint documentation

3. Effective Handoffs

  • Current State Summary: Clear description of where things stand
  • Next Steps: Specific, actionable next steps for next session/persona
  • Context Preservation: Key decisions, constraints, and requirements
  • Issue Awareness: Known problems and potential solutions

📊 Session Management Metrics

Session Quality Metrics

  • Documentation Completeness: Percentage of work properly documented
  • Context Continuity: Success rate of session handoffs
  • Objective Achievement: Percentage of session objectives met
  • Issue Resolution Rate: Problems resolved vs. problems created

Productivity Metrics

  • Session Efficiency: Work completed per time invested
  • Context Retrieval Time: Time spent getting up to speed each session
  • Rework Rate: Percentage of work that needs to be redone
  • Knowledge Transfer Success: Information successfully preserved across sessions

Project Health Metrics

  • Documentation Currency: How up-to-date project documentation is
  • Decision Traceability: Ability to trace current state back to decisions
  • Issue Resolution Time: Time from issue identification to resolution
  • Team Alignment: Consistency of understanding across team members

🛠️ Tools & Automation

APM Session Management Tools

  • Session Note Templates: Standardized templates for different session types
  • Context Search: Tools to find relevant previous sessions
  • Progress Tracking: Integration with backlog.md and project tracking
  • Handoff Automation: Automated handoff documentation generation

Integration with APM Commands

  • Automatic Documentation: native Claude Code slash commands automatically update session notes
  • Context Awareness: Commands check previous session context
  • Progress Tracking: Commands update project progress automatically
  • Voice Notifications: Audio feedback for session management actions

📚 Related Workflows

📖 Session Management Checklist

Session Start Checklist

  • Reviewed latest relevant session notes
  • Created new session note with clear objectives
  • Understood context from previous work
  • Set realistic time expectations
  • Prepared necessary tools and resources

During Session Checklist

  • Documenting work progress in real-time
  • Recording important decisions and rationale
  • Tracking issues and resolutions
  • Updating project artifacts (backlog.md, etc.)
  • Regular progress checkpoints every 15-20 minutes

Session End Checklist

  • All work progress documented
  • Important decisions recorded with rationale
  • Issues and resolutions captured
  • Next steps clearly defined
  • Handoff information complete
  • Project artifacts updated
  • Session objectives reviewed and marked complete/incomplete

Master session management to ensure no context is lost and every session builds upon previous achievements.

Clone this wiki locally