Borrowing it
Nothing to install: this file belongs to binpash/trai. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/binpash/trai/main/CLAUDE.mdgit clone --depth 1 https://github.com/binpash/traiWrote 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.
[](https://agentmods.dev/instructions/binpash/trai/claude-md)<a href="https://agentmods.dev/instructions/binpash/trai/claude-md"><img src="https://agentmods.dev/badge/instructions/binpash/trai/claude-md/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.
<a href="https://agentmods.dev/instructions/binpash/trai/claude-md"><img src="https://agentmods.dev/badge/instructions/binpash/trai/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02387 | $0.02387 |
| Opus 5.5 | $0.00955 | $0.00955 |
| Sonnet 5.5 | $0.00477 | $0.00477 |
| Haiku 4.5 | $0.00239 | $0.00239 |
Grade D, and why
trai CLAUDE.md scanned grade D with 3 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 2mo 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- **Do NOT** modify the user's `~/.claude/settings.json`. Plugin state lives in `${CLAUDE_PLUGIN_DATA}` only. Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- **Do NOT** delete or rewrite an overlay dir without user confirmation. Programmatic `rm -rf` on `$XDG_STATE_HOME/trai/sessions/*` without the `--yes` interaction is a data-loss event. (Wiping `overlay/temproot/` conten Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
3. **Plugin-only distribution.** Installed via `/plugin marketplace add <git-url>`. No curl-pipe-sh, no wrapper binary. How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
trai — repo context
This repo is a Claude Code plugin that sandboxes each Bash tool call through binpash/try so the user can review the accumulated filesystem diff after Claude finishes and choose to commit or discard.
Scope decisions (locked; see docs/claude/design-notes.md for why)
- Per-Bash hook, not outer wrapper.
PreToolUse(Bash)rewrites eachBash(x)→Bash(try -D $overlay 'x')— passing the full command as a single arg (notbash -c '...') becausetryinternals doecho "$@"which collapses multi-args.-Dimplies-n. - Edit / Write / MultiEdit are NOT sandboxed. They write through Node directly; hooks can't intercept them. Users rely on git for that half.
- Plugin-only distribution. Installed via
/plugin marketplace add <git-url>. No curl-pipe-sh, no wrapper binary. - All-or-nothing commit in v1.
/trai:commitor/trai:discard --yes. Partial commits defer togit add -ppost-commit. - Linux-only. Doctor refuses to start on macOS/Windows.
- Shared overlay per session. One
-Ddir across all Bash calls so state accumulates.pre-bash.shpre-cleanstemproot/before each call because upstreamtry's validity check (sandbox_valid_or_empty) refuses sandboxes with non-directory entries intemproot/. git/sudo/docker/ read-only commands are passthrough (not wrapped).- No default network isolation (
-xnot passed). Claude needs the API. - Plugin-internal scripts self-exempt. Any command starting with
$CLAUDE_PLUGIN_ROOT/is passthrough. Required so/trai:doctorsees the real host,/trai:passthroughwrites its token to the real FS, etc. SessionStartis idempotent. Claude Code fires it on startup,/clear,/compact,/resume, and auto-compact.session-start.shreuses an existing overlay if one is live; otherwise creates a fresh one.
Load-bearing files
hooks/pre-bash.sh— the rewriter. Reads Claude'sPreToolUseJSON on stdin, emits{hookSpecificOutput.updatedInput.command}with thetry-wrapped command. If you break this, nothing is sandboxed.hooks/session-start.sh— creates the overlay dir, writes$XDG_STATE_HOME/trai/current-session, runsscripts/doctor.shin quiet mode. If doctor fails, writes emptycurrent-sessionso the pre-bash hook self-disables.hooks/session-end.sh— prints a reminder banner if the overlay is uncommitted.scripts/doctor.sh— kernel /unprivileged_userns_clone/try-installed /unshare/ FS-type preflight. Single source of truth for "is this environment compatible."scripts/is-passthrough.sh— matches a command against the passthrough patterns fromconfig/defaults.json. Called frompre-bash.sh.config/defaults.json— default passthrough + ignore patterns. Users override via$CLAUDE_PLUGIN_DATA/config.json..claude-plugin/plugin.json— plugin manifest..claude-plugin/marketplace.json— single-plugin marketplace so/plugin marketplace add <git-url>works.commands/*.md— seven slash commands (/trai:diff,/trai:commit,/trai:discard,/trai:explore,/trai:status,/trai:doctor,/trai:passthrough).
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.
- 2mo ago First seen · 80 lines · 2,387 tokens per session scan D b19377bfae20
trai CLAUDE.md is an instructions file published in the GitHub repository binpash/trai (6 stars, last pushed 6mo ago), licensed MIT. It adds 2,387 tokens to every session, about $0.0095 per session on Opus 5.5. A static security scan graded it D with 3 findings (reads agent configuration directories, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
trai CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| trai CLAUDE.mdbinpash/trai | Instructions file | 6 | 6mo ago | MIT | D | 2,387 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,685 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,086 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 280k | 2d ago | MIT | A | 4,325 | Codex, OpenCode |