trudi-clear-case

trudi-clear-case is a command for Claude Code from nebulae/trudi. It costs 27 tokens per session (1,483 once invoked), scanned C, original, MIT.

A reset command for a TRUDI investigation case. TRUDI is a case-based investigation and live-monitoring system; the command previews the files and memory it will remove, then asks for confirmation.

In plain words
What is it for?
Use it to remove a case’s analysis, exports, reports, project memory and, for live monitoring, watcher state and alerts. Evidence, mounted images and selected configuration files are preserved.
Why use it?
It clears old investigation results and monitoring state before starting again, while showing the destructive changes in advance.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/trin/cases/<case>.

Good fit Use it to remove a case’s analysis, exports, reports, project memory and, for live monitoring, watcher state and alerts. Evidence, mounted images and selected configuration files are preserved.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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 trudi-clear-case

README.md
[![agentmods](https://agentmods.dev/badge/commands/nebulae/trudi/trudi-clear-case.svg)](https://agentmods.dev/commands/nebulae/trudi/trudi-clear-case)
Your own site
<a href="https://agentmods.dev/commands/nebulae/trudi/trudi-clear-case"><img src="https://agentmods.dev/badge/commands/nebulae/trudi/trudi-clear-case.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 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,483 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.00027 $0.01483
Opus 5 $0.00014 $0.00741
Sonnet 5 $0.00005 $0.00297
Haiku 4.5 $0.00003 $0.00148

Measured 4d ago against content hash 65bce0971a4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

trudi-clear-case 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 4d 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.

3. **(live) remove monitoring state** — `rm -rf <case_dir>/monitoring`.
claude/commands/trudi-clear-case.md · 110 lines

How it starts

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

/trudi-clear-case

Resets a case to a clean slate. Removes the investigation outputs and the case's Claude project memory, and for a live-monitoring case also stops the watcher and removes the monitoring state (alerts + everything under monitoring/).

Destructive and irreversiblemisc.clear_case_run hard-deletes (no backup). This command therefore previews everything it will remove and requires explicit confirmation before deleting anything. If the operator wants a backup-taking reset of just the output dirs instead, point them at python -m tools.trudi_reset --case-dir <case> --purge-outputs.

The argument, if supplied, names the case. Otherwise read it from ~/cases/.common/active_case.

What is removed vs. preserved

Removed Preserved
analysis/*, exports/*, reports/* CLAUDE.md
~/.cache/trudi/session.json .claude/settings.json (tool allowlist)
~/.claude/projects/<encoded-case-dir>/memory/* (the case's project memory) any evidence/, mounted images
live: monitoring/ (alerts, response, baselines, watchers, artifacts, seq/open-inv state) top-level case data files (e.g. ground_truth.json)
live: TRUDI cache counter/hook-state (via trudi_reset) ~/.cache/trudi/hash_cache.json (evidence-hash memo)

The project-memory deletion is case-scoped: clear_case_run encodes the case dir (/home/trin/cases/<case>-home-trin-cases-<case>), so it can never touch the global ~/.claude/projects/-home-trin/memory/.

Steps

1. Resolve the case

  1. case_id = $ARGUMENTS if non-empty, else cat ~/cases/.common/active_case. Refuse if neither is set.
  2. case_dir = absolute path ~/cases/<case_id> (expand ~). Confirm it exists. Use the absolute path everywhere so the encoded memory path resolves correctly.
  3. Detect live: the case is live-monitoring if <case_dir>/monitoring/ exists. Otherwise treat as static-evidence.

2. Build the removal preview (read-only — delete NOTHING yet)

Enumerate the actual targets so the operator sees exactly what will go. Use read-only shell (ls, find … | wc -l, du -sh) — no rm:

  • Outputs: list contents of analysis/, exports/, reports/. Show each file (or a count + total size if large).
  • Project memory: compute encoded = <abs case_dir> with /-; list files under ~/.claude/projects/<encoded>/memory/ (state "none" if the dir is absent/empty).
  • Cache: note ~/.cache/trudi/session.json will be removed (and, live, the call-id counter / hook-state reset).
  • Live only:
    • monitor.list_watchers(case_id) — list watchers that will be stopped (client_id + alive/dead). (Ensure an execution log is active first: if core.execution_log.log._path is unset, call misc.start_execution_log(case_id, "<case_dir>/analysis/<case_id>_trace.json").)
    • Summarize monitoring/ that will be removed: alert payload count, response suggestion/approval/execution counts, baselines present, rendered detector artifacts, watcher pid/log files, and the _open_investigation.json / _last_check_seq.txt / _inv_seq.txt state.

Read the full file on GitHub · 110 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. 4d ago Changed · -1 lines 65bce0971a4d
  2. 8d ago First seen · 111 lines · 27 tokens per session scan C c6450c743edc

Subscribe to this mod's changes

trudi-clear-case is a command published in the GitHub repository nebulae/trudi (57 stars, last pushed 7d ago), licensed MIT. It adds 27 tokens to every session and 1,483 once invoked, about $0.0001 per session on Opus 5. 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-08-30.