← Back to directory
T

Token-Goat

Community
Reduce wasted AI coding context and keep agents focused.
GitHub source repository ↗
★ 62 Stars Category · Dev Tools Very popular
43FMRS · D
Reliability
4/20
Security and permissions
8/20
Maintenance
8/20
Documentation
13/20
Setup experience
10/20

Token-Goat is a local token-optimization and hook tool for AI coding CLIs, not a clearly evidenced standalone MCP server: the supplied material provides no server manifest, MCP transport, or tool inventory. Its primary value is reducing context noise and repeated reads; deployment should be reviewed for configuration changes, file access, cache retention, and the validation status of each client bridge.

Read the FMRS scoring method →

Token-Goat is a Node.js-based CLI and hook system for compressing terminal output, shrinking images, intercepting repeated reads, extracting code or document slices, generating compact manifests, caching Bash/Web/MCP output, and scanning fetched web content for prompt-injection patterns. The README claims 40–90% reductions in AI token use or cost; actual results depend on the workflow.

Tools

The tool list has not been reviewed yet.

Setup

Requires Node.js 22 or later. Run npm install -g token-goat, then token-goat install and token-goat doctor. Codex CLI users can run token-goat install --codex; Gemini, Qwen, Copilot, OpenCode, pi, and Grok CLI have corresponding install options. Restart AI sessions after installation. The background indexer is not started by install; run token-goat worker start if needed.

Fit and risk

Best for

  • Developers who regularly use Claude Code, Codex CLI, Gemini CLI, or other supported AI coding CLIs.
  • Users seeking to reduce context usage from large repositories, logs, screenshots, and skill files.
  • Users comfortable with modifying local AI-client configuration and creating indexes and caches.

Not for

  • Users seeking a standard MCP server manifest, documented MCP transport, or directly callable MCP tool inventory.
  • Users who do not want a global npm package, registered hooks, or client-configuration changes.
  • Production users requiring validated macOS support; the README labels macOS as untested.

Required permissions

  • Requires installing a global Node.js/npm package.
  • Requires writing client configuration and hook files for supported AI tools.
  • Requires reading project files, Git information, and relevant session data to build indexes, caches, and compact manifests.
  • The optional worker runs as a local background process.

Risks and side effects

  • Hooks intercept or rewrite reads, Bash commands, screenshots, and other tool calls, which can change how original output is presented.
  • Indexes, caches, and session manifests store project or tool output locally; the README does not document complete retention or encryption behavior.
  • The README claims to scan fetched web content and block prompt injection, but this should not replace human review or the client's own security controls.
  • Some bridges are not validated against live instances, including the documented Qwen, OpenClaw, and pi integrations; Copilot hook failures can deny all tool calls in a session.
  • Repository metadata says NOASSERTION for the license, while the README badge shows PolyForm Noncommercial; verify the repository license before use.

Troubleshooting

  1. Run `token-goat doctor` to verify hooks and confirm `sharp: ok`.
  2. If image processing fails, inspect the doctor output; the README notes that Alpine musl and some ARM environments may compile sharp from source.
  3. Fully restart the AI CLI after installing or updating hooks, especially Copilot CLI.
  4. Use `token-goat worker status` to inspect the index worker, and `worker start` or `worker stop` as needed.
  5. If the index is stale, run `token-goat index` or use `--force-refresh` on supported read commands.

Use cases

Compress verbose output from pytest, npm, Docker, Git, compilers, and other development CLIs.
Retrieve focused code and documentation slices with `token-goat read`, `section`, `symbol`, or `skeleton`.
Preserve edited files, accessed symbols, and key reads during session compaction.
Shrink screenshots and cache repeated Bash, web, and MCP outputs.
Register read, compression, and session hooks for supported AI CLIs.

Supported clients

Claude CodeFull support
Codex CLIFull support
Gemini CLIFull support
Qwen CodeFull support
Copilot CLIPartial support
OpenCodePartial support
piPartial support
Grok CLIPartial support