SuperAPIAI Directory

The-top-innovation

github.com · AI coding

skimread is a lossless context protection tool for AI coding agents, released as the open-source repository The-top-innovation. It sits between agents and two sources of high token consumption: large file reads and noisy command output. For files, it provides an outline containing functions, classes, headings, keys, and their line number ranges, letting agents read only the needed fragments; for commands, it compresses the output of tools such as pytest, npm, and cargo into a summary, preserving errors, failed tests, and stack frames, and provides a handle for looking up the full output. The tool has zero dependencies, runs entirely locally, makes no network calls and has no telemetry, is MIT-licensed, works out of the box with Claude Code, and can also be integrated with agents such as Codex, Cursor, Aider, and Copilot via the CLI and MCP server.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

skimread is a "lossless context protection" tool for AI coding agents, hosted on GitHub under the name The-top-innovation. Its core goal is to reduce the tokens agents consume when reading large files and executing commands, while ensuring no information is lost.

Purpose When using AI coding agents, token costs mainly come from two things the agent does not really need: reading large files in full (for example, reading an entire 2000-line file just to find one function), and reading noisy command output (for example, pytest printing 1500 PASSED lines just to report 2 failures). skimread sits between the agent and these two sources, first giving the agent a "quick overview."

Main capabilities

  1. File outlines: when an agent is about to read a file that exceeds a threshold (default 400 lines or 16 KB) without specifying a line range, skimread returns a file map listing functions, classes, headings, keys, and their line number ranges, and suggests reading only the needed fragments. If the agent requests the full file a second time in the same session, it is allowed through to avoid getting stuck.
  2. Command summaries: for known noisy commands (npm, pytest, cargo, go, tsc, docker, git diff, find, and about 100 others), it rewrites them to run through skimread, so the agent sees errors, failed tests, user-code stack frames, and summary lines, with large numbers of PASSED lines collapsed into one line.
  3. Lossless lookup: the full normalized output is first written to ~/.skimread/out/<id>.txt, and a handle is appended to the end of the summary, such as skimread show 42, skimread show 42 120-180, skimread show 42 --grep TypeError, so collapsed content can be retrieved at any time.
  4. Format-aware reduction: there are dedicated reducers for pytest, jest/vitest/mocha, cargo, go, npm/yarn/pnpm/bun, pip/uv/poetry, docker, tsc, git diff, and file-listing commands, discarding only lines with no decision value; unknown tools go through a generic path that removes progress noise, counts exact duplicate lines, and collapses near-duplicate lines.
  5. Scoring and budget: scoring is high for errors and stack frames and medium for summaries; when over budget, the head and tail plus windows around high-scoring lines are kept, and every trim is annotated with the omitted range and a lookup handle.6. Outline generation: Python uses the ast module to obtain exact signatures and ranges; JS/TS, Go, Rust, Java/Kotlin/C#/Swift, C/C++, PHP, and CSS use declaration regexes plus bracket matching; Ruby/Elixir/Lua use indentation; Markdown headings, JSON/YAML/TOML keys, CSV shapes, log files, Makefiles, shell functions, and SQL statements are also supported. Very large files have their members collapsed and truncation noted.
  6. Statistics: skimread stats shows tokens saved and a dollar estimate.

Usage Requires Python 3.9 or newer, with no other dependencies. Install from GitHub: pipx install git+https://github.com/avikchakraborty060-create/The-top-innovation。Claude After the user runs one command, it takes effect on restart; other agents can use it via CLI (put the snippet printed by skimread setup agents into AGENTS.md, .cursorrules, or the system prompt), or connect through the MCP server (skimread mcp provides the run, show, outline, read, and list tools; skimread setup mcp prints the configuration block). Pipes are also supported: cmd 2>&1 | skimread pipe --cmd "cmd". All state is stored in ~/.skimread, owner-only permissions, cleaned up after 7 days or 300 runs.

Use cases Suitable for scenarios involving large codebase development with Claude Code, Codex, Cursor, Aider, Copilot, or self-built agents, especially for teams or individuals who frequently read large files, run tests and build commands, and need to control token costs.

Limitations

  • Token counts are estimates (character count divided by 3.6), not tokenizer output, but the ratio is unaffected.
  • Outlines for bracket languages are regex-based, intended for navigation rather than correctness guarantees; unusual formatting may cause symbols to be missed.
  • Read protection adds one extra tool round-trip for files that just exceed the threshold; if the agent mostly needs the full file, raise the threshold.
  • Bash wrapping runs via the subprocess bash -c; functions and aliases defined in Claude Code's persistent shell are not visible (environment variables and working directory are visible).
  • Only Claude Code has a hook that can intercept the native Read; other agents need to add rule-file instructions via CLI/MCP to gain equivalent capability.
  • On security, the wrapper does not handle commands that change shell state (trailing cd, export, source), redirection, background execution, interactive, destructive, or privileged commands (rm, sudo, git push, git commit, curl | sh, etc.); these run as-is under normal permission rules.
  • The project provides no information on charges, pricing, or cloud services; related facts are not yet available.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools