DvirNaaman/dvir-token-manager

GitHub: DvirNaaman/dvir-token-manager

Stars: 5 | Forks: 0

# Token Manager | DN ![Skills - top skills by invocations](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/722f0cd8ac171553.png) ## Fully private The tool runs entirely on your machine. No telemetry, no outbound network calls, no third-party requests. The server listens on `127.0.0.1:8080` only. All assets (ECharts, Heebo, icons) are served locally from the `web/` directory. For independent verification, see `PRIVACY_AUDIT.md` in the project directory. ## Requirements - Python 3.8 or newer - Claude Code installed with at least one existing conversation under `~/.claude/projects/` - A modern browser (Chrome, Edge, Firefox) - No `pip install` required. The tool uses the Python standard library only. ## Running git clone https://github.com/DvirNaaman/dvir-token-manager.git cd dvir-token-manager python cli.py dashboard The command starts the server at `http://127.0.0.1:8080` and opens it automatically in your browser. The server re-scans every 30 seconds and pushes live updates over SSE, so you don't need to refresh manually. To stop: `Ctrl+C`. ## Additional CLI commands python cli.py scan # manually scan for new JSONL files python cli.py today # today's summary in the terminal python cli.py stats # all-time summary in the terminal python cli.py tips # savings tips based on usage patterns Any command accepts `--db PATH` and `--projects-dir PATH` to override defaults. ## Environment variables | Variable | Default | Purpose | |---|---|---| | `HOST` | `127.0.0.1` | Server listen address | | `PORT` | `8080` | Server listen port | | `CLAUDE_PROJECTS_DIR` | `~/.claude/projects` | Source of JSONL files | | `TOKEN_DASHBOARD_DB` | `~/.claude/token-dashboard.db` | Location of the local SQLite database | ## Privacy blur shortcut Pressing `Ctrl + B` anywhere in the dashboard blurs prompt text and sensitive content, useful for screenshots. Press again to unblur. ## How to verify zero outbound calls macOS / Linux: grep -rEi "https?://(?!127\.0\.0\.1|localhost)" --include="*.py" --include="*.js" --include="*.html" --include="*.css" . Windows (PowerShell): Get-ChildItem -Recurse -Include *.py,*.js,*.html,*.css | Select-String -Pattern 'https?://(?!127\.0\.0\.1|localhost)' The output should be empty aside from comments in ECharts LICENSE headers and the upstream attribution links listed in `PRIVACY_AUDIT.md`. ## Troubleshooting **Dashboard is empty:** make sure at least one conversation exists under `~/.claude/projects//.jsonl`. In non-standard environments, point to it manually with `--projects-dir`. **Port in use:** run with a different port. - macOS / Linux: `PORT=8090 python cli.py dashboard` - Windows (PowerShell): `$env:PORT=8090; python cli.py dashboard` - Windows (CMD): `set PORT=8090 && python cli.py dashboard`