TokenVigil
TokenVigil is a local-first auditing system for tracking token usage and estimated cost from coding-agent sessions. It combines a native macOS dashboard with an installable CLI for project-scoped, passive monitoring. The CLI reads local Claude Code and Codex usage metadata, can observe aggregate HandoffWire activity, and exposes reports only to the configured project orchestrator.
The CLI's Angela audit contract detects session concentration, context growth, low cache reuse, excessive turns, repeated resets, model-tier mismatch, possible duplicate work, and HandoffWire routing anomalies. Model-tier, reset, and duplicate-work findings are explicitly labeled as inference when metadata cannot prove intent. Reports always retain privacy.content_captured: false.
The app is built with Swift, AppKit, and the macOS App Sandbox. TokenVigil does not send your usage data anywhere.
Screenshots
Features
- Native macOS menu bar and window experience
- Total usage, today, recent 30 days, and recent 12 months views
- Token and cost breakdowns by provider and model
- Calendar heatmap and chart views for trend scanning
- Session-level review with model, project, token, cost, and record counts
- Local parsing for Claude Code JSONL, Codex rollout JSONL, and opencode SQLite data
- Security-scoped bookmark access for sandbox-friendly local file permissions
- Embedded LiteLLM pricing snapshot with hand-tuned pricing overrides for common models
Supported Sources
TokenVigil never opens a file picker automatically at launch. In Settings, use the Data Folders section to choose only the providers you use.
| Source | Folder selected by the user | Data read inside that folder |
|---|---|---|
| Claude Code | Claude Code data folder | projects/**/*.jsonl |
| Codex | Codex data folder | sessions/**/rollout-*.jsonl, archived_sessions/**, and optional config.toml |
| opencode | opencode data folder | opencode.db |
Each provider stores an independent read-only security-scoped bookmark. Leaving one provider unselected does not block selected providers.
Privacy
TokenVigil is designed as a local-only utility.
- It reads a provider folder only after you explicitly choose that folder in the standard macOS open panel.
- It stores one security-scoped bookmark per selected provider in
UserDefaultsso it can reopen that folder later. - It does not upload usage records, project paths, prompts, responses, or pricing data.
- It does not include analytics or telemetry.
The app may display local project paths from the agent logs because those paths are part of the source data. See the Privacy Policy.
Install
For the reusable CLI and Angela audit integration, follow INTEGRATION.md. The short path is:
./install.sh --with-codex-skill
cd /path/to/project
tokenvigil --json init --orchestrator "Michael - Orchestrator" --auditor Angela
tokenvigil --json doctor
The native dashboard can be installed separately:
Download the latest packaged app from the GitHub Releases page:
- Download
TokenVigil-macOS-universal.zipfrom the latest release. - Unzip the archive.
- Move
TokenVigil.appto/Applications. - Open TokenVigil. Launch does not open a file picker.
- Open Settings and, in Data Folders, choose the folder for each provider you use.
If macOS says TokenVigil.app is damaged and can't be opened. You should move it to the Trash., confirm that the app came from the official TokenVigil release page, then go to System Settings > Privacy & Security. In the Security section, click Open Anyway for TokenVigil, then open TokenVigil again and choose Open when prompted.
To build from source instead:
- Clone the repository.
- Open
TokenVigil.xcodeprojin Xcode. - Select the
TokenVigilscheme. - Build and run on macOS.
- Open Settings and choose provider folders in Data Folders.
First Run
TokenVigil does not request access at launch. Open Settings, find Data Folders, and choose each provider's data folder with the standard macOS folder picker. You can cancel without changing that provider's existing selection or data.
Selected providers load independently. An unselected provider shows that its folder has not been selected; an empty selected folder shows that no data was found. You can refresh manually from the window or menu bar popover, and change automatic refresh intervals in Settings.
Build
Requirements:
- macOS 15.0+
- Xcode 16.4+
- Swift 6.0
Build the app:
xcodebuild -project TokenVigil.xcodeproj -scheme TokenVigil -configuration Debug build
Run unit tests:
xcodebuild -project TokenVigil.xcodeproj -scheme TokenVigil -destination 'platform=macOS' -only-testing:TokenVigilTests test
Run all tests:
xcodebuild -project TokenVigil.xcodeproj -scheme TokenVigil -destination 'platform=macOS' test
Architecture
Each provider owns its scanner, parser, selected data-root contract, and read-only security-scoped bookmark, then emits shared ParsedUsageEntry values. PricingEngine and UsageAggregator turn those entries into summaries that are rendered by AppKit view controllers. Provider authorization and loading states remain independent in TokenStatsViewModel.
Provider scanner/parser
|
v
ParsedUsageEntry
|
v
PricingEngine + UsageAggregator
|
v
TokenStatsViewModel
|
v
AppKit sidebar, charts, menu bar popover
Key directories:
TokenVigil/
Analytics/ Aggregation logic
Models/ Shared usage and pricing models
Pricing/ Pricing table, LiteLLM catalog, cost engine
Providers/ Claude Code, Codex, and opencode adapters
Services/ Security-scoped bookmark management
ViewControllers/ AppKit UI
ViewModels/ Provider state coordination
TokenVigilTests/ Swift Testing unit tests
TokenVigilUITests/ XCTest UI tests
Pricing Data
TokenVigil estimates cost from embedded pricing data. Prices can drift from upstream provider billing, so treat app totals as an estimate rather than an invoice. Unknown models fall back to upstream cost when the source provides it; otherwise their cost may be shown as zero until pricing data is updated.
Contributing
Issues and pull requests are welcome. Please keep changes focused and include tests for parser, pricing, aggregation, or UI behavior when relevant.
For local agent guidance, see AGENT_GUIDE.md.
License
TokenVigil is licensed under the GNU General Public License v3.0 or later. See LICENSE.
Release files for tokenvigil-local 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tokenvigil_local-0.2.0.tar.gz | 32.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tokenvigil_local-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.4 kB
Release files / tokenvigil_local-0.2.0.tar.gz
| Download URL | tokenvigil_local-0.2.0.tar.gz |
|---|---|
| Size | 32.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b49699cf65d6f968fda16ccb98b981b811553ab61ae811738fbb91f1d8a761c5
|
|
BLAKE2b-256 checksum How to use checksums |
911c14269662e489257c5d95cb7c59ea5f77a6e2a9790a2aae89c4af65312f07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / tokenvigil_local-0.2.0-py3-none-any.whl
| Download URL | tokenvigil_local-0.2.0-py3-none-any.whl |
|---|---|
| Size | 27.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ae6b61d80615f397dbec04501f85a7bcb0733a23407451b497c2944900af464
|
|
BLAKE2b-256 checksum How to use checksums |
8a0a6b0984586113767357143701f53943ea31cd93153ec7b375da4ed6b6c11d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log