terret: Instructions file for Claude Code

CLAUDE.md

terret CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions subagents; names the TodoWrite tool; mentions Claude Code.

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

Reuse

Borrowing it

Nothing to install: this file belongs to terret-org/terret. 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/terret-org/terret/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/terret-org/terret

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/terret-org/terret/claude-md/github.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/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 terret CLAUDE.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.02643 $0.02643
Opus 5.5 $0.01057 $0.01057
Sonnet 5.5 $0.00529 $0.00529
Haiku 4.5 $0.00264 $0.00264

Measured 2mo ago against content hash 7b0e1e6f0331, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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. 2mo 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 (24 stars, last pushed 28d ago), licensed MIT. It adds 2,643 tokens to every session, about $0.0106 per session on Opus 5.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

terret CLAUDE.md compared with instructions from other repositories

terret CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
terret CLAUDE.mdterret-org/terretInstructions file2428d agoMITA2,643Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode