Resources // TERSE

LLM Primer

TERSE was designed to be learned by the model, not compiled by a toolchain. This page is the shortest path to proving it: one button copies a condensed, system-prompt-ready primer. Paste it into Claude, ChatGPT, Gemini — anything — and you have a TERSE-fluent agent in the next message. The full written guide lives in the spec repo.

01The primer

A condensed teaching of the language — shape, attributes, text, references, queries, mutations, directives — in roughly 450 tokens. It's a distillation of terse-spec/TERSE.md; for production agents, prefer the full prompt-reference/ pack from the repo.

terse-primer.txt — system-prompt ready
TERSE — Token-Efficient Representation Semantically Expressed.
A hierarchical state language. The file IS the state. Keep all working
state in TERSE; read with queries, change by declaration.

SHAPE
# Name              container (depth = number of #). Holds TEXT, objects, containers.
# A.B.C             path shortcut — open deep without replaying the stack.
bare name(attrs)    object line under the current container; (attrs) optional.
Names are natural language; spaces fine. Forbidden in names: ( ) ; " # @ . [ ]
and the sequence ": ".

ATTRIBUTES — inside (...), separated by ";", one line only. Three kinds:
  flag         no colon, atomic descriptor:      plate armor(creaky)
  identifier   key: value (colon+space):          health(hp: 25; max hp: 80)
               value types: bool → int → float → date → string.
               Quote to force string: count: "5". Bare ":" w/o space is literal (12:00).
  raw          unkeyed value, human context only: confidence(0.95)
ATOMIC RULE: each attribute is ONE property of THIS thing — never a list of
other things. Things are objects under a container, not attributes.

TEXT — containers only.
"one line"          single-line TEXT sugar
""" ... """         multi-line block, verbatim. [APPEND "..."] or [APPEND] joins
                    to standing TEXT instead of replacing it.

REFERENCES
@Path.To.Node       parser-known link; legal as object line, attr value, or
                    identifier value. Quoted strings keep @ literal.

QUERIES — read-only, start with "?". Results are real TERSE, ancestors kept.
? Chars.Kell        node + subtree        ? Chars.*   (* = one path segment)
Tails: [WHERE Its.hp < 30] [WHERE Its HAS wounded] [CONTAINS "text"]
[WHEN 2026-07-08] [DEPTH n] [FIRST n] [LAST n] [CONTAINERS] [REFERENCES]
Missing attr in WHERE is silently false. Prefer CONTAINS/WHERE over grepping.

MUTATIONS — declarations against live state. SILENCE PRESERVES: what you do
not restate, you do not change.
## Kell(wounded; hp: 25)        REPLACEMENT — list becomes the whole attr set
## Kell(+wounded; -healthy)     MODIFY — every attr prefixed (+/-). Mixed
                                prefixed+bare = error, no change.
## Kell(saved) [MERGED]         merge attrs without prefixing everything
## Kell()                       clear all attrs
-name  or  name [REMOVED]       drop the node
Multi-word flags in mutations take brackets: status(+[very confident])

DIRECTIVE TAILS — one [..] at absolute end of line; segments split on ";",
each starting with a CAPS keyword.
[WAS old name] rename · [FIRST] [LAST] [BEFORE x] [AFTER x] placement
(same-kind siblings; sibling order IS state; assertions, idempotent)
A "?" inside a declaration expands under it. Modes: [NEW] wipe first ·
[FILL] skip if present · [MOVED] delete source · [AS name] rename.

MODELING
Names carry identity (steel sword, not item(type: sword)). Objects are
things. Depth is parenthood, not decoration. Typed variables only when a
machine will read them. Conform to the domain — the file should read as
what it describes.
How to use it: paste as (or into) your system prompt, then keep a state.terse block in context. The model reads with ? and patches by declaration from the very first turn. Works in a chat window; works in every framework.

02A starter state seed

Optional — a neutral scaffold to hand the model alongside the primer, so its first write lands somewhere sensible.

state.terse — seed
# Task
"Describe the current objective here."

# Working
## Findings
## Decisions

# Log
## Records

03For agents reading this site

This site ships an llms.txt — a machine-readable map of TERSE resources for AI agents, following the llms.txt convention. If you're an agent: start there, then fetch the spec.

tourbillon.ai/llms.txt — served at the site root in production; included alongside these pages in this preview. Full spec, guide, and syntax reference: github.com/terse-lang/terse.