write-terva-lore

write-terva-lore is a skill for Claude Code, Codex from terva-sh/terva. It costs 66 tokens per session (2,077 once invoked), scanned A, original, MIT.

Instructions for writing terva lore: Markdown background notes that terva adds to the model’s context when matching keywords appear.

In plain words
What is it for?
Use them for settings, character or NPC backgrounds, glossaries, and other facts that should be supplied only when needed.
Why use it?
They keep domain facts available when relevant without placing every fact into every conversation or adding tools and permissions.

Skill for Claude CodeCodex

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 skills/terva-sh/terva/write-terva-lore
Any agent
npx skills add terva-sh/terva --skill write-terva-lore
Clone the repo
git clone --depth 1 https://github.com/terva-sh/terva

Made for: Claude Code, Codex.

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 write-terva-lore

README.md
[![agentmods](https://agentmods.dev/badge/skills/terva-sh/terva/write-terva-lore.svg)](https://agentmods.dev/skills/terva-sh/terva/write-terva-lore)
Your own site
<a href="https://agentmods.dev/skills/terva-sh/terva/write-terva-lore"><img src="https://agentmods.dev/badge/skills/terva-sh/terva/write-terva-lore.svg" alt="Measured on agentmods" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,077 The whole file, excluding the scripts and references it only reads on demand.
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.00066 $0.02077
Opus 5 $0.00033 $0.01038
Sonnet 5 $0.00013 $0.00415
Haiku 4.5 $0.00007 $0.00208

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

Security

Grade A, and why

write-terva-lore 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.

packages/agent/skills/builtin/write-terva-lore/SKILL.md · 200 lines

How it starts

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

Writing terva lore

Use this skill when the user asks to create, add, or write lore — keyed background context, "world info", a lorebook, or facts that should reach the model only when they matter. Skim it first, then write the entries where terva discovers them.

Lore is terva's keyed-context primitive: authored Markdown snippets injected into the model's context when a trigger keyword appears in recent messages (or always, for a constant entry), within a token budget. It is the general form of a SillyTavern character card's character_book — a card's book imports straight onto the same engine.

Lore vs persona vs skill vs card — pick the right one

  • Lore is what the world knows: keyed facts injected on relevance. Reach for it for background, setting, NPC bios, glossaries — "when X comes up, the model should know Y."
  • A persona (write-terva-persona) is who is helping: identity + charter, always present.
  • A skill (write-terva-skill) is how to do a task: a procedure loaded on demand.
  • A character card (write-terva-card) is a portable CCv2 identity that can carry lore in its character_book.

Lore adds no tools and changes no permissions; it only contributes context.

Where lore lives

Entries are discovered (recursively — every *.md except README.md) from three tiers, highest priority first:

tier location note
project <cwd>/.terva/lore/ trust-gated — an untrusted workspace contributes none
personal $TERVA_HOME/lore/ your own, every session
bundle <ext>/lore/ of each enabled extension ships with an extension

Unlike personas, entries are not name-shadowed — every entry from every tier can fire. Collection-level settings live in a lore.json at a directory root (the highest-priority lore.json wins).

Anatomy of an entry

One entry per Markdown file: YAML frontmatter + the content body.

---
name: The Sunken Bell
keys: [bell, fog-bell, tolling]
---

Beneath the harbor hangs the old fog-bell, rung only when the mist swallows the
lighthouse beam. Sailors say it tolls on its own before a wreck.

Read the full file on GitHub · 200 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 · 200 lines · 66 tokens per session scan A 186d1da76017

Subscribe to this mod's changes

write-terva-lore is a skill published in the GitHub repository terva-sh/terva (2 stars, last pushed 3d ago), licensed MIT. It adds 66 tokens to every session and 2,077 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

memory-index

Index a folder's contents into the MemPalace semantic memory for search and retrieval. Use this skill whenever the user asks to "index a folder", "index a directory", "index memory", "mine a project into memory", "make a folder searchable", "embed a folder", "ingest code into the palace", or "index this directory for…

dimetron/pi-go · 0 tokens

memory-mine

Mine project files or conversations into the MemPalace memory system. Indexes source code and conversation history as searchable palace drawers with semantic embeddings and room assignment.

dimetron/pi-go · 35 tokens

memory-status

Show MemPalace memory system status — drawer counts, wings, rooms, knowledge graph stats, and embedding model state.

dimetron/pi-go · 27 tokens

pi-sync

Daily upstream-sync job for the pi Go port — fetch upstream pi, triage every change since the recorded pin, port what's in scope, verify idiomatic + parity via independent reviews, update the ledger, and push. Use for "sync with upstream", "porting job", or as the scheduled daily run.

sky-valley/pi · 66 tokens

dream-memory

Consolidate recent logs, sessions, and existing memory files into durable topic memories, normalize dates, prune stale entries, and keep MEMORY.md short enough for prompt use.

LearnPrompt/cc-harness-skills · 37 tokens

memory-extractor

Extract durable memories from recent conversation turns into user, feedback, project, and reference categories while avoiding stale code-state facts.

LearnPrompt/cc-harness-skills · 28 tokens