memory-management

Save session work to dated memory files and compact context safely.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/MagicWifiMoney/openclaw-starter-kit --skill memory-management-magicwifimoney
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-management
Source: https://github.com/MagicWifiMoney/openclaw-starter-kit/tree/main/skills-custom/memory-management
Command: npx skills add https://github.com/MagicWifiMoney/openclaw-starter-kit --skill memory-management-magicwifimoney

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents context overload, data loss, and runaway session state by providing a repeatable protocol to save, compact, and manage AI session memory before switching contexts or spawning background work.

Core Features & Use Cases

  • Save & Persist: Save completed, in-progress, and pending work to dated memory files (memory/YYYY-MM-DD.md) and update MEMORY.md when significant.
  • Compact Protocol: Run session_status checks, switch models for compacting (sonnet → opus), and confirm readiness before and after compaction to preserve continuity.
  • Sub-agent & Async Safety: Schedule one-shot check-back crons before spawning sub-agents or promising timed work, ensure main session owns follow-ups, and enforce fail-fast behavior for sub-agents near context limits.
  • Context Thresholds: Warn at 50% and take automated actions at 75% token usage with different behaviors for main sessions versus sub-agents.

Quick Start

Save the current session to memory/YYYY-MM-DD.md, schedule a check-back cron for the task, then spawn the sub-agent so the main session retains follow-up control.

Frequently Asked Questions about memory-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent context overload and data loss during long AI conversations?

Prevent context overload by running a compact protocol that saves session state to dated memory files, checks session status, and switches models before compaction to preserve continuity and prevent data loss.

What's the best way to save session memory before spawning a sub-agent?

The best way to save session memory before spawning a sub-agent is to write work to dated memory files, schedule a one-shot check-back cron, and ensure the main session owns follow-ups to enforce async safety.

How does session compaction work when switching between sonnet and opus models?

Session compaction works by running session_status checks, switching from sonnet to opus for safe compaction, and confirming readiness before and after the process to maintain conversation continuity without losing pending tasks.

When should I trigger automated actions for token limits in session management?

Trigger automated actions for token limits at 75% context usage, while warning at 50%. Main sessions and sub-agents follow different threshold behaviors, with sub-agents enforcing fail-fast behavior near context limits.

Can I schedule check-back crons for timed work using session memory management?

Yes, you can schedule one-shot crons for check-backs before promising timed work or spawning sub-agents, ensuring the main session retains follow-up control and preventing runaway session state.

Why does my sub-agent fail near context limits during background work?

Sub-agents fail fast near context limits by design to prevent runaway session state. Save work to memory files and schedule check-back crons before spawning sub-agents to safely manage background tasks.