noctrace 0.0.1 → 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nyktora Group LLC
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,118 @@
1
+ <p align="center">
2
+ <img src="docs/screenshots/noctrace-logo.svg" alt="noctrace" width="320" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ Chrome DevTools Network-tab-style waterfall visualizer for <a href="https://docs.anthropic.com/en/docs/claude-code">Claude Code</a> agent workflows.
7
+ <br />
8
+ Zero config. Zero cloud. Just run <code>npx noctrace</code> and see what your agents are doing.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/noctrace"><img src="https://img.shields.io/npm/v/noctrace?color=cb6f10&label=npm" alt="npm version" /></a>
13
+ <a href="https://github.com/nyktora/noctrace/blob/main/LICENSE"><img src="https://img.shields.io/github/license/nyktora/noctrace?color=green" alt="MIT License" /></a>
14
+ <a href="https://www.npmjs.com/package/noctrace"><img src="https://img.shields.io/npm/dm/noctrace?color=blue" alt="npm downloads" /></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ ![Noctrace waterfall timeline](docs/screenshots/noctrace-waterfall.png)
20
+
21
+ ## Why
22
+
23
+ Claude Code's terminal output is opaque. Tool calls show summaries like "Read 3 files" and "Edited 2 files" — no paths, no timing, no concurrency visibility. When sub-agents spawn sub-agents, you're flying blind.
24
+
25
+ Noctrace reads Claude Code's session logs from `~/.claude/projects/` and renders them as an interactive waterfall timeline — the same visual paradigm that makes Chrome DevTools' Network tab instantly readable.
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ # Run directly (no install needed)
31
+ npx noctrace
32
+
33
+ # Or install globally
34
+ npm install -g noctrace
35
+ noctrace
36
+ ```
37
+
38
+ Requires Node.js 20+. That's it. No config, no hooks, no API keys.
39
+
40
+ ## Features
41
+
42
+ - **Waterfall timeline** — horizontal bars on a shared time axis showing tool call concurrency and duration
43
+ - **Collapsible agent groups** — sub-agents as expandable row groups with real execution time bars showing parallel work
44
+ - **Sub-agent visibility** — parses sub-agent JSONL files to show what happened inside each agent
45
+ - **Real-time updates** — file watcher pushes new events via WebSocket as your session runs
46
+ - **Context Health grade** — A-F letter grade from 5 signals with actionable recommendations
47
+ - **Compact stats pill** — toolbar shows agent count, health grade, total tokens, and session duration at a glance
48
+ - **Filter with highlighting** — search by tool name, label, or keywords (`error`, `agent`, `running`) with yellow match highlighting
49
+ - **Virtual scrolling** — handles sessions with hundreds of tool calls
50
+ - **Zoom & pan** — mouse wheel zoom (1-50x), click-drag pan
51
+ - **Detail panel** — click any row for full tool input/output, resizable
52
+ - **Re-read detection** — flags duplicate file reads that waste context
53
+ - **Dark theme** — Catppuccin Mocha palette
54
+
55
+ ### Context Health
56
+
57
+ ![Context health visualization](docs/screenshots/noctrace-context-rot.png)
58
+
59
+ Noctrace computes a real-time health score from your session data and warns you before context rot degrades output quality. The breakdown panel shows per-signal grades and tells you exactly when to run `/compact`.
60
+
61
+ | Signal | Weight | What it measures |
62
+ |--------|--------|-----------------|
63
+ | Context Fill | 40% | How full is the 200k token window |
64
+ | Compactions | 25% | Number of lossy compaction events |
65
+ | Re-reads | 15% | Duplicate file reads (retrieval failures) |
66
+ | Error Rate | 10% | Accelerating errors in second half of session |
67
+ | Tool Efficiency | 10% | Declining productive output |
68
+
69
+ ## How it works
70
+
71
+ 1. Starts a local server on `http://localhost:4117` (auto-finds next available port)
72
+ 2. Opens your browser
73
+ 3. Reads JSONL session logs from `~/.claude/projects/`
74
+ 4. Parses tool_use/tool_result pairs into a waterfall timeline
75
+ 5. Watches active session files for real-time updates via WebSocket
76
+
77
+ No hooks to install. No config files. No cloud. Everything stays local.
78
+
79
+ ## Configuration
80
+
81
+ | Environment Variable | Default | Description |
82
+ |---------------------|---------|-------------|
83
+ | `PORT` | `4117` | Server port (auto-increments if busy) |
84
+ | `CLAUDE_HOME` | `~/.claude` | Override Claude home directory |
85
+
86
+ ## Development
87
+
88
+ ```bash
89
+ git clone https://github.com/nyktora/noctrace.git
90
+ cd noctrace
91
+ npm install
92
+ npm run dev # starts server + Vite dev server
93
+ ```
94
+
95
+ | Command | Description |
96
+ |---------|-------------|
97
+ | `npm run dev` | Start dev server with HMR |
98
+ | `npm run build` | Production build (client + server) |
99
+ | `npm test` | Run test suite (Vitest) |
100
+ | `npm run typecheck` | TypeScript type checking |
101
+ | `npm run lint` | ESLint |
102
+
103
+ ## Tech Stack
104
+
105
+ - **Server**: Express 5, ws, chokidar
106
+ - **Client**: React 19, Vite 8, Tailwind CSS 4, Zustand 5
107
+ - **Tests**: Vitest 4
108
+ - **Language**: TypeScript 5.9 (strict mode)
109
+
110
+ ## License
111
+
112
+ [MIT](LICENSE)
113
+
114
+ ---
115
+
116
+ <p align="center">
117
+ Created and maintained by <a href="https://nyktora.com">Nyktora Group</a> · Contributions welcome
118
+ </p>
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { startServer } from '../dist/server/server/index.js';
3
+ import open from 'open';
4
+
5
+ const port = await startServer();
6
+ const url = `http://localhost:${port}`;
7
+ await open(url);