tktuner 0.2.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/LICENSE +21 -0
- package/README.md +57 -0
- package/dist/cli.js +2608 -0
- package/dist/cli.js.map +1 -0
- package/dist/hook-QKTYBOHD.js +114 -0
- package/dist/hook-QKTYBOHD.js.map +1 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matheus Oliveira
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# TkTuner
|
|
2
|
+
|
|
3
|
+
> Stop paying Fable prices for Haiku work.
|
|
4
|
+
|
|
5
|
+
Local-first token usage analytics for Claude Code power users. TkTuner reads the session logs Claude Code already writes to `~/.claude/projects/`, classifies how you actually use the agent (exploration / planning / execution / delegation), and shows where you burn tokens and quota: premium models doing cheap work, poor cache reuse, subagents inheriting expensive models.
|
|
6
|
+
|
|
7
|
+
**Local first.** `scan` and `report` run 100% on your machine, free, no account. TkTuner never stores message text, thinking content, or tool inputs — only models, token counts, tool names, timestamps and identifiers.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
tktuner scan # parse ~/.claude/projects/**/*.jsonl incrementally into a local SQLite db
|
|
13
|
+
tktuner report # terminal report: cost by model, phase×model waste, cache health, quota pressure
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Useful flags:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
tktuner scan --claude-dir <path> # custom Claude projects dir (default: ~/.claude/projects)
|
|
20
|
+
tktuner scan --full # ignore incremental state and reparse everything
|
|
21
|
+
tktuner report --days 7 # analysis window (default: 30)
|
|
22
|
+
tktuner report --all # entire history
|
|
23
|
+
tktuner report --project <name> # filter by project name substring
|
|
24
|
+
tktuner report --json # machine-readable output
|
|
25
|
+
tktuner report --debug-session <id-prefix> # per-turn classification breakdown
|
|
26
|
+
tktuner report --prices <path> # override the bundled model price table
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The local database lives at `$XDG_DATA_HOME/tktuner/tktuner.db` (default `~/.local/share/tktuner/tktuner.db`); override with `--db <path>`.
|
|
30
|
+
|
|
31
|
+
## Dashboard (tktuner.com)
|
|
32
|
+
|
|
33
|
+
Optional: sync your usage **metadata** to a hosted dashboard with history, charts and multi-device support.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
tktuner login # device flow — approve in the browser
|
|
37
|
+
tktuner sync # scan, then upload new turns (numbers only, gzip batches)
|
|
38
|
+
tktuner sync --dry-run # audit exactly what would be uploaded
|
|
39
|
+
tktuner hook install # opt-in: auto-sync when a Claude Code session ends
|
|
40
|
+
tktuner whoami # account, device and sync state
|
|
41
|
+
tktuner logout # revoke this device and delete local credentials
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
What syncs: token counts, model ids, tool **names**, timestamps, session ids, `sha256(project path)` + the folder's basename, session slugs, text **lengths**. What never syncs (and is never even stored locally): prompts, answers, thinking content, tool inputs/outputs, file paths, git branches. `--dry-run` shows the exact payload.
|
|
45
|
+
|
|
46
|
+
## Requirements
|
|
47
|
+
|
|
48
|
+
- Node.js >= 20
|
|
49
|
+
- `better-sqlite3` ships prebuilt binaries for common platforms; if your platform has none, a C++ toolchain (`build-essential`) is required to compile it.
|
|
50
|
+
|
|
51
|
+
## Status
|
|
52
|
+
|
|
53
|
+
Local analytics + dashboard sync. Prescription (`optimize` / `apply` — a generated `.claude/` folder tuned to your usage profile) is next.
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
MIT
|