Use when managing session memory persistence across multiple interactions, surviving context window compaction, and recovering from interruptions. Trigger with shared configuration or pattern lookups.
npx claudepluginhub emasoft/emasoft-plugins --plugin emasoft-chief-of-staffThis skill uses the workspace's default tool permissions.
Session memory is a critical persistence mechanism for the Chief of Staff agent. It enables the agent to maintain continuity across multiple interactions, survive context window compaction, and recover gracefully from interruptions. This skill teaches you how to implement, manage, and troubleshoot session memory in Chief of Staff.
AUDIT_REPORT.mdFINAL_AUDIT_RESULTS.mdREADME.mdaudit_tools/comprehensive_audit.pyaudit_tools/fix_toc_format.pyreferences/00-key-takeaways-and-next-steps.mdreferences/00-session-memory-examples.mdreferences/00-session-memory-fundamentals.mdreferences/00-session-memory-lifecycle.mdreferences/01-initialize-session-memory.mdreferences/02-memory-directory-structure-part1-directory-details.mdreferences/02-memory-directory-structure-part1-overview.mdreferences/02-memory-directory-structure-part2-naming-validation.mdreferences/02-memory-directory-structure-part2-operations.mdreferences/02-memory-directory-structure-part3-examples-troubleshooting.mdreferences/02-memory-directory-structure.mdreferences/03-manage-active-context-part1-update-procedures.mdreferences/03-manage-active-context-part2-snapshots-pruning.mdreferences/03-manage-active-context-part3-examples.mdreferences/03-manage-active-context-part4-troubleshooting.mdImplements 3-tier agent memory system with 5-level compaction tree for Claude Code. Manages session start protocols, compaction triggers, checkpoints, and memory files.
Saves Claude Code session state to memory by synthesizing changes, dispatching maintain agent to update files, and committing to git. Skips if no meaningful activity.
Maintains working memory across sessions via .cm/CONTINUITY.md: reads at start to load context/mistakes/learnings, updates at end with progress/decisions/next actions.
Share bugs, ideas, or general feedback.
Session memory is a critical persistence mechanism for the Chief of Staff agent. It enables the agent to maintain continuity across multiple interactions, survive context window compaction, and recover gracefully from interruptions. This skill teaches you how to implement, manage, and troubleshoot session memory in Chief of Staff.
Before using this skill, ensure:
| Resource Type | Output |
|---|---|
| Pattern | Pattern definition and usage example |
| Configuration | Config template with filled values |
| Reference | Reference content for context |
Session memory persists agent state across conversations and context compaction. It uses three coordinated documents in design/memory/: activeContext.md (current work), patterns.md (learned patterns), and progress.md (task tracking).
For complete details, see references/00-session-memory-fundamentals.md:
Session memory follows three phases: Load (at session start), Update (during work), and Save (before exit).
For complete details, see references/00-session-memory-lifecycle.md:
Steps: Check directory exists, read all three memory files, validate Markdown syntax, report loaded state.
Related documentation:
When to use: When shifting focus, changing current line, entering/exiting dialogs, or making decisions.
Steps: Identify change, open activeContext.md, update relevant section with timestamp, write immediately.
Related documentation:
When to use: After identifying recurring patterns, anti-patterns, conventions, or effective solutions.
Steps: Identify pattern, open patterns.md, add with description/examples, categorize, add date and context.
Related documentation:
When to use: When task completes, status changes, task becomes blocked, or dependencies resolve.
Steps: Identify changed task, open progress.md, update status with timestamp, document blockers if any, update dependent tasks.
Related documentation:
When to use: After unexpected termination, manual interruption, or long breaks.
Steps: Load all memory files, read activeContext.md for work state, read progress.md for task state, ask user to confirm resumption.
Related documentation:
When to use: When context usage exceeds 70%, before long-running operations, or proactively.
Steps: Ensure all three memory files are fully updated, run validation, write to disk, confirm ready.
Related documentation:
Session memory captures configuration state at session start to detect drift, maintain consistency, enable conflict resolution, and support audit trails.
Config snapshot location: design/memory/config-snapshot.md
This file is separate from authoritative configs in design/config/ (OPTIONAL: If EOA (Emasoft Orchestrator Agent) plugin is installed) and serves as a point-in-time capture.
When to use: During session initialization, after loading core memory files, before any work begins.
Steps: Read all config files from design/config/ (OPTIONAL: If EOA (Emasoft Orchestrator Agent) plugin is installed), create snapshot with timestamp and session ID, copy config content and metadata, save snapshot, record in activeContext.md.
Related documentation:
When to use: Periodically during long sessions (every 30 minutes), after config change notifications, before major tasks, when unexpected behavior occurs.
Steps: Read current and snapshot configs, compare timestamps, perform content comparison if timestamps differ, identify changed sections, log in activeContext.md, trigger conflict resolution if critical.
Related documentation:
When to use: When change detection reveals critical differences, high-priority notifications arrive, current work becomes incompatible, or orchestrator requests resolution.
Conflict types:
Related documentation:
These operational runbooks provide step-by-step instructions for executing each session memory procedure. Use them as quick-reference guides when performing the corresponding operation.
Runbook for creating or loading session memory files at session start to enable persistence across interactions and context compaction.
Runbook for updating the activeContext.md file when the agent's current focus, decisions, or session state changes.
Runbook for capturing recurring patterns, effective solutions, anti-patterns, and lessons learned into patterns.md for future reference.
Runbook for updating task status, documenting blockers, and managing dependencies in progress.md when task state changes.
Runbook for recovering agent state after unexpected termination, manual interruption, or long breaks by loading and validating memory files.
Runbook for safely preparing all session memory for context compaction to prevent data loss during context window reset.
Runbook for capturing a point-in-time copy of all configuration files into design/memory/config-snapshot.md at session start.
Runbook for periodically comparing current configuration against the session snapshot to detect drift and trigger conflict resolution.
Runbook for resolving configuration conflicts when change detection reveals critical differences, classified by conflict type (Non-Breaking, Breaking-Future, Breaking-Immediate, Irreconcilable).
Copy this checklist and track your progress:
Input: uv run python scripts/ecos_memory_manager.py init --session eoa-project-alpha --project project-alpha
Output: Creates memory-bank/ with activeContext.md, progress.md, patterns.md, and decisionLog.md initialized with session metadata.
For more worked examples, see references/00-session-memory-examples.md:
ecos_memory_manager.py initSymptoms: Files cannot be parsed, missing sections, syntax errors.
Symptoms: Agent continues wrong task, references outdated locations, old decisions referenced.
Symptoms: Tasks marked complete but work not done, dependencies resolved but blocked, timestamps out of order.
Symptoms: Slow initialization, noticeably slow operations, files are hundreds of KB.
Symptoms: Memory files exist but not reloaded, progress lost, patterns forgotten.
All session memory operations are provided by the unified ecos_memory_manager.py script. The individual standalone scripts (initialize-memory.py, validate-memory.py, etc.) have been superseded by subcommands of this single script.
ecos_memory_manager.py init - Create new session memory structure (creates design/memory/ and all three memory files)ecos_memory_manager.py validate - Check memory files for consistency (verifies directory, required sections, file existence)ecos_memory_manager.py health --json - Load and report on memory state (file sizes, entry counts, issues). Note: "loading memory" into agent context is an agent-level operation (reading the files directly), not a script operation.ecos_memory_manager.py add-decision|set-focus|add-progress|add-pattern - Persist changes to memory files immediately (writes are immediate via write_file_safely(), there is no deferred "save" concept)ecos_memory_manager.py compact - Archive old completed tasks (backs up files, removes old date sections from progress.md, trims old errors from activeContext.md)repair-memory.py - Recover from corruption (planned)The Chief of Staff agent requires additional integrations beyond session memory for team coordination.
AI Maestro is the inter-agent messaging system that enables the Chief of Staff to coordinate with other agents.
Related documentation:
The Chief of Staff uses specialized state files for team coordination, performance tracking, and alerts.
Related documentation:
The Chief of Staff follows a fail-fast approach to error handling with explicit recovery procedures.
Related documentation:
For essential principles and recommended reading order, see references/00-key-takeaways-and-next-steps.md:
See references/00-key-takeaways-and-next-steps.md for a full index of all reference documents.
Version: 1.0.0 Last Updated: 2025-02-01 Target Audience: Emasoft Chief of Staff Agent Difficulty Level: Intermediate