Shrink AI-agent command output to save tokens (git + npm, Windows)
Project description
slim-shady
Install as
slim-shady; the command you run isslim.
Shrink AI-agent command output so it burns fewer tokens.
When an AI coding assistant runs git status or npm install, the raw output can
be hundreds of lines — and every line costs tokens, money, and context-window
space. slim runs the command, compresses the output (keeping what matters,
dropping the noise), and returns the compact version. Same information, ~70–90%
fewer tokens.
Windows · works with
gitandnpm· integrates with Claude Code
$ slim git status
branch: main
summary: 0 staged, 1 modified, 3 untracked
modified (1):
M src/app.py
untracked (3):
README.md LICENSE tests/
[slim: hid ~58 tokens - run 'slim expand' for full output]
Install
With pip
pip install slim-shady
Gives you the slim command (plus tiktoken for real token counts).
Or download the .exe (no Python needed)
- Grab
slim.exefrom the latest release. - Put it in a folder on your
PATH. - Run
slim git status. (You only needgit/npminstalled — the tools it wraps.)
Quick start
slim init -g # turn on automatic mode for all projects (see below)
slim git status # try it manually
slim gain # see how many tokens you've saved
slim doctor # check everything is wired up
Make it automatic (recommended)
Typing slim every time is annoying. slim init installs a Claude Code hook so
your agent's git/npm commands are compressed automatically — when it runs
git status, it's transparently rewritten to slim git status.
slim init # this project only
slim init -g # all projects (global ~/.claude settings)
Restart Claude Code afterwards. See hooks/README.md for details and manual setup.
Commands
slim git <args> run git, return compressed output
slim npm <args> run npm, return compressed output
slim expand print the full output of the last slim command
slim gain savings dashboard (tokens saved, by tool, biggest)
slim reset clear saved stats
slim doctor health check: PATH, hook, tokenizer, tools
slim init [-g] install the Claude Code auto-rewrite hook (-g = global)
slim --version print version
slim --raw git ... debug: show before/after + % saved
How it works
slimdispatches to a per-tool filter that understands that command's output.- Each filter applies four strategies:
- filter — drop noise (ANSI colors, progress bars,
npm http/timing lines) - group — e.g. untracked files grouped by directory
- truncate — keep the head/tail of long blocks, hide the redundant middle
- dedupe — collapse repeated lines into
line (xN)
- filter — drop noise (ANSI colors, progress bars,
- For
git, known subcommands re-run a compact native variant (--porcelain,--oneline,--stat). Fornpm, the command runs once (installs/tests have side effects) and the captured output is compressed. - Errors, failures, warnings and summaries are always kept. Anything hidden is
recoverable with
slim expand.
How tokens are counted
slim measures savings by tokenizing text locally — no API calls during normal use:
saved = count(raw output) - count(compressed output)
- Both the
.exeand the pip install count withtiktoken, a real tokenizer. The.exebundles tiktoken's vocab so it works fully offline. - tiktoken uses GPT's vocabulary — a close proxy for Claude, usually within a few
percent, not exact. That's why counts are labelled
~. - A
~4 chars/tokenestimate remains only as a crash-safety fallback;slim doctorshows which counter is active.
Build the .exe yourself
build.bat # produces dist\slim.exe (bundles tiktoken, fully offline)
Scope & limitations
- Windows,
git+npmonly (more commands planned). - tiktoken approximates Claude's tokenizer, so counts aren't Claude-exact (
~). - Some Unicode glyphs (e.g. ✓) can be mangled by the Windows console; failures and summaries are always preserved.
License
MIT — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slim_shady-0.1.3.tar.gz.
File metadata
- Download URL: slim_shady-0.1.3.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3798cfb31341058d7414a49be5e5a87855c9c6d128c3fb11294f5570c765c75b
|
|
| MD5 |
c14f28a98f7f2a91118a2d35ca3bf4cb
|
|
| BLAKE2b-256 |
17db2d0aed7d00b72fe96d77dff741eb4c48450485577ebb44401efe135aede3
|
Provenance
The following attestation bundles were made for slim_shady-0.1.3.tar.gz:
Publisher:
publish.yml on SRUJAN-cpu/slim-shady
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slim_shady-0.1.3.tar.gz -
Subject digest:
3798cfb31341058d7414a49be5e5a87855c9c6d128c3fb11294f5570c765c75b - Sigstore transparency entry: 2031213106
- Sigstore integration time:
-
Permalink:
SRUJAN-cpu/slim-shady@31551166b4647030833eb6422ef097ce90f9eb0d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/SRUJAN-cpu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@31551166b4647030833eb6422ef097ce90f9eb0d -
Trigger Event:
push
-
Statement type:
File details
Details for the file slim_shady-0.1.3-py3-none-any.whl.
File metadata
- Download URL: slim_shady-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
184bf0076beb27be1d8cd4eef240c2104ef900c8b8073fca8074efc5eb02ac76
|
|
| MD5 |
1634e42f598fc1a29c8e642e0985ea65
|
|
| BLAKE2b-256 |
f462c6bc50cf991ea281ec303fb99204e5043de9db2f4254c010268c23e59ed0
|
Provenance
The following attestation bundles were made for slim_shady-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on SRUJAN-cpu/slim-shady
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slim_shady-0.1.3-py3-none-any.whl -
Subject digest:
184bf0076beb27be1d8cd4eef240c2104ef900c8b8073fca8074efc5eb02ac76 - Sigstore transparency entry: 2031213278
- Sigstore integration time:
-
Permalink:
SRUJAN-cpu/slim-shady@31551166b4647030833eb6422ef097ce90f9eb0d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/SRUJAN-cpu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@31551166b4647030833eb6422ef097ce90f9eb0d -
Trigger Event:
push
-
Statement type: