Two Months In: The Rust Binary That's Been Quietly Extending My Claude Code Sessions

2026年8月14日2 次浏览来源:Dev.to阅读原文

A few weeks before I wrote about hooks, I was already running one myself.

Not one I'd written, though.

Every , every , every I ran through Claude Code was already being intercepted, filtered, and rewritten before it ever reached the model's context.

I'd installed it back in June, mostly out of curiosity, and never turned it off.

Two months later it's just part of how Claude Code behaves on my machine, the same way telling me how much output it trimmed this week is just part of my routine now.

The tool is called RTK, and it solves a problem I didn't fully appreciate until I stopped noticing it: most of what a coding agent reads back from your terminal is noise it has to pay for, in context space, on every single command.

Not because the command failed, or because there's a bug to chase, but because that's just what terminals output for humans, and nobody had gone through and rebuilt each one specifically for a model to read instead.

What RTK actually does RTK is a single Rust binary that sits between your shell and your agent.

When Claude Code runs a Bash command, RTK intercepts the output, strips out what the model doesn't need, and hands back a compact version instead of the raw text.

No daemon, no background service, no dependencies to manage.

It's one static binary that adds under 10ms of overhead per call, which is low enough that I genuinely can't feel it in normal use.

It's not a wrapper you have to remember to call, either.

Once it's installed, it plugs into Claude Code the exact same way the hooks I wrote about do: as a native hook that rewrites the command before execution. quietly becomes .

You don't type anything differently.

The agent doesn't behave any differently.

The only thing that changes is what comes back.

The filter list is bigger than I expected when I first installed it.

Beyond the git and file basics, there's a full set for containers and infra: and come back deduplicated instead of scrolling, pods and services get the same treatment, and there's coverage for Pulumi, Terraform-adjacent output, and the AWS CLI (instance lists, Lambda functions, S3 listings, CloudFormation events, all stripped down to what's decision-relevant, with anything that looks like a secret excluded on the AWS side specifically).

Package managers get filters too, pnpm, pip, bundler, so a dependency install doesn't dump its entire resolution log into context just to end in "done." For anyone doing test automation, though, the part that matters most is the test runner support: Jest, Vitest, Playwright, pytest, Go tests, cargo test, RSpec, ScalaTest, rake.

All of them get reduced to failures only, with passing tests collapsed to a count.

That's the part I use daily, since most of what I run through Claude Code these days is exactly that loop: run the suite, see what broke, fix it, run it again.

Installing it Then wire it into Claude Code: Restart Claude Code, and from that point every Bash tool call goes through RTK automatically.

There's no per-command opt-in and nothing to remember.

That's the same property I liked about hooks in general: enforcement that doesn't depend on the model cooperating or you remembering to ask for it.

How it works under the hood RTK isn't doing anything as blunt as truncating output to a line count.

Each command family gets its own parser, and every filter applies some combination of four strategies: Smart filtering to drop pure noise: comments, boilerplate, blank padding, the kind of lines that exist for formatting and carry no information Grouping to aggregate similar items, files by directory, errors by rule or type, instead of listing every match individually Truncation that keeps the parts relevant to the current task and cuts the redundant rest, rather than cutting arbitrarily by length Deduplication that collapses repeated log lines into one line with a count, which matters a lot more than I expected once I started watching output shrink from hundreds of near-identical lines to a handful None of thi

分享
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

About

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools