agentleFS
rtk-airtk-ai/rtk/.github/copilot-instructions.md

rtk

Copilot instructions82k starsChanged 2 months agoApache-2.0View on GitHub

rtk (Rust Token Killer) is a CLI proxy that filters and compresses command outputs before they reach an LLM context, cutting 60-90% of bash output. It wraps common tools (git, cargo, grep, pnpm, go, etc.) and outputs condensed summaries instead of raw output. Percentages measure bash output, not billed tokens; RTK ships no tokenizer (src/core/tracking.rs estimates bytes / 4). Always prefix commands with rtk when running shell commands — this reduces token consumption for every operation you perform. rtk meta-commands…

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about rtk-ai/rtk

The biggest 5 of 110 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 110

Talked about on GitHub, Bluesky and Hacker News (110 times).

On GitHub · 50

45 more on GitHub

On Bluesky · 50

45 more on Bluesky

On Hacker News · 10

5 more on Hacker News

The file

We split this copilot-instructions.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Regex: Use LazyLock<Regex> for fixed patterns reused across calls.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions for rtk

rtk (Rust Token Killer) is a CLI proxy that filters and compresses command outputs before they reach an LLM context, cutting 60-90% of bash output. It wraps common tools (git, cargo, grep, pnpm, go, etc.) and outputs condensed summaries instead of raw output. Percentages measure bash output, not billed tokens; RTK ships no tokenizer (src/core/tracking.rs estimates bytes / 4).

Using rtk in this session

Always prefix commands with rtk when running shell commands — this reduces token consumption for every operation you perform.

# Instead of:              Use:
git status                 rtk git status
git log -10                rtk git log -10
cargo test                 rtk cargo test
cargo clippy --all-targets rtk cargo clippy --all-targets
grep -r "pattern" src/     rtk grep -r "pattern" src/

rtk meta-commands (always use these directly, no prefix needed):

rtk gain              # Show token savings analytics
rtk gain --history    # Full command history with per-command savings
rtk discover          # Scan session history for missed rtk opportunities
rtk proxy <cmd>       # Run a command raw (no filtering) but still track it

Verify rtk is installed before starting:

rtk --version   # Should print: rtk X.Y.Z
rtk gain        # Should show a dashboard (not "command not found")

Name collision: rtk gain failing means you have reachingforthejack/rtk (Rust Type Kit) installed instead. Run which rtk to check.

Build, Test & Lint

cargo build                    # Development build
cargo test                     # All tests
cargo test test_name           # Single test
cargo test module::tests::     # Module tests
cargo test -- --nocapture      # With stdout

# Pre-commit gate (must all pass before any PR)
cargo fmt --all --check && cargo clippy --all-targets && cargo test

bash scripts/test-all.sh       # Smoke tests (requires installed binary)

PRs target the develop branch, not main. All commits require a DCO sign-off (git commit -s).

Architecture

rtk routes CLI commands via a Clap Commands enum in main.rs to specialized filter modules in src/cmds/*/, each executing the underlying command and compressing output. Token savings are tracked in SQLite via src/core/tracking.rs.

For full details see ARCHITECTURE.md and docs/contributing/TECHNICAL.md. Module responsibilities are documented in each folder's README.md and each file's //! doc header.

Key Conventions

  • Error handling: anyhow::Result with .context("description")? — no bare ?, no unwrap() in production. Filters must fall back to raw command on error.
  • Regex: Use LazyLock<Regex> for fixed patterns reused across calls; keep runtime-dependent patterns local.
  • Testing: Unit tests inside modules (#[cfg(test)] mod tests). Fixtures in tests/fixtures/. Token savings assertions with count_tokens().
  • Exit codes: Preserve the underlying command's exit code via std::process::exit(code).
  • Performance: Startup <10ms (no async runtime), binary <5MB stripped.
  • Branch naming: fix(scope):, feat(scope):, chore(scope): where scope is the affected component.

For the full contribution workflow, design philosophy, and new-filter checklist, see CONTRIBUTING.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.