exe-watcher 0.2.53 → 0.2.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 AgentSeal (original codeburn)
4
- Copyright (c) 2026 Exe AI (exe-watcher fork)
3
+ Copyright (c) 2026 AgentSeal
4
+ Copyright (c) 2026 Exe AI
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  <p align="center">
2
- <img src="assets/owl-header.png" alt="Exe Watcher banner" width="520" />
2
+ <img src="assets/owls/readme-owl.gif" alt="Watcher owl glancing and blinking above the EXE wordmark" width="280" />
3
3
  </p>
4
4
 
5
- <p align="center"><strong>The owl watching your AI coding spend — tokens, cost, models, agents, and projects in one beautiful terminal + macOS menu bar.</strong></p>
5
+ <p align="center"><strong>The owl watching your AI team — spend, AI work time, and memory per employee, in your terminal and macOS menu bar.</strong></p>
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/exe-watcher"><img src="https://img.shields.io/npm/v/exe-watcher.svg" alt="npm version" /></a>
@@ -16,22 +16,70 @@
16
16
  <img src="assets/exe-watcher-readme.png" alt="Exe Watcher macOS menu bar spend dashboard" width="401" />
17
17
  </p>
18
18
 
19
- Exe Watcher turns your local AI coding sessions into a live spend cockpit: today's burn, provider/model mix, activity breakdown, one-shot rate, token trends, optimization hints, and project cost — without API keys, cloud sync, or wrappers around your tools.
19
+ Exe Watcher shows what your AI coding work costs, how long the agents run, and how each Exe OS employee's memory grows. Track nine coding clients, models, projects, tokens, and optimization findings from local usage files. Spend and time tracking need no API keys, account, proxy, or wrappers around your tools; employee memory and spend appear when Exe OS supplies its local agent stats.
20
+
21
+ **Forked from [CodeBurn by AgentSeal](https://github.com/getagentseal/codeburn) on April 24, 2026.** Since then, Exe AI has developed Watcher for AI employee teams and parallel agent workflows. [Development timeline and comparison](#development-since-the-codeburn-fork) · [Origin and MIT attribution](#origin--attribution)
22
+
23
+ **macOS app:** Download the universal DMG from [Releases](https://github.com/AskExe/exe-watcher/releases/latest), drag **Watcher by EXE** into **Applications**, and open it. macOS 14+ on Apple Silicon or Intel. From 0.2.55, Node and the CLI are included.
24
+
25
+ **Terminal CLI** (Node 22.5+):
20
26
 
21
27
  ```bash
22
28
  npm install -g exe-watcher
29
+ exe-watcher report
30
+ ```
31
+
32
+ Version 0.2.66 brings AI time, automatic timing catch-up and the floating quota display to the packaged app. All Time timing survives restarts and refreshes independently of cost history. Download the matching app from [Releases](https://github.com/AskExe/exe-watcher/releases/latest) or [odd.community/watcher](https://odd.community/watcher). To run the current CLI from source:
33
+
34
+ ```bash
35
+ git clone https://github.com/AskExe/exe-watcher.git
36
+ cd exe-watcher
37
+ npm ci
38
+ npm run build
39
+ node dist/cli.js report
23
40
  ```
24
41
 
25
42
  ---
26
43
 
27
- ## What makes it cool
44
+ ## Built for AI employee teams
45
+
46
+ - **Floating display** — a compact on-screen quota display for Claude, Codex, Kimi, Cursor, GitHub Copilot and Gemini, with **You + AI ≈** (your estimated interaction time) and **AI Time** (work time added across all agents). Quota rings show **quota left**, default to **Weekly**, and have a **Weekly / 5h** toggle. Click either time button for its explanation. Time totals default to Today; switch to Week, Month or All Time. Enable it from the menu bar footer’s **Display settings → Floating quota display**. [Details](mac/README.md#floating-display).
47
+ - **AI running time** — adds recorded work across agents, so parallel work is counted as agent-hours.
48
+ - **Elapsed busy time** — merges overlapping runs to show how long at least one agent was working.
49
+ - **Your time ≈** — estimates interaction from short reply-to-next-prompt gaps, with known subagents excluded. It is not an attention or productivity measurement.
50
+ - **Memory per employee** — shows persistent memory counts and growth over 24 hours, 7 days, and 30 days from Exe OS. These are saved memories, not RAM usage.
51
+ - **Spend per employee** — puts model-aware 24-hour, 7-day, and 30-day cost beside the same Exe OS employee identities.
52
+ - **Bounded background work** — coalesces usage-file events, reuses cached periods, resumes historical recovery, and rests between scans.
53
+ - **Visible data limits** — distinguishes unknown timing, missing historical call counts, recovered usage, and models whose costs cannot be priced.
54
+ - **One local view** — Claude Code, Codex, Cursor, Cursor Agent, Copilot, OpenCode, Kimi Code, OMP, and Pi, with no usage-data upload service.
55
+
56
+ ## Development since the CodeBurn fork
57
+
58
+ Watcher started as an import of CodeBurn 0.8.9 on **April 24, 2026**. By this review on **October 16, 2026**, it had **175 days of independent development—nearly six months**.
59
+
60
+ | Date (2026) | Watcher development milestone |
61
+ | --- | --- |
62
+ | April 24 | Imported the CodeBurn foundation and began the Exe rebrand as exe-fuelbar. |
63
+ | April 27–28 | Added Exe OS memory integration and the AI Employees section with per-agent memory growth and spend. |
64
+ | April 30 | Renamed the product to Watcher. |
65
+ | May–June | Improved accounting, period consistency, wake/recovery behavior, provider isolation, and model presentation. |
66
+ | October 3 | Added bounded event-driven usage refreshes, retained-history recovery, and pricing/accounting corrections. |
67
+ | October 14–15 | Added self-contained universal macOS packaging, the chosen owl artwork and animation, native Kimi usage, and clearer historical call coverage. |
68
+ | October 16 | Added the three AI time totals, provider coverage, a resumable timing index, automatic timing catch-up, and the floating quota/time display. |
69
+
70
+ ### Where Watcher differs today
71
+
72
+ Comparison checked against [CodeBurn 0.9.27, revision 9a40cc6](https://github.com/getagentseal/codeburn/tree/9a40cc603fcd194caca9daa8c5134a61ea7e0e2b) on October 16, 2026.
73
+
74
+ | Capability | Watcher | CodeBurn at the reviewed revision |
75
+ | --- | --- | --- |
76
+ | Three separate time totals across supported clients | AI running, overlap-adjusted elapsed busy, and estimated interaction time, filtered by period/provider/project | Session-duration and Codex generation-timing metrics exist; no equivalent three-total report was found. |
77
+ | Persistent memory per AI employee | Exe OS memory count plus 24h / 7d / 30d growth | No equivalent employee-memory ledger was found. |
78
+ | Exe OS employee integration | Memory and spend use Exe OS employee IDs and local daemon stats; includes agent-pipeline diagnostics | Agent/subagent spend views exist; no Exe OS employee/stats integration was found. |
79
+
80
+ Our subsequent work also includes accounting fixes, bounded history recovery, event-driven native refreshes, current API pricing, Kimi support, self-contained packaging, and Watcher's visual identity. These are documented improvements to our imported baseline; some capabilities also exist in today's CodeBurn. [Detailed evidence and adoption backlog](docs/codeburn-upstream-review.md) · [Changelog](CHANGELOG.md)
28
81
 
29
- - **Local-first spend tracking** — reads session data already on your machine; no telemetry service, no account, no proxy.
30
- - **Terminal + native macOS menu bar** — run the full TUI in your terminal or keep today's spend visible in the menu bar.
31
- - **Multi-provider view** — Claude Code, Codex, Cursor, Cursor Agent, Copilot, OpenCode, OMP, and Pi are auto-detected.
32
- - **Actually useful metrics** — cost, calls, sessions, tokens, cache hit %, one-shot rate, activity type, model split, tools, MCP servers, shell commands, and top sessions.
33
- - **Optimization built in** — finds token waste and gives copy-paste fixes for bloated prompts, repeated file reads, uncapped shell output, unused MCP servers, and ghost agents.
34
- - **Exe OS aware** — when Exe OS is present, Watcher adds AI employee memory growth and per-agent spend.
82
+ Watcher’s floating display takes inspiration from CodeBurn’s **Capacity Dock** and adds our two time totals. It supports six quota providers, including Claude and Codex, with Weekly as their default and a 5-hour toggle. OS threshold notifications and additional adapters remain in the [adoption backlog](docs/codeburn-upstream-review.md).
35
83
 
36
84
  ---
37
85
 
@@ -42,7 +90,7 @@ npm install -g exe-watcher
42
90
  ```bash
43
91
  exe-watcher menubar # install + launch
44
92
  exe-watcher menubar --force # reinstall latest
45
- exe-watcher menubar --version v0.2.38 # install a specific version
93
+ exe-watcher menubar --version v0.2.60 # install a specific version
46
94
  exe-watcher # on macOS: prompts to install menubar app
47
95
  ```
48
96
 
@@ -56,34 +104,93 @@ A Swift/SwiftUI popover that lives in your menu bar. Today's spend is always vis
56
104
  - **Activity breakdown** — Research, Building, Debugging, DevOps, Testing, and Planning with cost, turns, and one-shot rate.
57
105
  - **Model breakdown** — See which models are driving spend and call volume.
58
106
  - **Project spend** — Per-project cost across today / 7d / 30d.
107
+ - **AI time** — AI running, elapsed busy, and estimated interaction time for the selected period, with timing coverage details.
108
+ - **AI Employees** — Exe OS memory growth and employee spend, when local daemon data is available.
59
109
  - **Optimization findings** — Menubar links open the full optimizer or report directly in Terminal.
60
- - **Subscription tracking** — Claude Pro ($20/mo), Claude Max ($200/mo), Cursor Pro ($20/mo), or custom monthly budgets.
110
+ - **Plan budgets** — Compare API-equivalent spend with built-in monthly budget presets or a custom budget.
111
+ - **Live Claude capacity** — Five-hour and weekly utilization, reset times, and projections from the signed-in Claude account. This optional view uses provider credentials and may request macOS Keychain access.
61
112
  - **Capacity estimation** — Derives likely token limits from usage patterns when hard caps aren't published.
62
113
  - **Multi-currency** — USD, GBP, EUR, JPY, AUD, CAD, CHF, CNY, SEK, NOK, DKK, NZD, SGD, HKD, KRW, INR, BRL.
114
+ - **Animated owl** — Glances and blinks while the popover is visible, with Reduce Motion support.
115
+
116
+ macOS pushes usage-log change notifications to Watcher; there is no repeating background usage scan. Rapid writes are combined, with at least two minutes of rest after a scan and longer after slow scans (nine times the scan duration). A failed notification gets at most two spaced retries before waiting for new data or a user action. Watcher also catches up on launch/wake and explicit user actions. Only one CLI child runs at a time, at low scheduling priority, with a 256 MiB V8 heap limit and a 60-second timeout. Historical and provider detail views load on demand. Failed scans retain the last successful total, including across app restarts on the same date; missing data after midnight displays a dash until a scan succeeds.
117
+
118
+ ### AI time
119
+
120
+ The menu bar dashboard and full terminal report show three times beneath the spending overview. They follow the selected day, 7 days, 30 days, month or all-time view, with the same provider and project filters:
121
+
122
+ - **AI running:** recorded run time added across agents. Two agents running for one hour add two hours. Duplicate run IDs copied into forks count once.
123
+ - **Elapsed busy:** time when at least one agent was running. Those two parallel agents count as one elapsed hour.
124
+ - **Your time ≈:** an interaction estimate from reply-to-next-prompt gaps of up to five minutes, merged across chats. Known subagents and longer idle gaps are excluded. This does not measure attention, typing or time reading while an agent runs; unidentified automation may be included.
125
+
126
+ Timing recovery starts July 1, 2025 and uses retained local evidence. **Partial history** stays visible; missing timing is **Unknown**, never zero. Recorded durations may include tool execution and waiting, rather than only time generating tokens. Open runs are not extended to the present.
127
+
128
+ | Client | Available timing evidence |
129
+ |--------|---------------------------|
130
+ | Claude Code | Recorded turn durations; older prompt/reply clocks are inferred |
131
+ | Codex | Completed/interrupted run boundaries or durations; older reply clocks are inferred |
132
+ | Cursor IDE | Saved conversation message start/end clocks, when retained |
133
+ | Cursor Agent | Timestamped CLI result durations; ordinary text transcripts lack clocks |
134
+ | Copilot | Saved assistant turn start/end pairs |
135
+ | OpenCode | Completed message clocks, including archived sessions and subagents; late/missing completions use short inferred spans from saved parts |
136
+ | Kimi Code | Native saved step boundaries, including separate agents |
137
+ | Pi / OMP | Inferred prompt-to-final-reply spans |
138
+
139
+ Inferred spans are capped at 30 minutes; longer unmeasured gaps remain unknown. Deleted logs, unsupported formats and sessions without complete clocks cannot supply a full lifetime total. Provider details show how many files have usable timing in the selected period.
140
+
141
+ Timing uses a separate private index and leaves financial history intact. Existing usage-file events trigger small bounded updates; no extra polling service is installed. Historical recovery advances saved byte cursors in bounded passes, without rereading unchanged transcripts.
142
+
143
+ The menu bar continues known unfinished timing work in separate timing-only steps, without waiting for another file change or rerunning cost scans. Only one CLI child runs at a time; each step rests for at least nine times its elapsed runtime. Catch-up stops when the queue clears, an incomplete final record needs more data, a step fails, or two steps make no progress. Cost freshness timestamps stay unchanged. Provider file counts mean files with timing **in the selected view**, out of all discovered files.
144
+
145
+ ```bash
146
+ exe-watcher time --period all # saved/recent timing and coverage
147
+ exe-watcher time --period week --format json
148
+ exe-watcher time --recover --period all # one bounded historical pass
149
+ ```
150
+
151
+ Repeat a recovery pass while files remain pending and progress advances. Automatic parsing is capped at 16 MiB per update; explicit historical parsing at 256 MiB per pass. Incomplete or unreadable records remain clearly marked.
152
+
153
+ ### Memory and spend per AI employee
63
154
 
64
- Silent background refresh runs every 30 seconds. Period/provider data is cached and prefetched so tab switching feels instant.
155
+ When [Exe OS](https://github.com/AskExe/exe-os) supplies local agent stats, Watcher adds an **AI Employees** section to the menu bar with two panels:
156
+
157
+ - **Memory** — Persistent memory count for each employee, with 24h / 7d / 30d growth columns. This tracks saved knowledge records, not runtime memory consumption or memory quality.
158
+ - **Employee Spend** — Per-employee cost across 24h / 7d / 30d, using the model-aware cost buckets supplied by Exe OS.
159
+
160
+ How it works:
161
+
162
+ 1. Exe OS maps Claude Code sessions to employee IDs through its session-start integration.
163
+ 2. Its daemon publishes employee memory/growth and model-aware spend buckets to `~/.exe-os/agent-stats.json`.
164
+ 3. Watcher reads that local stats file; it does not open Exe OS's memory database or fetch memory contents.
165
+ 4. The CLI's project view also groups recognized agent worktree paths under their parent project.
166
+
167
+ The section shows a waiting state when Exe OS is detected without stats, and marks data older than five minutes as stale. `exe-watcher agent-status` reports whether the local directory, daemon PID file, stats format and file freshness are available. Spend/time tracking works independently of Exe OS.
65
168
 
66
169
  ### Interactive TUI dashboard
67
170
 
68
171
  ```bash
69
- exe-watcher # default: 7 days
172
+ exe-watcher report # 7-day terminal dashboard, including on macOS
70
173
  exe-watcher today # today only
71
174
  exe-watcher month # this calendar month
72
175
  ```
73
176
 
74
177
  Full-screen terminal dashboard with gradient charts, responsive panels, and keyboard navigation. Breaks down spend by day, project, model, activity type, tools, MCP servers, and shell commands. Auto-refreshes every 30 seconds.
75
178
 
76
- **Keys:** `1`-`5` switch periods (Today / 7d / 30d / Month / All). `p` toggle providers. `c` compare mode. `o` optimize view. `q` quit.
179
+ **Keys:** `1`-`5` switch periods (Today / 7d / 30d / Month / All); left/right arrows or Tab cycle periods. `p` switches providers. `r` refreshes. `c` opens comparison and `o` opens Optimize when available. Escape or `b` returns from Optimize; `q` quits.
77
180
 
78
181
  ### Optimize
79
182
 
80
183
  ```bash
81
- exe-watcher optimize # full scan
184
+ exe-watcher optimize # bounded Claude Code analysis
82
185
  exe-watcher optimize -p week # scope to last 7 days
83
186
  ```
84
187
 
85
188
  Scans your sessions and `~/.claude/` config for waste: re-read files, low read:edit ratios, uncapped bash output, unused MCP servers, ghost agents, bloated CLAUDE.md files. Returns exact copy-paste fixes and estimated savings. Grades your setup A through F.
86
189
 
190
+ In the full report, press `o` to see recommendations, `b` to return, or `r` to run the analysis again. Automatic refresh pauses while you read the optimizer. Large histories produce clearly marked partial recommendations from the newest selected sessions, within a smaller analysis budget. Partial checks omit the overall health grade and cleanup suggestions that require complete history. Nothing is applied automatically; token and dollar savings are estimates.
191
+
192
+ In the optimizer, press `c` to **copy all** recommendations and suggested fixes, ready to paste into Claude Code, or `e` to **save a Markdown file**. The file goes to Downloads when that folder exists, otherwise the current folder; the saved path appears on screen. Both actions use the displayed results without rescanning. Exports include the selected period, coverage warnings, estimates and complete fixes. If the system clipboard is unavailable, save the Markdown file instead.
193
+
87
194
  ### Compare
88
195
 
89
196
  ```bash
@@ -104,18 +211,25 @@ Side-by-side model comparison on your own data. One-shot rate, retry rate, cost
104
211
  | **Cursor Agent** | CLI sessions | Full support |
105
212
  | **Copilot** | `~/.copilot/session-state/` | Output tokens only |
106
213
  | **OpenCode** | SQLite (`~/.local/share/opencode/`) | Subtask sessions excluded |
214
+ | **Kimi Code** | `~/.kimi-code/sessions/` | Native `usage.record` logs, including subagents; rotating model aliases remain unpriced |
107
215
  | **OMP** (Oh My Pi) | `~/.omp/agent/sessions/` | Full support |
108
216
  | **Pi** | `~/.pi/agent/sessions/` | Full support |
109
217
 
110
218
  All providers auto-detected. If multiple tools have data, press `p` in the dashboard to toggle between them. The provider plugin system makes adding new tools straightforward — each provider is a single file in `src/providers/`.
111
219
 
220
+ On a new Mac, install and open Watcher: no client executables, API keys, shell setup or account connection are required. It reads supported clients' saved usage in the standard folders above. The menu bar app also picks up the first session from a client installed after Watcher starts. Custom folders require the matching environment override or an additional Claude profile root; Finder-launched apps do not inherit variables set only in your terminal shell.
221
+
222
+ Models are independent of clients: GLM, Kimi, DeepSeek, Gemini and other known models are priced from the model name recorded by Claude Code, OpenCode or another supported client. Costs use current API list rates, including separately recorded cache reads and writes. Subscription quotas, discounts, broker markups and old invoices are not reconstructed. Missing model prices preserve token counts and show an incomplete-cost notice in the app.
223
+
224
+ This is not universal interception of every AI request. A client must retain a supported usage format with token counts. Deleted logs, cloud-only chats and unsupported formats (including Python Kimi CLI's `~/.kimi/` Wire events and older OpenCode JSON storage) cannot be recovered automatically. Copilot's saved data currently provides output tokens only; Cursor Auto mode uses an estimate. See the table for coverage before treating a total as complete.
225
+
112
226
  ---
113
227
 
114
228
  ## CLI reference
115
229
 
116
230
  ```bash
117
231
  # Dashboard
118
- exe-watcher # interactive (default: 7 days)
232
+ exe-watcher report # interactive (default: 7 days)
119
233
  exe-watcher today # today only
120
234
  exe-watcher month # this month
121
235
 
@@ -124,7 +238,7 @@ exe-watcher report -p 30days # rolling 30-day window
124
238
  exe-watcher report -p all # everything on disk
125
239
  exe-watcher report --from 2026-04-01 --to 2026-04-10
126
240
  exe-watcher report --format json # structured JSON to stdout
127
- exe-watcher status # compact one-liner (today + month)
241
+ exe-watcher status # compact spending status
128
242
 
129
243
  # Menubar data (used by the Swift app)
130
244
  exe-watcher status --format menubar-json --period today --provider all
@@ -140,9 +254,14 @@ exe-watcher optimize -p week # scope to last 7 days
140
254
  exe-watcher compare # interactive model picker
141
255
  exe-watcher export # CSV (today, 7d, 30d)
142
256
  exe-watcher export -f json # JSON export
257
+
258
+ # AI time and employee diagnostics
259
+ exe-watcher time --period week --format json
260
+ exe-watcher time --recover --period all
261
+ exe-watcher agent-status # diagnose Exe OS stats freshness
143
262
  ```
144
263
 
145
- **Flags work everywhere:** `--provider`, `--project`, `--exclude`, `--from`, `--to`, and `--format json` combine freely across all commands.
264
+ `report` supports period, provider, project, exclusion, date-range and JSON options. `today`, `month`, `status` and `export` support provider/project/exclusion filters; Optimize and Compare accept period/provider options. `time` has period/provider/project/exclusion filters and text/JSON output. Use `<command> --help` for the options each command accepts.
146
265
 
147
266
  ---
148
267
 
@@ -159,21 +278,21 @@ Supported: USD, GBP, EUR, JPY, AUD, CAD, CHF, CNY, SEK, NOK, DKK, NZD, SGD, HKD,
159
278
 
160
279
  ### Plans
161
280
 
162
- Track spend against your subscription quota:
281
+ Track API-equivalent spend against a configured monthly budget:
163
282
 
164
283
  ```bash
165
- exe-watcher plan set claude-max # $200/month
166
- exe-watcher plan set claude-pro # $20/month
167
- exe-watcher plan set cursor-pro # $20/month
284
+ exe-watcher plan set claude-max # built-in $200 monthly budget
285
+ exe-watcher plan set claude-pro # built-in $20 monthly budget
286
+ exe-watcher plan set cursor-pro # built-in $20 monthly budget
168
287
  exe-watcher plan set custom --monthly-usd 150 --provider claude
169
288
  exe-watcher plan set none # disable
170
289
  ```
171
290
 
172
- The menubar shows a usage bar against your plan limit when a plan is active.
291
+ These are Watcher's budget presets, not a live price list or a measurement of subscription capacity. The menu bar shows spend against the configured budget. Live Claude five-hour/weekly utilization is a separate provider-reported view.
173
292
 
174
293
  ### Model aliases
175
294
 
176
- If a model shows `$0.00`, your provider's model name doesn't match LiteLLM pricing data. Map it:
295
+ If a recorded model has no verified price, Watcher keeps its tokens and warns that cost is excluded. When an alias refers to a known underlying model, map it explicitly:
177
296
 
178
297
  ```bash
179
298
  exe-watcher model-alias "my-proxy-model" "claude-opus-4-6"
@@ -181,25 +300,7 @@ exe-watcher model-alias --list
181
300
  exe-watcher model-alias --remove "my-proxy-model"
182
301
  ```
183
302
 
184
- Stored in `~/.config/exe-watcher/config.json`. User aliases override built-ins.
185
-
186
- ---
187
-
188
- ## Exe OS integration
189
-
190
- When [Exe OS](https://github.com/AskExe/exe-os) is installed, Watcher auto-detects it and adds an **AI Employees** section to the menubar with two panels:
191
-
192
- - **Memory** — Per-agent memory count with 24h / 7d / 30d growth columns
193
- - **Employee Spend** — Per-agent cost across 24h / 7d / 30d, using model-aware pricing (Opus, Sonnet, Haiku rates applied per-model)
194
-
195
- How it works:
196
-
197
- 1. Exe OS's SessionStart hook maps Claude Code sessions to agents via `~/.exe-os/session-cache/`
198
- 2. The daemon computes `getAgentSpend()` with per-model pricing and writes `~/.exe-os/agent-stats.json` every 60 seconds
199
- 3. Watcher reads the stats file — zero coupling, no auth, no direct database access
200
- 4. Worktree-aware: agent worktree paths collapse into parent project names
201
-
202
- The section appears automatically when exe-os is present and hides when it's not. Also shows daemon uptime and agent memory growth trends.
303
+ Stored in `~/.config/exe-watcher/config.json` (or beneath `XDG_CONFIG_HOME`). User aliases override built-ins. Only alias models whose identity you know; an alias supplies pricing, not proof of the underlying model.
203
304
 
204
305
  ---
205
306
 
@@ -207,22 +308,20 @@ The section appears automatically when exe-os is present and hides when it's not
207
308
 
208
309
  Two components, loosely coupled via CLI output:
209
310
 
210
- ```
211
- ┌──────────────────────────────────┐ ┌─────────────────────────────────┐
212
- │ CLI (Node.js / TypeScript) │ │ Menubar App (Swift / SwiftUI) │
213
- │ │ │ │
214
- │ Reads provider session files │ JSON │ Calls CLI with --format │
215
- │ Computes cost via LiteLLM rates ├─────►│ menubar-json │
216
- │ Daily cache (v6, atomic writes) │ │ @Observable state management │
217
- │ 365-day historical backfill │ │ 30s cache TTL, prefetch on │
218
- │ Lock serialization for safety │ │ launch, concurrent fetch │
219
- │ │ │ guards │
220
- └──────────────────────────────────┘ └─────────────────────────────────┘
311
+ ```text
312
+ Provider usage files
313
+ ↓
314
+ CLI: deduplicate → price tokens → cache daily totals → JSON
315
+ timing evidence → separate bounded timing index → time totals
316
+ ↓
317
+ macOS app: file notifications → one bounded CLI worker → menu bar
221
318
  ```
222
319
 
223
320
  **CLI pipeline:** Parse provider session files from disk → deduplicate by message ID → compute cost per token type (input, output, cache write, cache read, web search) → aggregate by period, project, model, activity → output as TUI, JSON, or CSV.
224
321
 
225
- **Menubar app:** Calls `exe-watcher status --format menubar-json --period <period> --provider <provider>` → decodes JSON → renders SwiftUI popover. All 5 periods are pre-fetched on launch for instant tab switching. Security: no shell injection — validated argv arrays are passed directly to child processes, not through a shell.
322
+ **Menubar app:** Calls `exe-watcher status --format menubar-json --period <period> --provider <provider>` → decodes JSON → renders SwiftUI popover. Usage-file notifications trigger coalesced refreshes, with catch-up on launch and wake. Period and provider views load when selected. A single CLI worker has memory, runtime, and output limits; failed scans preserve the last successful total. There is no periodic background usage scan. Security: no shell injection — validated argv arrays are passed directly to child processes, not through a shell.
323
+
324
+ **Employee data:** Reads Exe OS's local summary file alongside the usage payload. The memory/spend panels use daemon-supplied employee identities and do not transmit memory records.
226
325
 
227
326
  **Deduplication** per provider: API message ID (Claude), cumulative token cross-check (Codex), conversation/timestamp (Cursor), session+message ID (OpenCode), responseId (Pi/OMP).
228
327
 
@@ -230,23 +329,17 @@ Two components, loosely coupled via CLI output:
230
329
 
231
330
  ## Test suite
232
331
 
233
- 648 tests across 3 layers:
234
-
235
- | Layer | Framework | Count | What it covers |
236
- |-------|-----------|-------|----------------|
237
- | **CLI data integrity** | Vitest | 597 | Schema validation, provider sum consistency, period monotonicity, project spend accuracy, 365-day history, token sanity checks |
238
- | **Swift state** | Swift Testing | 45 | Period windowing, cache isolation, prefetch logic, capacity estimation, CLI resolution, provider sum validation, JSON decode |
239
- | **UI smoke** | Swift Testing + Accessibility | 6 | App launch, status item presence, popover display, period switching via macOS Accessibility APIs |
332
+ Tests cover CLI data integrity, native scheduling and resource limits, and optional macOS Accessibility smoke checks. CLI end-to-end tests use isolated usage fixtures.
240
333
 
241
334
  ```bash
242
335
  # Run CLI tests
243
- npm test
336
+ npx vitest run
244
337
 
245
- # Run Swift tests
246
- cd mac && swift test
338
+ # Run native state and resource tests
339
+ swift test --package-path mac --filter ExeWatcherMenubarTests
247
340
 
248
- # Run UI tests
249
- cd mac && xcodebuild test -scheme ExeWatcherUITests
341
+ # UI smoke tests require macOS Accessibility access
342
+ swift test --package-path mac --filter ExeWatcherUITests
250
343
  ```
251
344
 
252
345
  ---
@@ -275,7 +368,7 @@ cd mac && xcodebuild test -scheme ExeWatcherUITests
275
368
  | Low 1-shot rate (Coding 30%) | Agent struggling, retry loops |
276
369
  | Opus on small turns | Overpowered model for simple tasks |
277
370
  | Bash dominated by `git status`, `ls` | Agent exploring instead of executing |
278
- | Conversation category dominant | Agent talking instead of doing |
371
+ | Research dominant | Investigating, discussing approaches, or reading without edits |
279
372
 
280
373
  Starting points, not verdicts. A single experimental session with 60% cache hit is fine. That same number across weeks of work is a config issue.
281
374
 
@@ -283,7 +376,15 @@ Starting points, not verdicts. A single experimental session with 60% cache hit
283
376
 
284
377
  ## How it works
285
378
 
286
- Reads session data directly from disk. No wrapper, no proxy, no API keys needed. Pricing from [LiteLLM](https://github.com/BerriAI/litellm) (auto-cached 24h). Handles input, output, cache write, cache read, and web search costs.
379
+ Reads session data directly from disk. No wrapper, no proxy, no API keys needed. Pricing refreshes every 24 hours from official OpenAI, Anthropic, MiniMax, Z.AI, Kimi and xAI pricing pages, supplemented by [LiteLLM](https://github.com/BerriAI/litellm). Official rates take precedence over reseller prices for unqualified model names. Offline use retains the last available catalog or the bundled rates verified October 1, 2026, with warnings when a refresh fails. Handles input, output, 5-minute and 1-hour cache writes, cache reads, long-context tiers, and recorded web search costs. Claude streaming records are reconciled by API message ID using cumulative token counters; final usage is counted once.
380
+
381
+ Both historical and current usage use the latest available per-model API list rates. This answers "what would these tokens cost via API at today's prices?" Historical totals are rebuilt when pricing changes; they do not reconstruct the price charged on each original date. JSON reports include `pricing` metadata with the basis, refresh timestamp and source URLs. Missing session details still make recovered history an estimate. Models without published token prices (including Codex Spark) retain their tokens and an explicit cost-exclusion warning, rather than inheriting another model's price or an old reported bill.
382
+
383
+ Switching Claude accounts does not filter usage: Watcher counts all retained sessions in the configured data directory and Claude Desktop account folders. Codex archived sessions also count. Add other Claude profile roots with `claudeConfigDirs` in `~/.config/exe-watcher/config.json`.
384
+
385
+ “All Time” includes the entire available history. To set the beginning of your coding journey, add `"historyStartDate": "2025-07-01"` to the same config. This defines the reporting window; it cannot recreate missing logs. Unknown model prices generate a warning while their tokens remain counted.
386
+
387
+ For unfiltered All Time Claude totals, Watcher also reconciles `stats-cache.json` cumulative model counters with retained logs through the snapshot's cutoff date. Only missing per-model/token counters are added. Recovered usage is separately identified as `historicalRecovery`: it has no fabricated dates, sessions, or projects, and uses standard API rates with 5-minute cache writes because TTL/speed metadata is unavailable. Daily charts show dated logs only. Project/provider sums include recovery only where attribution is known. Usage lost from both logs and cumulative counters remains unknown. These are API-equivalent estimates, not subscription charges or invoices.
287
388
 
288
389
  **Environment variables:**
289
390
 
@@ -291,6 +392,9 @@ Reads session data directly from disk. No wrapper, no proxy, no API keys needed.
291
392
  |----------|-------------|
292
393
  | `CLAUDE_CONFIG_DIR` | Override Claude data directory (default: `~/.claude`) |
293
394
  | `CODEX_HOME` | Override Codex data directory (default: `~/.codex`) |
395
+ | `KIMI_CODE_HOME` | Override native Kimi Code data directory (default: `~/.kimi-code`) |
396
+ | `XDG_DATA_HOME` | Base data directory for OpenCode (default: `~/.local/share`) |
397
+ | `XDG_CONFIG_HOME` | Base directory for Watcher configuration (default: `~/.config`) |
294
398
  | `EXE_WATCHER_CACHE_DIR` | Override cache directory (default: `~/.cache/exe-watcher`) |
295
399
 
296
400
  ---
@@ -304,10 +408,15 @@ src/
304
408
  cli.ts Entry point (Commander.js)
305
409
  dashboard.tsx TUI (Ink — React for terminals)
306
410
  parser.ts Session reader, dedup, date filter
307
- models.ts LiteLLM pricing engine
411
+ models.ts Pricing catalog and verified model aliases
412
+ official-pricing.ts Official provider pricing overrides
308
413
  classifier.ts Activity classifier (6 categories)
309
414
  compare-stats.ts Model comparison engine
310
- menubar-json.ts Menubar payload builder (agent spend, project spend)
415
+ menubar-json.ts Menu bar payload, employee stats and project spend
416
+ resource-budget.ts Scan memory, runtime and output limits
417
+ history-build.ts Resumable historical accounting
418
+ time-tracking.ts AI running, elapsed busy and interaction estimates
419
+ time-index.ts Separate bounded timing index and recovery
311
420
  export.ts CSV/JSON export
312
421
  config.ts Config management
313
422
  currency.ts Currency conversion
@@ -320,27 +429,17 @@ tests/ CLI data integrity tests (Vitest)
320
429
 
321
430
  ## Origin & attribution
322
431
 
323
- Watcher is forked from [codeburn](https://github.com/getagentseal/codeburn) by [AgentSeal](https://github.com/getagentseal) (MIT license). We forked rather than contributed upstream because our roadmap diverges significantly:
432
+ Watcher is an independently developed derivative of [CodeBurn](https://github.com/getagentseal/codeburn) by [AgentSeal](https://github.com/getagentseal), used under the MIT license. It began as a source import into a new repository on **April 24, 2026 at 14:40 Asia/Makassar (06:40 UTC)**, initially named exe-fuelbar. It is a fork in the development sense; GitHub does not list this repository as a fork.
433
+
434
+ The [initial import](https://github.com/AskExe/exe-watcher/commit/8545e35633958ab3fd12600c1ac89c528c867904) contains 112 files identical to the corresponding files in [CodeBurn commit d3c4de0](https://github.com/getagentseal/codeburn/commit/d3c4de03759f0ded38052874fa829709d27fe7c6), whose package version was 0.8.9. Upstream's commit history was not imported.
435
+
436
+ **The inherited foundation** includes the CLI/TUI, eight provider integrations, the native macOS menu bar app, subscription tracking (including Claude's five-hour and weekly windows), capacity estimation, currency support, model comparisons, and optimization analysis. These were already present at import and belong in CodeBurn's credit.
324
437
 
325
- **What we changed:**
326
- - Rebranded to Watcher with the Exe Foundry Bold design system
327
- - 8 provider support (added Cursor Agent, Copilot, OMP, Pi, OpenCode)
328
- - Native macOS menubar app with multi-period views, provider tabs, project spend, and subscription tracking
329
- - Exe OS integration — per-agent spend and memory tracking for AI employee teams
330
- - Daily cache system (v6) with atomic writes and cold-start/progressive 365-day backfill
331
- - Capacity estimation from usage patterns
332
- - Multi-currency support (17 currencies)
333
- - 648-test suite across CLI, Swift state, and UI smoke layers
334
- - Consolidated activity categories from 13 to 6
335
- - Fixed double-counting bugs in the menubar JSON pipeline
336
- - Performance: 7-day and 30-day queries from 2-5s down to ~1s via daily cache
438
+ **Watcher's subsequent work** includes its Exe branding and owl artwork, Exe OS agent/memory integration, bounded event-driven refreshes and history recovery, accounting and pricing corrections, native Kimi Code support, self-contained macOS packaging, and AI running/elapsed/interaction time reporting. The roadmap serves our AI employee teams and multi-agent workflows.
337
439
 
338
- **Why we forked:**
339
- - Full control over the data pipeline to integrate with exe-os (our AI employee operating system)
340
- - Our classification model, provider support, and UI direction serve a different user base (AI-first teams running multi-agent workflows)
341
- - MIT license allows this — we give full credit to AgentSeal for the foundation
440
+ AgentSeal's original copyright notice and the full MIT terms are preserved in [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). The notices ship with the npm package and packaged macOS app. See the [dated upstream comparison and adoption backlog](docs/codeburn-upstream-review.md) for evidence and features to evaluate.
342
441
 
343
- Thank you to AgentSeal for building the original. If you want a clean cost tracker without exe-os integration, [codeburn](https://github.com/getagentseal/codeburn) is excellent.
442
+ Thank you to AgentSeal and CodeBurn's contributors for the foundation.
344
443
 
345
444
  ---
346
445
 
@@ -358,7 +457,7 @@ Thank you to AgentSeal for building the original. If you want a clean cost track
358
457
 
359
458
  ## License
360
459
 
361
- MIT
460
+ MIT. Includes CodeBurn by AgentSeal; see [LICENSE](LICENSE) and [third-party notices](THIRD_PARTY_NOTICES.md).
362
461
 
363
462
  ---
364
463
 
@@ -0,0 +1,37 @@
1
+ # Third-party notices
2
+
3
+ ## CodeBurn by AgentSeal
4
+
5
+ Exe Watcher includes code derived from [CodeBurn](https://github.com/getagentseal/codeburn), originally developed by [AgentSeal](https://github.com/getagentseal).
6
+
7
+ The initial source import on April 24, 2026 matches the 112 corresponding files in upstream revision `d3c4de03759f0ded38052874fa829709d27fe7c6` (package version 0.8.9). Its CLI/TUI, provider integrations, macOS app, subscription tracking, and analysis tools form Watcher's original foundation. Exe AI subsequently developed Watcher's branding, integrations, and other changes. See the repository's `docs/codeburn-upstream-review.md` for the comparison.
8
+
9
+ The native multi-provider quota adapters and response mapping also adapt the Codex, Kimi, Cursor, Copilot and Gemini readers from CodeBurn revision `9a40cc603fcd194caca9daa8c5134a61ea7e0e2b` (`src/quota/`). Watcher's adaptation uses independent native request admission and read-only credential access; it does not import the upstream OAuth rotation/write-back flows or provider vectors.
10
+
11
+ CodeBurn's original license is reproduced verbatim below. Exe AI's additional copyright notice appears in the root `LICENSE`.
12
+
13
+ ```text
14
+ MIT License
15
+
16
+ Copyright (c) 2026 AgentSeal
17
+
18
+ Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ of this software and associated documentation files (the "Software"), to deal
20
+ in the Software without restriction, including without limitation the rights
21
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ copies of the Software, and to permit persons to whom the Software is
23
+ furnished to do so, subject to the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be included in all
26
+ copies or substantial portions of the Software.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ SOFTWARE.
35
+ ```
36
+
37
+ Runtime dependencies and other bundled assets retain their own licenses. This CodeBurn notice does not replace them. Check the applicable upstream notices before importing further code or assets; current CodeBurn includes components with additional third-party terms.