AI Agent Hub
Back to skills
Context Memory Manager icon

Context Memory Manager

AI Agent Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Install @user_c1fd9783/context-memory-manager according to https://skillhub.cn/install/skillhub.md.

About this skill

The problem

Agents lose important context in long conversations when the context window is limited: user preferences, project state, and open tasks can be truncated or forgotten. A cron script alone cannot decide whether compression is needed because it does not see the live session_status.

How it works

The skill organizes agent memory into three layers: memory/chat/YYYY-MM-DD.md stores raw conversation records, memory/projects/... keeps structured project notes, and MEMORY.md maintains the global index, preferences, and todos. Each time the agent is awakened, it checks context usage and triggers the save-then-distill compression flow when usage reaches 70%, preserving the original conversation trace instead of discarding it. A daily cron job only scans changed files, estimates tokens, and writes review instructions to /tmp/cmm_review_report.json; the agent processes the report on its next wake and deletes the temporary file. Chat logs older than 30 days are moved to memory/archive/ rather than deleted.

Limits

It is best suited to AI agent workflows that need cross-session memory for preferences, projects, and todos. It relies on session_status for compression timing, uses rough token estimates, and preserves raw chat logs. If the host environment lacks session-status checks or cron support, automatic review is limited.

Use Cases

  • Compress a long session near the context limit by saving raw chat first, then extracting preferences and todos into MEMORY.md.
  • Run a nightly review of new chat files using .last_review and generate an incremental memory report.
  • Process agent_instructions in /tmp/cmm_review_report.json to update project logs, then delete the file.
  • Archive chat logs older than 30 days into memory/archive/ while keeping them readable.

Best For

  • Agent engineering teams that maintain long-running assistants need to preserve user preferences, project context, and todos across sessions.
  • Platform developers auditing AI assistant transcripts need raw conversation logs preserved without silent truncation.
  • Ops engineers managing agent state via cron and file directories need daily incremental memory reviews.
  • Developers building multi-agent systems need layered storage for chat logs, project notes, and MEMORY.md with automatic archival.