token-goat 2.9.26 → 2.9.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -88
- package/SECURITY.md +14 -0
- package/dist/{token-goat-chunk-OZRSREKR.mjs → token-goat-chunk-2AWQ2R5X.mjs} +2 -2
- package/dist/{token-goat-chunk-BH4ZVRB2.mjs → token-goat-chunk-2NNUA2LR.mjs} +4 -4
- package/dist/token-goat-chunk-2WOUYWLM.mjs +955 -0
- package/dist/{token-goat-chunk-IKZLSRII.mjs → token-goat-chunk-435UQTKD.mjs} +5 -3
- package/dist/{token-goat-chunk-62IHOU6L.mjs → token-goat-chunk-44BM7DDQ.mjs} +5 -3
- package/dist/token-goat-chunk-52NSDWYY.mjs +96 -0
- package/dist/{token-goat-chunk-CXBOFPF4.mjs → token-goat-chunk-67BNIKKO.mjs} +32 -18
- package/dist/{token-goat-chunk-XBESNWEX.mjs → token-goat-chunk-6AK46ZT7.mjs} +2 -3
- package/dist/{token-goat-chunk-7SXPJOSZ.mjs → token-goat-chunk-7CPMDFGB.mjs} +166 -40
- package/dist/token-goat-chunk-ASLWOQ3I.mjs +14 -0
- package/dist/{token-goat-chunk-MWID3YOY.mjs → token-goat-chunk-BGYOZ6DO.mjs} +6 -4
- package/dist/{token-goat-chunk-PAV6NNY7.mjs → token-goat-chunk-C5YPNZKQ.mjs} +22 -8
- package/dist/{token-goat-chunk-D2X7XN5M.mjs → token-goat-chunk-CIQ2FTY3.mjs} +23 -242
- package/dist/token-goat-chunk-D4ETHJD6.mjs +246 -0
- package/dist/{token-goat-chunk-7Y6GWTII.mjs → token-goat-chunk-DNRPXHYH.mjs} +25 -17
- package/dist/{token-goat-chunk-L43RKNHA.mjs → token-goat-chunk-DNSPXQXQ.mjs} +2 -2
- package/dist/token-goat-chunk-DPNLUJWB.mjs +220 -0
- package/dist/token-goat-chunk-E4ZOJIZK.mjs +1382 -0
- package/dist/token-goat-chunk-E5TK5DNO.mjs +718 -0
- package/dist/{token-goat-chunk-VVROQBQJ.mjs → token-goat-chunk-EUSDXRXU.mjs} +62 -12
- package/dist/{token-goat-chunk-POOI26O6.mjs → token-goat-chunk-FTP4U4QA.mjs} +12 -8
- package/dist/token-goat-chunk-G23DWHV4.mjs +142 -0
- package/dist/{token-goat-chunk-MDV5VWF4.mjs → token-goat-chunk-G7IWXCFF.mjs} +223 -15
- package/dist/{token-goat-chunk-C2PG4K5D.mjs → token-goat-chunk-GLXRTTLE.mjs} +7 -5
- package/dist/{token-goat-chunk-M6CVNHTW.mjs → token-goat-chunk-H5J3C56Q.mjs} +95 -573
- package/dist/{token-goat-chunk-BAWKGODL.mjs → token-goat-chunk-HNFZZHFW.mjs} +2 -2
- package/dist/{token-goat-chunk-TG5ZPD6B.mjs → token-goat-chunk-HUYUHODZ.mjs} +1036 -759
- package/dist/token-goat-chunk-IVE6U7KV.mjs +53 -0
- package/dist/{token-goat-chunk-ZZT6PVB3.mjs → token-goat-chunk-IVWI2OCK.mjs} +72 -45
- package/dist/{token-goat-chunk-GMOUBOX4.mjs → token-goat-chunk-JTKCQMQA.mjs} +37 -5
- package/dist/{token-goat-chunk-H2CPLEMP.mjs → token-goat-chunk-KOPIR3KZ.mjs} +46 -23
- package/dist/token-goat-chunk-L7H3U27L.mjs +35 -0
- package/dist/{token-goat-chunk-FLEYOCAS.mjs → token-goat-chunk-LZNBQTDK.mjs} +6 -4
- package/dist/token-goat-chunk-MELOKFDJ.mjs +199 -0
- package/dist/{token-goat-chunk-RH27ZSPF.mjs → token-goat-chunk-NMBWLRHW.mjs} +164 -50
- package/dist/{token-goat-chunk-43JFN26X.mjs → token-goat-chunk-O6I2XU4P.mjs} +27 -967
- package/dist/{token-goat-chunk-G6EYO5CD.mjs → token-goat-chunk-ONXH6NZ5.mjs} +2 -87
- package/dist/token-goat-chunk-ORNFMIER.mjs +295 -0
- package/dist/{token-goat-chunk-LHUP4DXZ.mjs → token-goat-chunk-PGTH2U4C.mjs} +1 -1
- package/dist/{token-goat-chunk-5BQ7W7D7.mjs → token-goat-chunk-PKRWMHVP.mjs} +76 -59
- package/dist/{token-goat-chunk-DA43OE7L.mjs → token-goat-chunk-PQ53BSCF.mjs} +1 -1
- package/dist/{token-goat-chunk-STYRLQIW.mjs → token-goat-chunk-PYSUADX4.mjs} +2 -2
- package/dist/{token-goat-chunk-JALB3KWJ.mjs → token-goat-chunk-QO3LXVVR.mjs} +4247 -5005
- package/dist/{token-goat-chunk-L45IWWMC.mjs → token-goat-chunk-RLP6J7WR.mjs} +6 -6
- package/dist/token-goat-chunk-RQGGMPCR.mjs +205 -0
- package/dist/{token-goat-chunk-MBDJR6HU.mjs → token-goat-chunk-RTMVLHWX.mjs} +3708 -4003
- package/dist/{token-goat-chunk-E3K3BTEQ.mjs → token-goat-chunk-S4VSXURL.mjs} +8 -6
- package/dist/{token-goat-chunk-LKSXAMJB.mjs → token-goat-chunk-SE6E4BKJ.mjs} +1 -1
- package/dist/token-goat-chunk-TCQANXYC.mjs +351 -0
- package/dist/token-goat-chunk-TDUT2CL6.mjs +564 -0
- package/dist/{token-goat-chunk-LRIZ7K3F.mjs → token-goat-chunk-TGOXNAHW.mjs} +54 -111
- package/dist/{token-goat-chunk-WNBSCSAI.mjs → token-goat-chunk-UA5BKWWQ.mjs} +1 -1
- package/dist/{token-goat-chunk-RIB6XY2V.mjs → token-goat-chunk-UXSXQQIY.mjs} +1 -1
- package/dist/{token-goat-chunk-7EPYB34H.mjs → token-goat-chunk-VMFWNHGR.mjs} +84 -73
- package/dist/token-goat-chunk-VQ6F6T7X.mjs +36 -0
- package/dist/{token-goat-chunk-5M3NRJD2.mjs → token-goat-chunk-VZQEWRVH.mjs} +6 -4
- package/dist/{token-goat-chunk-OSUFN2FV.mjs → token-goat-chunk-XB5KKOCG.mjs} +5 -25
- package/dist/{token-goat-chunk-6E2IDLHF.mjs → token-goat-chunk-XYWPOSCN.mjs} +57 -615
- package/dist/{token-goat-chunk-CQHY4SL7.mjs → token-goat-chunk-YAGLESS3.mjs} +8 -5
- package/dist/token-goat-chunk-YKSRAWUU.mjs +33 -0
- package/dist/{token-goat-chunk-F2ARFHLJ.mjs → token-goat-chunk-YOOVFPTP.mjs} +2 -2
- package/dist/{token-goat-chunk-EEIDFMEM.mjs → token-goat-chunk-YZAAZU2S.mjs} +12 -3
- package/dist/token-goat-chunk-Z6KBMOBI.mjs +53 -0
- package/dist/{token-goat-chunk-4GEDH2WU.mjs → token-goat-chunk-ZER6EAXZ.mjs} +81 -70
- package/dist/token-goat-hook-client.cjs +475 -0
- package/dist/token-goat-hook-client.mjs +26 -0
- package/dist/token-goat-hook.mjs +31 -21
- package/dist/token-goat.core.mjs +9 -39
- package/docs/C4_RUNTIME_ARCHITECTURE.md +2 -2
- package/docs/cli.md +35 -23
- package/docs/install.md +18 -14
- package/package.json +1 -1
- package/dist/token-goat-chunk-ADMR3QVF.mjs +0 -41
- package/dist/token-goat-chunk-E6B2UFDF.mjs +0 -30
- package/dist/token-goat-chunk-GKZ2US5B.mjs +0 -187
- package/dist/token-goat-chunk-MZTO4FXH.mjs +0 -26
package/README.md
CHANGED
|
@@ -43,17 +43,9 @@ Restart your AI sessions. Run `token-goat stats` a couple of minutes after your
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
<p align="center">
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<sub>Same requirements, smarter input: fewer input tokens, shorter answers, and context that stops compounding across rounds</sub>
|
|
50
|
-
</p>
|
|
51
|
-
|
|
52
|
-
<p align="center">
|
|
53
|
-
<img src="assets/stats_v180.png" alt="token-goat stats display" width="589">
|
|
54
|
-
<br>
|
|
55
|
-
<sub>Stats display — gradient bars, sparklines, and a calendar heatmap in 24-bit color</sub>
|
|
56
|
-
</p>
|
|
46
|
+
<p align="center"> <img src="assets/token-goat-comparison.jpg" alt="Side-by-side comparison: a bloated workflow sends whole files and grows context every round, while token-goat sends only the needed lines and stays lean" width="900"> <br> <sub>Same requirements, smarter input: fewer input tokens, shorter answers, and context that stops compounding across rounds</sub> </p>
|
|
47
|
+
|
|
48
|
+
<p align="center"> <img src="assets/stats_v180.png" alt="token-goat stats display" width="589"> <br> <sub>Stats display — gradient bars, sparklines, and a calendar heatmap in 24-bit color</sub> </p>
|
|
57
49
|
|
|
58
50
|
## The problem
|
|
59
51
|
|
|
@@ -123,6 +115,8 @@ The fastest way to reduce AI token costs is fixing these five, not writing short
|
|
|
123
115
|
| SQLite database (.db, .sqlite, .sqlite3, .db3) opened via Read | Full read denied; redirects to the SQLite narrow-slice family (`sqlite-tables`/`sqlite-schema`/`sqlite-query`) instead of reading binary bytes into context |
|
|
124
116
|
| Parquet file (.parquet) opened via Read | Full read denied; redirects to DuckDB for SQL querying instead of reading binary columnar data |
|
|
125
117
|
| Large JSON or YAML file (≥20 KB) read in full | Top-level keys or array summary previewed; redirects to `json-outline`/`json-query` or `yaml-outline`/`yaml-query` instead of blowing context on multi-megabyte payloads |
|
|
118
|
+
| A file read through inline Python, Node or PowerShell (`python -c "...open('r.json')..."`) | Runs capped at 2,000 tokens with no other filtering, so a one-key projection comes back whole; a whole-file dump is cut, ends with a recall id, and names `json-outline`/`json-query` for JSON and YAML. Still refused where the wrapper cannot run: a pipeline or chain, a background `&`, compression turned off |
|
|
119
|
+
| Findings you want to survive a compaction | `token-goat note set <key> "<finding>"` stores one per project; notes print at every session start and in the compaction manifest |
|
|
126
120
|
| Large JSON Lines file (.jsonl ≥20 KB) read in full | Record count and first-record schema shown; suggests slicing records with offset/limit instead of loading millions of tokens |
|
|
127
121
|
| Other Office binary (.odt, .ods, .ott, .odp) opened via Read | Full read denied; redirects to `pandoc` for text extraction (no dedicated reader for these formats yet) |
|
|
128
122
|
| Large CSV or TSV file (≥10 KB) read in full | Column headers, row count, and 3 sample rows shown; `token-goat csv-query` projects columns and/or filters rows instead of a full read; `duckdb` query suggestion for very large tabular data |
|
|
@@ -142,7 +136,7 @@ The fastest way to reduce AI token costs is fixing these five, not writing short
|
|
|
142
136
|
| Browser-automation MCP tool result (claude-in-chrome's `read_console_messages`/`read_network_requests`, chrome-devtools-mcp's `list_console_messages`/`list_network_requests`) carries verbose CDP plumbing per entry | Browser compression pack strips console `stackTrace` frames and network `requestHeaders`/`responseHeaders`/`timing`/`initiator`/`securityDetails`/cookie fields, keeping `url`/`method`/`status`/`resourceType`/`mimeType`/`reqid` and the actual log text, before the same table-ifying pass runs — same opt-out and full-recovery-by-id guarantee |
|
|
143
137
|
| Atlassian MCP tool result (Jira issues, Confluence pages, search results) carries repetitive UI chrome and schemas | Atlassian compression pack strips boilerplate fields (`avatarUrls`, `iconUrl`, `self`, `expand`, `schema`, `operations`, `editmeta`, `names`, `_links`, `timeZone`), reducing payloads by 60–80% before table compression |
|
|
144
138
|
| Oversized MCP tool result (≥25 KB) or dumped JSON tool spill file (e.g. `content.json`) re-read whole into context | Oversized MCP results return an elision preview and recovery ID; pre-read hooks intercept tool spill files, redirecting models to `token-goat mcp-output --json-query '<path>'` or `--file <path>` (~90–98% smaller) |
|
|
145
|
-
| Large XML package (.dtsx, .ampkg, .xaml) read in full or paged with sequential line ranges | Pre-read hook intercepts package reads (20KB threshold) with package-specific hierarchy advice; sequential
|
|
139
|
+
| Large XML package (.dtsx, .ampkg, .xaml) read in full or paged with sequential line ranges | Pre-read hook intercepts package reads (20KB threshold) with package-specific hierarchy advice; a fourth sequential range is denied once and redirected to `xml-outline` and `xml-query` |
|
|
146
140
|
| Scratch terminal script or shell command used to inspect XML (`Select-Xml`, `[xml]`, `inspect_*.ps1`, Python `xml.etree`, `xmllint`) | Pre-bash hook intercepts terminal XML parsing commands, recommending `token-goat xml-query --xpath <expr>` or `xml-outline` instead of multi-step script generation (~85–95% smaller) |
|
|
147
141
|
| XML document with deep element hierarchies or entity-encoded XML/AML payloads | `token-goat xml-query <file> --xpath <expr>` extracts targeted elements with exact line ranges (`--with-lines`), and `--decode-embedded-xml` pretty-prints and bounds nested AML payloads (~80–95% smaller) |
|
|
148
142
|
| `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 |
|
|
@@ -184,6 +178,7 @@ The fastest way to reduce AI token costs is fixing these five, not writing short
|
|
|
184
178
|
| Broad recursive Glob sweep (`*`, `**/*`) on root directory | Pre-Glob hook warns against tree-dumping and points at `token-goat map --compact` for fast, lightweight structure inspection |
|
|
185
179
|
| Guessing database column names in `session_store_sql` / `sql` and falling back to `SELECT *` | `token-goat session-schema [table]` and `describe <target>` provide instant schema discovery; `post_tool_use_failure` hook intercepts unknown columns and guides the query — ~85–95% smaller than trial-and-error `SELECT *` dumps |
|
|
186
180
|
| Compound test/build pipeline (`npm run build && npm run typecheck && npm test`) | Post-Bash hook routes chained build/test/lint commands to `generic-ci` compression, dropping verbose passing steps and compiler noise |
|
|
181
|
+
| Verbose command output on Windows under Codex CLI, Copilot CLI, or a PowerShell session, where the compression hook used to skip every command | Pre-Bash hook hands the command to PowerShell itself, base64-encoded through an environment variable the launched script clears first, so backslashes, quotes, and redirection survive and the output is compressed like anywhere else |
|
|
187
182
|
|
|
188
183
|
On 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.
|
|
189
184
|
|
|
@@ -196,9 +191,10 @@ cd ~/notes # or any plain folder of .md files, no .git required
|
|
|
196
191
|
token-goat index . --walk # non-git folders need --walk (git repos: plain `token-goat index .`)
|
|
197
192
|
token-goat semantic --preflight # verify runtime, model weights & project coverage
|
|
198
193
|
token-goat semantic "how long to steep cold brew"
|
|
194
|
+
token-goat semantic "how long to steep cold brew" "best grind for a pour-over" # several queries in one call
|
|
199
195
|
```
|
|
200
196
|
|
|
201
|
-
Returns relevance-ranked, distance-scored hits straight from the notes, the same surgical-read path used for code.
|
|
197
|
+
Returns relevance-ranked, distance-scored hits straight from the notes, the same surgical-read path used for code. When the closest hit is a weak match (too far from the query to trust), a notice names the distance, so a weak hit is not mistaken for an answer.
|
|
202
198
|
|
|
203
199
|
## Token savings, measured
|
|
204
200
|
|
|
@@ -341,6 +337,8 @@ token-goat doctor # confirms hooks are wired; reports any failure it fi
|
|
|
341
337
|
|
|
342
338
|
Three commands. Hooks register and start working immediately: no terminal popups, no tray icon, no service to babysit. That wires up Claude Code; other agent CLIs are added with a flag (`--codex`, `--copilot`, and siblings).
|
|
343
339
|
|
|
340
|
+
> **WSL performance tip:** Keep active repositories on WSL's native ext4 filesystem (`~/projects/...`) rather than Windows mounts (`/mnt/c/...`) to avoid 9P cross-OS filesystem translation overhead during initial indexing.
|
|
341
|
+
|
|
344
342
|
Per-harness setup for Codex, Gemini, Qwen, Kimi, opencode, OpenClaw, pi, Copilot, Grok and Cline/Windsurf/Cursor, the companion CLI tools worth installing alongside it, upgrading, and the full list of what lands on your machine: **[Install guide](docs/install.md)**.
|
|
345
343
|
|
|
346
344
|
## CLI
|
|
@@ -387,64 +385,17 @@ token-goat handoff-resolve review-notes --full
|
|
|
387
385
|
}
|
|
388
386
|
```
|
|
389
387
|
|
|
390
|
-
`token-goat install --vscode` creates or idempotently updates VS Code's
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
`~/.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
install
|
|
401
|
-
entry (registering it twice would duplicate its tool schemas in that
|
|
402
|
-
workspace). It also installs agent hooks in `~/.copilot/hooks/` (or
|
|
403
|
-
`.github/hooks/` with `-p`), the folder VS Code's Copilot agent reads hooks
|
|
404
|
-
from, so token-goat sees the agent's built-in reads, edits, and terminal
|
|
405
|
-
commands. `token-goat uninstall --vscode` (add `-p`/`--project` for the
|
|
406
|
-
project scope) removes only token-goat's server entry, guidance block, and
|
|
407
|
-
hooks, and keeps the hooks if `--copilot` still uses them.
|
|
408
|
-
|
|
409
|
-
**Visual Studio** (2022 17.14 or later, or 2026): `token-goat install --visualstudio`
|
|
410
|
-
adds the same `servers` entry to `%USERPROFILE%\.mcp.json` and a routing block
|
|
411
|
-
to `%USERPROFILE%\copilot-instructions.md` (Visual Studio 2026 reads that
|
|
412
|
-
file). With `-p`/`--project` it writes `.mcp.json` and
|
|
413
|
-
`.github/copilot-instructions.md` in the solution folder instead. Visual Studio
|
|
414
|
-
has no agent hooks, so token-goat works there through its MCP tools and
|
|
415
|
-
instructions only: no read dedup, hints, image shrink, or output folding. Two
|
|
416
|
-
switches in Visual Studio turn it on: the Tools > Options checkbox for custom
|
|
417
|
-
instructions, and the token-goat tools in the chat Tools picker, since new MCP
|
|
418
|
-
tools start disabled. `token-goat uninstall --visualstudio` (add `-p` for the
|
|
419
|
-
project) removes only token-goat's entry and block. See
|
|
420
|
-
[Visual Studio users](docs/install.md#visual-studio-users).
|
|
421
|
-
|
|
422
|
-
**Zed**: `token-goat install --zed` registers token-goat as an MCP context
|
|
423
|
-
server in Zed's `settings.json` (user scope only — Zed has no
|
|
424
|
-
project-local equivalent). Zed's first-party agent has no hooks API at all,
|
|
425
|
-
so this is MCP tools only, the same limits as Visual Studio above: no read
|
|
426
|
-
dedup, hints, image shrink, or output folding. Enable the token-goat server
|
|
427
|
-
under Zed's Agent panel tools list after installing; new MCP servers start
|
|
428
|
-
disabled. `token-goat uninstall --zed` removes the entry and its generated
|
|
429
|
-
shim script. See [Zed users](docs/install.md#zed-users).
|
|
430
|
-
|
|
431
|
-
**Cursor**: `token-goat install --cursor` registers token-goat as an MCP
|
|
432
|
-
server in `~/.cursor/mcp.json` (`-p`/`--project` for
|
|
433
|
-
`<project>/.cursor/mcp.json`). This never touches `~/.cursor/hooks.json`:
|
|
434
|
-
Cursor already imports Claude Code's hooks from `~/.claude/settings.json` by
|
|
435
|
-
default, so a plain `token-goat install` for Claude Code already gets hooks
|
|
436
|
-
running in Cursor too, with no separate Cursor hooks file to maintain or risk
|
|
437
|
-
clobbering. `token-goat uninstall --cursor` removes only the MCP entry. See
|
|
438
|
-
[Cursor users](docs/install.md#cursor-users).
|
|
439
|
-
|
|
440
|
-
**JetBrains** (WebStorm, IntelliJ, PyCharm, Rider, PhpStorm): no integration
|
|
441
|
-
today — no hooks, no MCP, no terminal filter. See
|
|
442
|
-
[JetBrains IDEs users](docs/install.md#jetbrains-ides-webstorm-intellij-pycharm-rider-phpstorm-users)
|
|
443
|
-
for why and what a Copilot-for-JetBrains user might already get for free.
|
|
444
|
-
|
|
445
|
-
The optional source-controlled extension lives in `vscode-extension/`. Build
|
|
446
|
-
and install its VSIX manually; `--vscode` intentionally does not copy or
|
|
447
|
-
install extensions:
|
|
388
|
+
`token-goat install --vscode` creates or idempotently updates VS Code's user-profile `mcp.json` by default (`%APPDATA%\Code\User\mcp.json` on Windows, `~/Library/Application Support/Code/User/mcp.json` on macOS, `~/.config/Code/User/mcp.json` on Linux) — add `-p`/`--project` for the project-local `.vscode/mcp.json` shown above instead. It also adds a delimited routing block, preserving unrelated JSON and user text: to `~/.copilot/instructions/token-goat.instructions.md` for the user install (a personal instructions file VS Code applies in every workspace, so the folder you run it from is left alone), or to `.github/copilot-instructions.md` with `-p`. It fails clearly on malformed JSON, and refuses to install into one scope if the other scope already has a token-goat-managed entry (registering it twice would duplicate its tool schemas in that workspace). It also installs agent hooks in `~/.copilot/hooks/` (or `.github/hooks/` with `-p`), the folder VS Code's Copilot agent reads hooks from, so token-goat sees the agent's built-in reads, edits, and terminal commands. `token-goat uninstall --vscode` (add `-p`/`--project` for the project scope) removes only token-goat's server entry, guidance block, and hooks, and keeps the hooks if `--copilot` still uses them.
|
|
389
|
+
|
|
390
|
+
**Visual Studio** (2022 17.14 or later, or 2026): `token-goat install --visualstudio` adds the same `servers` entry to `%USERPROFILE%\.mcp.json` and a routing block to `%USERPROFILE%\copilot-instructions.md` (Visual Studio 2026 reads that file). With `-p`/`--project` it writes `.mcp.json` and `.github/copilot-instructions.md` in the solution folder instead. Visual Studio has no agent hooks, so token-goat works there through its MCP tools and instructions only: no read dedup, hints, image shrink, or output folding. Two switches in Visual Studio turn it on: the Tools > Options checkbox for custom instructions, and the token-goat tools in the chat Tools picker, since new MCP tools start disabled. `token-goat uninstall --visualstudio` (add `-p` for the project) removes only token-goat's entry and block. See [Visual Studio users](docs/install.md#visual-studio-users).
|
|
391
|
+
|
|
392
|
+
**Zed**: `token-goat install --zed` registers token-goat as an MCP context server in Zed's `settings.json` (user scope only — Zed has no project-local equivalent). Zed's first-party agent has no hooks API at all, so this is MCP tools only, the same limits as Visual Studio above: no read dedup, hints, image shrink, or output folding. Enable the token-goat server under Zed's Agent panel tools list after installing; new MCP servers start disabled. `token-goat uninstall --zed` removes the entry and its generated shim script. See [Zed users](docs/install.md#zed-users).
|
|
393
|
+
|
|
394
|
+
**Cursor**: `token-goat install --cursor` registers token-goat as an MCP server in `~/.cursor/mcp.json` (`-p`/`--project` for `<project>/.cursor/mcp.json`). This never touches `~/.cursor/hooks.json`: Cursor already imports Claude Code's hooks from `~/.claude/settings.json` by default, so a plain `token-goat install` for Claude Code already gets hooks running in Cursor too, with no separate Cursor hooks file to maintain or risk clobbering. `token-goat uninstall --cursor` removes only the MCP entry. See [Cursor users](docs/install.md#cursor-users).
|
|
395
|
+
|
|
396
|
+
**JetBrains** (WebStorm, IntelliJ, PyCharm, Rider, PhpStorm): no integration today — no hooks, no MCP, no terminal filter. See [JetBrains IDEs users](docs/install.md#jetbrains-ides-webstorm-intellij-pycharm-rider-phpstorm-users) for why and what a Copilot-for-JetBrains user might already get for free.
|
|
397
|
+
|
|
398
|
+
The optional source-controlled extension lives in `vscode-extension/`. Build and install its VSIX manually; `--vscode` intentionally does not copy or install extensions:
|
|
448
399
|
|
|
449
400
|
```text
|
|
450
401
|
cd vscode-extension
|
|
@@ -454,24 +405,11 @@ npx @vscode/vsce package
|
|
|
454
405
|
code --install-extension token-goat-vscode-0.1.0.vsix
|
|
455
406
|
```
|
|
456
407
|
|
|
457
|
-
Its commands call the local CLI and use `workbench.action.chat.open` to
|
|
458
|
-
prefill chat. They never submit chat automatically.
|
|
408
|
+
Its commands call the local CLI and use `workbench.action.chat.open` to prefill chat. They never submit chat automatically.
|
|
459
409
|
|
|
460
|
-
Installing the extension is an alternative to `install --vscode`, not an
|
|
461
|
-
addition to it: the extension contributes the MCP decoder itself through VS
|
|
462
|
-
Code's `mcpServerDefinitionProviders` contribution point, so VS Code starts
|
|
463
|
-
`token-goat mcp-serve` on demand and there is no `mcp.json` to write and no
|
|
464
|
-
window to reload. That path needs VS Code 1.101 or newer, which the
|
|
465
|
-
extension's `engines` field requires. `install --vscode` remains the way to
|
|
466
|
-
configure the decoder without the extension — for Copilot in an editor that
|
|
467
|
-
has no extension installed, or for any other MCP client.
|
|
410
|
+
Installing the extension is an alternative to `install --vscode`, not an addition to it: the extension contributes the MCP decoder itself through VS Code's `mcpServerDefinitionProviders` contribution point, so VS Code starts `token-goat mcp-serve` on demand and there is no `mcp.json` to write and no window to reload. That path needs VS Code 1.101 or newer, which the extension's `engines` field requires. `install --vscode` remains the way to configure the decoder without the extension — for Copilot in an editor that has no extension installed, or for any other MCP client.
|
|
468
411
|
|
|
469
|
-
If the extension is running somewhere that contribution did not take effect,
|
|
470
|
-
it falls back to calling `token-goat mcp-status --vscode` (add
|
|
471
|
-
`-p`/`--project` for the workspace scope too) to check whether `mcp.json`
|
|
472
|
-
already configures the decoder, and offers to run `install --vscode` if not —
|
|
473
|
-
the same path resolver `install`/`uninstall` write against, so the two can
|
|
474
|
-
never drift on where `mcp.json` lives or what key name it looks for.
|
|
412
|
+
If the extension is running somewhere that contribution did not take effect, it falls back to calling `token-goat mcp-status --vscode` (add `-p`/`--project` for the workspace scope too) to check whether `mcp.json` already configures the decoder, and offers to run `install --vscode` if not — the same path resolver `install`/`uninstall` write against, so the two can never drift on where `mcp.json` lives or what key name it looks for.
|
|
475
413
|
|
|
476
414
|
**Copilot CLI** — add it to `~/.copilot/mcp-config.json`:
|
|
477
415
|
|
|
@@ -494,12 +432,16 @@ never drift on where `mcp.json` lives or what key name it looks for.
|
|
|
494
432
|
|
|
495
433
|
**What the index actually holds, in plain terms.** The point of a surgical read is returning a function body without the file around it, which means the database stores those bodies. `symbols.body` holds the source text of every indexed symbol, `symbols.docstring` its doc comment, `refs.context` the line around each reference, and `chunks.text` the passages that semantic search embeds. There is also a full-text index over the bodies and docstrings. So the database is not a list of names and line numbers: it is a substantial copy of your source, sitting in a plain unencrypted SQLite file outside the repository.
|
|
496
434
|
|
|
435
|
+
**How branch switches work.** The database tracks the active working tree by absolute path, not git branches or commit history. When branches switch, the index updates to match what is currently on disk. In-session commands like `git checkout` or `git switch` trigger a hook that queues changed files for reindexing. If branches switch in another terminal, token-goat catches drifted files during session-start reconciliation, and surgical reads self-heal on the fly if they hit a modified file. For frequent multi-branch work, consider `git worktree`. Each worktree gets its own directory and distinct index, eliminating reindexing churn between branches.
|
|
436
|
+
|
|
497
437
|
The file-by-file table for each harness, and the path that file sits at: **[What gets installed](docs/install.md#what-gets-installed)** (see also **[Permissions & auto-approval](docs/install.md#command-auto-approval-and-permissions)**).
|
|
498
438
|
|
|
499
439
|
## Zero maintenance
|
|
500
440
|
|
|
501
441
|
Hooks fire automatically on every tool call once installed — nothing to start or restart there. The background worker is a separate, manual step: `token-goat worker start` launches it as a detached process, `token-goat worker status` checks it, `token-goat worker stop` kills it. It restarts itself automatically if it crashes or gets killed while the machine is running — an edit hook checks its liveness and respawns it, rate-limited to about once every 5 minutes. It does not survive a reboot or logout, though; re-run `worker start` after either. `token-goat uninstall` removes the hook entries, `CLAUDE.md` block, and skill directory, but does not touch a running worker — stop it separately with `token-goat worker stop` if you no longer want it running.
|
|
502
442
|
|
|
443
|
+
Hooks also answer faster after the first call. That call starts a small resident process, the hook server, and later hook calls go to it instead of starting Node and loading token-goat each time. In measurements on Windows that took a hook call from 110 to 135 ms down to about 70 ms in Claude Code, Codex, Copilot CLI and VS Code chat, and a read command such as `token-goat section` from 122 ms to 60 ms when its output goes to the agent rather than a terminal. You never start it yourself. It stops after 30 minutes idle, after an upgrade, when you turn it off, and when `uninstall --purge` runs. `token-goat hook-server status` shows what is running and `token-goat hook-server stop` stops it. To turn it off, set `server = false` under `[hooks]` in your global config, or `TOKEN_GOAT_HOOK_SERVER=0`. A project's `.token-goat.toml` cannot change this setting, because one server answers every project.
|
|
444
|
+
|
|
503
445
|
To move to a newer release, `token-goat upgrade` installs it from npm and then re-runs `token-goat install`, so your hooks and integration manifests point at the build that just landed. `token-goat upgrade --check` reports whether one is available without installing anything, and `--json` gives the same answer for a script. Both go quiet when `network.offline` is set, and `token-goat doctor` mentions an available update at the end of its report.
|
|
504
446
|
|
|
505
447
|
## Verify
|
|
@@ -513,7 +455,7 @@ token-goat stats
|
|
|
513
455
|
|
|
514
456
|
### Confirming hooks are wired
|
|
515
457
|
|
|
516
|
-
`doctor` checks the binary, worker, database, and disk. It does not inspect `settings.json` hook wiring. To confirm all three hooks are present, re-run `install`:
|
|
458
|
+
`doctor` checks the binary, worker, database, and disk, and whether the installed Claude Code, Codex and Copilot hook shims match the running build. It does not inspect `settings.json` hook wiring. To confirm all three hooks are present, re-run `install`:
|
|
517
459
|
|
|
518
460
|
```
|
|
519
461
|
token-goat install
|
package/SECURITY.md
CHANGED
|
@@ -99,6 +99,20 @@ Direct dependencies with a forward patch are kept current rather than pinned: `p
|
|
|
99
99
|
|
|
100
100
|
For a scanner that ingests a bill of materials rather than a lockfile, `npm run sbom` writes CycloneDX 1.5 to stdout.
|
|
101
101
|
|
|
102
|
+
## What actually runs
|
|
103
|
+
|
|
104
|
+
The supply-chain attacks worth planning for no longer run at install time. Blocking `preinstall` and `postinstall` hooks answers the previous generation; the current one ships a package that installs cleanly, passes a static scan, and hides its payload inside a method the host application is certain to call once it starts working normally. Nothing about that install looks wrong, so nothing examining the install can find it.
|
|
105
|
+
|
|
106
|
+
What the class still needs is a package in the tree, which is why the number that matters here is how few there are. Exactly one package is required at runtime: [`jsonc-parser`](https://www.npmjs.com/package/jsonc-parser), bundled into the shipped artifact at build time. Every other production dependency is `optional` and resolved lazily, so its code runs only if you use the feature that needs it, on an install that actually has it. Skip optional packages, as the second row of the table above does, and the whole install is two packages: Token-Goat and that one dependency.
|
|
107
|
+
|
|
108
|
+
Which names may appear in that tree is pinned in [`tests/guards/runtime_dependency_set_is_locked.test.ts`](tests/guards/runtime_dependency_set_is_locked.test.ts) and checked on every CI run. A dependency that arrives through a routine version bump fails the build and names itself, rather than quietly beginning to execute in every install. Installs themselves are `npm ci` against the committed lockfile, so resolution cannot drift from what was reviewed, and Dependabot proposals wait seven days ([`.github/dependabot.yml`](.github/dependabot.yml)) rather than adopting a version on the day it is published.
|
|
109
|
+
|
|
110
|
+
The lockfile is not the only thing that decides what loads, so it is not the only thing checked. [`tests/guards/bundle_runtime_imports_are_reviewed.test.ts`](tests/guards/bundle_runtime_imports_are_reviewed.test.ts) reads the built artifact instead and requires every package name it can resolve at run time to have been reviewed — including the ones the lockfile cannot show you, such as a module the host agent supplies out of its own process. Installing this package runs nothing: it declares no `preinstall`, `install`, or `postinstall` script, which [`tests/guards/lifecycle_script_is_published.test.ts`](tests/guards/lifecycle_script_is_published.test.ts) keeps at zero rather than leaving to habit. `npm audit signatures` runs in CI and before every commit that moves the lockfile, so a tarball altered after publication fails rather than installs.
|
|
111
|
+
|
|
112
|
+
Releases are built and published by two separate jobs ([`.github/workflows/publish.yml`](.github/workflows/publish.yml)). Everything that executes dependency code — `npm ci`, the suite, the build — runs in a job that holds no registry credential, and the only thing crossing into the publishing job is the built bundle. That job installs nothing and passes `--ignore-scripts`, so no lifecycle hook can run beside the upload; [`tests/guards/publish_job_runs_no_dependency_code.test.ts`](tests/guards/publish_job_runs_no_dependency_code.test.ts) holds the split. This does not make a release untamperable, and it is not claimed to: the build itself is a bundler running dependency code, so the artifact is the residual risk. It is a smaller one than a writable checkout sharing a job with a publish token.
|
|
113
|
+
|
|
114
|
+
None of this inspects what a dependency does once it runs. It bounds how much third-party code can run at all, and makes any change to that set something a person has to agree to.
|
|
115
|
+
|
|
102
116
|
## Verifying what you installed
|
|
103
117
|
|
|
104
118
|
Every published version is built and pushed by one workflow, [`.github/workflows/publish.yml`](.github/workflows/publish.yml), which runs only when a GitHub release is published (or manually, and then only from `main`). It publishes with npm provenance, so npm holds a signed attestation tying the tarball to the commit and workflow run that produced it. Nothing is ever published from a developer workstation.
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
openReadonlySqlite,
|
|
12
12
|
runReadOnlySqliteQuery,
|
|
13
13
|
validateReadOnlySelect
|
|
14
|
-
} from "./token-goat-chunk-
|
|
15
|
-
import "./token-goat-chunk-
|
|
14
|
+
} from "./token-goat-chunk-PQ53BSCF.mjs";
|
|
15
|
+
import "./token-goat-chunk-XB5KKOCG.mjs";
|
|
16
16
|
import "./token-goat-chunk-NMTKNYGF.mjs";
|
|
17
17
|
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
18
18
|
export {
|
|
@@ -2,13 +2,13 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
loadConfig
|
|
5
|
-
} from "./token-goat-chunk-
|
|
6
|
-
import {
|
|
7
|
-
VERSION
|
|
8
|
-
} from "./token-goat-chunk-6E2IDLHF.mjs";
|
|
5
|
+
} from "./token-goat-chunk-TGOXNAHW.mjs";
|
|
9
6
|
import {
|
|
10
7
|
displaySafeJson
|
|
11
8
|
} from "./token-goat-chunk-NMTKNYGF.mjs";
|
|
9
|
+
import {
|
|
10
|
+
VERSION
|
|
11
|
+
} from "./token-goat-chunk-MELOKFDJ.mjs";
|
|
12
12
|
import {
|
|
13
13
|
init_define_import_meta_env
|
|
14
14
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|