{"id":50768415,"url":"https://github.com/sheldonhull/ouroburn","last_synced_at":"2026-06-11T16:01:44.472Z","repository":{"id":356647828,"uuid":"1231451786","full_name":"sheldonhull/ouroburn","owner":"sheldonhull","description":"macOS menu bar app tracking Claude Code token burn rate. Local JSONL parsing, no API hits.","archived":false,"fork":false,"pushed_at":"2026-06-09T20:33:44.000Z","size":486,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T22:15:53.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheldonhull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"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-07T01:19:41.000Z","updated_at":"2026-06-09T20:33:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sheldonhull/ouroburn","commit_stats":null,"previous_names":["sheldonhull/ouroburn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sheldonhull/ouroburn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheldonhull%2Fouroburn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheldonhull%2Fouroburn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheldonhull%2Fouroburn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheldonhull%2Fouroburn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheldonhull","download_url":"https://codeload.github.com/sheldonhull/ouroburn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheldonhull%2Fouroburn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34206492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":[],"created_at":"2026-06-11T16:01:42.487Z","updated_at":"2026-06-11T16:01:44.425Z","avatar_url":"https://github.com/sheldonhull.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ouroburn\n\nmacOS menu bar app that tracks Claude Code token burn rate.\nSnake eats its tail faster as you spend more.\nColor shifts blue → red as the rate climbs.\n\n## What it does\n\n- Polls Claude Code transcript JSONL files (`$CLAUDE_CONFIG_DIR`,\n  `$XDG_CONFIG_HOME/claude/projects/**`, `~/.claude/projects/**`) once per minute.\n- Aggregates tokens and cost across five view modes — daily, weekly, monthly,\n  5-hour billing block, and per-session — with per-model breakdown.\n- Drives an animated ouroboros icon: rotation speed and heat color scale linearly\n  with the trailing 5-minute token rate.\n- Surfaces spikes through `UNUserNotificationCenter` (rate doubled and exceeds\n  500 tok/min, throttled to one alert per 10 minutes).\n- Caches the most recent snapshot to `~/Library/Caches/ouroburn/snapshot.json`\n  so the popover has data the moment you open the app, even offline.\n- Caches LiteLLM pricing data to `~/Library/Caches/ouroburn/pricing.json` with a\n  24-hour TTL; falls back to the cached copy when the feed is unreachable.\n\n## Why\n\nAI agents burn money. Watch it happen.\n\n## Build \u0026 run\n\nRequires macOS 14+ and the Xcode toolchain (Swift 6).\n\n```sh\nmise install      # installs hk, pkl, task, swiftformat, swiftlint\nmise run build    # release build\nmise run run      # debug run (menu bar icon appears in the status area)\nmise run test     # 29 swift-testing cases across loader, aggregator, blocks, pricing\nmise run lint     # swiftlint\nmise run fmt      # swiftformat\n```\n\nThe `test` task includes the rpath flags needed when running on Command Line\nTools without a full Xcode install. With Xcode present, plain `swift test`\nalso works.\n\n## Layout\n\n```\nSources/Ouroburn/\n  main.swift                    entry point — accessory activation policy\n  AppDelegate.swift             wires tracker + status bar + notifier\n  Models/\n    UsageEntry.swift            normalized JSONL line\n    ModelBreakdown.swift        per-model aggregation row\n    AggregateBucket.swift       unified bucket shape across view modes\n    ViewMode.swift              day | week | month | sessionBlock | session\n  Core/\n    JSONLLoader.swift           getClaudePaths port + streaming parse + dedup\n    PricingService.swift        LiteLLM feed fetch, prefix lookup, disk cache\n    SessionBlockBuilder.swift   5-hour Claude billing window algorithm\n    Aggregator.swift            day/week/month/session bucketing + cost calc\n    DiskCache.swift             snapshot persistence for offline bootstrap\n    Notifier.swift              throttled spike notifications\n    BurnTracker.swift           60-second poll loop, snapshot orchestrator\n  UI/\n    StatusBarController.swift   NSStatusItem + popover toggle\n    OuroborosView.swift         hand-drawn animated snake biting tail\n    MetricsViewController.swift segmented control + table popover\n\nTests/OuroburnTests/\n  JSONLLoaderTests.swift        parse/reject/dedup/cutoff/path-resolution\n  AggregatorTests.swift         day/week/month/session/model-breakdown\n  SessionBlockBuilderTests.swift gap, active, UTC floor, window split\n  PricingServiceTests.swift     decode/lookup/cost/disk-cache round trip\n  Fixtures/                     sample.jsonl + pricing.json\n```\n\n## Open work\n\n- Spike notification copy could include cost-per-hour delta vs. previous window.\n- 200k-token tiered Claude pricing is not yet honored (ccusage `pricing.ts:290`).\n- Popover does not yet show the active 5-hour block as a progress strip.\n- No filesystem-watch fast path — every poll re-walks the projects directory.\n\n## Credits\n\nAlgorithms ported from [`ryoppippi/ccusage`](https://github.com/ryoppippi/ccusage)\n(MIT). The tool itself is npm-only; we read transcripts directly to keep the\nmenu bar polling cycle self-contained and offline-capable.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheldonhull%2Fouroburn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheldonhull%2Fouroburn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheldonhull%2Fouroburn/lists"}