tokencanary
v0.1.7
Published
CLI and daemon that reduces Claude Code token usage via hooks and local analysis
Readme
Token Canary
Token Canary is a CLI and daemon that reduces Claude Code token usage using hooks and lightweight local analysis. You get prompt compression and lower usage while still running claude as usual—no alias required.
- 30-day free trial — full optimization from first install
- Prompt compression — dedupe lines, keep first stack trace
- License-aware — optimization runs only when the license is valid
Install
Requirements: Node.js 18+, Claude Code installed (claude on PATH), macOS or Linux.
npm install -g tokencanaryQuick start
Install
npm install -g tokencanarySet up Token Canary
tokencanary doctor
tokencanary setupStart using Claude Code normally
claudetokencanary setup checks your environment, starts your trial (via our servers), writes config to ~/.tokencanary/, and configures Claude Code hooks automatically when possible. If auto-config isn’t available, it prints clear instructions. An internet connection is required for setup and for refreshing license status.
How it works
The CLI installs a small daemon and writes a hook config file. Claude Code sends prompts through the configured URLs; Token Canary compresses them locally and forwards the result. All prompt processing stays on your machine. Trial and license are validated by our servers; the CLI and daemon cache license status and can use it offline for a short grace period.
Commands
| Command | Description |
|--------|-------------|
| tokencanary doctor | Check environment (Claude Code, OS, config) |
| tokencanary setup | Set up hooks, start trial, start daemon |
| tokencanary install | Alias for setup |
| tokencanary stop | Stop the daemon |
| tokencanary uninstall | Stop daemon and remove ~/.tokencanary |
| tokencanary status | Daemon and license status |
| tokencanary stats | Session savings (requests optimized, chars reduced) |
| tokencanary logs | Recent logs (~/.tokencanary/logs/) |
| tokencanary upgrade | Open browser to subscribe ($19/mo or $99/yr) |
| tokencanary license | License and trial info |
Trial and pricing
- Trial: 30 days from first
tokencanary setup, full optimization. Trial is created and validated by our servers; one trial per machine. - After trial: Optimization is disabled; Claude Code works normally. You are prompted to upgrade.
- Pricing: $19/month or $99/year. Run
tokencanary upgradeto open the checkout in your browser.
Privacy and security
- Prompt processing runs locally. Only compressed payloads are sent to Claude as part of normal Claude Code usage.
- Setup and license checks communicate with Token Canary servers (install ID, machine ID, plan, expiry). No prompt content is sent.
- Config and logs are stored under
~/.tokencanary/on your machine. Session stats (fortokencanary stats) are in~/.tokencanary/stats.jsonand represent the current daemon session; they reset when the daemon restarts.
Troubleshooting
tokencanary doctorfails: Ensure Node.js 18+, Claude Code on PATH, and that~/.tokencanary(or the reported config directory) is writable.- "Could not start trial" on setup: An internet connection is required; check your network and try again.
- Hooks not applied: Run
tokencanary setupagain to try auto-config, or add the hook URLs from~/.tokencanary/hooks.jsonto Claude Code (e.g. via/hooksor~/.claude/settings.json). - Daemon not running: Run
tokencanary status; if needed runtokencanary setupagain. - No stats yet: Run
tokencanary statsafter using Claude Code with optimization enabled; stats reset when the daemon restarts. Usetokencanary stopthentokencanary setupto restart. Checktokencanary logsfor errors. - Hooks and Cursor/Claude Code: Token Canary hooks are designed to fail open. If the daemon is down, the hook config is missing, or the request times out, prompts are passed through unchanged and the host is never blocked. You only get optimization when the daemon is running and responds successfully.
Support
- Homepage: npm package
- Issues and billing: Use the support channel provided with your subscription or trial.
License
Proprietary. See LICENSE file.
