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
In this repository5 other files it gives its agents.
- adversarial-reviewSkill
- claude-md-bootstrapSkill
- memory-bootstrapSkill
- memory-hygieneSkill
- skill-authoringSkill
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
- Very specific: line 14
Prefix every terminal command with
rtk: If RTK has a dedicated filter, it uses it.
≈ “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.
Files
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 pushWhen to Apply
| Situation | Action |
| Any build, test, lint, or typecheck | rtk wrap mandatory |
| Any git command | rtk wrap mandatory |
Any GitHub CLI (gh) | rtk wrap mandatory |
| Reading part of a file >200 lines | rtk read <file> |
| Searching across files | rtk grep <pattern> |
| Debugging unknown command output | rtk err <cmd> — errors only |
| Need raw output for debugging | rtk 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 usageAnti-Patterns
| Pattern | Why it fails |
git status | head -30 | RTK already trims to signal; head loses semantic grouping |
cargo test 2>&1 | grep FAIL | rtk 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 globally | Breaks 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
- TTY-interactive commands — RTK cannot filter what has not been printed.
rebase -i,add -i, and login flows must run raw. - Stdin pipelines —
cat foo | rtk cmddefeats RTK; it filters its own command's output, not piped input. - Hook-based auto-filtering is Unix-only. On Windows,
rtk init -gfalls back to legacy mode — prefixing is manual, and this rule is the only mechanism.
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
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.

