trai CLAUDE.md

trai CLAUDE.md is an instructions file for coding agents 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

Installs and runs on its own, but its text points at files inside the plugin that ships it — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed.

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 instructions/binpash/trai/claude-md
Clone the repo
git clone --depth 1 https://github.com/binpash/trai

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.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.svg" alt="Measured on agentmods" 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. 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.02387 $0.02387
Opus 5 $0.01193 $0.01193
Sonnet 5 $0.00477 $0.00477
Haiku 4.5 $0.00239 $0.00239

Measured 3d ago against content hash b19377bfae20, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 (5 stars, last pushed 3mo ago), licensed MIT. It adds 2,387 tokens to every session, about $0.0119 per session on Opus 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

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens