{"id":49956671,"url":"https://github.com/dfkhelper/token-goat","last_synced_at":"2026-06-27T03:00:47.470Z","repository":{"id":358176536,"uuid":"1240275670","full_name":"DFKHelper/token-goat","owner":"DFKHelper","description":"Token burn reducer and focus keeper for Claude Code, Codex, Gemini CLI, Cline, Windsurf, Aider, Cursor, Copilot, pi, and more: session-aware read hints, 130+ bash output filters, compact manifest injection, image shrinking, prompt injection protection, and much more.","archived":false,"fork":false,"pushed_at":"2026-06-21T02:56:19.000Z","size":19640,"stargazers_count":36,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-21T04:22:29.470Z","etag":null,"topics":["ai-coding","anthropic","claude-code","cli-tool","codex","codex-cli","context-window","developer-productivity","hooks","linux","llm","llm-tools","python","token-cost","token-optimization","windows","wsl"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DFKHelper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"Zelys"}},"created_at":"2026-05-16T00:31:24.000Z","updated_at":"2026-06-21T02:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/DFKHelper/token-goat","commit_stats":null,"previous_names":["dfkhelper/token-goat"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/DFKHelper/token-goat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFKHelper%2Ftoken-goat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFKHelper%2Ftoken-goat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFKHelper%2Ftoken-goat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFKHelper%2Ftoken-goat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DFKHelper","download_url":"https://codeload.github.com/DFKHelper/token-goat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DFKHelper%2Ftoken-goat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34839888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding","anthropic","claude-code","cli-tool","codex","codex-cli","context-window","developer-productivity","hooks","linux","llm","llm-tools","python","token-cost","token-optimization","windows","wsl"],"created_at":"2026-05-18T00:14:54.173Z","updated_at":"2026-06-27T03:00:47.455Z","avatar_url":"https://github.com/DFKHelper.png","language":"Python","funding_links":["https://github.com/sponsors/Zelys"],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"AI Token Optimizer — Cuts Costs, Sharpens Focus, Blocks Prompt Injection\"\ndescription: \"Cuts AI tool costs 40–80% and guards against prompt injection. Stops re-reads, extracts one function vs. whole file, shrinks screenshots 97%.\"\nimage: /token-goat/assets/goat-social.png\npermalink: /\n---\n\n# Token-Goat\n\n![Token-Goat](assets/logo.png)\n\n**85%** smaller reads · **97.4%** image compression · **160+** filter \u0026 interception rules · **94–99%** skill overhead cut · compaction memory · **prompt injection** guard · **3.7 GB** never reached the model · **1.1 Gt** tokens saved\n\n**Reduces AI token use/costs by 40–90%, and improves its focus. Fully automated, always online.**\n\n**Also defends against prompt injection. Every fetched page is scanned for attack patterns and wrapped in an untrusted-content fence before hitting the model. One config line to disable.**\n\n**Your AI re-reads the same file three times. Every compaction causes amnesia. Every build log buries the one line that matters. You pay for all of it. Token-Goat fixes all of it — automatically.**\n\nToken-Goat sits silently between your AI and your tools. Re-read a file? It gets a one-line hint and a narrow-slice suggestion instead of the full file again. Grab a screenshot? A 100 KB copy reaches the model instead of 10 MB. Run `pytest`, `npm install`, `docker build`, or `cargo`? The thousands of progress bars and passing-test names are stripped to the failures before the output even reaches the context window. Open a PDF, a large Markdown doc, or a CSV? The hook intercepts it — heading tree, page count, or column preview — so the model never pays for the full file. Run `gh run watch` or `next dev` a second time? Prior output is recalled rather than re-run. Compact a long session? It gets a clean structured manifest of edited files and key symbols so nothing important is forgotten. Sessions drop 40–90%+ in cost. You change nothing about how you work.\n\nWorks with **Claude Code**, **Gemini CLI**, **Codex CLI**, **Aider**, **Cursor**, **Cline**, **Windsurf**, **Copilot CLI**, OpenCode, OpenClaw, and **pi** ([pi-coding-agent](https://github.com/earendil-works/pi-mono)).\n\n**Ask your AI to install it fully (give it this GitHub link), or install in one command:**\n\n```\nnpm install -g token-goat \u0026\u0026 token-goat install\n```\n\nRestart your AI sessions. Run `token-goat stats` a couple of minutes after your next session to see the massive savings. It also doubles as a great tracker of your work. Welcome to token efficiency.\n\n[![npm](https://img.shields.io/npm/v/token-goat.svg)](https://www.npmjs.com/package/token-goat) [![CI status](https://github.com/DFKHelper/token-goat/actions/workflows/ci.yml/badge.svg)](https://github.com/DFKHelper/token-goat/actions/workflows/ci.yml) [![PolyForm Noncommercial](https://img.shields.io/badge/license-PolyForm%20Noncommercial-lightgrey)](LICENSE)\n\n![Windows 10 | 11](https://img.shields.io/badge/Windows-10%20%7C%2011-0078d4?logo=windows\u0026logoColor=white) ![Linux including WSL](https://img.shields.io/badge/Linux-including%20WSL-FCC624?logo=linux\u0026logoColor=black) ![macOS (untested)](https://img.shields.io/badge/macOS-untested-lightgrey?logo=apple\u0026logoColor=white) ![requires Node.js](https://img.shields.io/badge/requires-Node.js-339933?logo=node.js\u0026logoColor=white)\n\n\u003e **Built and continually improved, free, by one person. If it saves you tokens, drop a ⭐️ at the top of this page. One click. Makes my day. Also, if you'd like anything added, [drop me a line](mailto:token-goat@dfkhelper.com).**\n\n[Install](#install) · [CLI](#cli) · [What gets installed?](#what-gets-installed) · [Stats](#stats-display) · [Security \u0026 uninstall](#security-privacy-and-uninstall)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/stats_v180.png\" alt=\"token-goat stats display\" width=\"589\"\u003e\n  \u003cbr\u003e\n  \u003csub\u003eStats display — gradient bars, sparklines, and a calendar heatmap in 24-bit color\u003c/sub\u003e\n\u003c/p\u003e\n\n## The problem\n\nAIs read `auth.py`. Then reads it again. And again. Then a third time after compaction wipes the session. Then it can't find what it wanted and searches other lines and files. You pay for every token and most of it is waste.\n\nLong sessions accumulate waste five ways. Screenshots cross the model at full resolution. A single PNG can land at 10+ MB. The agent re-reads files it already parsed earlier in the same conversation. When a session compacts, the summary LLM doesn't know which files were edited or which symbols mattered, so it preserves the wrong things. And every `pytest`, `npm install`, `docker build`, or `git log` dumps thousands of lines of progress bars, deprecation warnings, and passing-test names that bury the one line that actually matters.\n\nThe fifth waste is skills. A single large skill injects 10k–65k tokens every time. Run a five-iteration `/improve` loop and you've paid for five full copies of the same rules. Token-Goat now blocks repeat skill loads before they happen: a PreToolUse hook intercepts the second invocation, serves the cached compact (~400 tokens) instead, and only allows a reload when compaction may have evicted the skill from context. It also intercepts direct reads of skill files and ensures the compaction manifest carries the full skill index — so nothing is forgotten and the full body never re-enters context unnecessarily.\n\nThe fastest way to reduce AI token costs is fixing these five, not writing shorter prompts. Each one is preventable. Token-Goat intercepts all five, automatically.\n\n## What changes\n\n| Without Token-Goat | With Token-Goat |\n|--------------------|------------------|\n| 3.3 MB screenshot lands in model context | 84 KB compressed copy, 97.4% smaller |\n| Agent re-reads files from earlier in the session | \"Already read this\" reminder with narrow slice suggestion |\n| Agent re-reads a file edited mid-session | Unified diff injected as a hint — full Read avoided when the diff covers the change |\n| Compaction forgets which files were edited | Structured session manifest injected before compact |\n| Same files re-read from scratch after `/compact` | Recovery hint at SessionStart lists cached snapshot + bash + WebFetch IDs |\n| Loaded skill body summarised away by compaction | `### Active Skills` manifest section + `**Skills**:` recovery block list every loaded skill; full body recoverable via `token-goat skill-body \u003cname\u003e` without re-invoking |\n| Large skill bodies re-injected each turn (6 active skills = 65k+ tokens) | `\u003c!-- COMPACT_END --\u003e` marker: everything above the marker is the compact form; token-goat detects it on load, caches the compact slice, and injects only that — typically ~400 tokens vs. 10k+ |\n| Model reads a skill SKILL.md file directly mid-session (burning the full 10k–65k tokens again) | Pre-Read hook intercepts `*/.claude/skills/\u003cname\u003e/SKILL.md` paths; if the skill is already cached this session it emits a `token-goat skill-body \u003cname\u003e` hint instead |\n| Same large skill invoked twice in a session | PreToolUse hook blocks the reload; serves cached compact (~400 tokens) via `additionalContext` instead of the full 40–65k body. Allows the reload if compaction fired since the last load |\n| Skill invoked with `first_load_compact=true` and `\u003c!-- COMPACT_END --\u003e` present | First load also blocked; only the curated compact section is served. Full body available via `token-goat skill-body \u003cname\u003e` on demand |\n| Same docs URL fetched twice in a session | Re-fetch blocked at warm+ context pressure; cached body available via `token-goat web-output \u003cid\u003e` |\n| `cat src/auth.py` or `Get-Content module.py` run via Bash | Pre-Bash hook detects whole-file reads of indexed source files and suggests `token-goat read \"file::Symbol\"`, `skeleton`, or `section` — covers `cat`, `bat`, `type`, PowerShell `Get-Content`/`gc` |\n| `rg pattern src/` or `grep -rn` run via Bash (first time) | Pre-Bash hook suggests `token-goat symbol \u003cname\u003e` and `token-goat semantic \"\u003cquery\u003e\"` as indexed alternatives to a full directory walk |\n| `rg \"^def\" src/file.py` or `grep \"class \" module.ts` — structural search on a single source file | Pre-Bash hook redirects to `token-goat skeleton \"file\"` or `outline \"file\"` — all symbols with line numbers, no full-file read |\n| `rg` or `grep` run twice with the same pattern | Pre-Bash dedup hint fires on repeated `rg`/`grep`/`ag` calls the same way it fires on the native Grep tool; repeat searches return a cached match-count hint instead of re-running |\n| Read tool targets `tool-results/\u003cid\u003e.txt` or `tasks/\u003cid\u003e.output` | Pre-Read hook suggests `token-goat bash-output \u003cid\u003e --tail N` / `--grep PATTERN` / `--section H`; the filename stem is the output ID |\n| Repeated monitoring command run again (`gh run watch`, `next dev`, `vitest`, `docker logs`) | Pre-bash recall hint: when a prior run is cached and its output exceeds 2 KB, a pointer to `token-goat bash-output \u003cid\u003e --grep PATTERN` is injected instead of re-running the command |\n| `pnpm`/`yarn`/`bun` install or build dumps full output | pnpm, yarn, and bun compress filters now strip install noise and build logs the same way npm does; `pnpm run`/`yarn run` route through their own filter |\n| Surgical-read command returns a 10k-line symbol or a full section dump | Capped at ~25k tokens; marker names the truncation ratio and narrowing command (`symbol` → `file::Class.method`; `section` → sub-heading; cached → `--grep`/`--tail`) |\n| Full file read for one function or section | `token-goat read file::symbol`, about 85% smaller |\n| `pytest` dumps 150 PASSED lines + dots + tracebacks | Failures-first view, 80 to 97% smaller |\n| `npm install` floods deprecation warnings + spinner | Errors kept; warnings collapsed by package, ~90% smaller |\n| `docker build` emits sha256 digests + transfer progress | Step headers + errors kept; noise dropped, ~75% smaller |\n| `ruff` / `eslint` / `mypy` repeat the same rule 50 times | Grouped by rule with first 3 examples, ~80% smaller |\n| Same `pytest` / `cargo` / `git log` re-run mid-session | Small prior outputs (≤8 KB) served inline on first repeat; larger outputs get a hint pointing at `token-goat bash-output \u003cid\u003e` |\n| Same `Grep` pattern re-run with hundreds of matches | Pre-Grep dedup hint quotes the prior match count |\n| Same docs URL fetched twice | Re-fetch denied at warm+ context pressure (redirects to `token-goat web-output \u003cid\u003e`); advisory hint at cool |\n| `token-goat section pyproject.toml::tool.ruff` | One TOML table extracted instead of the whole config; same for `.yaml`/`.yml`/`.json`/`.ini`/`.cfg`/`.env`/`Dockerfile` |\n| Typoed `token-goat symbol getUserr` | Auto-redirects to the unambiguous close match (use `--strict` to opt out) |\n| `grep`/`rg` returns 50+ match lines | File-level summary: top 20 files by match count; full result cached, ~80% smaller |\n| Same \"already read\" hint fires on every re-read | Suppressed after first injection; SHA-256 fingerprinting prevents the same nag twice per session |\n| Same bash command runs 3+ times in one session | Escalating warning: \"ran 2×\" on repeat, \"WARNING: ran N×\" by the third; output always cached |\n| Agent starts cold with no git context in a dirty repo | Branch, change counts, and 5 recent commits injected at startup (~50 tokens) |\n| Re-read hint shows only the line range | Hint includes previously-accessed symbol names: `[symbols: login, refresh, …]` |\n| Manifest too large or unstructured after compaction | Manifest gains `### MUST_PRESERVE` sealed block, `### What Worked` (last 2 green test runs), inline git diffs, and `### TODOs` from TaskList |\n| CSV/JSON/JSONL/log file re-read when only structure changed | Pre-Read hint for structured files (CSV headers, JSON keys, log format), ~70% smaller than full read |\n| Index-only files (lockfiles, source maps, bundles) read on every session | Pre-Read suppression for read-only files (package-lock.json, *.map, dist/), skipped unless explicitly edited |\n| Large markdown file read in full (README.md, CHANGELOG.md, CLAUDE.md ≥8 KB) | Heading tree intercepted instead — H1–H3 with `#2`/`#3` disambiguation; `token-goat section` shortcuts listed for well-known files; post-edit injects a re-read suggestion rather than the full file |\n| PDF or Office binary (.docx, .xlsx, .pptx, .odt) opened via Read | Full read denied; PDF shows page count and outline; Office binaries redirect to `pandoc` or `docx2txt` for text extraction |\n| Large CSV or TSV file (≥10 KB) read in full | Column headers, row count, and 3 sample rows shown; `duckdb` query suggestion for large tabular data |\n| Large TXT or log file (≥20 KB) read in full | Line count + first/last 5 lines shown; `.log`/`.out` files bias toward `--tail 100 --grep`; general catch-all for any file ≥100 KB |\n| Subagent reads a 47–86 KB recon dump (or greps a 73 KB transcript) and overflows its window | `pre_read` denies a full Read at or above `large_read_redirect_bytes` (~45 KB default), and a `content`-mode Grep over one oversized file, redirecting both to surgical reads or a windowed `offset`/`limit` |\n| Subagent overflows at \"hello\" with no idea why | `token-goat baseline` attributes the fixed environmental floor — other plugins' hook dumps, both CLAUDE.md files, MEMORY.md, MCP servers — by owner, suggested fix, and fixed-vs-variable cost |\n| MCP screenshot call lands 10 MB image in context because no file path was passed | `pre_screenshot` denies chrome-devtools and playwright screenshot calls without a `filePath`/`file_path` argument; redirects the model to re-issue with one, so the saved file flows through image-shrink (~39K tokens raw → ~8K compressed) |\n| `curl -v` dumps TLS handshake + all request/response headers | Verbose lines stripped; request line, HTTP status, content-type, and body kept — typically 70–90% smaller |\n| `jest --verbose` / `vitest --verbose` emits one `✓` line per passing test | Consecutive passing-test lines collapsed to a count per file; failures kept verbatim, ~95% smaller on passing suites |\n| `go test -v` emits `--- PASS: TestName (Ns)` for every passing test | PASS lines collapsed to a count per package; FAIL lines and panic output kept, ~90% smaller on clean runs |\n| Python script raises and dumps a 30-frame traceback | Intermediate frame pairs collapsed to a count; outermost frame, exception type, and message kept |\n| `tsc --noEmit` emits hundreds of type errors across many files | Errors grouped by file, up to 3 examples per file shown, rest counted; ~70–90% smaller |\n| `make`/`cmake`/`ninja` emits hundreds of `[N%] Building …` progress lines | Progress lines collapsed to a count; warnings, errors, and `Built target` lines kept, ~85% smaller on clean builds |\n| Command writes JUnit XML and prints the path | XML parsed directly; compact summary (totals + failed test names/messages) injected — raw XML never enters context |\n| `grep`/`rg` matches a line in a `.min.js` or `.min.css` file | Matching line truncated to 200 chars; filename and line number preserved |\n| Claude Code writes async-task output to a temp file | `pre_read` intercepts the path and redirects to `token-goat bash-output \u003cid\u003e` with `--head`/`--tail`/`--grep` support |\n| Re-read hints fire immediately after conversation compaction | Grace period suppresses deny hints for the first few reads after a compact so the model can re-orient |\n| Large reference doc (CLAUDE.arch.md, API spec) re-read in full every new session | `token-goat compact-doc \u003cpath\u003e` builds a deterministic extractive sidecar (headings + first N lines per section); `pre_read` serves it in place of the full file — 80–95% smaller. Sidecar is automatically marked stale when the source is edited. |\n| Re-read denial fires as an advisory hint the model can ignore | When `deny_reread` is on (default), `pre_read` actively denies re-reads of files confirmed in the current context window, not just nudges; the advisory still fires for older reads that may have scrolled out |\n| Unchanged files produce duplicate hints across sessions | Hint fingerprint includes file path; unchanged-file short-circuit skips re-read pre-check entirely |\n| Dedup hints fire even when agent ignores them | Curator pass skips dedup hints when the agent's preceding action pattern suggests they'll be ignored |\n| Bash dedup hints conflict with other compression | `token-goat compress` can be called as dedup-vs-hint filter; one-call access to cached output |\n| Large manifest sections with no useful signal | Drop empty sections, strip project name from paths (cleaner relative paths in manifest) |\n| Manifest git-history section loses signal on clean main | Inline git diffs + skip git log when on clean main branch; session-awareness improves manifest hygiene |\n| Skill body lost after compaction but recovery too verbose | Recovery hint deduped skills by content_sha (same skill loaded twice = one entry); inline skill checklist |\n| Recovery hints omit critical paths when space is tight | Hint budget hard caps per kind (files=5, bash=3, web=2, skills=4); skip bash snippet when recall available |\n| `token-goat map` outputs without rank context | Semantic compact mode outputs one result per line; `--full` for old format |\n| AVIF format not supported despite better compression | AVIF image-shrink via sharp (when libvips is built with libaom); WebP fallback; codec auto-detection in docker |\n| Token-savings invisible until you run `stats` | Token-savings benchmark (slow-marked test suite) locks in measured wins; `token-goat stats` reports net-positive impact |\n| Hook crash leaves agent waiting for response | Fail-soft barrier catches `BaseException`/`MemoryError`/`SystemExit`; hook always returns `{\"continue\": true}` |\n| Concurrent edits lose update counts mid-session | Session CAS + mtime-based retry prevent lost edits in manifest |\n| Dirty queue appends corrupt on concurrent writes | OS file lock (fcntl/msvcrt) prevents torn JSON lines |\n| Worker claim file blocks all re-spawns on crash | Mtime staleness check (\u003e60s) auto-recovers zombie claim files |\n| DRY consolidation — 600+ lines duplicated | Tool-response extractor unified; cache helpers (`_safe_join`, `OutputStatDict`) consolidated; dedup-hint template collapsed; CLI output/history commands unified; `humanize_bytes` centralized in `render/ansi` |\n| Compaction hook subprocess ~190 ms cold | Lazy imports of heavy modules in `hooks_session` and `compact`; compaction path ~110 ms cold (~42% faster) |\n| Pre-compact subprocess runs on every session | Compact-skip sentinel on disk: if session file is \u003c5 min old and no edits logged, subprocess exits in \u003c1 ms |\n| Git ops slow manifest build in non-repo dirs | `git diff` / `git log` calls skipped when `cwd` is not inside a git repo (saves 60–100 ms per hook fire) |\n| `terraform init` downloads 30+ provider plugins | Provider install lines collapsed to a count note; generic progress lines head/tail compressed (5+5 kept); `Init complete!` preserved |\n| `terraform show` dumps a full resource block | Noise attributes (id, arn, timeouts, tags) stripped per resource block; high-signal fields kept with a suppression note |\n| `kubectl events` lists raw repetitive events | Events grouped by REASON with a per-group count; field-selector hint added to narrow scope |\n| `kubectl describe` floods labels and annotations | Labels/annotations blocks collapsed to line counts; Conditions table kept in full; container resource fields preserved |\n| `npm install` verbose output with sill/http/verb/spinner lines | Verbose timing, sill, http, verb lines suppressed; warn lines beyond first 3 collapsed; braille spinner reify lines dropped |\n| Fetched web content lands raw in model context | Scanned for attack patterns, wrapped in an untrusted-content fence; matched pattern name written to the log |\n| Chatty log repeats the same error or event thousands of times | `token-goat logfold` collapses consecutive duplicates to `[Nx]` counts; same event logged with different timestamps or request IDs folds correctly — ~90–95% smaller on repetitive logs |\n| Reading poetry.lock or package-lock.json to find a pinned version | `token-goat lockdeps` returns a name/version table of direct dependencies; optional packages and transitive entries excluded |\n\nOn a per-token API plan, 100K wasted tokens per session runs about $0.30. Five sessions a week is ~$450/year. AI coding cost reduction at that scale comes from fixing the waste, not from using the product less. Token-goat is free. And on subscription plans, it can result in limits feeling 10x higher.\n\n## Token savings, measured\n\nNumbers below come from synthetic-fixture benchmarks in the test suite. Each row points at the source file where the measurement is reproduced.\n\n| Source | Improvement | Measured impact | Where |\n|--------|-------------|-----------------|-------|\n| Image shrink | WebP encoder beats JPEG on screenshot-shaped images | ~39% smaller than the same image at JPEG quality 85 | `src/image_shrink.ts` (codec selection) |\n| Repomap output | Short labels (`f:`, `s:`, `c:`) and auto-compact mode below 6 KB | ~30–40% denser output for the same byte budget | `src/repomap.ts` (`token-goat map --budget`) |\n| DB reindex | Batched single transaction + composite indexes on `(file_id, kind)` | 100 files / 10K rows: 84 s → 1 s (~80× faster) | `src/parser.ts`, `src/db.ts` (index migration) |\n| Hook cold-start | Lazy import of heavy modules; unknown events short-circuit | 86 ms → 30 ms (~65% faster); unknown-event dispatch \u003c1 ms | `src/hooks_cli.ts` |\n| Symbol start_line | TypeScript decorators captured in symbol span | One `token-goat read` returns the decorator + signature + body; no re-read | `src/parser.ts` (TypeScript adapter) |\n| Section extraction | Setext headings, h5/h6, anchor IDs, and `__frontmatter__` | `token-goat section` resolves more headings without falling back to a full file read | `src/parser.ts` (Markdown adapter) |\n| Image cache | Real LRU eviction (was FIFO; old hot entries got dropped) | Higher hit rate on repeat screenshots in long sessions | `src/image_shrink.ts` |\n| Monorepo defaults | Reindex batch 500 → 2000; compact `min_events` 5 → 3 | Fewer worker wakeups; compact manifests fire on shorter sessions | `src/config.ts` defaults |\n| Miss suggestions | `symbol` auto-redirects on a single high-confidence close match (`--strict` opts out); `read` / `section` print \"Did you mean…?\" | Keeps agents on the surgical-read path instead of falling back to full-file `Read` | `src/read_replacement.ts` |\n\n## Token-savings examples\n\nConcrete before/after for the four interception points. Token counts use the ~4-chars-per-token rule of thumb.\n\n### 1. Image — screenshot interception\n\n```\n$ ls -lh screenshot.png\n-rw-r--r-- 1 user user 1.2M screenshot.png\n\n# Without token-goat: Claude reads the 1.2 MB PNG.\n# With token-goat: hook re-encodes as WebP and substitutes the cached copy.\n\n$ token-goat image-shrink screenshot.png\nout: ~74 KB WebP   (94% smaller)\n```\n\nThe same image at JPEG quality 85 lands around 120 KB. WebP wins by another ~39% on screenshot-shaped content (large flat regions, sharp text edges).\n\n### 2. Surgical read — one function, not the whole file\n\n```\n# Without token-goat: full file read.\n$ wc -l src/auth.py\n512 src/auth.py            # ~12,000 tokens\n\n# With token-goat: pull just the function.\n$ token-goat read \"src/auth.py::login\"\nout: 38 lines              # ~300 tokens   (97% smaller)\n```\n\nSame applies to `token-goat section \"README.md::Install\"` — one heading instead of the whole document. Anchor IDs and setext headings resolve too, so `section \"doc.md::Quick-start\"` works when the file uses `Quick start` as an `\u003ch2\u003e` with an explicit `{#quick-start}` anchor.\n\n### 3. Compact manifest — preserve what mattered\n\n```\n# Without token-goat: PreCompact fires with no extra context.\n# The summarizer LLM picks what to keep, often loses the edit set.\n\n# With token-goat: PreCompact hook injects a structured manifest.\n$ token-goat compact-hint --session-id \u003cid\u003e\nout: ~280 tokens covering 8 edited files + 12 symbols accessed + 4 key reads\n```\n\nThe 280-token manifest is one-shot during compaction. The win is downstream: post-compaction, the agent doesn't re-read files it had already edited, saving a full-file Read pass on each one.\n\n### 4. Repomap — orientation without an `ls -R` dump\n\n```\n# Without token-goat: recursive ls + a handful of Read calls to figure out the repo.\n$ ls -R . | wc -c\n51234                       # ~50 KB of raw paths, no signal about importance\n\n# With token-goat: PageRank-ranked, token-budgeted summary.\n$ token-goat map --budget 4000\nout: ~4 KB                  # top-ranked files + key symbols   (92% smaller)\n```\n\n`--budget` is a hard cap. Below 6 KB the output automatically switches to short-label mode (`f:` files, `s:` symbols, `c:` calls) to fit more signal per byte. `token-goat map --compact` is a shortcut for a 300-token budget when you only need the high-rank cluster.\n\n### 5. Bash output compression\n\n```\n# Without token-goat: pytest dumps every PASSED line + dots + tracebacks.\n$ pytest -v tests/\n... (3 KB of output, 150 PASSED lines, 1 FAILED at the bottom)\n\n# With token-goat: the PreToolUse hook rewrites the command to\n# `token-goat compress --filter pytest`. The wrapper runs pytest, captures\n# stdout+stderr, applies the per-tool filter, and prints failures first.\n$ token-goat compress --filter pytest --cmd \"pytest -v tests/\"\n= test session starts =\ncollected 150 items\nFAILED tests/test_x.py::test_one\n= 1 failed, 149 passed in 2.3s =\n\n[token-goat: collapsed 149 PASSED lines]\n[token-goat: pytest filter compressed 4.8 KiB to 0.1 KiB (97% saved)]\n```\n\nBuilt-in output compression covers 130+ dev tool CLIs: `pytest`, `jest` / `vitest`, `cargo`, `npm` / `pnpm` / `yarn` / `bun`, `docker`, `kubectl` / `helm`, `aws`, `ruff` / `eslint` / `mypy` / `pylint` / `oxlint`, `git`, `make` / `gradle` / `mvn` / `ant` / `bazel`, `go test` / `golangci-lint`, `terraform` / `pulumi` / `cdk`, `pip` / `uv` / `conda`, `python`, `gh`, `ansible`, `pre-commit`, `grep`, `eza` / `ls`, `fd`, `bat`, `jq`, `yq`, `curl` / `wget`, `rsync`, `dotnet`, `cmake` / `ctest`, `swift` / `xcodebuild`, `ruby` / `bundler`, `elixir` / `mix`, `php` / `composer`, `flutter` / `dart`, `rust` / `cargo`, `kotlin` / `ktlint`, `zig`, `crystal`, `haskell` / `cabal`, `nix`, `R`, `c++` (conan / vcpkg / cppcheck / clang-tidy), `wrangler` / `hardhat` / `serverless`, `erlang`, `fly.io`, `forge`, `elm`, `julia`, `tox`, `vault`, `packer`, `nx` / `lerna` / `turbo`, `prettier` / `biome`, `sass`, `wasm-pack`, `deno`, **and AI tool CLIs**: `aider`, `gemini`, `claude`, `gh copilot`, `copilot`, `cursor`, `windsurf` (incl. Cascade), `opencode`, `continue`, `cline`. Each filter strips ANSI escapes, collapses `\\r` progress bars, dedupes repeated lines, groups linter issues by rule, keeps every error block verbatim, and caps total output at 1000 lines / 64 KiB. Compound commands (`cmd1 \u0026\u0026 cmd2`) are wrapped per segment, so `git diff \u0026\u0026 git log` compresses both halves. Disable globally with `TOKEN_GOAT_BASH_COMPRESS=0`, per-filter via `[bash_compress] disabled_filters = [\"docker\"]` in config.toml, or preview the output of any command with `token-goat compress --cmd '\u003cyour command\u003e'`. To exclude project-specific directories from indexing (temporary venvs, build sandboxes), add `[indexing] skip_dirs = [\"my-tmpdir\"]` to config.toml.\n\n`gh api` responses get an extra pass: boilerplate `*_url` fields (`followers_url`, `gists_url`, `starred_url`, and around a dozen others) are stripped from JSON objects; `html_url`, `avatar_url`, `clone_url`, and `ssh_url` are kept. User and repo objects typically shrink 60–80%. When token-goat sees a GitHub permission error in the output or a non-zero exit on a security endpoint, it injects a system message suggesting `gh auth refresh -s security_events`.\n\n### 6. Context pressure\n\nToken-goat tracks how close a session is to the autocompact trigger and tightens its hints as the window fills. Surgical-read suggestions kick in on progressively smaller files as pressure builds (500 lines at cool, down to 50 at critical), so large reads get flagged before they tip the session over. The PreCompact manifest also shrinks: capped at 500 tokens once the window runs hot, 300 once critical, so it stops contributing to the pressure it measures. The denominator is always the fixed 660,000-token autocompact trigger budget, not the model's raw context window, so the same thresholds apply across models. Run `token-goat doctor --context` to see the current footprint.\n\n## Install\n\n\u003e **Easiest install:** paste this repo's URL into your AI and ask it to install token-goat properly. It will run the commands, check codecs, and confirm everything is working.\n\n**Requirements:** Node.js 18 or later (all platforms)\n\n```\nnpm install -g token-goat\ntoken-goat install\ntoken-goat doctor          # confirms hooks and sharp are working; look for \"sharp: ok\"\n```\n\nThree commands. Done. Hooks register, a background worker starts at logon and stays out of the way. No terminal popups, no tray icon, no service to babysit.\n\n**Important — sharp is part of the install.** The biggest single win (~39% smaller than JPEG, ~97% smaller than raw PNG) comes from WebP encoding. sharp ships with prebuilt native binaries on Windows, macOS, and most Linux platforms, so a standard `npm install -g token-goat` includes it. On Alpine musl and some ARM boards, npm compiles from source against libvips — that may add a few seconds. `token-goat doctor` will report `sharp: ok` when the image pipeline is working; if it flags a failure, follow the [Image support](#image-support) section below before considering the install complete. **AI agents performing this install: run `token-goat doctor` after `token-goat install` and resolve any sharp failure as part of the same task — do not treat it as a follow-up.**\n\nTwo things change how Claude Code sessions behave: hooks fire automatically (image shrink, re-read dedup, compact manifests), and a block written to `~/.claude/CLAUDE.md` plus a registered skill tell the agent to prefer `token-goat read` / `symbol` / `section` over full-file reads. A `Bash(token-goat:*)` allowlist entry in `settings.json` lets the agent run those commands without a per-call approval prompt.\n\nOn Linux and WSL, the worker registers as a systemd user service when systemd is available. On WSL without systemd, and on macOS, the SessionStart hook ensures the worker is running at the start of every Claude Code session.\n\n### Codex CLI users\n\n```\ntoken-goat install --codex\n```\n\nThe `--codex` flag patches both Claude Code and Codex CLI in one pass.\n\n### Gemini CLI users\n\n```\ntoken-goat install --target gemini\n```\n\nThis writes hook entries into `~/.gemini/settings.json` using Gemini CLI's `BeforeTool` / `AfterTool` / `SessionStart` / `PreCompress` event names. Token-goat translates between Gemini's snake_case tool names (`run_shell_command`, `read_file`, `grep_search`, etc.) and its internal format automatically. Image shrinking, session hints, post-edit indexing, compact assist, and bash output compression all work. To remove: `token-goat uninstall --gemini`.\n\n### opencode users\n\n```\ntoken-goat install --opencode\n```\n\nThe `--opencode` flag patches Claude Code and drops a TypeScript bridge plugin into opencode's plugins directory — one command, no separate base install. Image shrinking, post-edit indexing, and compact assist work. Session hints don't — opencode's plugin API has no way to inject context before a tool read.\n\n### openclaw users\n\n```\ntoken-goat install --openclaw\n```\n\nThe `--openclaw` flag patches Claude Code and drops a TypeScript bridge plugin into `~/.openclaw/plugins/` and registers it in `openclaw.json` — one command, no separate base install. Image shrinking, post-edit indexing, and pre-fetch denial work. Session hints and compact assist don't — no context injection point, no compaction event.\n\n### pi users\n\n```\ntoken-goat install --pi\n```\n\nThe `--pi` flag patches Claude Code and drops a TypeScript extension into pi's global extensions directory (`~/.pi/agent/extensions/token-goat.ts`). pi auto-discovers it on the next launch (approve the project-trust prompt the first time). The extension is a normal pi extension — a default-exported factory that subscribes to `session_start`, `tool_call`, `tool_result`, `session_before_compact`, and `session_compact` — and bridges those events into token-goat's `token-goat hook \u003cevent\u003e` subprocess protocol.\n\nWhat works: **bash output compression** (the bash command is rewritten in `tool_call`), **re-read denial** (`tool_call` returns `{ block, reason }` for confirmed re-reads), **image shrinking** and **surgical-read redirects** (args rewritten in place), **post-edit indexing** and **output caching** (`tool_result`), and the **compaction manifest** (captured at `session_before_compact`, re-injected after `session_compact` since pi's compaction replaces rather than appends). Skill-overhead preservation does not apply — pi has no Skill tool; skills are template expansions. To remove: `token-goat uninstall --pi`.\n\n**Project-local install (single project only).** pi also loads extensions from a project's `.pi/extensions/` directory (after the project is trusted). To install for one project without touching the global directory, drop the extension there:\n\n```bash\nnpx token-goat install --pi --local\n```\n\nThis writes `.pi/extensions/token-goat.ts` in the current project only. Remove it by deleting that file.\n\n### Cline, Windsurf, Cursor, Copilot CLI, and other AI tool CLIs\n\nNo separate install step needed. Token-goat compresses the terminal output of these tools automatically as soon as they appear on your PATH. Run `token-goat doctor` to confirm they are detected — the \"Third-party AI tools\" section will show `detected — bash output compression active`.\n\nFilters are built in for: **Cline** (`cline` / `claude-dev`), **Windsurf** (`windsurf`, including Cascade AI patterns), **Cursor** (`cursor`), **GitHub Copilot CLI** (`gh copilot explain/suggest` and the standalone `copilot` binary), **Aider** (`aider`), **Continue** (`continue`), **OpenCode** (`opencode`). Each filter strips version banners, spinner/thinking lines, token-usage boilerplate, and tool-call progress noise while keeping the AI response body, error signals, and any user-approval prompts verbatim.\n\n### Updating\n\nUpdates ship automatically. `token-goat install` schedules a weekly `npm install -g token-goat@latest` run at Sunday 03:00 local time (Windows scheduled task; Linux/macOS crontab line tagged `# token-goat-autoupdate`). `token-goat uninstall` reverses it.\n\nManual paths:\n\n| When | Command |\n|------|---------|\n| Update now | `npm install -g token-goat@latest` |\n| Reinstall from scratch (broken install, sharp failure) | `npm install -g token-goat@latest` |\n| Disable auto-updates | Delete the `token-goat-update` scheduled task (Windows) or the `# token-goat-autoupdate` crontab line (Linux/macOS) |\n\n## CLI\n\n| Command | What it does |\n|---------|-------------|\n| `token-goat symbol \u003cname\u003e` | Jump to a symbol definition. Add `--all-projects` to search across every indexed repo. |\n| `token-goat read \"file::symbol\"` | Pull one function or class, not the whole file. Supports qualified lookups: `read \"file.py::Class.method\"`. |\n| `token-goat section \"doc.md::Heading\"` | Pull one Markdown section by heading. Near-miss headings auto-redirect (difflib ratio ≥ 0.75) with a `(redirected from: …)` marker. Disambiguate duplicates with `\"doc.md::Heading#2\"`. |\n| `token-goat skill-section \"\u003cname\u003e::\u003cheading\u003e\"` | Extract a named section from an installed skill without reading the full skill file. |\n| `token-goat skeleton \"file\"` | Show all signatures in a file without bodies — typically 70–90% fewer tokens than a full read. |\n| `token-goat outline \"file\"` | List top-level symbols with line ranges and docstring hints — one-glance file map. |\n| `token-goat scope \"file:line\"` | Show symbols in scope at a given line — avoids reading the whole file to understand locals. |\n| `token-goat exports \"file\"` | List public (exported) symbols with types and docstring hints. |\n| `token-goat refs \"\u003cname\u003e\"` | Show all files and line numbers where a symbol is referenced. |\n| `token-goat callers \u003csymbol\u003e` | Show which functions call a given symbol, grouped by caller with file, caller name, and every invoking line. Complements `refs`, which shows raw reference sites without grouping by enclosing function. |\n| `token-goat call-chain \u003csymbol\u003e` | Trace every caller layer from a symbol back to the entry points — one step deeper than `callers`. Use when you need to know what reaches a function across the whole call graph, not only who invokes it directly. Pairs with `impact` for the downstream direction. |\n| `token-goat impact \u003csymbol\u003e` | Walk the reference graph forward and list every file and function that depends on a symbol, with hop depth and dependency type (call, type annotation, import). Run before a refactor to size up the blast radius without starting a build. |\n| `token-goat context-for \u003ctask\u003e` | Takes a natural-language task description, runs semantic search across the indexed codebase, and emits a prioritized list of `token-goat read` commands trimmed to a token budget. Fetches only the relevant slices instead of loading entire files. `--budget N` sets the token ceiling; `--top N` limits the file count; `--json` for structured output. |\n| `token-goat ask \"\u003cquestion\u003e\"` *(experimental)* | Answers a question about the codebase out-of-band: retrieves the relevant slices, synthesizes a short answer in token-goat's own process, and returns only that answer plus pointer-citations, so the primary model never pays for the slice bodies. When the `claude` CLI (Claude Code) is on PATH it synthesizes with Haiku, its cheapest tier, with no setup; `codex` falls back to its own default model. Set `TOKEN_GOAT_ASK_MODEL=\u003cmodel\u003e` or `--model` to choose a different model, or `TOKEN_GOAT_ASK_CMD=\"\u003ccommand\u003e\"` for a custom backend. With no CLI on PATH it makes no network call and degrades to `context-for` pointers. Answers cache across sessions and self-invalidate when a cited slice changes. `--scope`, `--budget`, `--show-sources`, `--json`. |\n| `token-goat changed [\u003cref\u003e]` | List symbols that changed since a git ref, without reading the full diff. |\n| `token-goat blame \"file::symbol\"` | Git blame narrowed to a specific symbol's lines — no whole-file blame needed. |\n| `token-goat types [\"file\"]` | List type definitions (TypedDict, Protocol, dataclass, Pydantic models) in a file or across the project. |\n| `token-goat imports \"file\"` | Show the import graph for a file one level deep. |\n| `token-goat find \"\u003cquery\u003e\"` | Unified search: exact/fuzzy symbol match + semantic, merged and ranked by confidence. |\n| `token-goat similar \"file::symbol\"` | Find the top-k symbols most semantically similar to a given symbol. |\n| `token-goat test-for \"file\"` | Find test file(s) for an implementation file and list their test functions. |\n| `token-goat dead` | Surface functions, methods, and classes with no recorded callers in the project index. Private names and common entry points (`main`, `app`, etc.) are excluded by default. `--include-private` lifts the underscore filter; `--kind` narrows to specific symbol types; `--top N` caps output; `--json` for structured output. Results are a heuristic lead — dynamic dispatch and external callers are invisible to static indexing. |\n| `token-goat coverage-gaps` | Find callables in non-test source files that never appear in a test file's reference records. Useful for spotting untested surface area before a refactor or release. `--top N` caps output; `--json` for structured output. |\n| `token-goat recent [N]` | Show the N most recently edited/accessed files with their symbols. |\n| `token-goat grep \"\u003cpattern\u003e\"` | Session-aware grep: runs `rg` and caches results; repeat patterns get a dedup hint instead of re-running. |\n| `token-goat semantic \"\u003cquery\u003e\"` | Find code by meaning, not by filename. Add `--mode keyword` for BM25 term search (no embedding model needed) or `--mode hybrid` to combine both. Tune with `--max-distance \u003cfloat\u003e` or `--no-rerank`. |\n| `token-goat map` | Get a compact orientation of the repo. Add `--compact` to fit a 300-token budget. |\n| `token-goat arch` | Project-wide import graph summary: hub modules (most imported), entry points (nothing imports them), and circular chains. Complements `token-goat deps \u003cfile\u003e` for per-file depth. |\n| `token-goat ignores` | List active skip patterns for the current project — built-in skip dirs and suffixes, plus any patterns from `.tokengoatignore`. |\n| `token-goat gdrive-sections \u003cfile-id\u003e` | List the heading outline of a Google Doc without fetching the body. |\n| `token-goat stats` | See how many tokens you have saved. Shows a per-source breakdown (image / hint / read / compact / bash / web). |\n| `token-goat cost [--session]` | Estimated tokens saved, session or all-time, broken down by savings source. |\n| `token-goat history` | Show current session access history: bash commands, URLs fetched, and grep patterns. |\n| `token-goat bash-output \u003cid\u003e` | Retrieve a cached Bash output by ID instead of re-running the command. Large outputs return a head+tail view by default; pass `--full` for everything, or narrow with `--head N`, `--tail N`, or `--grep PATTERN`. |\n| `token-goat bash-history` | List cached Bash outputs (newest first) with their IDs, byte sizes, and exit codes. |\n| `token-goat compress --cmd '\u003ccommand\u003e'` | Preview what the Bash compression hook would do to any command — runs it, applies the matching filter, and prints the compressed view. |\n| `token-goat web-output \u003cid\u003e` | Retrieve a cached WebFetch response body by ID — same head+tail default, `--full`, and `--head`/`--tail`/`--grep` slicers as `bash-output`. |\n| `token-goat web-history` | List cached WebFetch responses (newest first) with their IDs, byte sizes, status codes, and URL previews. |\n| `token-goat skill-body \u003cname\u003e` | Retrieve a cached Skill body by name without re-invoking the skill (which would replay side effects). Same head+tail default, `--full`, and `--head`/`--tail`/`--grep` slicers as `bash-output`. |\n| `token-goat skill-history` | List cached Skill bodies (newest first) with their IDs, byte sizes, truncation status, and skill names. |\n| `token-goat skill-compact \"\u003cname\u003e\"` | Generate and print a compact summary (~400 tokens) for a cached skill body — useful for skills without a `\u003c!-- COMPACT_END --\u003e` marker. Also caches the compact so subsequent calls are instant. |\n| `token-goat skill-compact --all` | Batch-regenerate stale or missing compacts for every skill cached in the current session. Skips skills whose compact is already fresh (source SHA matches). Run after updating any skill file on disk. |\n| `token-goat skill-list [--session-id \u003cid\u003e]` | List all skills cached in the current (or specified) session with body token count, compact availability, compact_stale status, hit count, and age. |\n| `token-goat skill-list --json` | Machine-readable version; each skill row includes `compact_stale` (true/false/null) — true means the compact's embedded source SHA no longer matches the body's current SHA and a `skill-compact \u003cname\u003e` regeneration is recommended. |\n| `token-goat skill-size` | Show per-session token overhead for all cached skills, with restructure recommendations. |\n| `token-goat skill-diff \"\u003cname\u003e\"` | Unified diff between the two most recent cached versions of a skill — tracks skill updates across sessions. |\n| `token-goat compact-hint --session-id \u003cid\u003e` | Inspect the compaction manifest for a session. Add `--trigger auto` to preview the pressure-aware budget the live PreCompact hook would use. |\n| `token-goat resume \u003csession_id\u003e` | Emit a single post-compact recovery packet — top skills, last two Bash outputs, top edited-file diffs, and `git diff --stat`, capped at ~2000 tokens. Replaces 5-10 round-trips. |\n| `token-goat config list / get / set / validate` | Inspect or edit `config.toml` from the CLI. `validate` reports unknown keys with did-you-mean suggestions. |\n| `token-goat clean-cache` | Prune on-disk caches to their configured floor without waiting for the worker. |\n| `token-goat prune-cache` | Manually trigger LRU eviction across all cache directories (images, bash, web, skills). |\n| `token-goat session-summary` | Compact one-liner about current session state — designed for orchestrators and multi-agent loops. |\n| `token-goat cache-audit` | Audit your Claude Code config for patterns that bust the prompt cache. |\n| `token-goat pack \u003cpatterns\u003e` | Collect files matching glob patterns into a single LLM-ready output — Markdown (default), XML, or plain text — with a manifest table of per-file line and token counts. `--line-numbers` prefixes each line; `--instruction-file` appends a task prompt; `--output` writes to a file; `--no-ignore` bypasses `.tokengoatignore`. `--strip-comments` removes language-appropriate comments before packing (shebangs preserved; `#` inside string literals is a known limitation). `--scan-secrets` checks for credentials and exits 2 with per-file warnings if any are found. `--budget N` exits 3 when the estimated token count exceeds N — lets a shell script treat an oversized context as a hard error. Reads file paths from stdin when no patterns are given. |\n| `token-goat budget \u003cpatterns\u003e` | Estimate the token cost of a file set without reading them into context. Prints results sorted by cost descending; `--context \u003cN\u003e` shows each file as a share of an N-thousand-token window. `--json` for machine-readable output. Run before `pack` to decide what to include. |\n| `token-goat tokens [patterns]` | Per-file token footprint table, sorted largest-first. `--tree` groups by directory with subtotals and percentage of total. `--top N` limits to the N biggest files. `--asc` reverses order. `--json` for structured output. Omit patterns to scan the whole project. Useful for deciding what to exclude before running `pack`. |\n| `token-goat todo` | Scan indexed project files for `TODO`, `FIXME`, `HACK`, `XXX`, and `NOTE` comment markers. Groups by file by default; `--group kind` to group by marker type; `--kinds` to filter to a subset; `--json` for machine output. Markers in string literals are excluded. |\n| `token-goat failures [src]` | Extract failing test blocks from test runner output (pytest, Jest, Go, Cargo). Passes and preamble are dropped; each failure comes back as a labeled block. Reads stdin by default; pass a file path for saved output. `--json` for structured output. |\n| `token-goat trace [src]` | Condense Python exception tracebacks to project-owned frames. Strips library, stdlib, and venv frames; chained exceptions preserve cause notes; bare exceptions without a message are handled. `--keep N` (default 5) caps the frame count. `--json` for structured output. |\n| `token-goat lockdeps [path]` | Summarize lock file dependencies as a compact table. Reads poetry.lock, uv.lock, requirements.txt, Pipfile.lock, package-lock.json, Cargo.lock, and yarn.lock. Direct dependencies only — optional and transitive entries excluded. `--json` for structured output. |\n| `token-goat logfold [src]` | Collapse consecutive duplicate log lines. Runs of identical or structurally equivalent lines fold to `[Nx] line`. Normalizes timestamps, UUIDs, IPs, and hex IDs before comparing so the same event with different values folds correctly. `--tail N` keeps last N lines; `--no-normalize` disables normalization; `--json` for structured output. |\n| `token-goat hot [--limit N]` | Cross-session file frequency table: read and edit counts tallied from all stored sessions, ranked by total activity. Shows which files dominate your token spend across your entire history. `--project \u003cdir\u003e` filters to one project; `--json` for structured output. |\n| `token-goat note set/get/unset/list/clear` | Persistent per-project notes stored as key-value pairs. Token-goat injects them at session start and after compaction so they survive conversation rollover. Use to pin decisions, constraints, or reminders that would otherwise vanish after compaction. `note list --json` for machine-readable output; `note clear` removes everything at once. |\n| `token-goat project list` | Show all project roots indexed by token-goat with their file counts. Roots on the blocklist appear tagged `[excluded]`. `--json` for structured output. |\n| `token-goat project exclude \u003cpath\u003e` | Add a project root to the blocklist so the worker never indexes it. Writes the resolved absolute path to `[worker] blocked_roots` in `config.toml`; idempotent. Remove the entry from the config to re-enable indexing. |\n| `token-goat project prune [--dry-run]` | Remove tracked roots that no longer exist on disk. `--dry-run` previews removals without touching the database. Useful after deleting or moving projects. |\n| `token-goat install` | Wire up hooks and autostart. `--dry-run` previews the changes, `--verify` audits an existing install. |\n| `token-goat doctor` | Confirm everything is wired correctly. Surfaces install state, cold-import timing, cache hit rates, compaction-budget telemetry, opt-in flag status, and canonical-root sanity. Pass `--context` to show the **Context footprint** section: a fill bar with severity (ok / warn / high / URGENT), per-component breakdown (skills catalog, loaded skill bodies, CLAUDE.md+MEMORY.md, conversation estimate), session-to-session growth trend with sessions-to-URGENT projection, and tiered compaction recommendations (Tier 0–4) naming the exact commands to run. Auto-shown when fill \u003e 40 % or any loaded skill \u003e 2 K tokens lacks a compact. |\n| `token-goat baseline` | Attribute the per-session environmental baseline — other plugins' SessionStart hook dumps, both CLAUDE.md files, MEMORY.md, and configured MCP servers — ranked by token cost and tagged by owner (you / harness / `plugin:\u003cname\u003e`), a concrete fix, and whether the cost is fixed (recurs every session) or variable. Identical re-fired hook dumps are deduped to one row. `--subagent` shows only the fixed sources a freshly spawned agent inherits; `--json` for the machine view. Complements `doctor --context` (which costs skills); set `[hints] baseline_budget_tokens` to get a once-per-session SessionStart nudge when the fixed baseline exceeds your budget. |\n| `token-goat compact-doc \u003cpath\u003e` | Build an extractive compact sidecar for a large reference doc (`.md`/`.markdown`). The compact is stored in the token-goat data dir as a SHA-keyed sidecar; `pre_read` serves it in place of the full file when it exists and is fresh, saving 80–95% of context tokens. Use `--force` to rebuild, `--sentences N` to control lines per section (default 2), `--show` to print the result. The sidecar is automatically marked stale when you edit the source file. Config: `[hints] stable_doc_compacts = true` (default on). |\n\nFirst `token-goat semantic` call downloads a small embedding model, about 130 MB, into the token-goat data directory. One-time. Offline after that.\n\nMissed lookups recover surgically: `symbol` auto-redirects to a single high-confidence close match (pass `--strict` to opt out), while `read` and `section` print a \"Did you mean…?\" list — a typo costs at most one extra glance, not a re-read.\n\n### Skill efficiency — the `\u003c!-- COMPACT_END --\u003e` marker\n\nWhen Claude Code invokes a skill, it re-injects the full skill body on every subsequent turn. A large skill file (e.g. a 10k-token `/improve` or `/ralph`) can cost 40–65k tokens per session across 6 active skills. The `\u003c!-- COMPACT_END --\u003e` marker solves this: place it in any skill file to split it into a compact form (above the marker, ~400 tokens) and a reference section (below). Token-goat detects the marker the first time the skill fires, caches only the compact slice, and injects that from then on — labelled `--- compact form (N tokens) ---` so the model knows to request the full body only when it needs the detail.\n\nTo add the marker to a skill, open the file and insert `\u003c!-- COMPACT_END --\u003e` on its own line where the \"quick reference ends and the detail begins\" — typically after the quick-start table and before step-by-step instructions. The full reference section is still reachable via `token-goat skill-section \"\u003cname\u003e::\u003cheading\u003e\"` or `token-goat skill-body \u003cname\u003e` when needed.\n\n**Re-load and direct-read protection.** Even without the marker, token-goat protects against the two other ways large skills burn context in a long session:\n\n- If the model tries to `Read` a skill file directly (`~/.claude/skills/improve/SKILL.md`), the pre-read hook intercepts it and emits a `token-goat skill-body improve` hint instead — the full 10k–65k tokens never enter context.\n- If the same skill is invoked a second time in the session (e.g. `/improve` called again after a `/compact`), re-load detection fires: instead of re-caching the full body, token-goat emits the cached token count and `skill-body`/`skill-section` recall hints. The model can retrieve any section it actually needs rather than absorbing the whole skill again.\n\nTo check overhead for your current skills: `token-goat skill-size`. To inspect compact freshness, run `token-goat skill-list` — the `compact_stale` column shows `[stale]` when a skill's compact was generated from an older version of the file. Run `token-goat skill-compact --all` to refresh every stale compact in the current session in one pass.\n\n`token-goat install` now pre-generates compacts for all installed skills as its final step, so compacts are ready from the first session. If you install new skills after the initial install, run `token-goat skill-compact --all` manually — or check `token-goat doctor --context` which reports how many skills were added since the last pre-gen pass and shows the exact command to run.\n\n## What gets installed?\n\n`token-goat install` writes the following on your machine — nothing else, anywhere. Every entry is reversed by `token-goat uninstall`. Run `token-goat doctor` at any time to see which of these are currently present.\n\n**Claude Code integration** (`~/.claude/`)\n\n| Path | What |\n|------|------|\n| `~/.claude/settings.json` | Hook entries for `SessionStart`, `PreToolUse` (Read/Grep/Bash, Drive/WebFetch), `PostToolUse` (Edit/Write/MultiEdit, Read/Grep/Glob, Bash, WebFetch, Skill), and `PreCompact`. Plus a `Bash(token-goat:*)` permission allowlist entry. Existing hooks are preserved; a timestamped `.bak` is written before any change. |\n| `~/.claude/CLAUDE.md` | A delimited block (`\u003c!-- token-goat-begin --\u003e` … `\u003c!-- token-goat-end --\u003e`) telling the agent to prefer `token-goat read` / `symbol` / `section` over `Read` / `Grep`. Any existing content is preserved. |\n| `~/.claude/skills/token-goat/SKILL.md` | The token-goat skill — the same routing guidance in skill form. |\n\n**Worker autostart** (one of the following, picked by platform)\n\n| Platform | Entry |\n|---------|------|\n| Windows | `HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\token-goat-worker`. No admin rights required. |\n| Linux (with `systemd --user`) | `~/.config/systemd/user/token-goat-worker.service`, enabled. |\n| Linux (no systemd, incl. WSL) | `~/.config/autostart/token-goat-worker.desktop`. On WSL without systemd, the SessionStart hook also starts the worker on every Claude Code session. |\n| macOS (untested) | `~/Library/LaunchAgents/com.dfkhelper.token-goat-worker.plist`, loaded via `launchctl`. |\n\nThe autostart command is `node \u003cnpm-prefix\u003e/lib/node_modules/token-goat/dist/cli.js worker --daemon`. No compiled `.exe` is dropped; AV/EDR products do not behavior-flag this invocation pattern.\n\n**Weekly auto-update** (Sunday 03:00 local time, runs `npm install -g token-goat@latest`)\n\n| Platform | Entry |\n|---------|------|\n| Windows | Scheduled task `token-goat-update` (`schtasks`). |\n| Linux / macOS | A `crontab` line tagged with `# token-goat-autoupdate`. |\n\n**Data directory** (created on first run)\n\n| Platform | Path |\n|---------|------|\n| Windows | `%LOCALAPPDATA%\\dfk-helper\\token-goat\\` |\n| Linux / WSL | `~/.local/share/token-goat/` |\n| macOS | `~/Library/Application Support/dfk-helper/token-goat/` |\n\nContains the symbol index (`global.db`, per-project `.db` files), session cache, shrunken-image cache, cached skill bodies (5 MB cap, LRU-evicted), embedding model (~130 MB, downloaded on the first `semantic` call), logs, locks, and the dirty-file queue. Nothing outside this directory and `~/.claude/` is written.\n\n**With `--codex`** (Codex CLI integration)\n\n| Path | What |\n|------|------|\n| `~/.codex/config.toml` | Hooks block with Codex-specific matchers (`view_image|Bash`, `apply_patch`, `web_search`). Existing hooks preserved. |\n| `~/.codex/AGENTS.md` | A delimited block (`\u003c!-- token-goat-codex-begin --\u003e` … `\u003c!-- token-goat-codex-end --\u003e`) with the same routing guidance, adapted for Codex tool names. |\n\n**With `--opencode`** (opencode plugin)\n\n| Path | What |\n|------|------|\n| `~/.config/opencode/plugins/token-goat.ts` (Linux/macOS) or `%APPDATA%\\opencode\\plugins\\token-goat.ts` (Windows) | TypeScript bridge plugin. Fires on `tool.execute.before`, `tool.execute.after`, and `experimental.session.compacting`. Covers image shrinking, post-edit indexing, and compact assist. |\n\n**With `--openclaw`** (openclaw plugin)\n\n| Path | What |\n|------|------|\n| `~/.openclaw/plugins/token-goat-bridge.ts` | TypeScript bridge plugin. Fires on `before_tool_call` and `after_tool_call`. Covers image shrinking, post-edit indexing, and pre-fetch denial. |\n| `~/.openclaw/openclaw.json` | Plugin entry added under `plugins.entries`. Existing entries preserved. |\n\n**With `--pi`** (pi extension)\n\n| Path | What |\n|------|------|\n| `~/.pi/agent/extensions/token-goat.ts` | TypeScript extension (default-exported `ExtensionAPI` factory). Subscribes to `session_start`, `tool_call`, `tool_result`, `session_before_compact`, and `session_compact`. Covers bash compression, re-read denial, image shrinking, surgical-read redirects, post-edit indexing, output caching, and the compaction manifest. A project-local install writes `\u003cproject\u003e/.pi/extensions/token-goat.ts` instead. |\n\n**With `--hermes`** (Hermes Agent integration)\n\n| Path | What |\n|------|------|\n| `~/.claude/settings.json` | No new entries beyond the base Claude Code install. Hermes delegates tasks to Claude Code via `claude -p '\u003ctask\u003e'`, which loads hooks from this file normally. `token-goat install --hermes` verifies the hooks are present and reports the result. To remove the Hermes detection: `token-goat uninstall --hermes` (removes no files — Hermes shares the Claude Code hook entries). |\n\n## Zero maintenance\n\nAfter install, there is nothing to start, stop, or restart. The worker runs at logon on Windows, Linux, and macOS; on WSL without systemd, the SessionStart hook covers it. Survives reboots on every platform. `token-goat uninstall` reverses every change, including the startup entry.\n\n## Verify\n\n```\ntoken-goat doctor\ntoken-goat stats\n```\n\n`doctor` confirms the install is healthy. `stats` shows cumulative savings.\n\n## Image support\n\nToken-goat shrinks large images before they reach the model, cutting vision token costs by 60–90%. The pipeline uses [`sharp`](https://sharp.pixelplumbing.com/), a Node.js image processing library that ships prebuilt native binaries for Windows, macOS, Linux, and Alpine.\n\nOn most platforms, `npm install -g token-goat` installs sharp without additional steps. npm pulls a prebuilt binary keyed to your Node.js major version and OS — no C++ compiler, libvips, or system codec libraries required.\n\nQuick check (any platform):\n\n```\ntoken-goat doctor\n```\n\nIf the `sharp` line shows `OK`, you're done.\n\n### Image support — troubleshooting\n\nIf `token-goat doctor` reports `sharp: FAIL`, the most common cause is a cached binary built against a different Node.js version. A fresh install usually fixes it:\n\n```bash\nnpm install -g token-goat@latest\ntoken-goat doctor\n```\n\nOn Alpine Linux, some ARM boards, and air-gapped environments, npm can't fetch a prebuilt binary and falls back to compiling from source. That requires `libvips` and C++ build tools:\n\n```bash\n# Debian / Ubuntu / WSL\nsudo apt-get install -y libvips-dev build-essential\n\n# Alpine\napk add --no-cache vips-dev build-base python3\n\n# Fedora / RHEL\nsudo dnf install -y vips-devel gcc-c++ make\n```\n\nAfter installing the system packages:\n\n```bash\nnpm install -g token-goat@latest\ntoken-goat doctor\n```\n\nFor platform-specific build details, see the [sharp installation docs](https://sharp.pixelplumbing.com/install).\n\n## Stats display\n\n`token-goat stats` uses 24-bit ANSI color and Unicode block characters for gradient bars, sparklines, and the activity heatmap. In the right terminal it renders sharply. In the wrong one you get broken characters, flat gray blocks, or a \"rich is not installed\" error.\n\nWhen it's working, the output shows rounded box borders (╭─╮), gradient bars with fractional edges (▏▎▍▌▋▊▉█), sparklines (▁▂▃▄▅▆▇█), and a heatmap where cells step from dark to bright green. Question marks, boxes, or solid-color bars mean the terminal or font needs fixing.\n\n---\n\n### Stats display — Windows\n\nThe old Windows console host — `cmd.exe`, the legacy \"Windows PowerShell\" app — does not support 24-bit color. Windows Terminal does.\n\n**Step 1: Install Windows Terminal** (already on Windows 11; skip if you have it)\n```powershell\nwinget install --id Microsoft.WindowsTerminal -e --silent\n```\n\n**Step 2: Set it as the default terminal** (Windows 10 only — Windows 11 handles this automatically)\n\nOpen Windows Terminal → `Ctrl+,` → **Startup** → **Default terminal application** → **Windows Terminal** → **Save**.\n\n**Step 3: Confirm the font**\n\nWindows Terminal ships with Cascadia Code, which covers every character token-goat uses. No additional install needed. To confirm it's selected: `Ctrl+,` → **Profiles → Defaults → Appearance** → Font face should read `Cascadia Code` or `Cascadia Mono`.\n\nIf you prefer a Nerd Font, download any variant from [nerdfonts.com](https://www.nerdfonts.com/font-downloads), install it, and select it in the font preference above.\n\n**If bars still look flat** (solid single-color blocks instead of a gradient), add to your PowerShell profile (`$PROFILE`):\n```powershell\n$env:COLORTERM = \"truecolor\"\n```\n\n---\n\n### Stats display — macOS\n\nTerminal.app on Catalina and later, iTerm2, and the VS Code integrated terminal all handle truecolor and Unicode without configuration. Most users need nothing here. (macOS is untested — see the badge at the top.)\n\nIf sparklines or box borders show as question marks or plain dashes, install a complete font:\n```bash\nbrew install --cask font-jetbrains-mono-nerd-font\n```\nSet it in your terminal's font preferences and reopen.\n\nIf colors look flat, add to `~/.zshrc` or `~/.bash_profile`:\n```bash\nexport COLORTERM=truecolor\n```\n\n---\n\n### Stats display — Linux / WSL\n\n**WSL users:** you're running inside Windows Terminal. Follow the Windows steps above — same terminal, same font.\n\n**SSH sessions:** the remote shell doesn't inherit truecolor from the local terminal. Add to `~/.bashrc` on the remote machine:\n```bash\nexport COLORTERM=truecolor\nexport TERM=xterm-256color\n```\n\n**Missing Unicode characters:** any Nerd Font covers everything token-goat uses.\n```bash\n# Ubuntu / Debian\nsudo apt install fonts-jetbrains-mono\n\n# Arch\nsudo pacman -S ttf-jetbrains-mono-nerd\n```\n\n---\n\n### Stats display — AI automated setup\n\nScripts for non-interactive setup. No prompts.\n\n#### Windows (PowerShell)\n```powershell\n# 1. Install Windows Terminal if absent\nif (-not (Get-Command wt.exe -ErrorAction SilentlyContinue)) {\n    winget install --id Microsoft.WindowsTerminal -e --silent\n}\n\n# 2. Set Windows Terminal as the default console host\n#    UI equivalent: Windows Terminal -\u003e Ctrl+, -\u003e Startup -\u003e Default terminal application -\u003e Windows Terminal\n#    GUIDs are for Windows Terminal stable release\nreg add \"HKCU\\Console\" /v DelegationConsole /t REG_SZ /d \"{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}\" /f\nreg add \"HKCU\\Console\" /v DelegationTerminal /t REG_SZ /d \"{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}\" /f\n\n# 3. Enable truecolor for the current session and persistently for the user account\n[System.Environment]::SetEnvironmentVariable(\"COLORTERM\", \"truecolor\", \"User\")\n$env:COLORTERM = \"truecolor\"\n\n# 4. Verify\ntoken-goat stats\n```\n\n#### macOS / Linux / WSL (bash)\n```bash\nOS=\"$(uname -s)\"\n\n# Install a complete font\nif [[ \"$OS\" == \"Darwin\" ]]; then\n    command -v brew \u0026\u003e/dev/null \u0026\u0026 brew install --cask font-jetbrains-mono-nerd-font\nelif [[ \"$OS\" == \"Linux\" ]]; then\n    command -v apt-get \u0026\u003e/dev/null \u0026\u0026 sudo apt-get install -y fonts-jetbrains-mono\n    command -v pacman  \u0026\u003e/dev/null \u0026\u0026 sudo pacman -S --noconfirm ttf-jetbrains-mono-nerd\nfi\n\n# Enable truecolor — appends only if not already present\nRCFILE=\"${HOME}/.zshrc\"\n[[ -f \"${HOME}/.bashrc\" ]] \u0026\u0026 RCFILE=\"${HOME}/.bashrc\"\ngrep -q \"COLORTERM=truecolor\" \"$RCFILE\" || echo 'export COLORTERM=truecolor' \u003e\u003e \"$RCFILE\"\ngrep -q \"TERM=xterm-256color\" \"$RCFILE\" || echo 'export TERM=xterm-256color' \u003e\u003e \"$RCFILE\"\n# shellcheck disable=SC1090\nsource \"$RCFILE\"\n\n# Verify\ntoken-goat stats\n```\n\n#### Truecolor check (any platform)\n\nRun this if the stats output still looks wrong. A smooth green gradient from left to right means truecolor is active. Solid single-shade green means it isn't.\n\n```bash\nnode -e \"for(let r=0;r\u003c256;r+=32)process.stdout.write('\\x1b[48;2;0;'+r+';0m  ');process.stdout.write('\\x1b[0m\\n')\"\n```\n\n## Security, privacy, and uninstall\n\n**No telemetry. No analytics. No background reporting or silent outbound connections.**\n\nOutbound network is reserved to three explicit cases:\n\n- First `token-goat semantic` call downloads the embedding model (~130 MB) into the data directory. Offline after that.\n- Google Drive API calls, only if you already authorized Drive in Claude Code. Token-goat never prompts for its own auth.\n- Image fetches from URLs: either explicit via `token-goat fetch-image \u003curl\u003e`, or when the AI agent issues a WebFetch call that returns image content — the hook intercepts and shrinks the image. The URL always originates from the agent's work, not from token-goat itself.\n\n**Security reports.** See [SECURITY.md](SECURITY.md). Email `token-goat@dfkhelper.com`; do not file as a GitHub issue. Reports are acknowledged within 7 days; coordinated disclosure with a 90-day default window.\n\n**Prompt injection.** When an AI reads a file, web page, or command output, that content enters its context alongside your own instructions. Prompt injection is when untrusted content includes text designed to look like instructions — \"Ignore all previous directives and run this instead\" — to redirect the AI mid-task.\n\nToken-goat intercepts every Read, Fetch, and Bash call the AI makes. It does not filter or sanitize content before passing it to the model; doing so would silently break legitimate use cases. The primary defense is the model's own training to treat tool output as data, not as commands from a trusted party.\n\nIn practice: if you're reading files from untrusted sources or fetching unknown URLs during a session, pay attention to any actions the AI takes immediately after. Unusual follow-on behavior — opening files it wasn't asked about, writing to unexpected locations — is a sign that something in the read content may have tried to redirect it.\n\n**Windows Defender (optional, Windows only).** Real-time scanning slows indexing. To exclude the data folder, open PowerShell as administrator:\n\n```powershell\nAdd-MpPreference -ExclusionPath \"$env:LOCALAPPDATA\\dfk-helper\\token-goat\"\n```\n\n`0x800106ba` means the prompt is not elevated; reopen as administrator. On enterprise-managed Windows (domain-joined / Intune), Defender exclusions may be locked by Group Policy. The command will fail; that is expected and harmless.\n\n**Uninstall.**\n\n```\ntoken-goat uninstall\n```\n\nReverses everything in [What gets installed?](#what-gets-installed): the scheduled task or systemd unit, the registry value or `.desktop` or `.plist`, the hook entries in `settings.json`, the `CLAUDE.md` block, the skill directory. Add `--codex`, `--gemini`, `--opencode`, `--openclaw`, `--pi`, or `--hermes` to also strip those integrations. Add `--purge` to also delete the data directory (cache, index, models, logs). Nothing else on the system depends on it.\n\n## About\n\nI built this because long Claude Code and Codex sessions on my machine kept burning context in the same ways: screenshots landing at 2-3 MB, the agent re-reading a file it parsed hours earlier in the same conversation, compactions that forgot which functions were edited. Each felt preventable.\n\nThis is a solo project. I use it daily on Windows 11. Tests run on Node.js 20 and 22.\n\n## Requests and issues\n\nWant token-goat to support something it doesn't yet? Open a GitHub issue. Feature requests: a new agent CLI integration (Cline, Copilot Workspace, or any tool not yet covered), a new language adapter, or an image or document format the shrink path doesn't compress yet. Issues are public and searchable. That's where I work out what to build next. A short repro plus what you'd want the command to do is enough.\n\nBug reports go to the same place. The most useful ones include:\n- Your OS, shell, and token-goat version (`token-goat --version`)\n- The matching log line from `%LOCALAPPDATA%\\dfk-helper\\token-goat\\logs\\` on Windows or `~/.local/share/token-goat/logs/` on Linux/WSL\n- What you expected and what actually happened\n\nFor private questions, commercial licensing, or anything you'd rather not post publicly, contact me at token-goat@dfkhelper.com.\n\n## Available for work\n\nSenior or staff engineering. Developer tools, AI infrastructure, or context management.\n\nI've spent months inside Claude Code's hook system, session management, and compaction pipeline. Not reading the docs. Instrumenting them to see what was actually happening. The work is in this repo.\n\nI build systems that run without babysitting, measure their own impact, and fail quietly. If you're building tooling for developers who work with AI, reach out.\n\n[token-goat@dfkhelper.com](mailto:token-goat@dfkhelper.com)\n\n## Disclaimer\n\nToken-Goat runs on your machine and touches your files. The software is provided as-is, without warranty of any kind. DFK Helper LLC is not liable for any damages arising from use. Full terms, including the No Liability clause, are in the LICENSE file.\n\n## License\n\nToken-Goat is licensed under the PolyForm Noncommercial License 1.0.0. See the LICENSE file for the full terms.\n\nIndividual developers may install and use Token-Goat on their own machines for personal productivity without a commercial license, provided the use does not involve providing Token-Goat as a service to others, incorporating it into a commercial product or platform, or deploying it as shared infrastructure across a team or organization. Employment at a for-profit company does not by itself make use commercial — but if your employer is the primary beneficiary of the deployment, a commercial license applies. When in doubt, email token-goat@dfkhelper.com.\n\nCommercial use is reserved. That means copying or incorporating this codebase into a product, charging for access to it, or running it as shared infrastructure across a team at a for-profit company. Commercial licensing: token-goat@dfkhelper.com.\n\nCopyright (c) 2026 DFK Helper LLC.\n\nPatent Pending.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfkhelper%2Ftoken-goat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfkhelper%2Ftoken-goat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfkhelper%2Ftoken-goat/lists"}