Cognitally
Tracks token throughput, session metrics, and cost data for Hermes Agent by reading its local ledger.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cognitallyshow my token usage and cost for today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
đ§ Cognitally
Sovereign AI Coding Agent Observability & Token Cost Ledger for Linux / Ubuntu
(Formerly TokDash â evolved with Stdio MCP Server & Single-Flight Streaming)
Real-time token throughput, prompt caching, quota tracking, and read-only MCP control plane for AI coding agents.
English | įŽäŊ䏿
đ Overview
Cognitally (from Cognitive + Tally) is a local-first, low-overhead desktop observatory, CLI tool, and standard Model Context Protocol (MCP) server for developers using autonomous AI coding tools. It performs passive, zero-leakage local log parsing across 14 mainstream coding agents to provide mathematical certainty into token volume, cache reads, cost provenance, subscription quotas, and project attribution.
Automatic seamless one-time migration is supported from legacy ~/.config/tokdash and ~/.tokei.
Related MCP server: ai-usage-mcp
⨠Features
đ Read-Only Stdio MCP Server (
cognitally --mcp): Native support for the MCP specification (2024-11-05). Claude Code, Cursor, Codex, and OpenCode can query current token consumption, quotas, and costs directly via 6 strictly read-only tools (get_usage,get_cost,get_quota,get_projects,get_models,get_accounting_status).⥠Single-Flight Refresh & Streaming Engine: Shared flock-protected canonical snapshots prevent redundant concurrent parsing and eliminate memory spikes on live rollouts.
đ Local-First & Transparent Privacy: Reads local session transcripts and SQLite/JSONL cache files on your disk for passive accounting. No prompts, code, or context logs are uploaded to third-party telemetry servers.
đ¤ Canonical Export (
cognitally --export json/csv): Export deterministic, schema-versioned token and cost datasets to JSON or CSV.⥠Full Token Metrics Breakdown: Distinguishes Prompt Input, Completion Output, and Cache Reads, avoiding cache-token double counting.
đ° Configurable Cost Estimation: Uses OpenRouter's model pricing catalog (
pricing.json) together with customizable local rate overrides (pricing_overrides.json) for private endpoints, discounts, and explicit pricing provenance.đ Two-Week Daily Expense Trend: Interactive daily bar chart with per-tool cost breakdowns on hover.
đ¤ Multi-Agent Quota & Window Limits: Real-time quota countdowns for Antigravity (Google AI Pro), Codex Plus/Pro, Cursor Ultra, and Grok.
đ Workspace & Project Tracking: Aggregates token spend and session counts per code repository and detects local listening ports.
đ Modern UI & System Tray: Frameless dark/light mode with a native Ubuntu system tray icon, minimize-to-tray behavior, and hotkey toggling.
đ ī¸ Supported AI Coding Agents
Cognitally passively inspects standard local session logs in read-only mode and does not act as an interception proxy.
Agent / Tool | Detection Target | Metrics Tracked |
Claude Code |
| Input, Output, Cache Read/Write, Turns & Estimated Cost |
Codex CLI |
| Tokens, Reasoning, Cache Reads, Estimated Cost |
Grok Build |
| Real API tokens, live quotas, windows & cost |
Grok Bot |
| Bot interaction turns & token throughput |
Cursor Composer |
| Monthly plan spend, auto-spend, % used & reset countdown |
Antigravity / Gemini CLI | Local process & session store | Google AI Pro 5h rate limits, quotas & per-step tokens |
Kimi Code |
| Agent turn tokens, model routing & cost |
DeepSeek Harness |
| JSONL session metrics, model routing & cost |
OpenCode |
| DeepSeek / local LLM token telemetry & cost |
Hermes Agent |
| Authoritative local ledger, sessions, token throughput |
Pi Coding Agent |
| Tool calls, input/output token counts |
GLM Code |
| Zhipu GLM-5 series tokens & session metrics |
CodeBuddy / WorkBuddy |
| Tencent coding assistant turns & token counts |
Qoder |
| Qoder IDE / Work / CLI multi-target tokens & metrics |
Design Note: Cognitally explicitly focuses on these 14 first-class production AI coding agents, ensuring rock-solid ingestion pipelines and strict mathematical reconciliation. Peripheral niche tools are de-emphasized.
đ Quick Start
Prerequisites
Ubuntu / Debian Linux (20.04+)
Node.js >= 22.12.0
Python >= 3.10
npm (Node âĨ22.12).
pnpmoptional if corepack works on your machine
Installation & Launch
# 1. Clone the repository
git clone https://github.com/kamanager2012/tokdash.git
cd tokdash
# 2. Run the automated installer
# (installs dependencies, builds UI, and creates 'cognitally' CLI + desktop launcher)
chmod +x install.sh
./install.sh
# 3. CLI & Desktop Usage
cognitally --doctor # Run system & 14-agent health check
cognitally --mcp # Launch standard Stdio MCP server for Claude Code / Codex / Cursor
cognitally --export json # Export canonical snapshot to JSON
cognitally --export csv # Export daily model breakdown to CSV
./start.sh # Launch frameless Linux desktop observatoryDesktop Launcher: After running
install.sh, pressSuper(Windows key) on Ubuntu, search for Cognitally, and launch it from the application menu.
Development Mode
# Install dependencies
npm install
# Start the Vite development server
npm run dev
# In another terminal, run Electron against the development server
npm startđ¤ Contributing
Contributions, issues, and feature requests are welcome.
Please read the Contributing Guide and Code of Conduct.
đ License & Acknowledgements
Licensed under the MIT License.
Special thanks to @cclank for the original macOS tokei concept.
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenAI organization usage and cost reporting through an admin API key connected by the user.
Read-only bank access for your AI agent. Connects Claude, ChatGPT, Cursor, Gemini, Codex.
Exact Claude API cost calc with real cache economics, plus a tiktoken-misuse scanner.
Deterministic AI/LLM cost calculators with one-command setup across major agent clients.
121
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides tools for Claude to query local Claude Code token usage and cost data, enabling spend analysis and insights through natural language.8 npm1MIT
- AlicenseNot gradedqualityAmaintenanceEnables local-first tracking of AI token usage and costs from Claude Code and OpenCode, answering queries about tokens, models, sessions, and cost through MCP tools and a CLI, with no network calls.1,170 npm1MIT
- AlicenseNot gradedqualityCmaintenanceProvides coding agents with pre-flight cost estimation by analyzing local logs to forecast token usage and quota impact before expensive work, exposing tools for remaining quota, per-task cost estimates, and attempt affordability.162 npmMIT
- AlicenseNot gradedqualityAmaintenanceReads the Claude Code, Codex and OpenCode usage logs already on your machine and reports token totals, per-day and per-hour activity, a per-agent and per-model breakdown, and a year-in-review recap. It makes no network request at all â a test fails if any source file in the package can open a socket.415MIT