slim for Openclaw

A pluggable pipe filter that strips verbose CLI output before it reaches the LLM to maximize your context budget.

workloftai
v1.0.0
Jul 1, 2026
0
336
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install slim

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install slim using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is slim?

slim is an essential utility for modern AI workflows, serving as a pluggable command-line pipe filter that optimizes context window consumption. By stripping out verbose, non-essential CLI outputs like massive Kubernetes YAML configurations, complex JSON payloads, dependency trees, and long lockfiles, this tool ensures your AI agent focuses its processing power on the critical logic signals rather than repetitive noise. As an ecosystem integration, it stands out among Openclaw Skills for its lightweight footprint and immediate utility.

Built entirely with the Python standard library, slim operates with a safe dual-mode processing paradigm: lossless structural cleanups are active by default, while intelligent, lossy content clamping handles exceptionally large files. By preventing terminal outputs from overwhelming the LLM, this package dramatically improves agent speed and decreases inference costs, showcasing why it is a must-have optimization tool in the registry of Openclaw Skills.

slim Use Cases

  • Managing massive Kubernetes outputs where a full pod configuration or cluster status dump exceeds token budget limits.
  • Intercepting verbose dependency installations, lockfile generation, or build logs such as pip install details before transmission to the model.
  • Filtering extensive Git diffs or log sequences to preserve critical changes while truncating excessive history lines.
  • Seamlessly integrating with AI developer environments using Openclaw Skills to maintain high-quality context for Claude Code or other autonomous agents.

How slim Works

  1. Data Interception: The tool intercepts standard input via piping or direct executable wrappers during tool execution.
  2. Always-On Cleaning (Lossless): It automatically strips away ANSI color codes, trims trailing whitespaces, collapses redundant blank lines, and squashes identical consecutive lines into a clean count marker.
  3. Intelligent Clamping (Lossy): If outputs exceed a safety threshold (defaulting to 250 lines), it selectively clamps the payload. Recognizable files like Kubernetes configs are parsed down to crucial head and tail segments with distinct elision markers.
  4. Context Preservation: The optimized stream is output to stdout, while a concise performance report can optionally be written to stderr, letting users of Openclaw Skills monitor content reduction metrics instantly.

slim Setup

To install and configure slim, ensure you have Python 3 and Bash ready. Integrate it into your environment as follows:

# Navigate to your environment directory
cd {baseDir}

# Ensure the bin directory contains slim and make it executable
chmod +x ./bin/slim

# Test the installation with a basic pipe command
cat verbose_output.log | ./bin/slim --report

This utility is pre-configured to operate out-of-the-box as part of your collection of Openclaw Skills.

slim Data Schema & Taxonomy

The slim tool processes standard input streams and outputs clean data. It handles outputs with specific structural strategies depending on the file or command category:

Tool / Format Unclamped Threshold Clamped Format (Head + Tail Lines) Lossless Operations Applied
Standard Text / Unrecognized > 250 lines 60 head + 30 tail lines ANSI removal, blank line collapsing
kubectl get -o yaml/json Always-on 25 head + 10 tail lines YAML/JSON structural preservation
pip install Always-on Drops progress, keeps summary Removes continuous progress bar noise

All custom filters and hooks can be expanded by extending the standard mapping in slim/plugins.py via simple python callbacks, aligning with the architectural goals of modular Openclaw Skills.

slim Advanced Features

  • Composable Unix Piping: Features a strictly partitioned output model where the filtered output streams directly to stdout, and the executive report streams to stderr, keeping UNIX pipelines entirely unbroken.
  • Extensible Python Plugin System: Allows users to register custom Callable[[str], str] structures within slim/plugins.py to clamp custom proprietary CLI formats.
  • Claude Code Integration: Specially optimized to run at the tool-execution layer, which bypasses Claude's post-tool limitations by applying inline mitigation before processing.
  • Interactive Report Flags: Running with the --report option yields detailed compression stats, proving highly valuable when diagnosing token costs across multiple Openclaw Skills workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*