worktree-status

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rtk-ai/rtk/worktree-status
Clone the repo
git clone --depth 1 https://github.com/rtk-ai/rtk

Made for: Claude Code.

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. Scan, not verified.
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 $0.00005 $0.00836
Opus 5 $0.00003 $0.00418
Sonnet 5 $0.00001 $0.00167
Haiku 4.5 $0.00001 $0.00084

Measured 2d ago against content hash 3ee13823e330, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 (78,131 stars, last pushed yesterday), licensed Apache-2.0. It adds 5 tokens to every session and 836 once invoked, about $0.0000 per session on Opus 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.