{"id":50003522,"url":"https://github.com/mehmetdemircs/repospend","last_synced_at":"2026-05-24T19:01:03.368Z","repository":{"id":358763642,"uuid":"1242654107","full_name":"mehmetdemircs/RepoSpend","owner":"mehmetdemircs","description":"Local-first dashboard for tracking Codex / AI coding token usage and repo-level cost.","archived":false,"fork":false,"pushed_at":"2026-05-19T12:42:38.000Z","size":2160,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T15:04:08.886Z","etag":null,"topics":["ai-coding","cli","codex","cost-tracking","dashboard","developer-tools","local-first","openai-codex","sqlite","token-usage","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/repospend","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehmetdemircs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-18T16:15:27.000Z","updated_at":"2026-05-19T14:39:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mehmetdemircs/RepoSpend","commit_stats":null,"previous_names":["mehmetdemircs/repospend"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mehmetdemircs/RepoSpend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehmetdemircs%2FRepoSpend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehmetdemircs%2FRepoSpend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehmetdemircs%2FRepoSpend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehmetdemircs%2FRepoSpend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehmetdemircs","download_url":"https://codeload.github.com/mehmetdemircs/RepoSpend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehmetdemircs%2FRepoSpend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33356135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding","cli","codex","cost-tracking","dashboard","developer-tools","local-first","openai-codex","sqlite","token-usage","typescript"],"created_at":"2026-05-19T14:02:03.408Z","updated_at":"2026-05-22T17:01:12.076Z","avatar_url":"https://github.com/mehmetdemircs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RepoSpend\n\n[![npm version](https://img.shields.io/npm/v/repospend)](https://www.npmjs.com/package/repospend)\n[![npm downloads](https://img.shields.io/npm/dm/repospend)](https://www.npmjs.com/package/repospend)\n[![license](https://img.shields.io/npm/l/repospend)](./LICENSE)\n[![node](https://img.shields.io/node/v/repospend)](https://www.npmjs.com/package/repospend)\n[![CI](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml/badge.svg)](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml)\n\nRepoSpend is a local-first dashboard for seeing which repositories are using the\nmost AI coding tokens.\n\nIt reads supported local Codex and Claude Code files in read-only mode, groups\nsessions by Git repo, and shows token usage, cost estimates, models, sessions,\nand agent friction.\n\nNo login. No telemetry. No prompt uploads.\n\n## Quick Start\n\nYou can run RepoSpend without installing it globally:\n\n```bash\nnpx repospend\n```\n\nThen open the local dashboard URL printed in your terminal.\n\nOr install it once:\n\n```bash\nnpm install -g repospend\nrepospend\n```\n\nRepoSpend starts a local dashboard, binds to localhost, opens your browser, and\nprints the dashboard URL. By default it runs at\n[http://localhost:2005](http://localhost:2005).\n\nRepoSpend requires Node.js `20` or newer. It uses `better-sqlite3`, so npm may\ninstall a native SQLite package for your platform.\n\n## Good For\n\n- finding which repo is burning the most AI coding tokens\n- reviewing expensive or unusual coding-agent sessions\n- comparing Codex and Claude Code usage locally\n- spotting repeated command failures and agent friction\n- exporting usage data for your own analysis\n\n## Screenshots\n\nScreenshots use fictional Middle-earth demo data. The Lord of the Rings themed\nrepo names, sessions, prompts, token counts, and costs are intentional; no private\nrepository data is shown.\n\n### Overview\n\n![RepoSpend overview dashboard with fictional Middle-earth usage data](docs/screenshots/dashboard-overview.png)\n\nThe main dashboard summarizes AI coding tokens, API-equivalent cost, top repos,\ncache reuse, file edits, and command issue rate.\n\n### Repositories\n\n![RepoSpend repositories table with fictional repo usage](docs/screenshots/repos-view.png)\n\nThe repos view compares spend, tokens, sessions, cache hit rate, file edits, and\ntoken intensity across projects.\n\n### Repository Detail\n\n![RepoSpend repository detail for one-ring-infra](docs/screenshots/repo-detail.png)\n\nRepo detail explains why a project stands out, including cost concentration,\nwarnings, token shape, sessions, and command signals.\n\n### Sessions\n\n![RepoSpend sessions table with fictional session titles](docs/screenshots/sessions-view.png)\n\nThe sessions view makes individual AI coding runs searchable and sortable by\nrepo, tool, model, outcome, cost, tokens, and activity.\n\n### Session Detail\n\n![RepoSpend session detail for a fictional palantir event stream fix](docs/screenshots/session-detail.png)\n\nSession detail shows the shape of one run: cost, tokens, model, file edits,\ncommands, highlights, and issues to inspect.\n\n### Agent Friction\n\n![RepoSpend agent friction screen with fictional command issue signals](docs/screenshots/agent-friction.png)\n\nAgent Friction separates blocking command failures from harmless shell exits so\nhigh-token troubleshooting is easier to review.\n\n## What It Shows\n\nRepoSpend helps you break down local AI coding usage by:\n\n- repo\n- session\n- day and hour\n- model\n- source/tool and app/surface, where detectable\n- token type\n- estimated API-equivalent cost\n\nIf Codex records work from both of these paths:\n\n```text\n/Users/elrond/dev/RivendellRecords\n/Users/elrond/dev/RivendellRecords/apps/web\n```\n\nRepoSpend walks up to the Git root and shows them together as one\n`RivendellRecords` project.\n\n## Supported Tools\n\n| Tool | Status | Notes |\n|---|---|---|\n| Codex | Most complete support | Tokens, models, sessions, repo grouping, command friction |\n| Claude Code | Initial support | Sessions, projects, models, timestamps, tokens when available |\n| RTK | Optional/local | Shown only when local RTK data exists |\n\nRepoSpend started as a Codex-first release. Claude Code support is newer and\ndepends on what your local Claude Code files include.\n\n## Privacy\n\nRepoSpend is local-first:\n\n- no login\n- no telemetry\n- no prompt uploads\n- no changes to Codex or Claude Code files\n\nEverything the dashboard shows comes from files already on your machine.\n\n## Cost Estimates, Not Invoices\n\nRepoSpend shows **API-equivalent cost**.\n\nThat means it estimates cost from local token counts and the pricing assumptions\nstored in RepoSpend. It is useful for comparing repos and sessions, but it is not\nan invoice.\n\nYour actual cost may be different because of subscriptions, credits, included\nusage, account-level terms, provider changes, or other billing details. If you use\nCodex or Claude Code through a subscription, read the number as \"what this token\nusage would roughly cost at API-style rates.\"\n\nClaude Code cost may show as unknown when local files do not include token counts\nor a model name. RepoSpend shows those sessions with unknown tokens/cost rather\nthan guessing.\n\n### Why RepoSpend's token totals can look lower than `ccusage`\n\nIf you compare RepoSpend to `ccusage` you may see matching costs but different\n\"total tokens\", especially for Codex where cache reads dominate. This is\nexpected.\n\nRepoSpend treats `cached_input_tokens` as a **subset of** `input_tokens`, which\nis how the OpenAI and Anthropic APIs document the field. The \"total tokens\"\nnumber reflects the tokens the model actually processed. `ccusage` adds cached\ntokens as a separate line item in its \"Total Tokens\" column, which inflates the\ntotal but does not change billing.\n\nThe dollar cost is the source of truth and should agree between the two tools\nwithin rounding. If costs diverge, that is a real discrepancy worth\ninvestigating; token-count divergence on its own usually is not.\n\n### Codex Desktop on Windows\n\nRepoSpend captures Codex **CLI** usage on Windows from `~/.codex/`. The Codex\n**Desktop app** (installed as the MSIX package\n`OpenAI.Codex_\u003cid\u003e` under `%LOCALAPPDATA%\\Packages\\`) does not persist session\ntranscripts or per-turn token usage to disk. Only Electron caches and debug\nlogs are stored locally. Real session data lives server-side. Neither RepoSpend\nnor `ccusage` can report on Codex Desktop usage from local files alone.\n\n## What It Reads\n\nRepoSpend only reads local files. It does not edit Codex, Claude Code, or RTK\ndata.\n\nCodex data:\n\n```text\n~/.codex/state_5.sqlite\n~/.codex/sessions\n```\n\nClaude Code data:\n\n```text\n~/.claude/projects\n~/.config/claude/projects\n~/Library/Application Support/Claude/local-agent-mode-sessions\n~/.config/Claude/local-agent-mode-sessions\n```\n\nRepoSpend also checks `~/.claude/history.jsonl` for source status, but does not\nimport history-only entries into usage analytics because they do not contain\nreliable token/model data.\n\nClaude Code transcript files can contain prompt text, tool output, and file\ncontents. RepoSpend keeps all scanning local.\n\nRepoSpend-owned settings:\n\n```text\n~/.repospend/pricing.json\n~/.repospend/config.json\n```\n\nThe Settings page includes a reset action for RepoSpend-owned files under\n`~/.repospend/`. It does not delete or edit anything under `~/.codex` or\n`~/.claude`.\n\n## Commands\n\nMost users only need:\n\n```bash\nrepospend\n```\n\nThere are also a few terminal-friendly commands:\n\n```bash\nrepospend scan\nrepospend by-repo\nrepospend by-day\nrepospend by-hour\nrepospend by-model\nrepospend by-app\nrepospend export --format json\nrepospend export --format csv\n```\n\nMost commands also accept a simple source filter:\n\n```bash\nrepospend by-repo --source codex\nrepospend by-repo --source claude\nrepospend by-repo --source all\n```\n\nUse `REPOSPEND_NO_OPEN=1 repospend` if you want the URL printed without opening a\nbrowser.\n\n## Current Limits\n\n- Codex support is still the most complete path for token and command-friction\n  analysis.\n- Claude Code support is initial: sessions, projects, timestamps, models, and\n  token usage are shown when present in local JSONL files.\n- Claude Code sessions without local token details are shown with unknown\n  tokens/cost.\n- Cost estimates do not represent subscription billing, credits, regional\n  pricing, or account-specific terms.\n- Budget alerts are not active yet.\n- Some older sessions may not include full token, command, or prompt details.\n- RTK analytics appear only when local `rtk` data is available.\n\n## Develop\n\nFrom source:\n\n```bash\npnpm install\npnpm dev\n```\n\nUseful checks before publishing:\n\n```bash\npnpm lint\npnpm typecheck\npnpm test\npnpm build\n```\n\n`pnpm dev` starts the API on\n[http://127.0.0.1:4318](http://127.0.0.1:4318) and the dashboard on\n[http://127.0.0.1:2005](http://127.0.0.1:2005), with `/api` proxied locally.\n\n## Maintainers\n\nPublishing notes are in [docs/PUBLISHING.md](docs/PUBLISHING.md).\n\n## Security\n\nPlease see [SECURITY.md](SECURITY.md) for reporting security issues.\n\n## Changelog\n\nPlease see [CHANGELOG.md](CHANGELOG.md) for release notes.\n\n## License\n\n[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehmetdemircs%2Frepospend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehmetdemircs%2Frepospend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehmetdemircs%2Frepospend/lists"}