← Back to Skills Marketplace
sundevilatb

Context Slimmer

by SunDevilATB · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1429
Downloads
0
Stars
6
Active Installs
1
Versions
Install in OpenClaw
/install context-slimmer
Description
Audit and slim down always-loaded context files (AGENTS.md, TOOLS.md, USER.md, MEMORY.md, HEARTBEAT.md, SOUL.md, IDENTITY.md). Use when asked to reduce token usage, audit context files, optimize context window, or slim down workspace files. Measures current token cost and identifies what to move, remove, or compress.
README (SKILL.md)

Context Slimmer

Audit workspace files that load into every message and reduce their token footprint.

Quick Start

# Measure current context cost
bash scripts/measure.sh

# Full audit (outputs recommendations)
bash scripts/measure.sh --audit

Audit Process

For each always-loaded file, evaluate:

  1. Move to skill — Content only needed for specific tasks (betting config, group chat rules, detailed protocols). Move to a skill or reference file that loads on demand.
  2. Remove — Outdated info, dead features, completed one-time setup, duplicated content across files.
  3. Compress — Verbose explanations that could be 1 sentence. If the agent already knows it, cut it.

Rules of Thumb

  • If a cron job handles it, remove it from HEARTBEAT.md
  • If it's in SOUL.md, don't repeat it in MEMORY.md or AGENTS.md
  • If it's in USER.md, don't repeat it in MEMORY.md
  • If the agent does it daily, it doesn't need instructions — just a trigger word
  • Prefer 1 sentence over 5 bullets saying the same thing
  • Target: each file should justify every line's token cost

Expected File Sizes (lean targets)

File Target
AGENTS.md \x3C 500 tokens
TOOLS.md \x3C 500 tokens
USER.md \x3C 700 tokens
MEMORY.md \x3C 400 tokens
HEARTBEAT.md \x3C 400 tokens
SOUL.md \x3C 250 tokens
IDENTITY.md \x3C 50 tokens
Total \x3C 2,800 tokens

Output Format

Report: current size, projected size, savings per file. Include specific recommendations grouped by move/remove/compress.

Usage Guidance
This skill is low-risk code-wise (no network calls, no credentials), but it is incomplete and slightly inconsistent with its own documentation. Before installing or running it: (1) review the script to confirm it only examines files you want checked; it reads the workspace path you supply (or the current directory) and will print counts/flags for those files; (2) don't run it pointed at sensitive directories unless you intend to scan them; (3) note the script does not produce the detailed move/remove/compress recommendations or projected savings promised by SKILL.md — you'll need to produce those recommendations yourself (or pair the output with manual review or an LLM prompt); (4) be aware the CLI usage in the README is slightly mismatched with the script's argument parsing (the script treats the second positional argument as workspace), so test it in a safe directory first. If you expect fully automated slimming recommendations, request an updated script that computes per-file projected sizes and explicit move/remove/compress suggestions and that documents correct argument usage.
Capability Analysis
Type: OpenClaw Skill Name: context-slimmer Version: 1.0.0 The `scripts/measure.sh` file contains a shell injection vulnerability. The `WORKSPACE` variable, which can be supplied as the second argument to the script, is used directly in shell commands (e.g., `wc -c < "$filepath"`, `grep`). This allows for arbitrary command execution if an attacker can control the `WORKSPACE` argument, making it a critical Remote Code Execution (RCE) vulnerability. While the skill's stated purpose and other functionalities are benign, this lack of input sanitization makes the skill suspicious.
Capability Assessment
Purpose & Capability
The skill claims to audit always-loaded context files and reduce token footprint; the provided scripts/measure.sh measures file sizes, approximates tokens, flags over-target files, and runs a light duplicate/verbosity checklist — which aligns with the stated purpose. However SKILL.md promises a full 'report' with projected sizes, savings per file, and concrete move/remove/compress recommendations. The script does not compute projected sizes, per-file savings, or generate concrete move/remove/compress suggestions, so the delivered capability is weaker than claimed.
Instruction Scope
SKILL.md instructs running scripts/measure.sh (with --audit and --workspace flags). The script reads the listed files from the workspace and prints checks — no network I/O — which is expected. Concerns: (1) the script's argument handling is inconsistent with the Quick Start: it inspects $1 for --audit and treats $2 as WORKSPACE, so the documented '--workspace /path' usage may not behave as expected; (2) the SKILL.md promises automated slimming recommendations but the script only emits counts/flags and limited duplicate-detection info, not move/remove/compress recommendations; (3) the script will read files from whatever directory is passed (or the current working directory), so running it against an unintended path could examine different files. None of these are inherently malicious, but they are functional mismatches and a small user-safety concern.
Install Mechanism
No install spec and the skill is instruction-only with a small local bash script. No downloads or external installers are used, which minimizes install risk.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The script only reads files in the provided workspace path — this matches the stated purpose and is proportionate.
Persistence & Privilege
The skill is not always-loaded and uses default agent-invocable behavior. It does not request permanent presence or modify other skills or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install context-slimmer
  3. After installation, invoke the skill by name or use /context-slimmer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: audit and slim down always-loaded context files. Includes measure.sh script for token counting and duplicate detection.
Metadata
Slug context-slimmer
Version 1.0.0
License
All-time Installs 7
Active Installs 6
Total Versions 1
Frequently Asked Questions

What is Context Slimmer?

Audit and slim down always-loaded context files (AGENTS.md, TOOLS.md, USER.md, MEMORY.md, HEARTBEAT.md, SOUL.md, IDENTITY.md). Use when asked to reduce token usage, audit context files, optimize context window, or slim down workspace files. Measures current token cost and identifies what to move, remove, or compress. It is an AI Agent Skill for Claude Code / OpenClaw, with 1429 downloads so far.

How do I install Context Slimmer?

Run "/install context-slimmer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Context Slimmer free?

Yes, Context Slimmer is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Context Slimmer support?

Context Slimmer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Context Slimmer?

It is built and maintained by SunDevilATB (@sundevilatb); the current version is v1.0.0.

💬 Comments