Open Source Alternatives
  • Alternatives
  • Categories
    Categories by size882 projects
    • Developer Tools461
    • AI & Machine Learning404
    • Web Development196
    • Business & Productivity191
    • Communication & Collaboration126
    • Security & Monitoring126
    • IT Management123
    • Product & Project Management106
    • Cloud & Hosting105
    • Data & Analytics104
    Browse all 21 categoriesLLMOps & AI Tooling, Design & Creative and 9 more
  • Blog
  • Advertise
SearchNotion, Slack, password manager.../
Submit
Open Source Alternatives
  • Alternatives
    • Developer Tools461
    • AI & Machine Learning404
    • Web Development196
    • Business & Productivity191
    • Communication & Collaboration126
    • Security & Monitoring126
    • Browse all 21 categories
  • Blog
  • Advertise
Submit your project

New open source projects by email

The projects we add and every new guide. Free, unsubscribe any time.

Open Source Alternatives LogoOpen Source Alternatives

Handpicked Open Source Alternatives to Paid Softwares

Product

  • Categories
  • Tag
  • Advertise

Resources

  • Blog
  • Collection
  • Submit

Company

  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Sitemap

Alternatives

  • Claude Code
  • Jira
  • Notion
  • Slack
  • Linear
  • Wispr Flow
  • All alternatives
© 2026 Open Source Alternatives. All rights reserved.
Open SourceAlternatives
Home/Categories/Developer Tools/rtk
icon of rtk

rtk

Open source alternative to Tokenade, TokenShift, Portkey, Bifrost (Maxim AI) and TokenCrush

  • 84.1K stars
  • Apache-2.0
  • Active this week
  • Last commit 1 day ago

Last verified Oct 20, 2026

Optimize AI coding token costs by compressing shell output before it reaches the context window, cutting an average of 89% of bash noise across 100+ commands.

Visit websiteGitHub84.1K stars
image of rtk
TL;DR

rtk is a Rust CLI proxy that compresses shell command output before your AI coding agent reads it, removing an average of 89.2% of bash noise across 2,927 measured developer commands. It replaces manual output-trimming workarounds for CLI-heavy agentic sessions, and is an open source alternative to paid LLM cost management tools like Portkey and TokenShift for this specific use case. Apache 2.0 licensed, single binary, zero runtime dependencies. Best for developers using API-billed AI coding tools who pay per token, and for flat-rate users who hit context overflow on long sessions.

Read the full breakdownHide the full breakdownWho it is for, how it works, trade-offs, the quick start and the FAQ
who it's for

Who rtk is for#

Developers on API-billed AI coding tools

Teams using Aider, Gemini CLI, or the OpenAI Codex API pay per input token. For these users, every filtered command call directly reduces cost. The website cites a ten-person team wasting roughly $1,750 per month on CLI noise before filtering. rtk's 89% average bash output reduction on common commands translates to measurable billing impact, diluted by prompt and output tokens but real in absolute terms.

Skip if:

You are on a flat-rate subscription and have never hit context overflow or rate limits during a session. Token compression still extends sessions, but the direct billing impact is absent.

Claude Code and Cursor users with long agentic sessions

On flat-rate plans, rtk extends how many tool calls fit in a session before context overflow forces a restart. For complex multi-file refactors or long debugging sessions with many git and test commands, the extra headroom can mean completing a task in one session instead of two. The auto-rewrite hook makes adoption invisible: install once, restart the agent, and every subsequent Bash call is filtered automatically.

Skip if:

Your sessions are short and focused on reading and editing files through native agent tools. rtk's value compounds with Bash tool call volume; low-Bash workflows see limited benefit.

Teams deploying AI coding infrastructure

Organizations running their own LLM infrastructure can deploy rtk alongside existing tooling without any vendor dependency. Since rtk operates as a local binary that compresses shell output before it reaches any network boundary, it integrates cleanly with on-premise AI coding setups and requires no changes to LLM routing or API configuration.

Skip if:

Your managed AI coding platform already compresses or summarizes tool call output at the platform level, in which case rtk adds redundant filtering.

the problem

The problem it solves#

Every command an AI coding agent runs dumps raw output into the context window. A cargo test suite with 262 passing tests outputs over 4,800 tokens of boilerplate. A git diff on a medium-sized change can reach 21,500 tokens. For pay-per-token users on tools like Aider, Gemini CLI, or the raw Anthropic API, that verbose output makes up the majority of the bill. For flat-rate users on Claude Code or Cursor, the same noise fills the context window faster, triggering rate limits and forcing session restarts before complex tasks finish. The website cites a team of ten wasting roughly $1,750 per month on CLI noise alone.

The problem is structural: developer CLI tools output for human readers who scan rather than read every line. Test runners print every passing test. Git diff shows full surrounding context. Directory listings expand to one line per file. None of these tools have an agent-friendly output mode, and teams either accept the waste or maintain fragile per-tool wrappers that break across version updates.

how rtk solves it

How it solves it#

100+ command-specific output filters

rtk ships pre-built filters for the commands AI coding agents call most: git status, git diff, git log, cargo test, pytest, go test, jest, vitest, docker ps, kubectl pods, AWS CLI subcommands, eslint, tsc, ruff, and more. Each filter applies the right strategy for that command's structure. Cargo test collapses all passing tests to a count and shows only failures; git log trims to hash, author, and subject; git push returns a single confirmation line instead of 15 lines of progress output.

Auto-rewrite hook for 16 AI coding tools

Run `rtk init -g` once to install a PreToolUse hook in your AI tool's configuration. From that point, every Bash call is transparently rewritten to the rtk equivalent before the agent sees any output. Supports Claude Code, GitHub Copilot, Cursor, Gemini CLI, Codex, Windsurf, Cline, OpenCode, Pi, Hermes, Mistral Vibe, Kilo Code, Google Antigravity, Kimi AI, and Factory Droid across macOS, Linux, and native Windows.

Token savings analytics via rtk gain

The `rtk gain` command shows a summary of tokens saved, broken down by command type, with daily, weekly, and monthly views and an ASCII graph of the last 30 days. Savings are stored locally in SQLite with no external telemetry. One developer reported 138 million tokens saved across 15,720 commands after several weeks of daily use. The `rtk discover` command scans recent session logs to identify commands not yet routed through rtk.

Single Rust binary, under 10ms overhead

rtk is a single statically-linked Rust binary with zero runtime dependencies. It adds under 10 milliseconds of overhead per command, making it transparent during interactive and agentic use. Install options: Homebrew (`brew install rtk`), the curl one-liner for Linux and macOS, pre-built binaries for macOS, Linux, and Windows from GitHub releases, or `cargo install --git https://github.com/rtk-ai/rtk`.

Smart file reading and code summarization

The `rtk read` command applies heuristic file summarization: standard mode returns signatures and structure rather than full file bodies; aggressive mode (`-l aggressive`) returns function and type signatures only. The `rtk smart` command produces a two-line heuristic code summary. These reduce the token cost of file inspection operations that AI coding agents frequently perform during code exploration.

strengths · trade-offs

Strengths and trade-offs#

Strengths

  • Zero-infrastructure deploymentrtk runs locally as a single binary with no server, no API key, and no routing layer between your agent and the LLM. Token savings happen on the input side before any network call. This is categorically different from cloud-based token management tools that require proxying LLM traffic through an external service. A developer on a corporate network with outbound restrictions can use rtk without any external dependency.
  • Apache 2.0 license with no commercial restrictionsThe Apache 2.0 license permits commercial use, modification, and redistribution without restriction. Teams can include rtk in internal tooling, CI environments, or shipped developer products without a license review. Unlike paid token management platforms where usage costs scale with volume, rtk's cost is fixed at zero for the binary itself.
  • Savings measured on real developer commandsThe 89.2% average noise reduction comes from 2,927 actual developer commands, not a synthetic benchmark. The README explicitly notes that bash output savings do not map 1:1 to billing reduction: bash output is one input token source, and input tokens are only part of the bill. This honest disclosure distinguishes rtk from tools that present savings figures without qualification.
  • Native Windows support since v0.37.2The auto-rewrite hook runs as a native binary command on Windows from v0.37.2, requiring no Unix shell, bash, or jq. Command Prompt, PowerShell, and Windows Terminal all work identically to macOS and Linux. Pre-built binaries for x86_64 Windows are available in GitHub releases. WSL is also fully supported with the standard Linux install path.

Trade-offs

  • -Token counts are approximations, not exact figuresrtk estimates token counts as bytes divided by 4 rather than using a model-specific tokenizer. The README explicitly flags this: percentage reductions are reliable relative indicators, but the absolute token numbers shown in `rtk gain` are approximate and should not be used for billing reconciliation. If you need exact token counts for cost attribution, compare against your LLM provider's usage dashboard.
  • -Hook applies to Bash calls only, not native agent toolsThe auto-rewrite hook intercepts Bash tool calls made by the AI agent. Claude Code built-in tools (Read, Grep, Glob) bypass the hook entirely. To get rtk filtering on those workflows, you must use shell equivalents (cat, rg, find) or call rtk commands directly. Agents that rely heavily on native tool calls rather than shell commands see less benefit.
  • -High open issue count reflects broad adoption and coverage gapsThe repo carried 1,970 open issues at time of writing, against 76,500+ stars. The volume reflects both project scale and gaps in filter coverage for niche commands. Core git, cargo, pytest, and docker filters are well-tested; if your toolchain includes less common tools (Scala sbt, some OpenShift oc subcommands), verify filter behavior before relying on it in production sessions.
versus alternatives

rtk vs alternatives#

rtk vs Portkey

Portkey is a commercial LLM gateway that routes API calls across providers, adds semantic caching, and provides observability over LLM traffic. rtk operates at a different layer: it compresses bash command output before the AI agent reads it, so the input token load is reduced before the API call is even constructed.

FeaturertkPortkey
LicenseApache-2.0Proprietary
DeploymentLocal CLI binaryManaged cloud or self-hosted gateway
ApproachCLI output compressionAPI routing, caching, observability
CostFreePaid commercial tiers

rtk is the better fit when verbose CLI output (test runners, git, build tools) is the primary source of token waste in your agentic coding workflow. Portkey suits teams building LLM applications that need cross-provider routing, caching of repeated prompts, or compliance-grade audit logs across all LLM calls, which rtk does not provide.

rtk vs TokenShift and Bifrost (Maxim AI)

TokenShift and Bifrost (Maxim AI) are commercial LLMOps platforms that address token costs and model governance at the API and prompt layer. rtk targets an earlier waste source: the raw bash output that fills an AI coding agent's context window before the LLM message is even built.

FeaturertkTokenShift / Bifrost
LicenseApache-2.0Proprietary
DeploymentLocal binaryManaged cloud service
ApproachShell output compressionPrompt and API-level optimization
CostFreePaid

For developers whose primary token waste is in CLI tool output during agentic coding sessions, rtk provides open source coverage that LLMOps platforms do not specifically target. TokenShift and Bifrost remain relevant for broader LLM application observability, model routing, and governance across diverse application types beyond coding agents.

install · quick start

Quick start#

bash
Install rtk as a single binary via Homebrew, then run setup to activate the auto-rewrite hook for your AI coding tool.
```bash
brew install rtk
rtk init -g
```
tech stack · detected from GitHub

What it's built on#

Languages
RustTypeScript
frequently asked

FAQ#

Is rtk free to use?

Yes. rtk is Apache 2.0 licensed and free to use, modify, and redistribute. The core CLI tool has no feature restrictions on the open source tier. RTK Pro is a separate commercial tier for teams that need token governance, security controls, and organizational analytics, but the open source binary covers the full filtering and savings analytics feature set.

Does rtk work with Claude Code?

Yes. Run rtk init -g to install a PreToolUse hook in Claude Code's settings.json. After restarting Claude Code, every Bash call is automatically rewritten to the rtk equivalent before execution. Claude Code's built-in tools (Read, Grep, Glob) are not intercepted by the hook; to get rtk filtering on those workflows, use shell commands (cat, rg, find) or explicit rtk subcommands instead.

How much does rtk actually reduce my LLM bill?

rtk removes an average of 89.2% of bash output by bytes, but that does not translate to an 89% billing reduction. Bash output is one contributor to input tokens, alongside your prompt, system prompt, and conversation history. Input tokens are also only part of the bill, which also counts output tokens. The README makes this explicit. The actual billing reduction is real but diluted at each step; it is most significant for API-billed tools where CLI-heavy sessions generate high input token counts.

Does rtk send any data to external servers?

No. rtk runs entirely as a local binary. It intercepts and compresses command output locally and writes savings data to a local SQLite database. No telemetry or usage data is sent externally. RTK Pro, the commercial team tier, may have different data handling for its governance features; check its documentation if that tier is relevant to your team.

What AI coding tools does rtk support?

rtk supports 16 AI coding tools as of the current README: Claude Code, GitHub Copilot (VS Code and CLI), Cursor, Gemini CLI, Codex, Windsurf, Cline and Roo Code, OpenCode, OpenClaw, Pi, Hermes, Mistral Vibe, Kilo Code, Google Antigravity, Kimi AI, and Factory Droid. Each has its own init flag documented in the README and on the project website's supported agents guide.

also worth a look

Similar open-source tools#

Caveman

Alternative toTokenade

Token-slashing caveman-speak for cheaper, faster AI code.

  • 113,757 GitHub stars
  • Apache-2.0Licence Apache-2.0

Bifrost

Alternative toPortkey

Open-source AI gateway with 23+ providers, failover, and MCP support.

  • 8,975 GitHub stars
  • Apache-2.0Licence Apache-2.0

Litellm

Alternative toPortkey

Self-hosted AI gateway for 100+ LLMs in OpenAI format

  • 61,759 GitHub stars
  • CustomLicence MIT with enterprise directory carve-out

magic-compact

Alternative toTokenade

Lossless context compression for Claude Code and OpenCode

  • 173 GitHub stars
  • BSD-3-ClauseLicence BSD-3-Clause

token-optimizer-mcp

Alternative toTokenade

Token savings and persistent knowledge graphs for AI coding agents

  • 554 GitHub stars
  • MITLicence MIT

OmniRoute

Alternative toOpenRouter

352-provider AI gateway with automatic fallback and token compression

  • 78,353 GitHub stars
  • MITLicence MIT
by category

Open source tools in these categories#

462

Developer Tools

REA (Reverse Engineer Anything), superpowers, Skills for Real Engineers
404

AI & Machine Learning

freeCodeCamp, OpenClaw, REA (Reverse Engineer Anything)
106

Cloud & Hosting

dify, RuView, rtk

Featured

rakazo

Alternative toGrok Bot

AI teammates you own: your keys, your model, your machine.

  • 4,904 GitHub stars
  • Apache-2.0Licence Apache-2.0
  • #AI Agents

Inbox Zero

Alternative toSuperhuman

AI email assistant that drafts replies and clears your inbox

  • 12,712 GitHub stars
  • AGPL-3.0Licence AGPL-3.0
  • #Email

Omnara

Alternative toCClaude Managed Agents

Open-source agent deployment API. Self-host or use Omnara Cloud.

  • 2,957 GitHub stars
  • Apache-2.0Licence Apache-2.0
  • #AI Agents
Feature your project

New open source projects by email

The projects we add and every new guide. Free, unsubscribe any time.

Find open source alternatives to paid software

/
  • Claude Code to OpenCode
  • Jira to Windshift
  • Notion to AppFlowy
  • Slack to Mattermost
  • Linear to GitLab
  • Wispr Flow to Handy
  • CapCut to Concat
  • Grok Bot to rakazo
  • Superhuman to Inbox Zero
  • Airtable to AITable
  • Muse to OpenClaw
  • GitHub Copilot to Cline
  • Datadog to Netdata
  • Microsoft Teams to Rocket.Chat
  • Pinecone to Qdrant
  • Zapier to n8n
  • Devin AI to OpenHands
  • Firebase to Supabase
  • 1Password to KeePassXC
  • Confluence to Docmost
  • Contentful to Strapi
  • Adobe Premiere Pro to Shotcut
  • ChatGPT to AnythingLLM
  • LangSmith to Langfuse
  • Claude Code to OpenCode
  • Jira to Windshift
  • Notion to AppFlowy
  • Slack to Mattermost
  • Linear to GitLab
  • Wispr Flow to Handy
  • CapCut to Concat
  • Grok Bot to rakazo
  • Superhuman to Inbox Zero
  • Airtable to AITable
  • Muse to OpenClaw
  • GitHub Copilot to Cline
  • Datadog to Netdata
  • Microsoft Teams to Rocket.Chat
  • Pinecone to Qdrant
  • Zapier to n8n
  • Devin AI to OpenHands
  • Firebase to Supabase
  • 1Password to KeePassXC
  • Confluence to Docmost
  • Contentful to Strapi
  • Adobe Premiere Pro to Shotcut
  • ChatGPT to AnythingLLM
  • LangSmith to Langfuse