Get Started
Everything you need to start saving tokens with Agent Notation.
Learn the Notation
Agent Notation is a human-readable shorthand for LLM prompts. It replaces verbose English with compact symbols and abbreviations, cutting token costs by up to 63% while preserving full meaning.
Operators
| Symbol | Meaning | Example |
|---|---|---|
→(->) | Flow / mapping | fn(x)→int |
> | Sequence step | validate>log>ret |
? | Conditional | err?retry|fail |
| | Else branch | ok?save|log |
&& | Logical AND | auth&&valid |
|| | Logical OR | cache||fetch |
# | State prefix | #cs role:agent |
×(*) | Group-by | top5×rev |
+ | Combine / and | log+ret.fail |
! | Negation | !hallucinate |
: | Type annotation | x:int |
[] | List suffix | int[] |
~ | Duration | cache~1h |
@ | Target | esc@human |
Common Abbreviations
| Short | Full |
|---|---|
fn | function |
py | Python |
js | JavaScript |
ts | TypeScript |
ctx | context |
ret | return |
int | integer |
str | string |
bool | boolean |
rpt | report |
desc | descending |
esc | escalate |
svc | service |
amt | amount |
cfg | configuration |
7 Compression Rules
- Drop filler — remove articles, copulas, hedging words
- Abbreviate — use standard abbreviations (
function→fn) - Use operators — replace verbal relationships with symbols (
returns→→) - Annotate types — use colon syntax (
x:int) - Comma-separate — list parallel operations
- Key-value pairs — for configuration (
tone:formal) - Conditionals — use
?and|for branches
Worked Example
English:
Write a JavaScript async function that fetches user data from the database,
validates the response, and returns a formatted JSON document, or returns
an error message if validation fails.Step by step:
- Language prefix:
js - Abbreviate:
async fn,usr,db,val,res,fmt,doc,err,msg - Add operators:
→for flow,|for alternative
Result:
js async fn: usr db→val(res)→fmt doc:json | err msgCLI
Install
bashnpm install -g @agentnotation/cliOr use it via npx without installing:
bashnpx @agentnotation/cli compress "Write a Python function that filters even numbers"Commands
compress — English to notation
bash# From argument
anot compress "Validate user input and return formatted errors"
# From stdin
echo "Validate user input and return formatted errors" | anot compress
# JSON output
anot compress --json "Validate user input and return formatted errors"
# Batch mode (one prompt per line)
cat prompts.txt | anot compress --batchexpand — Notation to English
bashanot expand "val(usr input)→fmt err"
# JSON output
anot expand --json "val(usr input)→fmt err"
# Batch mode
cat notation.txt | anot expand --batchvalidate — Check notation syntax
bashanot validate "fn(x:int)→int"
# ✓ Valid Agent Notation
anot validate "fn((x)"
# error: Unbalanced parentheseslint — Best-practice suggestions
bashanot lint "function(x)→return y"
# warning: "function" can be abbreviated to "fn"
# warning: "return" can be abbreviated to "ret"stats — Compare token costs
bashanot stats \
--english "Write a Python function that filters even numbers" \
--notation "py fn: filter even nums"
# English: 9 tokens | Agent Notation: 7 tokens | Savings: 22%VS Code Extension
Install
Coming Soon
The extension is not on the VS Code Marketplace yet. To install locally, build the VSIX from the repo:
bashcd vscode-extension
npm install && npm run package
# Install the .vsix in VS Code: Extensions → ⋯ → Install from VSIXFeatures
- Syntax highlighting — operators, abbreviations, and comments in
.tforgeand.tffiles - Inline diagnostics — validation errors and lint warnings appear as you type
- Hover tooltips — hover any abbreviation to see its expansion
- Autocompletion — suggests abbreviations and operators as you type
- Token count — live token count in the status bar
- Compress / Expand commands — right-click or use the command palette
Cursor & VS Code Forks
The extension works in Cursor, Windsurf, and other VS Code forks. Install the VSIX the same way.
AI Tool Integrations
Teach any AI tool to read and write Agent Notation. Pick your tool below for copy-pasteable setup instructions.
Paste this into any model's system prompt to teach it Agent Notation:
System prompt snippet
You understand Agent Notation, a compact shorthand for LLM prompts.
Key operators: → (flow/returns), > (sequence), ? (conditional), | (else),
&& (AND), || (OR), # (state prefix), ~ (duration), @ (target), × (group-by),
+ (combine), ! (negate), : (type), [] (list).
Common abbreviations: fn=function, ret=return, val=validate, ctx=context,
cfg=configuration, req=request, res=response, msg=message, err=error,
auth=authentication, db=database, usr=user, doc=document, fmt=format,
py=Python, js=JavaScript, ts=TypeScript.
When you receive notation, expand it to understand the full intent.
When asked to compress, use these rules to produce compact notation.
Full reference: https://agentnotation.dev/llms-full.txtFor the comprehensive machine-readable reference, point the model to llms-full.txt.