Install
openclaw skills install @jackkeller/leanctx-integrationAutomatically compresses OpenClaw tool outputs to reduce token usage by 60-99%
openclaw skills install @jackkeller/leanctx-integrationLeanContext integration for OpenClaw that automatically compresses tool outputs to reduce token usage by 60-99%.
| Endpoint | Data Sent | Purpose |
|---|---|---|
| None | N/A | This skill operates entirely locally |
No external API calls are made. All processing happens on your local machine.
This skill operates autonomously during OpenClaw's normal operation. It intercepts read and exec tool calls transparently without requiring explicit user approval for each invocation. This is standard behavior for OpenClaw skills.
To disable automatic invocation, set enabled: false in your OpenClaw config.
By using this skill, your file contents and command outputs are processed locally for compression purposes. No data is sent to external services. Only install if you are comfortable with this local processing.
Intercepts OpenClaw's read and exec tool calls and applies intelligent compression:
openclaw skills install leanctx-integration
Or manually:
cd ~/.openclaw/workspace/skills
git clone https://github.com/your-repo/leanctx-integration.git
cd leanctx-integration
npm install
npm run build
Add to your openclaw.json:
{
"skills": {
"leanctx-integration": {
"enabled": true,
"config": {
"threshold": 100,
"cacheEnabled": true,
"excludedPaths": ["node_modules", ".git", "dist"],
"excludedCommands": ["cat", "echo"]
}
}
}
}
Once installed, LeanContext works automatically - no code changes required!
Note: Metrics tracking has been temporarily disabled. The skill automatically compresses tool outputs, but session-level metrics reporting is not currently available. This feature may be revisited in a future update.
Via your agent: Ask: "Clear the LeanCTX cache"
Direct CLI:
npx leanctx clear-cache
Before: ~2000 tokens
After: ~50 tokens
Savings: 97.5%
Before: ~500 tokens (full commit info)
After: ~30 tokens (hashes + messages)
Savings: 94%
Before: ~200 tokens (all download messages)
After: ~10 tokens (summary only)
Savings: 95%
git log → Commit hashes + first linegit status → Changed files onlygit diff → Diff markers + changesnpm install → Package countnpm test → Test results + summarycargo build → Errors onlydocker ps → Header + first 10 rowskubectl → Header + first 15 rowsAdd to excludedPaths in config:
{
"excludedPaths": ["node_modules", ".git", "**/*.spec.ts"]
}
Ask your agent: "Clear the LeanCTX cache"
Or via CLI:
npx leanctx clear-cache
MIT