← 返回
未分类 中文

Agent Memory Cleanup

Clean and audit long-term agent memory files such as user.md, memory.md, memories.md, profile.md, preferences.md, and agent_memory.md. Use when the user expl...
Clean and audit long-term agent memory files such as user.md, memory.md, memories.md, profile.md, preferences.md, and agent_memory.md. Use when the user expl...
hollis9087 hollis9087 来源
未分类 clawhub v0.3.7 1 版本 100000 Key: 无需
★ 0
Stars
📥 424
下载
💾 0
安装
1
版本
#latest

概述

Agent Memory Cleanup

This skill should be lightweight and low-noise. Do not require the user to know internal implementation names unless they ask. The user should still receive clear memory-state prompts, such as "memory appears too large, stale, duplicated, conflicted, or unsafe," when action is useful.

Default Flow

  1. Detect memory pressure or pollution.
  2. If Python/file access is available, run a cheap summary check first:
python scripts/audit_memory.py memory.md --summary-json
  1. If quality.intervention is no_intervention_needed, do not interrupt the user.
  2. If intervention is needed, say briefly that memory appears too large, stale, duplicated, conflicted, or unsafe, and ask whether to review cleanup recommendations. Avoid implementation labels like the skill name unless the user asks.
  3. After the user agrees, run:
python scripts/audit_memory.py memory.md --mode propose-patch --include-diff
  1. Apply only after a second explicit approval, unless unattended cleanup was already authorized:
python scripts/audit_memory.py memory.md --mode apply-approved

The apply mode must create timestamped backups before writing.

Trigger Points

Use this flow for:

  • Memory write/update rejected, full, over budget, truncated, or too long.
  • Short memory with secrets, task-state residue, duplicated facts, or conflicting preferences.
  • User says a remembered fact is wrong, outdated, project-only, or should not be remembered.
  • Before saving a new global memory candidate:
python scripts/audit_memory.py --candidate "candidate memory text" --summary-json

If candidate lint returns do_not_write_candidate_to_global_memory, do not store it globally. Offer to skip it or keep it as project/task notes.

Intervention Values

  • prompt_cleanup_now_secret_detected: recommend cleanup immediately; never echo raw secrets.
  • prompt_user_review_conflicting_memory: ask the user to resolve conflicting durable preferences.
  • do_not_write_candidate_to_global_memory: block global memory write.
  • prompt_cleanup_recommended: offer cleanup recommendations.
  • prompt_audit_recommended: mention memory quality may be degrading and ask whether to review.
  • no_intervention_needed: stay silent.

Load Extra Context Only When Needed

Do not read references by default. Load them only for the matching need:

  • references/default-rules.json: deterministic thresholds and regex rules.
  • references/classification-rubric.md: manual fallback if Python cannot run.
  • references/agent-paths.md: path discovery when memory files are unclear.
  • references/mcp-version.md: MCP wrapper design.

Safety

  • Keep only stable global preferences and durable cross-task context.
  • Remove or redact secrets, stale task state, branch/PR/debug notes, and one-off plans.
  • Do not rewrite clean memory just for style.
  • Do not broadly scan the user home directory without explicit request.
  • Back up every edited memory file.

版本历史

共 1 个版本

  • v0.3.7 当前
    2026-06-01 12:47

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

Long Task Handoff

hollis9087
Ultra-light automatic handoff manager for long-running agent sessions at context-boundary moments. Use this skill when a
★ 0 📥 414

Academic Reader (Holli)

hollis9087
AI学术阅读助手,采用钱学森方法论,帮助阅读、总结和反思技术书籍。
★ 0 📥 312

Financial Fraud Analyzer Lite

hollis9087
财务造假风险分析技能。基于财务报表(利润表、资产负债表、现金流量表)评估盈余操纵与会计舞弊概率,输出结构化风险结论与证据链。支持单公司深度分析和批量筛查。用于用户请求检测财务报表欺诈、盈余操纵等情形。
★ 0 📥 529