← Back to Skills Marketplace
2691
Downloads
1
Stars
5
Active Installs
1
Versions
Install in OpenClaw
/install sophie-optimizer
Description
Automated context health management for OpenClaw. Monitors token usage, snapshots memory, and resets sessions to maintain performance. Authored by Sophie.
Usage Guidance
Before installing/running this skill: 1) Review and back up your OpenClaw data (~/openclaw/MEMORY.md and ~/.openclaw/agents/main/sessions) — reset.sh deletes session .json/.jsonl files. 2) Test optimizer.py without the --reset flag to verify archive and MEMORY.md updates work as you expect. 3) Note the documentation mismatch: the SKILL.md mentions a tokens<80k early-exit that is not implemented; confirm the token-check behavior you want. 4) Ensure your environment supports systemctl --user and that restarting openclaw-gateway via systemd is acceptable. 5) Because the skill's source/homepage are unknown, prefer running it in a sandbox or non-production account first, and inspect or run the scripts manually rather than granting automatic or scheduled execution until you're comfortable with its behavior.
Capability Analysis
Type: OpenClaw Skill
Name: sophie-optimizer
Version: 1.0.0
The OpenClaw skill 'sophie-optimizer' is designed for automated context health management. It performs several powerful actions: archiving context summaries to local JSON files, updating the agent's `~/openclaw/MEMORY.md` file with these summaries, deleting session files (`.jsonl`, `.json`) from `$HOME/.openclaw/agents/main/sessions`, and restarting the `openclaw-gateway.service`. While these actions involve file system modification and service control, they are explicitly stated in `SKILL.md` and implemented in `optimizer.py` and `reset.sh` as core functionalities for 'resetting sessions' and 'maintaining performance'. There is no evidence of data exfiltration, arbitrary command execution, persistence mechanisms, obfuscation, or malicious prompt injection attempts against the agent. All actions are directly aligned with the skill's declared purpose of self-optimization.
Capability Assessment
Purpose & Capability
The name/description (context health: monitor tokens, snapshot memory, reset sessions) matches the included files: optimizer.py creates JSON snapshots and updates MEMORY.md; reset.sh deletes session files and restarts openclaw-gateway. Minor inconsistencies: SKILL.md's Protocol claims a pre-check 'If tokens < 80k, exit', but optimizer.py does not implement that token-threshold check. SKILL.md usage example hardcodes /home/lucas in the run command while the script uses its own BASE_DIR; this is a documentation mismatch but not a functional contradiction.
Instruction Scope
Instructions and code act within OpenClaw user data scope: they create archives/ in the skill directory, read/write ~/openclaw/MEMORY.md, and reset session storage at ~/.openclaw/agents/main/sessions. The reset step deletes .json/.jsonl session files and restarts the user systemd service (systemctl --user restart openclaw-gateway.service). There are no external network endpoints or credential exfiltration paths in the code. The operations are potentially destructive (deleting session history) but are coherent with the stated purpose.
Install Mechanism
No install spec (instruction-only with bundled code files). Nothing is downloaded or written by an installer. Risk from install mechanism is low.
Credentials
The skill requests no environment variables or external credentials, which is proportional. It does, however, operate on files under the user's home directory (~/openclaw/MEMORY.md and ~/.openclaw/...), and it invokes systemctl --user, which requires appropriate user-level systemd support. The required filesystem and service-control privileges are consistent with the skill's function but are worth noting because they allow destructive state changes.
Persistence & Privilege
always:false and normal model invocation settings. The skill does not request permanent platform-level presence nor modify other skills' configs. It will, when run, delete session data and restart the gateway service — actions with local destructive effect but limited to the user's OpenClaw data and the user's systemd user service.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install sophie-optimizer - After installation, invoke the skill by name or use
/sophie-optimizer - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of Sophie Optimizer for OpenClaw.
- Monitors session token usage and automates context health management.
- Archives current state snapshots and updates long-term memory.
- Performs automated session resets to maintain performance.
- Run manually or automatically via scheduler (e.g., cron).
Metadata
Frequently Asked Questions
What is Sophie Optimizer?
Automated context health management for OpenClaw. Monitors token usage, snapshots memory, and resets sessions to maintain performance. Authored by Sophie. It is an AI Agent Skill for Claude Code / OpenClaw, with 2691 downloads so far.
How do I install Sophie Optimizer?
Run "/install sophie-optimizer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Sophie Optimizer free?
Yes, Sophie Optimizer is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Sophie Optimizer support?
Sophie Optimizer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Sophie Optimizer?
It is built and maintained by zAyresz (@zayresz); the current version is v1.0.0.
More Skills