rtk is a command-line proxy that filters and compresses output from development commands before it reaches an LLM's context. It is used with coding agents to reduce the tokens consumed by commands such as Git operations. The catalogue includes skills, commands, agents, and instructions for using rtk in agent workflows.
Borrowing it
Nothing to install: this file belongs to rtk-ai/rtk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rtk-ai/rtk/develop/.claude/commands/rtk-test-before-merge.mdgit clone --depth 1 https://github.com/rtk-ai/rtkWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/rtk-ai/rtk/rtk-test-before-merge)<a href="https://agentmods.dev/commands/rtk-ai/rtk/rtk-test-before-merge"><img src="https://agentmods.dev/badge/commands/rtk-ai/rtk/rtk-test-before-merge/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/rtk-ai/rtk/rtk-test-before-merge"><img src="https://agentmods.dev/badge/commands/rtk-ai/rtk/rtk-test-before-merge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00177 |
| Opus 5.5 | $0.00000 | $0.00071 |
| Sonnet 5.5 | $0.00000 | $0.00035 |
| Haiku 4.5 | $0.00000 | $0.00018 |
Grade A, and why
rtk-test-before-merge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Force the agent to write or extend a test for every behaviour change.
Test before merge
For every code change that affects observable behaviour:
- Identify the existing test that covers the area. If none, propose creating it (note the gap in the response).
- Write the failing test FIRST in a separate commit named
test: <what>— verify it fails on main, passes on the branch. - The implementation commit comes second.
- If the change is purely refactoring, run the existing tests and report the count + duration; do not add new tests just to satisfy this rule when there is no behaviour change.
Skip is allowed only when:
- Tweaking a doc string, comment, log message
- Renaming a private symbol
- A pre-existing TODO points at "test added in #issue-N"
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 20 lines · 0 tokens per session scan A ccedc3b1c64b
rtk-test-before-merge is a command published in the GitHub repository rtk-ai/rtk (84,655 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 177 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.
Other commands, from other repositories
feature-implement-execute
Phase 4 of develop: Execute the implementation plan with per-task TDD, quality gates, and completion verification.
execute-work-packet
Execute a single work packet: verify dependencies, run TDD task loop through three gates, write completion marker.
debug
Systematic root-cause investigation, then fix with TDD — never proposes a fix before finding the cause; resumable diagnosis + regression test in .orc/ state. Workspace-aware. For a quick one-off look without session state, prefer the bundled /debug.
loop
Autonomous execution loop. Runs the TDD cycle repeatedly until all tasks in an epic are complete, with circuit breaker protection and PR workflow.
ccc-feature-start
Kick off a feature: research context, create an isolated branch, confirm a green baseline, write a task breakdown, and the first failing test. Use when starting new feature work in a git repository.
execute
Execute the next available tracked task with TDD, pre-commit validation, PR creation, AI code review, and issue tracker bridge sync.