ClawKit Logo
ClawKitReliability Toolkit

Token Optimization Guide

The Problem: 131K Tokens Per Cold Start

OpenClaw injects all 28 tool schemas into context at every session start. With no lazy loading, this costs 131K+ input tokens before your agent does anything. A 7-skill agent uses only ~14K tokens.

If your agent feels like it's "eating too many tokens," this guide explains why and how to cut cold-start costs by up to 90%.

Quick Fix

Disable unused tools to immediately reduce token injection:

See which tools are currently enabled
openclaw config get agents.defaults.tools
Disable specific tools you don't use
# Example: disable browser, exec, and file tools
openclaw config set agents.defaults.tools.browser false
openclaw config set agents.defaults.tools.exec false
openclaw gateway restart

Why Cold Starts Are Expensive

Every time a new session starts (cold start), OpenClaw injects the full schema for every enabled tool into the LLM context. There is no lazy loading — all tool definitions are sent upfront so the model knows what's available.

1

Session starts

A new conversation begins (cold start) or the context window is reset.

2

28 tool schemas injected

Each tool's JSON schema (parameters, descriptions, examples) is added to the system prompt.

3

~131K input tokens consumed

Before your first message, 131K+ tokens are already used by tool definitions alone.

4

Every message adds to this base

Your messages, agent responses, and tool results stack on top of the 131K baseline.

Audit Your Tool Count

List all enabled tools and their schema sizes
openclaw config get agents.defaults.tools

Count the tools in the output. Each tool schema adds roughly 2K-8K tokens depending on complexity. Browser automation and file tools are the heaviest.

Typical Tool Token Costs

browser (act, screenshot, etc.)~12K
exec (shell commands)~4K
file (read, write, search)~8K
message (channel output)~2K
memory (search, store)~3K
sessions (spawn, list)~5K

Disable Unused Tools

Most agents don't need all 28 tools. A Discord chatbot doesn't need browser automation. A cron reporter doesn't need file tools. Disable what you don't use:

Chatbot-only config (minimal tools)
# Minimal setup for a chat-only agent
openclaw config set agents.defaults.tools.browser false
openclaw config set agents.defaults.tools.exec false
openclaw config set agents.defaults.tools.file false
openclaw gateway restart

Impact Analysis

Disabling browser + exec + file tools saves approximately 24K tokens per cold start. The agent can still chat, use memory, and send messages to channels.

Don't Disable Tools You Need

If you disable a tool the agent tries to use, it will fail silently or hallucinate the result. Only disable tools you're certain your workflow doesn't need.

/compact — Compress Context Mid-Session

During long conversations, the context window fills up with previous messages and tool results. Use /compact in your chat to compress the context and free up space:

Type in your OpenClaw chat:

/compact

This summarizes the conversation history into a compressed form, reducing token usage for subsequent messages.

Cost Calculator

Use our Agent Cost Simulator to see exactly how much your current tool configuration costs per session and per day:

Simulate Your Costs

Input your model, tool count, and daily usage to get a cost estimate. Compare before and after optimization.

Open Cost Simulator

Community Benchmarks

Real-World Token Usage (Community Data)

Full toolkit (28 tools)

~131K input tokens

$0.39/session (GPT-4.1)

15 tools (no browser/exec)

~72K input tokens

$0.22/session (GPT-4.1)

7 skills (chatbot only)

~14K input tokens

$0.04/session (GPT-4.1)

7 skills (DeepSeek V3.2)

~14K input tokens

$0.004/session

Key Takeaway

Switching from 28 tools to 7 tools saves ~117K tokens per session. Combined with DeepSeek V3.2, you can reduce per-session cost from $0.39 to $0.004 — a 99% reduction.

Did this guide solve your problem?

Need Help?

Try our automated tools to solve common issues instantly.