Back to browse
GitHub Repository

πŸͺ› Rust powered precision file tools for AI agents thats minimize context use: patch-based edits, kernel-enforced path confinement. Dramatically fewer tokens than naive read/write. MCP Server or embeddable, bring your own MCP (Rust, Python, Nodejs). Come with Skills.md (npx skills add ckanthony/Chisel)

12 starsRust

MCP file tools silently eat your context window.I built one that doesnt

by ckanthonyΒ·Mar 1, 2026Β·6 pointsΒ·9 comments

AI Analysis

●●●BangerWizardryBig BrainSolve My Problem

Patch-based edits cut context use by 100x on large files versus naive MCP servers.

Strengths
  • β€’O(diff) edits and O(match) reads deliver measurable token savings that scale linearly with file size.
  • β€’Kernel-level path confinement via cap-std and fixed command whitelist prevents accidental escape or arbitrary execution.
  • β€’Embeddable core library works across Rust, Node.js, and Python via WASM without subprocess overhead.
Weaknesses
  • β€’MCP ecosystem still nascent; adoption depends on Claude Code and competing agent platforms maturing.
  • β€’No Windows support documented; cross-platform reach limits immediate audience.
Target Audience

AI agent builders, Claude Code users, developers optimizing context window usage

Similar To

Anthropic Files API Β· OpenAI Code Interpreter MCP Β· Cursor file tools

Post Description

Hi, I am Anthony.

Every token your filesystem tools consume is context the model cannot use for reasoning. Most MCP file servers are O(file size) on every operation: reads return the whole file, edits rewrite the whole file. The context window fills up before the agent gets anything meaningful done, and the problem compounds silently as your files grow.

Chisel makes edits O(diff) and reads O(match). The agent sends a unified diff instead of a full rewrite, and queries with grep or sed instead of reading entire files. On a 500-line file this is nearly two orders of magnitude less context per operation. The savings scale linearly with file size, so the larger your codebase, the more it matters.

The other thing I cared about was security. Path confinement is enforced at the kernel level via cap-std and openat with O_NOFOLLOW, not a userspace prefix check. Shell commands run via direct execve against a fixed compile-time whitelist β€” no sh -c wrapper, no arbitrary execution. Atomic writes use a tmp-and-rename so a failed patch never corrupts the target file.

It ships as a standalone MCP server, as chisel-core, a plain sync Rust library you can embed in your own MCP server, and as a WASM build for Node.js and Python runtimes, you can bring your own MCP and build on top of it.

Would love feedback, especially from anyone building agents that do heavy file manipulation.

GitHub: https://github.com/ckanthony/Chisel

Similar Projects