claw-memory-manager
Skill4 starsChanged 5 months agoMITView on GitHub
Manage OpenClaw Agent's built-in memory features — enable/disable/configure Dreaming (Light→REM→Deep auto memory consolidation) and Active Memory (proactive memory injection with three style presets: conservative / balanced / aggressive). Auto-detects K8s ConfigMap mirrors, creates *.bak.<timestamp> backups before write, supports --dry-run preview, --style preset for active-memory, --half-life / --max-age / --timezone for dreaming, and triggers gateway restart automatically (opt-out via --no-restart). Triggers: "enable dreaming", "tune memory half-life", "configure agent memory", "enable active memory", "switch memory style", "conservative/balanced/aggressive memory mode".
- Installs packages
In this repository16 other files it gives its agents.
- agent-avatar-managerSkill
- agent-team-meshSkill
- codex-thread-repairSkill
- collective-memorySkill
- copy-my-profileSkill
- hello-envSkill
- init-hooksSkill
- multica-squad-load-balancerSkill
- multica-squad-onboardSkill
- openviking-projectsSkill
- recover-codex-project-chatsSkill
- rename-sessionSkill
- session-recoverySkill
- subagent-timeout-configSkill
- token-slimSkill
- workspace-git-setupSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 134
If you run OpenClaw locally (e.g.
- Very specific: line 153
Add a new entry to the FEATURES dict at the top of agent_memory.py:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claw Memory Manager
- Version: 1.1.1
- License: MIT
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/better-agent-skills
Manage OpenClaw Agent's built-in memory features through one safe CLI: enable/disable, tune parameters, preview with dry-run, auto-backup, and auto-restart.
What it does
OpenClaw Agent has two built-in memory features:
- Dreaming — scheduled job (default 03:00 local time) that scans your
daily memory signals, scores them, and auto-promotes high-recall items
to long-term
MEMORY.md. - Active Memory — lightweight sub-agent that runs before every turn, retrieves relevant memories, and injects them into the model context window for better recall.
Both require editing nested config trees, syncing to multiple paths in managed environments, and restarting the gateway. This skill does it all in one command, safely.
Supported features
| Feature | What | CLI flags |
dreaming | Light→REM→Deep three-phase memory consolidation | --half-life, --max-age, --timezone |
active-memory | Proactive memory injection with style presets | --style {conservative,balanced,aggressive} |
See references/features.md for full schema details.
Quick start — Dreaming
# Check OpenClaw support
python3 scripts/agent_memory.py check dreaming
# See current state
python3 scripts/agent_memory.py status dreaming
# Enable with defaults (half-life 30d, max-age 60d, timezone UTC)
python3 scripts/agent_memory.py enable dreaming
# Custom tuning
python3 scripts/agent_memory.py enable dreaming --half-life 14 --timezone America/New_York
# Preview only
python3 scripts/agent_memory.py enable dreaming --dry-run
# Disable
python3 scripts/agent_memory.py disable dreamingQuick start — Active Memory
# Enable with default style (balanced)
python3 scripts/agent_memory.py enable active-memory
# Pick a style preset
python3 scripts/agent_memory.py enable active-memory --style conservative
python3 scripts/agent_memory.py enable active-memory --style aggressive
# Inspect current style + parameters
python3 scripts/agent_memory.py status active-memory
# Preview only
python3 scripts/agent_memory.py enable active-memory --style aggressive --dry-run
# Disable
python3 scripts/agent_memory.py disable active-memoryActive Memory style presets
| Style | Use case | queryMode | promptStyle | Context window | Inject cap | Timeout | Thinking |
conservative | Fastest, precision-focused | message | precision-heavy | user 1×120 / assist 0 | 150 chars | 8 s | off |
balanced (default) | Everyday use | recent | balanced | user 2×220 / assist 1×180 | 220 chars | 15 s | off |
aggressive | Best recall, larger context | full | recall-heavy | user 4×500 / assist 2×400 | 500 chars | 25 s | minimal |
Style is inferred back from queryMode when running status active-memory.
CLI flags
| Flag | Applies to | Purpose | Default |
--half-life N | dreaming | Signal decay half-life (1-90 days) | 30 |
--max-age N | dreaming | Signal hard expiry (1-90 days) | 60 |
--timezone TZ | dreaming | IANA timezone for schedule | UTC |
--style NAME | active-memory | conservative / balanced / aggressive | balanced |
--dry-run | all | Print planned changes; do not write | off |
--no-backup | all | Skip *.bak.<timestamp> creation | off (backup on) |
--no-restart | all | Skip openclaw gateway restart after change | off (auto-restart on) |
Safety features
| Layer | Behavior |
| Auto-backup | Every write creates openclaw.json.bak.<YYYYMMDD_HHMMSS> (use --no-backup to opt out) |
| Dry-run | --dry-run prints exact JSON change + sync targets + restart action without touching disk |
| Managed-env auto-detect | /app/clawconfig/ and /app/k8s-config/clawconfig/ auto-detected — synced if present, silently skipped if not |
| Validation | Half-life and max-age ranges enforced (1-90); --style enforced by argparse choices |
| Verify after write | Re-reads config to confirm change took effect before reporting success |
Configuration sources
The script reads/writes:
- Runtime config:
~/.openclaw/openclaw.json(or$OPENCLAW_CONFIG) - Managed-environment mirrors (auto-detected, optional):
/app/clawconfig/openclaw.json(Pod restart source in K8s)/app/k8s-config/clawconfig/openclaw.json(K8s ConfigMap source)
If you run OpenClaw locally (e.g. npm install -g openclaw on your laptop),
only the runtime config exists and the script does the right thing
automatically.
Why use this skill
Without this skill, enabling Active Memory requires:
- Reading the OpenClaw plugins config schema
- Editing nested JSON under
plugins.entries.active-memorywith 10+ fields - Picking sensible defaults for
queryMode/promptStyle/ context windows - Copying to 2 mirror paths (in K8s environments)
- Running
openclaw gateway restart - Manually verifying
This skill: one command + a style preset, with backup + dry-run + verify built in.
Extending to new memory features
Add a new entry to the FEATURES dict at the top of agent_memory.py:
FEATURES["my-feature"] = {
"path": ["plugins", "entries", "my-plugin", "config"],
"enable_patch": {"enabled": True, ...},
"disable_patch": {"enabled": False},
"check_key": "enabled",
"status_key": "frequency", # field shown in `status`
"description": "What this feature does",
}For features with preset-style choices (like active-memory), follow the
ACTIVE_MEMORY_STYLES pattern and set supports_style: True in the entry.
Files
claw-memory-manager/
├── SKILL.md ← agent entry point
├── README.md ← this file
├── LICENSE ← MIT
├── .gitignore
├── scripts/
│ └── agent_memory.py ← single Python entry, zero external deps
└── references/
└── features.md ← feature catalog + schema referenceChangelog
See CHANGELOG.md for the full version history.
See also
references/features.md— full feature catalog, config schemas, and extension guide- OpenClaw docs — platform reference
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

