tokenoscopy 0.0.0-stage → 0.3.0
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/README.md +36 -2
- package/dist/chunk-L62TVAWB.js +752 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +716 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +22 -0
- package/package.json +59 -4
package/README.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tokenoscopy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Flight recorder & spend control for coding-agent fleets.** Records every Claude Code session — every prompt, tool call, file edit, and dollar — into a replayable timeline with budgets that can actually stop a runaway run.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g tokenoscopy
|
|
7
|
+
tokenoscopy init --key tok_…
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Sign in at [tokenoscopy.com](https://tokenoscopy.com) and the **Setup** screen
|
|
11
|
+
hands you that command with your key already written into it, then waits for
|
|
12
|
+
your first session and shows it to you as it lands.
|
|
13
|
+
|
|
14
|
+
Install globally rather than relying on `npx`: the budget guard runs before
|
|
15
|
+
every Bash and MCP tool call, and `npx` re-resolves the package each time.
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
| Command | What it does |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `init` | Wires Claude Code hooks (live events + transcript flush + budget guard) into `~/.claude/settings.json`. Idempotent; keeps a backup; never touches your other hooks. `--project` targets `./.claude/settings.json` for CI. `--print` shows the config without writing. |
|
|
22
|
+
| `flush` | Parses the current session transcript, computes list-price spend, **redacts secrets client-side**, uploads. Called by hooks; safe to run manually with `--transcript <path>`. |
|
|
23
|
+
| `guard` | PreToolUse budget check. Hard 1500ms timeout; **every failure path fails open** — your session never stalls on us. |
|
|
24
|
+
| `tail` | Watches `~/.claude/projects` and flushes transcripts as they change. `--backfill` uploads the last 7 days first; `--since <days>` widens that and relabels each session's billing lane. |
|
|
25
|
+
| `doctor` | Verifies config, hook wiring, API reachability, key validity, and the billing lane (with the evidence that decided it). |
|
|
26
|
+
|
|
27
|
+
## Privacy
|
|
28
|
+
|
|
29
|
+
Redaction runs on your machine before anything uploads: credential shapes (Anthropic/OpenAI/GitHub/Slack/AWS/Google/Stripe), JWTs, private-key blocks, Authorization headers, connection-string passwords, secret assignments, and emails in content. Replays include the paths of files the agent read or edited (and each one relative to the repo root); branch drift is counted from local git refs, with no network call.
|
|
30
|
+
|
|
31
|
+
## Environment
|
|
32
|
+
|
|
33
|
+
- `TOKENOSCOPY_KEY` — ingest key (overrides config file; use in CI)
|
|
34
|
+
- `TOKENOSCOPY_API_URL` — API base (default `https://tokenoscopy.com`)
|
|
35
|
+
- `TOKENOSCOPY_CONFIG_DIR` — config location (default `~/.config/tokenoscopy`)
|
|
36
|
+
|
|
37
|
+
MIT © Tokenoscopy
|