🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Openclaw Token Memory Optimizer

by @klautimus

Optimization suite for OpenClaw agents to prevent token leaks and context bloat. Use when an agent needs to implement background task isolation (Cron) or a Reset & Summarize workflow (RAG).

πŸ’‘ Examples

Use memory_search to retrieve context from your logs instead of loading everything:

memory_search(query="what did we decide about the API design")

The tool returns relevant snippets with file paths and line numbers. Use memory_get to pull specific sections.


βš™οΈ Configuration

Add transcript paths to memorySearch.extraPaths:

{
  "memorySearch": {
    "extraPaths": [
      "~/.openclaw/sessions/*.jsonl"
    ]
  }
}

Best Practices

  • Index selectively (recent sessions, important conversations)
  • Use date-based filtering to limit search scope
  • Archive old transcripts to cold storage after indexing

  • πŸ“‹ Tips & Best Practices

  • Index selectively (recent sessions, important conversations)
  • Use date-based filtering to limit search scope
  • Archive old transcripts to cold storage after indexing

  • View on ClawHub
    TERMINAL
    clawhub install openclaw-token-memory-optimizer

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’