OpenClaw Token Optimizer
Analysis
This looks like a local cost-saving helper, but it can persistently change how your agent loads context and picks models.
Findings (4)
Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.
Checks for instructions or behavior that redirect the agent, misuse tools, execute unexpected code, cascade across systems, exploit user trust, or continue outside the intended task.
**Stop there.** Don't load anything else unless needed. ... **Simple conversations → HAIKU ONLY**
The generated AGENTS.md template can direct future agents to load less context and enforce cheaper models if the user chooses to install it.
assets/config-patches.json ... assets/HEARTBEAT.template.md ... references/PROVIDERS.md
The integrity manifest references assets and reference files that are not included in the provided file manifest, while the docs also describe using those optional files.
Checks whether tool use, credentials, dependencies, identity, account access, or inter-agent boundaries are broader than the stated purpose.
if os.environ.get("ANTHROPIC_API_KEY"): return "anthropic" ... elif os.environ.get("OPENROUTER_API_KEY"): return "openrouter"The router checks for provider API-key environment variables to infer which model provider to recommend, despite no required env vars being declared.
Checks for exposed credentials, poisoned memory or context, unclear communication boundaries, or sensitive data that could leave the user's control.
STATE_FILE = Path.home() / ".openclaw/workspace/memory/context-usage.json" ... state["file_access_count"]
The optimizer persists local file-usage metadata that may inform future context-loading recommendations.
