Agent Notation

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

SymbolMeaningExample
(->)Flow / mappingfn(x)→int
>Sequence stepvalidate>log>ret
?Conditionalerr?retry|fail
|Else branchok?save|log
&&Logical ANDauth&&valid
||Logical ORcache||fetch
#State prefix#cs role:agent
×(*)Group-bytop5×rev
+Combine / andlog+ret.fail
!Negation!hallucinate
:Type annotationx:int
[]List suffixint[]
~Durationcache~1h
@Targetesc@human

Common Abbreviations

ShortFull
fnfunction
pyPython
jsJavaScript
tsTypeScript
ctxcontext
retreturn
intinteger
strstring
boolboolean
rptreport
descdescending
escescalate
svcservice
amtamount
cfgconfiguration

7 Compression Rules

  1. Drop filler — remove articles, copulas, hedging words
  2. Abbreviate — use standard abbreviations (function fn)
  3. Use operators — replace verbal relationships with symbols (returns )
  4. Annotate types — use colon syntax (x:int)
  5. Comma-separate — list parallel operations
  6. Key-value pairs — for configuration (tone:formal)
  7. 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:

  1. Language prefix: js
  2. Abbreviate: async fn, usr, db, val, res, fmt, doc, err, msg
  3. Add operators: for flow, | for alternative

Result:

js async fn: usr db→val(res)→fmt doc:json | err msg

Try it in the Playground →

CLI

Install

bashnpm install -g @agentnotation/cli

Or 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 --batch

expand — 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 --batch

validate — Check notation syntax

bashanot validate "fn(x:int)→int"
# ✓ Valid Agent Notation

anot validate "fn((x)"
# error: Unbalanced parentheses

lint — 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 VSIX

Features

  • Syntax highlighting — operators, abbreviations, and comments in .tforge and .tf files
  • 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.txt

For the comprehensive machine-readable reference, point the model to llms-full.txt.