Skip to content

Token counts

How many tokens an agent reads to write VibeLang, and how many a VibeLang program takes beside the Effect TypeScript it replaces.

An agent that writes VibeLang loads the skill first: its forms, rules and idioms, with a link to the page that owns each one. The vibelang npm package ships it at node_modules/vibelang/skills/vibelang/SKILL.md.

Method

  • Tokenizer: OpenAI's o200k_base encoding, through js-tiktoken 1.0.21. No Anthropic count is published: Anthropic offers no verified offline tokenizer for its current models, and these docs do not estimate one.
  • Pages: each file's exact, complete Markdown source, nothing stripped. This page is not counted.
  • Cheat-sheet pairs: each entry's paired code blocks as written, after removing the docs checker's directives. Imports written in those blocks are counted. Shared declarations and companion files outside the paired blocks are excluded. Some fragments need a surrounding Effect.gen body.
  • Reference programs: each program's exact, complete source, with its imports, whitespace and final newline. Nothing is removed.
  • Scripts: docs/tools/token-counts.ts in the VibeLang repository measures the loads, the cheat-sheet pairs and the page sizes. bun docs/tools/token-counts.ts --check fails when this page drifts from what it measures, and --write updates it. docs/user/benchmarks/reference-tokens/count.mjs measures the reference programs.

Thirty reference pairs

The repository's benchmark-30/v1 suite has 30 tasks in six categories. Each task has a reference pair: two programs that solve it, one in VibeLang and one in Effect TypeScript. This table counts both programs of every reference pair.

CategoryReference pairsEffect TypeScriptVibeLangSaved
Typed Errors & Recovery51,17079032.5%
Services & Layers593765929.7%
Structured Concurrency567147828.8%
Resource Safety & Streams582259028.2%
Platform & Boundary Soundness582266918.6%
Effect UI Components51,7611,50214.7%
All 30 reference pairs306,1834,68824.2%
  • Across the 30 reference pairs, the VibeLang programs take 4,688 tokens and the Effect TypeScript programs take 6,183: 24.2% fewer in total.
  • VibeLang is shorter in all 30 reference pairs.
  • The saving in one reference pair runs from 5.4% to 43.7%, with a median of 26.9%.
  • In characters, the totals are 17,391 and 23,982: 27.5% fewer.
  • The Effect TypeScript programs run from 102 to 481 tokens each.

The reference token count produced these numbers. Its results.json records both counts of every reference pair and the SHA-256 of each source file. node count.mjs there counts again and fails when results.json differs.

What the count shows

A token count is the size of the source text. A person reads that text and a model reads or writes it, so a smaller count means less text for either. The count is exact for a model that uses o200k_base. Other models' tokenizers give other counts.

The count does not show more than that:

  • No model ran. The count says nothing about whether an agent finishes a task, how long it takes or what it costs.
  • The project wrote both programs of every pair. A different author could write either side shorter or longer.
  • The count does not compile or run the programs. The suite's own verifier does that. It needs a compiler build, and the linked README names it.

Two measurements, two totals

This page reports two savings, and they do not combine. Each has its own programs and its own total.

AspectReference pairsCheat-sheet entries
TableThirty reference pairsEffect TypeScript beside VibeLang
One rowA category of five reference pairsOne snippet that shows one form
What is countedThe whole file. Every Effect TypeScript program imports from effect.The paired code blocks. Shared declarations outside them are excluded.
Where VibeLang is longerIn no reference pairIn the entries that table marks with a negative saving

A cheat-sheet entry isolates one form, and for some forms the VibeLang spelling is the longer one. A reference program solves a whole task, so it also counts the imports, declarations and signatures around those forms. Quote each saving with its own count of reference pairs or entries.

What an agent loads

LoadTokens
The VibeLang skill, packages/compiler/skills/vibelang/SKILL.md5,187
The skill and the cheat sheet17,552
The skill and the user guide (173 pages)640,000
The user guide alone630,000
The specification (11 chapters)320,000
The decision log, docs/design/history/DECISIONS.md140,000

Effect TypeScript beside VibeLang

6.7% fewer tokens across 47 pairs in total; VibeLang is longer in 20 pairs. This is the saving over the combined source tokens, not the arithmetic mean of the percentages below.

Each row is one cheat sheet entry: its Effect TypeScript blocks against its VibeLang blocks. A negative saving means the VibeLang snippet is longer.

EntryEffect TypeScriptVibeLangSaved
Effect types816223.5%
Errors36975.0%
Errors are classes97898.2%
Errors that encode371267.6%
Services373116.2%
Services of any shape574324.6%
Layers45442.2%
Schemas482743.8%
Schema aliases261061.5%
Data types411465.9%
Readonly members14140.0%
Statements instead of generators4749-4.3%
Programs as Effect values2830-7.1%
Providing layers362822.2%
Providing one service635414.3%
Catching by tag50492.0%
Falling back in an expression403025.0%
Catching in an expression4748-2.1%
Entry point2238-72.7%
Catch every cause4950-2.0%
Rethrow a cause3552-48.6%
Run on every exit2931-6.9%
Exit, yield, and interrupt3338-15.2%
Interruption6566-1.5%
No imports from effect or its subpath packages291644.8%
Look up platform services633150.8%
Effect's functions without the Effect. prefix433420.9%
Operators on Effect's data types54531.9%
The pipe operator342720.6%
Fail on a missing value4143-4.9%
Blocks as values3448-41.2%
Effect blocks as arguments7783-7.8%
Match a value614034.4%
Match errors by class594327.1%
Match a data type's variants2955-89.7%
Option, Exit, and Result6062-3.3%
Test and bind4445-2.3%
Native await189267-41.3%
TypeScript companion files883065.9%
Fork and join433518.6%
Wait for several6266-6.5%
First success, all outcomes52495.8%
Fork scoped work523925.0%
Detached and scoped fibers3550-42.9%
Wait for a Deferred3034-13.3%
Race4366-53.5%
A concurrent loop403610.0%
All 47 entries2,3252,1706.7%

Every page

Onboarding

PageTokens
Start Here8,100
Welcome3,500
Why VibeLang?3,100
A Real Provider, Before and After1,500
Learning Path11,000
The Effect Type2,100
Installation2,500
Creating Effects2,900
Two Types of Errors960
Basic Concurrency2,100
Core Concepts15,000
Effect's Modules2,100
Running Effects1,400
Sequencing Effects1,200
Building Pipelines1,500
Devtools9,100
All 13 pages34,000

Setup

PageTokens
Set up VibeLang1,900
What is in the alpha3,700
Source maps920
Docs freshness1,800
Start a project5,500
New project620
Existing project2,000
Migrating retired forms2,900
Build and test8,900
vibelang CLI6,600
Vite and Vitest2,400
Format and lint11,000
Format with dprint2,000
Developer tools8,600
Frameworks15,000
Effect UI3,900
React1,900
React Native and Metro530
Vue2,700
Svelte2,400
Foldkit3,300
Editors5,100
VS Code and Cursor1,200
Neovim1,200
Zed840
Other editors740
Coding agents1,100
Keep .ts file names1,700
VibeLang in .ts files1,700
Upgrade210,000
Release notes210,000
All 24 pages270,000

Guides

PageTokens
Getting Started1,400
Error Management14,000
Expected Errors3,200
Unexpected Errors1,200
Fallback1,100
Matching970
Retrying970
Timing Out960
Sandboxing910
Error Accumulation800
Error Channel Operations1,600
Parallel and Sequential Errors890
Custom Error Classes1,300
Requirements Management6,600
Managing Services1,800
Default Services1,400
Managing Layers2,300
Layer Memoization1,200
Resource Management4,300
Introduction1,500
Scope2,800
Observability7,400
Logging2,300
Metrics1,700
Tracing2,400
Tracking Fibers1,000
Configuration3,000
Runtime1,600
Scheduling5,700
Using schedules1,100
Choosing and combining schedules1,800
Scheduling work with cron1,400
Schedule cookbook1,400
State Management3,000
Ref1,200
SynchronizedRef950
SubscriptionRef890
Batching3,000
Caching2,300
Caching Effects1,100
Cache1,200
Concurrency7,800
Fibers2,000
Deferred1,200
Queue1,600
PubSub1,400
Semaphore890
Latch740
Stream12,000
Introduction1,200
Creating Streams2,900
Consuming Streams1,000
Error Handling1,800
Operations4,300
Resourceful Streams860
Sink5,000
Introduction760
Creating Sinks2,500
Operations1,000
Leftovers830
Testing1,900
TestClock1,900
Code Style8,400
Guidelines830
Dual APIs1,000
Branded Types1,700
Pattern Matching1,800
Excessive Nesting1,100
Control Flow Operators1,900
Data Types18,000
BigDecimal1,500
Cause1,400
Chunk1,100
Data1,600
DateTime3,200
Duration1,500
Result1,700
Exit1,400
HashSet1,700
Option2,500
Redacted870
Trait1,800
Equal1,100
Hash690
Behaviour2,400
Equivalence790
Order1,600
Schema30,000
Introduction1,100
Getting Started1,700
Basic Usage3,300
Filters1,400
Advanced Usage2,800
Projections690
Transformations2,100
Annotations1,000
Canonical Codecs1,200
Error Messages1,400
Error Formatters1,000
Class APIs1,700
Default Constructors1,300
Effect Data Types1,700
Standard Schema760
Arbitrary1,600
JSON Schema1,700
Equivalence710
Formatter510
Schema Compilers1,900
Platform18,000
Introduction2,700
FileSystem1,300
Path830
PlatformLogger750
Runtime1,300
Terminal1,600
Platform globals in VibeLang6,800
Cloudflare Workers710
Alchemy2,300
All 101 pages160,000

VibeLang features

PageTokens
Handlers (open proposal, not in the alpha)160
Producers1,500
Building an HTTP API1,900
VibeLang for Effect users4,700
Cheat sheet12,000
Pattern matching with match and is3,900
Benchmarks: humans and agents4,400
Vibe a Lang: ontology & domain DSLs4,200
Human & machine syntax mode2,200
Typed SQL queries1,700
Calling native code2,400
Diagnostic code map11,000
Imported lint diagnostics13,000
Experimental platform APIs37,000
Serializable tagged unions with schema data2,300
Handle errors by tag with catch2,100
Vibe in .ts files with // @vibe1,900
TypeScript inside a .vibe file with module declarations1,100
JSX in .vibex files910
Brands and refinements on schemas800
Declare HTTP APIs with api880
Clean up with defer820
All 22 pages110,000

Experimental

PageTokens
Durable workflows9,000
Build agents8,000
Durable tasks and workflows2,000
Fuzzing with Experimental.Fuzz3,400
Spec functions and proofs3,600
Observability with Experimental.Otlp3,200
Sandboxes with Experimental.Sandbox3,100
Test agentic programs with Experimental.Test3,900
Schema services and worker imports2,800
Orchestration patterns and PACKAGE.vibe3,200
Ahead-of-time compilation4,000
All 11 pages46,000

For teams

PageTokens
VibeLang for your team370
Why we trust Vibe works17,000
All 2 pages17,000

Specification

PageTokens
Introduction3,400
The language130,000
1. Functions and Effect types14,000
2. Running Effects30,000
3. Failures11,000
4. Pattern matching25,000
5. Services and the environment16,000
6. Data9,900
7. Configuration and tooling18,000
8. Runtime guarantees8,000
Appendices180,000
Grammar, diagnostics, and denied and open VIPs160,000
Module resolution matrix27,000
All 11 pages320,000