PROJECT · TOK0 / FIELD COMPRESSION UNIT
SERIAL NO. 0.1.1 · BUILT IN RUST · MIT
OPEN SOURCE — SHELL OUTPUT COMPRESSION PROXY TOK0 · DOCS >>> REFERENCE

Configuration

Every knob tok0 exposes — config file, environment variables, project trust, opt-in features. Defaults are good; this page is for when they aren't.

tok0 is intended to be invisible after tok0 init. You should never need to edit a config file. When you do, this is the canonical reference.

Config file location

~/.config/tok0/config.toml

On Windows: %APPDATA%\tok0\config.toml. On macOS: same as Linux (XDG-style, not ~/Library/Application Support).

The file is created on first run if it doesn’t exist. Every field is optional.

Full schema with defaults

[general]
# Where the SQLite token meter lives.
database_path = "~/.config/tok0/meter.db"
# Where snapshots get written when a filter falls back.
snapshot_dir  = "~/.cache/tok0/snapshots"
# Hard ceiling for any single command's output, post-pipeline.
max_chars     = 8000

[runtime]
# Time budget for any single wrapped command before tok0 kills it.
command_timeout_secs = 60
# If a filter errors, write the raw stdout to snapshot_dir for debugging.
snapshot_on_failure  = true

[bridge]
# Skip prompting on first run; useful in CI where stdin isn't interactive.
non_interactive = false
# Pin which AI tools tok0 should detect. Empty = all.
tools = []  # ["claude-code", "cursor", "gemini-cli", ...]

[telemetry]
# Off by default. Even when on, this is anonymous instance metrics —
# no command output, no paths, no identifiers.
enabled = false
endpoint = "https://api.tok0.dev/telemetry"

[updater]
# Check GitHub Releases for new versions.
auto_check = true
# Channel: "stable" | "beta"
channel    = "stable"

[cloud]
# Only used when the binary is built with --features cloud.
api_url = "https://api.tok0.dev"

Environment variables

Env vars override the config file when set.

VariableEffect
TOK0_CONFIGPath to an alternate config file.
TOK0_DB_PATHOverride general.database_path.
TOK0_DISABLEIf set to 1, tok0 passes through every command unchanged. The bypass switch.
TOK0_QUIETSuppress non-error stderr output.
TOK0_LOGerror (default), warn, info, debug, trace.
TOK0_TIMEOUT_SECSOverride runtime.command_timeout_secs.
TOK0_NO_TELEMETRYIf set, telemetry is forcibly off regardless of config.
NO_COLORStandard. Disables tok0’s own ANSI output.
Tip

TOK0_DISABLE=1 is the safest way to verify a regression is caused by tok0. Set it, re-run, compare.

Filter search paths

Custom rules are loaded from three locations in priority order:

  1. .tok0/filters/*.toml — project-local, requires tok0 trust ..
  2. ~/.config/tok0/filters/*.toml — user-global, no trust prompt.
  3. Built-in (embedded in the binary).

See Writing TOML rules for the schema.

Trust gating

Project-local rules can ship arbitrary regexes that get applied to your shell output. tok0 treats them as untrusted by default:

cd ~/projects/my-repo
tok0 trust .                   # opt this project in
tok0 untrust .                 # revert
tok0 trust list                # show all trusted projects

Trust is stored in ~/.config/tok0/trust.toml keyed by absolute path. Moving or renaming the project invalidates the trust entry. This is intentional — same model as VS Code workspace trust.

Bridge state

Hooks are written into each AI tool’s own config dir, not into tok0’s. Where they go:

ToolHook surface
Claude Code~/.claude/settings.json (PreToolUse hook)
CursorSettings → Rules (manual paste-in)
Gemini CLI~/.gemini/GEMINI.md
Windsurf~/.codeium/windsurf/memories/...
Cline~/Documents/Cline/Rules/tok0.md
Amp~/.config/amp/AGENTS.md
OpenCode~/.config/opencode/AGENTS.md
Codex~/.codex/AGENTS.md
Kimi Code~/.kimi/tok0.md

tok0 status shows which surfaces are wired and the integrity hash of each one. tok0 verify re-checks every hook against tok0’s signed manifest — catches drift, manual edits, or tampering.

Resetting

tok0 init --remove   # remove every hook tok0 installed
rm -rf ~/.config/tok0 ~/.cache/tok0   # nuke local state

If you want to keep historic stats but reset hooks, just run tok0 init --remove — the meter database stays.

BUILT IN RUST · SINGLE STATIC BINARY · 8 MB v0.1.1 / MIT GITHUB.COM/PRXM-LABS/TOK0