terret CLAUDE.md

terret CLAUDE.md is an instructions file for coding agents from terret-org/terret. It costs 2,643 tokens per session, scanned A, original, MIT.

Repository instructions for Terret, a Ruby project that runs AI agents through plugins, tools, events, sessions, and service components. The repository contains twelve related Ruby packages in one codebase.

In plain words
What is it for?
Use them when modifying Terret's core services, provider adapters, credentials, approvals, subagents, tool scheduling, or adding an event.
Why use it?
They explain the project's architecture and identify rules that should remain intact when changing the agent loop, services, adapters, or plugin system.

Instructions file

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/terret-org/terret/claude-md.svg)](https://agentmods.dev/instructions/terret-org/terret/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/terret-org/terret/claude-md"><img src="https://agentmods.dev/badge/instructions/terret-org/terret/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,643 This file is loaded in full into every session.
When invoked 2,643 The same file — it is already loaded in full.
Security scan A 0 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.1 $0.02643 $0.02643
Opus 5 $0.01321 $0.01321
Sonnet 5 $0.00529 $0.00529
Haiku 4.5 $0.00264 $0.00264

Measured 5d ago against content hash 7b0e1e6f0331, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

terret CLAUDE.md scanned grade A with 0 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 152 lines

How it starts

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

Terret

Ruby-native, model-agnostic agent harness where everything is a plugin. Twelve gems in one repo:

  • gems/hames is the kernel. Services in a context, typed events, reversible effects, dependency-driven boot. It knows nothing about LLMs and is reusable for any plugin-composed application.
  • gems/terret-core is the harness built on it. Session log, tools pipeline, agent loop, LLM seam (vocabulary, AdapterBase retry policy, FakeAdapter), plus the M6 long-lived-agent services: durable approvals (ctx[:approvals], opt-in per tool), the compactor on the sole-provider ctx[:summarizer] seam, the titler, and hot-reloadable per-agent policy (AllowList as a log projection). M8 added the sole-provider ctx[:subagents] seam (a child agent on a fresh session, run to completion) and the loop's tool barrier, which runs a message's concurrency: :parallel calls together on the reactor while a :serial tool is a barrier of one. Terret::Credentials (ctx[:credentials]) lives here too: ENV <PROVIDER>_API_KEY first, then an optional AES-256-GCM file store, every resolved value fed to the scrubber.
  • gems/terret-openrouter is the one real adapter (plan §6.5): OpenRouter's OpenAI-compatible API behind ctx.llm, streaming SSE with tool calling and usage accounting. The transport is injectable, so its unit tests need no network and no gems; only the default AsyncTransport requires async-http.
  • gems/terret-store-sqlite is the durable session store (M3): the append-only log one event per row in SQLite (WAL) behind the ctx[:session_store] seam. Memory and JSONL providers live in terret-core; the store row is explicit in every boot.
  • gems/terret-ws is the v1 interface (M4): one WebSocket per agent behind ctx[:ws], the §9.2 frames, exact replay-then-tail on the session log; wire contract in docs/protocol.md; only the real endpoint requires async-websocket.
  • gems/terret-acp is the second interface (M8): an Agent Client Protocol server behind ctx[:acp] so an editor can drive an agent over JSON-RPC on stdio. It consumes session/event and drives ctx[:loop] — the same two seams the socket does, on a different transport, with no change to core; mapping in docs/acp.md. stdlib-only.
  • gems/terret-mcp is the MCP client (M5): manceps-backed stdio and streamable-HTTP servers mounted as mcp__<server>__<tool> sources behind ctx[:tools], per-server approval, per-call timeouts, the allow list in terret-core; mapping in docs/mcp.md.
  • gems/terret-morph is a ctx[:summarizer] provider (M6): Morph's Compact API on the wire proven in the deployed agora integration (bearer key, compression_ratio: 0.4, nil-on-any-failure), an injectable transport so its unit tests need no network, and a MORPH_LIVE=1 live lane (pending a MORPH_API_KEY in this environment).
  • gems/terret-exec is the execution world (M7, plan §6.6): ctx[:fs] with every path realpath-contained to a granted workspace dir behind an fs/authorize waterfall, ctx[:subprocess] (spawn and PTY under the one reactor, SIGTERM→SIGKILL cancellation), ctx[:shell] (one persistent bash per agent, sentinel protocol), ctx[:terminals] (named long-lived PTYs, capped), and ctx[:sandbox] with the None provider — every argv passes sandbox.wrap before it spawns. Stdlib only.
  • gems/terret-tools-std is the standard roster (M7, plan §6.7): Read, Write, Edit, Glob, Grep, Bash, WebFetch, terminal_open/input/read/close — Claude Code's names verbatim, no alias map — registered on those seams with honest mutating/approval/concurrency metadata. Bash's approval derives from sandbox.isolated? at registration; WebFetch sits behind a deny-by-default domain policy re-checked per redirect hop, plus a host-side loopback/link-local floor. M8 added Task (delegate to a child agent via ctx[:subagents]), TodoWrite, and job_start/job_collect/job_stop over ctx[:jobs].
  • gems/terret-sandbox-docker is the container provider (M7): a long-lived container per boot, each workspace dir bind-mounted at the same absolute path, argv wrapped into docker exec, --network none by default. One patch row moves the execution world into it; docker-gated tests skip clean when the daemon is absent.
  • gems/terret is the meta-gem and the composition layer (M8, plan §7): bundles ship ordered config rows, profiles stack bundles, patches adjust rows by id, and Terret.boot hands the result to the Hames loader. It ships terret-base (config/bundle.yml), the headless profile template, and the trt executable (boot, dump-config, doctor, acp). Its discover_bundles mounts a third-party bundle off that gem's gemspec metadata["terret"], so a plugin gem becomes composable by shipping normally. The contract is docs/composition.md; read it and plan §7 before changing anything here. Terret::Meta::VERSION is the gem's version — Terret::VERSION belongs to terret-core.

Read the full file on GitHub · 152 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. 5d ago First seen · 152 lines · 2,643 tokens per session scan A 7b0e1e6f0331

Subscribe to this mod's changes

terret CLAUDE.md is an instructions file published in the GitHub repository terret-org/terret (25 stars, last pushed 15d ago), licensed MIT. It adds 2,643 tokens to every session, about $0.0132 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

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

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

next.js AGENTS.md

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

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,469 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