agentleFS
Guz007Guz007/claude-code-os-plugin/skills/rtk-discipline/SKILL.md

rtk-discipline

Skill0 starsChanged 4 months agoMITView on GitHub

Token-saving terminal command discipline using rtk (Rust Token Killer) to filter noisy build, test, git, and CLI output. Use when the user has rtk installed, asks to reduce token burn from command output, or is running heavy build/test/git loops that flood context.

  • Commits and pushes

The file

We split this skill 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:

    Prefix every terminal command with rtk: If RTK has a dedicated filter, it uses it.

    line 14

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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
SKILL.md

RTK Discipline — Token-Killer Command Workflow

Wraps high-noise commands (git, cargo, pnpm, gh, docker, kubectl, tsc) with rtk to strip ANSI noise, deduplicate logs, and group output by file. Typical reduction: 60–90% fewer tokens per command.

Requires rtk on PATH. If it is not installed, say so rather than silently emitting commands that will fail.

The Golden Rule

Prefix every terminal command with rtk. If RTK has a dedicated filter, it uses it. If not, it passes through unchanged. Wrapping is always safe; skipping is the only way to lose.

In command chains, prefix every segment — && runs each command in its own process, so only the first inherits the wrapper otherwise:

# Wrong — only the first command is filtered
rtk git add . && git commit -m "msg" && git push

# Right
rtk git add . && rtk git commit -m "msg" && rtk git push

When to Apply

SituationAction
Any build, test, lint, or typecheckrtk wrap mandatory
Any git commandrtk wrap mandatory
Any GitHub CLI (gh)rtk wrap mandatory
Reading part of a file >200 linesrtk read <file>
Searching across filesrtk grep <pattern>
Debugging unknown command outputrtk err <cmd> — errors only
Need raw output for debuggingrtk proxy <cmd> — bypasses the filter

Useful Subcommands

rtk err <cmd>       # errors only from any command
rtk log <file>      # deduplicated logs with counts
rtk json <file>     # JSON structure without values
rtk summary <cmd>   # smart summary of output
rtk gain            # savings stats (--history for per-command)
rtk discover -a     # find missed RTK usage

Anti-Patterns

PatternWhy it fails
git status | head -30RTK already trims to signal; head loses semantic grouping
cargo test 2>&1 | grep FAILrtk cargo test already does failures-only with file context
Running raw "to see what happens"Burns 2k–10k tokens before you decide to filter
Wrapping interactive commands (git rebase -i, login flows)RTK filters output, not input. Run TTY-bound commands raw.
Aliasing git → rtk git globallyBreaks tools that shell out to git expecting raw output. Apply as a prompt rule, not a system alias.

Token-Cost Math

A single tsc run on a medium TypeScript repo: ~12k tokens raw, ~2k through rtk tsc. Across a session of 30 builds, 50 git commands, and 20 test runs, the difference is roughly 150k–250k tokens — one full context window per workday.

This is not a micro-optimization. It is the difference between "out of context, must compact" and "40% headroom left for the next task."

Known Gaps

  1. TTY-interactive commands — RTK cannot filter what has not been printed. rebase -i, add -i, and login flows must run raw.
  2. Stdin pipelines — cat foo | rtk cmd defeats RTK; it filters its own command's output, not piped input.
  3. Hook-based auto-filtering is Unix-only. On Windows, rtk init -g falls back to legacy mode — prefixing is manual, and this rule is the only mechanism.

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.