rtk: Command for Claude Code

.claude/commands/tech/worktree-status.md

worktree-status is a command for Claude Code from rtk-ai/rtk. It costs 5 tokens per session (836 once invoked), scanned A, original, Apache-2.0.

A command for checking the background Cargo check—the Rust compiler's project validation—for a named Git worktree branch. It reads the corresponding log and reports whether the check passed or failed.

In plain words
What is it for?
Use it with an exact branch name to inspect Cargo check results, completion time, failure output, or available logs.
Why use it?
It lets you see whether a worktree's code validation finished without rerunning the check. It also explains common reasons when no matching log exists.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: model in frontmatter.

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 →

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,791 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/commands/tech/worktree-status.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 worktree-status

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/rtk-ai/rtk/worktree-status"><img src="https://agentmods.dev/badge/commands/rtk-ai/rtk/worktree-status.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 836 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.00005 $0.00836
Opus 5.5 $0.00002 $0.00334
Sonnet 5.5 $0.00001 $0.00167
Haiku 4.5 $0.00001 $0.00084

Measured 1mo ago against content hash 3ee13823e330, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

worktree-status 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.

.claude/commands/tech/worktree-status.md · 117 lines

How it starts

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

Worktree Status Check

Check the status of background cargo check for a git worktree.

Usage

/tech:worktree-status feature/new-filter
/tech:worktree-status fix/session-bug

Implementation

Execute this script with branch name from $ARGUMENTS:

#!/bin/bash
set -euo pipefail

BRANCH_NAME="$ARGUMENTS"
LOG_FILE="/tmp/worktree-cargo-check-${BRANCH_NAME//\//-}.log"

if [ ! -f "$LOG_FILE" ]; then
  echo "❌ No cargo check found for branch: $BRANCH_NAME"
  echo ""
  echo "Possible reasons:"
  echo "1. Worktree was created with --fast / --no-check flag"
  echo "2. Branch name mismatch (use exact branch name)"
  echo "3. Cargo check hasn't started yet (wait a few seconds)"
  echo ""
  echo "Available logs:"
  ls -1 /tmp/worktree-cargo-check-*.log 2>/dev/null || echo "  (none)"
  exit 1
fi

LOG_CONTENT=$(head -n 1000 "$LOG_FILE")

if echo "$LOG_CONTENT" | grep -q "✅ Cargo check passed"; then
  TIMESTAMP=$(echo "$LOG_CONTENT" | grep "Cargo check passed" | sed 's/.*at //')
  echo "✅ Cargo check passed"
  echo "   Completed at: $TIMESTAMP"
  echo ""
  echo "Worktree is ready for development!"

elif echo "$LOG_CONTENT" | grep -q "❌ Cargo check failed"; then
  TIMESTAMP=$(echo "$LOG_CONTENT" | grep "Cargo check failed" | sed 's/.*at //')
  echo "❌ Cargo check failed"
  echo "   Completed at: $TIMESTAMP"
  echo ""
  ERROR_COUNT=$(grep -v "Cargo check" "$LOG_FILE" | grep -c "^error" || echo "0")
  echo "Errors:"
  echo "─────────────────────────────────────"
  grep "^error" "$LOG_FILE" | head -20
  echo "─────────────────────────────────────"
  echo ""
  echo "Full log: cat $LOG_FILE"
  echo ""
  echo "⚠️  You can still work on the worktree - fix errors as you go."

elif echo "$LOG_CONTENT" | grep -q "⏳ Cargo check started"; then
  START_TIME=$(echo "$LOG_CONTENT" | grep "Cargo check started" | sed 's/.*at //')
  CURRENT_TIME=$(date +%H:%M:%S)
  echo "⏳ Cargo check still running..."
  echo "   Started at: $START_TIME"
  echo "   Current time: $CURRENT_TIME"
  echo ""
  echo "Check again in a few seconds or view live progress:"
  echo "  tail -f $LOG_FILE"

else
  echo "⚠️  Cargo check in unknown state"
  echo ""
  echo "Log content:"
  cat "$LOG_FILE"
fi

Read the full file on GitHub · 117 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. 1mo ago First seen · 117 lines · 5 tokens per session scan A 3ee13823e330

Subscribe to this mod's changes

worktree-status is a command published in the GitHub repository rtk-ai/rtk (84,791 stars, last pushed 2d ago), licensed Apache-2.0. It adds 5 tokens to every session and 836 once invoked, about $0.0000 per session on Opus 5.5. 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.