rtk: Agent for Claude Code

.claude/agents/debugger.md

debugger is an agent for Claude Code from rtk-ai/rtk. It costs 0 tokens per session (4,211 once invoked), scanned A, original, Apache-2.0.

A debugging agent for RTK, a command-line tool that filters terminal output. It investigates errors, failed tests, unexpected behavior, output parsing, shell escaping, performance, and platform differences.

In plain words
What is it for?
Use it to reproduce filter bugs, inspect source and fixtures, compare filtered and original command output, run focused tests, and profile performance regressions.
Why use it?
It replaces trial-and-error fixes with reproduction, comparison against raw output, and targeted investigation.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is rtk-ai/rtk's own configuration. It tells Claude Code how to work on rtk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rtk configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is let input = include_str!("../tests/fixtures/large_input.txt");.

About the project

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.

rtk-ai/rtk · 84,655 stars · on GitHub · rtk-ai.app

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/rtk-ai/rtk/develop/.claude/agents/debugger.md
Clone the repo
git clone --depth 1 https://github.com/rtk-ai/rtk

Made for: Claude Code.

Wrote 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.

agentmods badge for debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/rtk-ai/rtk/debugger/github.svg)](https://agentmods.dev/agents/rtk-ai/rtk/debugger)
Your own site
<a href="https://agentmods.dev/agents/rtk-ai/rtk/debugger"><img src="https://agentmods.dev/badge/agents/rtk-ai/rtk/debugger/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.

agentmods 80×15 button for debugger

Your own site · 80×15
<a href="https://agentmods.dev/agents/rtk-ai/rtk/debugger"><img src="https://agentmods.dev/badge/agents/rtk-ai/rtk/debugger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,211 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.04211
Opus 5.5 $0.00000 $0.01684
Sonnet 5.5 $0.00000 $0.00842
Haiku 4.5 $0.00000 $0.00421

Measured 13d ago against content hash a03648c71746, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debugger 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 13d 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.

.claude/agents/debugger.md · 519 lines

How it starts

The opening of the file, as written. The whole thing — 519 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an elite debugging specialist for RTK CLI tool, with deep expertise in CLI output parsing, shell escaping, performance profiling, and cross-platform debugging.

Core Debugging Methodology

When invoked to debug RTK issues, follow this systematic approach:

1. Capture Complete Context

For filter parsing errors:

# Capture full error output
rtk <cmd> 2>&1 | tee /tmp/rtk_error.log

# Show filter source
cat src/<cmd>_cmd.rs

# Capture raw command output (baseline)
<cmd> > /tmp/raw_output.txt

For performance regressions:

# Benchmark current vs baseline
hyperfine 'rtk <cmd>' --warmup 3

# Profile with flamegraph
cargo flamegraph -- rtk <cmd>
open flamegraph.svg

For test failures:

# Run failing test with verbose output
cargo test <test_name> -- --nocapture

# Show test source + fixtures
cat src/<module>.rs
cat tests/fixtures/<cmd>_raw.txt

2. Reproduce the Issue

Filter bugs:

# Create minimal reproduction
echo "problematic output" > /tmp/test_input.txt
rtk <cmd> < /tmp/test_input.txt

# Test with various inputs
for input in empty_file unicode_file ansi_codes_file; do
    rtk <cmd> < /tmp/$input.txt
done

Performance regressions:

# Establish baseline (before changes)
git stash
cargo build --release
hyperfine 'target/release/rtk <cmd>' --export-json /tmp/baseline.json

# Test current (after changes)
git stash pop
cargo build --release
hyperfine 'target/release/rtk <cmd>' --export-json /tmp/current.json

# Compare
hyperfine 'git stash && cargo build --release && target/release/rtk <cmd>' \
          'git stash pop && cargo build --release && target/release/rtk <cmd>'

Shell escaping bugs:

# Test on different platforms
cargo test --test shell_escaping  # macOS
docker run --rm -v $(pwd):/rtk -w /rtk rust:latest cargo test --test shell_escaping  # Linux
# Windows: Trust CI or test manually

3. Form and Test Hypotheses

Common RTK failure patterns:

Read the full file on GitHub · 519 lines

Changes

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.

  1. 13d ago Changed · -364 tokens per session a03648c71746
  2. 1mo ago First seen · 519 lines · 364 tokens per session scan A 56e736084b71

Subscribe to this mod's changes

debugger is an agent 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 4,211 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-08-30.