trai: Instructions file for Claude Code

CLAUDE.md

trai CLAUDE.md is an instructions file for Claude Code from binpash/trai. It costs 2,387 tokens per session, scanned D, original, MIT.

Repository-specific instructions for trai, a Claude Code plugin that runs Bash commands in a reviewable temporary filesystem overlay. A plugin is an add-on that extends an agent's behavior.

In plain words
What is it for?
Use them when developing, reviewing, or operating the trai plugin, especially its Bash sandboxing and session commit process.
Why use it?
They document the project's design limits, operating-system support, installation method, and commit or discard workflow.

Instructions file for Claude Code

Written for Claude Code: $CLAUDE_PLUGIN_ROOT variable. Also seen: reads .claude/ paths; mentions .claude-plugin; mentions Claude Code.

This is binpash/trai's own configuration. It tells Claude Code how to work on trai 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 trai configures →

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

View source ↗ binpash/trai
Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/binpash/trai/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/binpash/trai

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 trai CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/binpash/trai/claude-md/github.svg)](https://agentmods.dev/instructions/binpash/trai/claude-md)
Your own site
<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.

agentmods 80×15 button for trai CLAUDE.md

Your own site · 80×15
<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>
Per session 2,387 This file is loaded in full into every session.
When invoked 2,387 The same file — it is already loaded in full.
Security scan D 3 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.02387 $0.02387
Opus 5.5 $0.00955 $0.00955
Sonnet 5.5 $0.00477 $0.00477
Haiku 4.5 $0.00239 $0.00239

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

Security

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.
CLAUDE.md · 80 lines

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)

  1. Per-Bash hook, not outer wrapper. PreToolUse(Bash) rewrites each Bash(x) → Bash(try -D $overlay 'x') — passing the full command as a single arg (not bash -c '...') because try internals do echo "$@" which collapses multi-args. -D implies -n.
  2. Edit / Write / MultiEdit are NOT sandboxed. They write through Node directly; hooks can't intercept them. Users rely on git for that half.
  3. Plugin-only distribution. Installed via /plugin marketplace add <git-url>. No curl-pipe-sh, no wrapper binary.
  4. All-or-nothing commit in v1. /trai:commit or /trai:discard --yes. Partial commits defer to git add -p post-commit.
  5. Linux-only. Doctor refuses to start on macOS/Windows.
  6. Shared overlay per session. One -D dir across all Bash calls so state accumulates. pre-bash.sh pre-cleans temproot/ before each call because upstream try's validity check (sandbox_valid_or_empty) refuses sandboxes with non-directory entries in temproot/.
  7. git / sudo / docker / read-only commands are passthrough (not wrapped).
  8. No default network isolation (-x not passed). Claude needs the API.
  9. Plugin-internal scripts self-exempt. Any command starting with $CLAUDE_PLUGIN_ROOT/ is passthrough. Required so /trai:doctor sees the real host, /trai:passthrough writes its token to the real FS, etc.
  10. SessionStart is idempotent. Claude Code fires it on startup, /clear, /compact, /resume, and auto-compact. session-start.sh reuses an existing overlay if one is live; otherwise creates a fresh one.

Load-bearing files

  • hooks/pre-bash.sh — the rewriter. Reads Claude's PreToolUse JSON on stdin, emits {hookSpecificOutput.updatedInput.command} with the try-wrapped command. If you break this, nothing is sandboxed.
  • hooks/session-start.sh — creates the overlay dir, writes $XDG_STATE_HOME/trai/current-session, runs scripts/doctor.sh in quiet mode. If doctor fails, writes empty current-session so 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 from config/defaults.json. Called from pre-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).

Read the full file on GitHub · 80 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. 2mo ago First seen · 80 lines · 2,387 tokens per session scan D b19377bfae20

Subscribe to this mod's changes

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.

Related

trai CLAUDE.md compared with instructions from other repositories

trai CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
trai CLAUDE.mdbinpash/traiInstructions file66mo agoMITD2,387Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,086GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file280k2d agoMITA4,325Codex, OpenCode