cargo-target-isolation

cargo-target-isolation is a command for Claude Code from rjwalters/kicad-tools. It costs 0 tokens per session (1,158 once invoked), scanned C, original, MIT.

A Cargo build-isolation recipe for Rust projects. Cargo is Rust's build and test tool; this recipe separates build outputs so workspaces do not overwrite one another.

In plain words
What is it for?
It helps make local Rust builds, tests, and runs trustworthy when multiple workspaces or worktrees are active.
Why use it?
A shared build folder can make tests run a binary from another workspace, producing misleading passes or failures.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It helps make local Rust builds, tests, and runs trustworthy when multiple workspaces or worktrees are active.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/rjwalters/kicad-tools/cargo-target-isolation
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.

Clone the repo
git clone --depth 1 https://github.com/rjwalters/kicad-tools

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 cargo-target-isolation

README.md
[![agentmods](https://agentmods.dev/badge/commands/rjwalters/kicad-tools/cargo-target-isolation/github.svg)](https://agentmods.dev/commands/rjwalters/kicad-tools/cargo-target-isolation)
Your own site
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/cargo-target-isolation"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/cargo-target-isolation/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 cargo-target-isolation

Your own site · 80×15
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/cargo-target-isolation"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/cargo-target-isolation.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 1,158 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.01158
Opus 5.5 $0.00000 $0.00463
Sonnet 5.5 $0.00000 $0.00232
Haiku 4.5 $0.00000 $0.00116

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

Security

Grade C, and why

cargo-target-isolation scanned grade C with 1 finding 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 6d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

printed path (`rm -rf /tmp/cargo-target-123`). The `rmScope` guard
.claude/commands/loom/cargo-target-isolation.md · 86 lines

How it starts

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

Shared Cargo Target Dir: Isolation Recipe (#8457)

Load when: you are about to run (or just ran) a local cargo build/cargo test/cargo run whose result will inform a verdict — a Judge approval or rejection, a Doctor "the fix works", or a Builder "tests pass" before opening a PR.

Why this exists

A fleet host with one shared cargo target directory uplifts every workspace binary to a single un-hashed path (e.g. target/debug/loom-daemon). Cargo overwrites that path whenever another worktree builds concurrently. An integration test that executes it can therefore observe a different worktree's binary, silently. On 2026-09-20 this produced three real false-verdict incidents in one day: a Judge saw 12 false failures from a mid-run overwrite (an isolated re-run passed 194/194), a Doctor's cargo test --bin loom-daemon reported results for a binary that, per strings, contained none of that PR's code, and a deliberately behavior-flipped local canary build landed at the shared path while Judges concurrently tested the real PR.

A shared-target-dir integration-test result is not verdict-bearing evidence. Treat a pass or a fail observed there as uninformative — not as grounds to approve, reject, or declare a fix confirmed — until you have reproduced it from an isolated build.

The recipe: the CARGO_TARGET_DIR Loom gave you

Decide once, before your first verdict-bearing build:

  1. $CARGO_TARGET_DIR is set to a Loom-owned dir: a path under <repo>/.loom/targets/, or the per-worktree dir named in your worktree's .loom-cargo-target-dir. Use it as given. Loom created it for this run and reclaims it (see Cleanup). Do not export another or delete it.

  2. Otherwise (unset, a shared cache, an operator value, or you are one of several agents building concurrently in one session, which all inherit the same value): build into your worktree's own target/.

    CARGO_TARGET_DIR="$WORKTREE_ABS/target" cargo test -p loom-daemon --test the_test_you_need
    

Read the full file on GitHub · 86 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. 6d ago Changed · +1 lines 8629118cd961
  2. 9d ago Changed · -6 lines 9d6ae92ac09b
  3. 11d ago Changed 8feb89c7562b
  4. 23d ago First seen · 91 lines · 0 tokens per session scan C fd802f5eb045

Subscribe to this mod's changes

cargo-target-isolation is a command published in the GitHub repository rjwalters/kicad-tools (70 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,158 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-26.