AI Agent Quickstart
Tenon is designed for AI coding agents (Claude Code, Codex, Antigravity, Cursor, OpenCode, and custom harnesses) to read, write, check, and build with minimal token overhead.
1. Install the Tenon agent skill
The one-line installer
(curl -fsSL https://tenon-lang.org/install.sh | bash)
runs tenon setup --skills automatically. Run it
anytime to install or refresh the bundled SKILL.md in
standard agent skill directories
(~/.agents/skills/tenon/ and
~/.claude/skills/tenon/):
tenon setup --skills
2. Prime the agent context
Emit a token-budgeted primer tailored to the task at hand:
tenon prime --task cli
# Available tasks: general, cli, tui, mcp, agent, web, plugin
# Optional: --budget <tokens> --json
Inspect the 105 bundled edition = "2026" plugin
APIs (including the 15 std_* domain facades and
standard packages, plus
fsm/fsm_gen/fsm_test) on
demand without reading source trees:
tenon plugins index --all
tenon doc --card tui --json
3. Read,
write, and edit canonical terse UTF-8 .tn
Tenon stores canonical terse UTF-8 .tn source on
disk (M26+, ADR-0314),
supporting compound assignments (+=), implicit tail
returns, = expr function bodies, deep
with lenses, ??,
let ... else, typed holes (todo("...")),
and requires/ensures contracts. Legacy
compact ~1 files remain readable transparently.
# Write a new file directly as canonical terse UTF-8
tenon write app/helper.tn <<'EOF'
fn greet(name: str) -> str = name
EOF
# Inspect any .tn file (or structured AST/outline JSON)
tenon view app/helper.tn
tenon view app/helper.tn --json
# Edit an existing function in place
tenon edit replace-fn app/helper.tn greet
Single-file manifestless #! scripts
(ADR-0319) run directly without
tenon.toml:
tenon ./script.tn --arg value
4. Add plugins, auto-fix, constrain decoding, and verify
tenon add std_data
tenon check --fix --json
tenon holes --json
tenon grammar --surface ordinary --root expr --format gbnf
tenon test
tenon profile ./app
tenon install
tenon check --fix --jsonapplies safe deterministic fixes and returns structured Oracle JSON diagnostics (expected_type,actual_type,callee_signature,in_scope, rankedcandidatespatches, ADR-0322).tenon check --assert-pure/--assert-totalenforces capability purity and check-free totality (ADR-0320).
5. Connect via MCP
(tenon mcp serve)
Expose Tenon's compiler, documentation cards, and workspace tools over stdio JSON-RPC to any MCP-compatible host:
tenon mcp serve
Example MCP client configuration:
{
"mcpServers": {
"tenon": {
"command": "tenon",
"args": ["mcp", "serve"]
}
}
}
Verify the server responds to initialize and
tools/list over stdio, or run the end-to-end
qualification harness in bench/onboarding-smoke/README.md.
6. Run the
bundled coding harness (tenon harness)
Tenon ships a fast, sandboxed Tier-0 coding harness
(tenon harness) backed by harness_aci,
harness_policy, harness_verify,
harness_rewind, and agent_obs. It
defaults to a local OpenAI-compatible llama-server
($TENON_HARNESS_URL or
http://127.0.0.1:18083/v1) with a compact fixed
prefix (< 2K tokens) for high KV-cache hit
rates:
# Pre-build and cache the bundled harness binary once
tenon harness warmup --json
# Run a fast Tier-0 task against local llama-server (default http://127.0.0.1:18083/v1)
TENON_HARNESS_MODEL=inkling-2-mini \
tenon harness --policy-preset workspace-edit --json "Fix the failing test in main.tn"
# Opt-in semantic MCP bridge, escalation handoff, and secret-redacted trajectory capture
tenon harness --mcp --escalate probe-k1 --record-trace ./traces "Add --json flag to CLI"
Key flags:
--provider local|openai|anthropic|script(default:local)--base-url URL/--model NAME/--api-key-env VAR--policy-preset readonly|workspace-edit|strict(or--policy <file.json>)--mcp(adds 2-toolsearch_tools+actionrouter),--no-auto-fix,--verify-cmd CMD--escalate [probe-k1|teacher:<model>](writesharness.escalation/v1JSON on breaker trip/verify fail/turn limit)--record-trace DIR(harness.trace/v1JSONL with secret redaction;--trace-origin live_work|synthetic_bank|eval)- Exit codes:
0=ok,2=usage/config,3=schema,4=policy,5=budget/timeout,6=runtime
Split
Architecture: tenon harness vs
coding-harness-2
| Surface | Best For | Architecture |
|---|---|---|
tenon harness (bundled in
tenon) |
Fast everyday Tier-0 single-agent tasks (bug fixes, small features, API discovery, CI scripts) | Compact < 2K prefix, 6-tool
harness_aci, zero-turn tenon check --fix
+ harness_verify delta, opt-in
--escalate handoff |
coding-harness-2
(../coding-harness-2) |
Multi-agent Harness² evolution, deep multi-file refactors,
EXPERIENCE.md domain learning, parallel branches |
Full multi-stage planner/verifier/evolution loop consuming
EscalationHandoff and shared
harness_aci/harness_policy plugins |
Verify the bundled harness end-to-end with bench/harness-cli/smoke.py.