Skim: The Most Intelligent Context Optimization Engine for Coding Agents
Code skimming. Command rewriting. Test, build, and git output compression. Token budget cascading. 17 languages. 14ms for 3,000 lines. Built in Rust.
Other tools filter terminal noise. Skim understands your code. It parses ASTs across 17 languages, strips implementation while preserving architecture, then optimizes every other type of context your agent consumes: test output, build errors, git diffs, and raw commands. 14ms for 3,000 lines. 48x faster on cache hits.

Why Skim?
Context capacity is not the bottleneck. Attention is. Every token you send to an LLM dilutes its focus. Research consistently shows attention dilution in long contexts -- models lose track of critical details even within their window. More tokens means higher latency, degraded recall, and weaker reasoning. Past a threshold, adding context makes outputs worse. While other tools stop at filtering command output, Skim parses your actual code structure and optimizes the full spectrum of agent context: code, test output, build errors, git diffs, and commands. Deeper, broader, and smarter than anything else available.
Take a typical 80-file TypeScript project: 63,000 tokens. That contains maybe 5,000 tokens of actual signal. The rest is implementation noise the model doesn't need for architectural reasoning.
80% of the time, the model doesn't need implementation details. It doesn't care how you loop through users or validate emails. It needs to understand what your code does and how pieces connect.
That's where Skim comes in.
| Mode | Tokens | Reduction | Use Case |
|---|
| Full | 63,198 | 0% | Original source code |
| Structure | 25,119 | 60.3% | Understanding architecture |
| Signatures | 7,328 | 88.4% | API documentation |
| Types | 5,181 | 91.8% | Type system analysis |
For example:
// Before: Full implementation (100 tokens)
export function processUser(user: User): Result {
const validated = validateUser(user);
if (!validated) throw new Error("Invalid");
const normalized = normalizeData(user);
return await saveToDatabase(normalized);
}
// After: Structure only (12 tokens)
export function processUser(user: User): Result { /* ... */ }
One command. 60-90% smaller. Your 63,000-token codebase? Now 5,000 tokens. Fits comfortably in a single prompt with room for your question.
That same 80-file project that wouldn't fit? Now you can ask: "Explain the entire authentication flow" or "How do these services interact?" — and the AI actually has enough context to answer.
Features
Code Skimming (the original, still unmatched)
- 17 languages including TypeScript, JavaScript, Python, Rust, Go, Java, C, C++, C#, Ruby, SQL, Kotlin, Swift, Markdown, JSON, YAML, TOML
- 6 transformation modes from full to minimal to pseudo to structure to signatures to types (15-95% reduction)
- 14.6ms for 3,000-line files. 48x faster on cache hits
- Token budget cascading that automatically selects the most aggressive mode fitting your budget
- Parallel processing with multi-file globs via rayon
Command Rewriting (skim init)
- PreToolUse hook rewrites
cat, head, tail, cargo test, npm test, git diff into skim equivalents
- Two-layer rule system with declarative prefix-swap and custom argument handlers
- One command installs the hook for automatic, invisible context savings
Test Output Compression (skim test)
- Parses and compresses output from cargo, go, vitest, jest, pytest
- Extracts failures, assertions, pass/fail counts while stripping noise
- Three-tier degradation from structured parse to regex fallback to passthrough
Build Output Compression (skim build)
- Parses cargo, clippy, tsc build output
- Extracts errors, warnings, and summaries
Lint Output Compression (skim lint)
- Parses ESLint, Ruff, mypy, golangci-lint output
- Extracts errors and warnings with severity grouping
- Three-tier degradation from structured parse to regex fallback to passthrough
Package Manager Compression (skim pkg)
- Parses npm, pnpm, pip, cargo audit/install/outdated output
- Extracts vulnerabilities, version conflicts, and dependency issues