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.
npx skills add terva-sh/terva --skill write-terva-extensiongit clone --depth 1 https://github.com/terva-sh/tervaWrote 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/skills/terva-sh/terva/write-terva-extension)<a href="https://agentmods.dev/skills/terva-sh/terva/write-terva-extension"><img src="https://agentmods.dev/badge/skills/terva-sh/terva/write-terva-extension/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/skills/terva-sh/terva/write-terva-extension"><img src="https://agentmods.dev/badge/skills/terva-sh/terva/write-terva-extension.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.00067 | $0.05030 |
| Opus 5.5 | $0.00027 | $0.02012 |
| Sonnet 5.5 | $0.00013 | $0.01006 |
| Haiku 4.5 | $0.00007 | $0.00503 |
Grade C, and why
write-terva-extension scanned grade C with 1 finding 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
"tool_name":"bash","tool_args":{"command":"rm -rf /tmp/foo"}} How it starts
The opening of the file, as written. The whole thing — 495 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Writing a terva extension
Use this skill when the user asks for help building a terva extension — a new slash command, a new tool the LLM can call, an audit hook, or a permission gate. Skim this whole skill first, then collaborate with the user on the specific extension they want.
What an extension is
A terva extension is an external executable that terva launches as a subprocess and talks to over its stdin/stdout in newline-delimited JSON. It can be written in any language that can read/write JSON lines from stdio: Go, TypeScript (via tsx), Python, Rust, shell with jq, anything. Crash isolation is automatic; one bad extension never takes down terva.
Three things an extension can do (any combination):
-
Slash commands — register
/fooso the user can run it from the input. The handler returns a "prompt" (submitted to the agent), an "insert" (text dropped into the editor), a "display" (one-shot styled note in the chat), or a "noop". -
Tools — register tools the LLM itself calls. Schema is JSON Schema; terva routes the model's
tool_callto the extension'stool_result. Same lifecycle as built-in tools (read/write/edit/bash/skill). -
Lifecycle hooks — subscribe to events (session_start, turn_start, tool_call, turn_end, assistant_message) for telemetry / audit / custom UI, or intercept tool calls before execution to refuse dangerous patterns.
-
Model context & tool visibility — fold standing guidance into the system prompt (
register_context/refresh_context) and hide tools that can't do anything useful in the current workspace (set_withdrawn_tools). These touch the model's cached prefix, so they carry a discipline — see "Being responsible with context & tools" below before reaching for them.
On-disk layout
Each extension lives in its own directory:
~/Library/Application Support/terva/extensions/<name>/
├── extension.json # manifest (required)
└── <executable> # whatever exec points at
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 Changed · +21 lines 50aab4388b66
- 3mo ago First seen · 474 lines · 67 tokens per session scan C a0f578ae519b
write-terva-extension is a skill published in the GitHub repository terva-sh/terva (5 stars, last pushed today), licensed MIT. It adds 67 tokens to every session and 5,030 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
write-terva-extension compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| write-terva-extensionterva-sh/terva | Skill | 5 | today | MIT | C | 67 | Claude Code, Codex |
| pi-syncsky-valley/pi | Skill | 96 | today | MIT | A | 66 | Claude Code |
| pi-go-reviewsky-valley/pi | Skill | 96 | today | MIT | A | 45 | Claude Code |
| sls-dashboard-builderalibaba/loongsuite-pilot | Skill | 275 | today | Apache-2.0 | A | 72 | Claude Code, Codex |
| agentloop-audit-dashboardalibaba/loongsuite-pilot | Skill | 275 | today | Apache-2.0 | A | 149 | Claude Code, Codex |
| loongsuite-pilot-opsalibaba/loongsuite-pilot | Skill | 275 | today | Apache-2.0 | A | 15 | Claude Code, Codex |
| code-guidelines-godimetron/pi-go | Skill | 235 | today | MIT | A | 124 | Claude Code, Codex |