context-management
Agent 上下文管理方法论:通过分层文件体系实现跨 session 记忆延续、职责分离和高效上下文恢复。Use when: (1) 搭建新 agent 工作区, (2) 优化 agent 记忆和上下文管理, (3) 长期运行 agent 的记忆维护。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/349840432m-dev/agent-context-memoryWhat This Skill Does
The context-management methodology provides a structured, file-based framework for AI Agents to maintain state across different sessions. Rather than relying on volatile model memory, this skill dictates a hierarchical file system architecture consisting of five distinct layers: SOUL.md (Identity), USER.md (User Context), AGENTS.md (Routing/Protocol), TOOLS.md (Environment), and a dual-layer memory system (daily logs and long-term MEMORY.md). By implementing this skill, your agent effectively moves its brain onto the disk, ensuring that it carries historical context, learned lessons, and specific user preferences into every new conversation. It transforms your agent from a stateless chatbot into an evolving autonomous assistant that gets smarter and more efficient over time.
Installation
Run the following command in your terminal to initialize the context management framework within your agent directory:
clawhub install openclaw/skills/skills/349840432m-dev/agent-context-memory
Use Cases
- Long-Running Agents: Perfect for agents managing multi-day projects, research tasks, or repetitive daily automation workflows.
- Agent Workspace Initialization: Use this to standardize the structure of a new project, ensuring clear boundaries between agent identity, user preferences, and system environment configurations.
- Knowledge Capitalization: Use this to capture debugging insights, error fixes, and operational "tribal knowledge" that would otherwise be lost when the agent session expires.
Example Prompts
- "I am starting a new project on market research. Please initialize the standard context management directory structure, starting with a SOUL.md file that defines my role as a professional analyst."
- "I just encountered an error with the web-search skill. Please analyze the current daily memory log, identify the failure pattern, and summarize the fix into the long-term MEMORY.md file for future reference."
- "Summarize the current project status and user preferences based on the content in USER.md and the latest memory logs to prepare for the next session."
Tips & Limitations
- Write, Don't Remember: The core principle is that explicit file documentation beats model inference. If it isn't in a file, assume the agent doesn't know it.
- Maintenance: Periodically review the
memory/folder and purge outdated logs to prevent the context window from becoming bloated with irrelevant historical data. - Consistency: Ensure the agent has read/write access to the root of its workspace to effectively manage the file hierarchy.
- Granularity: When updating
MEMORY.md, focus only on non-obvious, non-repeating insights. If an experience can be derived from existing code documentation, it does not belong in the long-term memory layer.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-349840432m-dev-agent-context-memory": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write
Related Skills
feishu-user-md
飞书端读取USER.md任务清单。当用户说"查看任务"、"我的任务"时触发,实时解析并返回格式化的分类任务列表,让用户快速了解当前所有可用任务和技能。
image-prompt-generator
基于五层拆解法的AI图片提示词生成器。将模糊的创意想法转化为结构严谨、可执行的图像生成规格书,支持多种风格预设和目标工具适配。
multi-agent-workshop
七阶段(含阶段0任务澄清)多角色工作坊;角色种类与人数均由任务决定。触发词:"多角色研讨"、"需求工作坊"、"需求评审"、"圆桌"、"定方案再执行"。