agent-analyzer 0.1.2
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 +60 -0
- package/README.md +127 -0
- package/npm/bin/agent-analyzer-darwin-arm64 +0 -0
- package/npm/bin/agent-analyzer-darwin-x64 +0 -0
- package/npm/bin/agent-analyzer-linux-arm64 +0 -0
- package/npm/bin/agent-analyzer-linux-x64 +0 -0
- package/npm/bin/agent-analyzer-win32-x64.exe +0 -0
- package/npm/bin/agent-analyzer.js +27 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Claude Log Analyzer Source Available License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Robert Douglass. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This license governs the Claude Log Analyzer source code and related project files
|
|
6
|
+
in this repository, except for files that clearly state a different license.
|
|
7
|
+
Third-party dependencies remain governed by their own licenses.
|
|
8
|
+
|
|
9
|
+
## 1. Source Availability
|
|
10
|
+
|
|
11
|
+
You may view, download, and clone this repository to inspect the source code,
|
|
12
|
+
evaluate the software, report issues, and propose contributions.
|
|
13
|
+
|
|
14
|
+
## 2. Limited Evaluation Use
|
|
15
|
+
|
|
16
|
+
You may run unmodified copies of the software for personal, internal evaluation,
|
|
17
|
+
security review, and development testing. This permission does not include any
|
|
18
|
+
production, hosted, commercial, resale, or service-provider use.
|
|
19
|
+
|
|
20
|
+
## 3. Contributions
|
|
21
|
+
|
|
22
|
+
By submitting a contribution, you grant Robert Douglass a perpetual, worldwide,
|
|
23
|
+
irrevocable, royalty-free license to use, reproduce, modify, distribute,
|
|
24
|
+
sublicense, and relicense your contribution as part of Claude Log Analyzer.
|
|
25
|
+
You represent that you have the right to grant this license.
|
|
26
|
+
|
|
27
|
+
## 4. Restrictions
|
|
28
|
+
|
|
29
|
+
Except as expressly allowed above, you may not:
|
|
30
|
+
|
|
31
|
+
- use the software in production or for commercial purposes;
|
|
32
|
+
- provide the software, or substantially similar functionality, as a hosted or
|
|
33
|
+
managed service;
|
|
34
|
+
- sell, rent, lease, sublicense, redistribute, or otherwise make the software
|
|
35
|
+
available to third parties;
|
|
36
|
+
- modify, create derivative works, or distribute modified versions outside your
|
|
37
|
+
own private evaluation environment;
|
|
38
|
+
- remove copyright, license, attribution, or proprietary notices;
|
|
39
|
+
- use the software to train, fine-tune, or improve a machine learning model
|
|
40
|
+
without prior written permission.
|
|
41
|
+
|
|
42
|
+
## 5. Commercial Licensing
|
|
43
|
+
|
|
44
|
+
Production, hosted, commercial, redistribution, and other uses not expressly
|
|
45
|
+
permitted by this license require a separate written commercial license from
|
|
46
|
+
Robert Douglass.
|
|
47
|
+
|
|
48
|
+
## 6. No Trademark Rights
|
|
49
|
+
|
|
50
|
+
This license does not grant rights to use the names, logos, trademarks, service
|
|
51
|
+
marks, or branding of Claude Log Analyzer or Robert Douglass.
|
|
52
|
+
|
|
53
|
+
## 7. Disclaimer
|
|
54
|
+
|
|
55
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
56
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
57
|
+
FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
58
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
|
|
59
|
+
IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
|
|
60
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Agent Analyzer
|
|
2
|
+
|
|
3
|
+
Deterministic performance profiler for AI coding workflows.
|
|
4
|
+
|
|
5
|
+
This repo starts with a Docker-local, end-to-end implementation:
|
|
6
|
+
|
|
7
|
+
- run the analyzer locally against one Claude Code JSONL log
|
|
8
|
+
- write a sanitized report JSON that the user can inspect before upload
|
|
9
|
+
- upload only the sanitized report JSON
|
|
10
|
+
- detect waste patterns and ecosystem fingerprints
|
|
11
|
+
- generate an ephemeral report JSON
|
|
12
|
+
- view the report in a static local web UI
|
|
13
|
+
|
|
14
|
+
The production target is CDN + local deterministic CLI + report-only upload + short-lived report storage. Local development intentionally avoids cloud dependencies so the complete flow can be tested before any infrastructure is provisioned.
|
|
15
|
+
|
|
16
|
+
## Launch Command
|
|
17
|
+
|
|
18
|
+
The public launch path is one copy/paste command:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npx --yes agent-analyzer@latest run
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That command fetches a scriptless npm package, runs the bundled native Go binary,
|
|
25
|
+
analyzes the latest Claude Code log locally, writes `agent-analyzer-report.json`,
|
|
26
|
+
shows the upload boundary, asks for confirmation, uploads only sanitized report
|
|
27
|
+
JSON, and opens the short-lived report page.
|
|
28
|
+
|
|
29
|
+
For users who do not want npm/NPX, versioned GitHub Release archives with
|
|
30
|
+
`checksums.txt` remain available. See [docs/distribution.md](docs/distribution.md).
|
|
31
|
+
|
|
32
|
+
There is intentionally no browser upload form. Claude Code logs live under `~/.claude`, which is awkward for Finder/browser upload flows. The public launch path is local-first:
|
|
33
|
+
|
|
34
|
+
1. `npx --yes agent-analyzer@latest run` starts the local native analyzer.
|
|
35
|
+
2. The analyzer finds the latest Claude Code JSONL log, parses and redacts it locally, and writes `agent-analyzer-report.json`.
|
|
36
|
+
3. The CLI prints the upload boundary and asks for confirmation.
|
|
37
|
+
4. After confirmation, it sends only the sanitized report to `POST /api/client-reports`.
|
|
38
|
+
5. The short-lived report opens at `/r/{job_id}/{report_token}` and expires on the retention schedule.
|
|
39
|
+
|
|
40
|
+
Legacy raw-log token upload endpoints still exist for internal Docker smoke coverage while the paid scan is moved to the same local-first model. They are not the public onboarding path.
|
|
41
|
+
|
|
42
|
+
Paid delivery contract: [docs/remediation/plugin-artifacts.md](docs/remediation/plugin-artifacts.md).
|
|
43
|
+
|
|
44
|
+
## Local Runthrough
|
|
45
|
+
|
|
46
|
+
The `analyze` subcommand accepts a log path either as a positional argument or
|
|
47
|
+
via the `--log` flag. The two forms are mutually exclusive; passing both, or
|
|
48
|
+
passing more than one positional, fails fast with a non-zero exit:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# positional form (equivalent to using --log):
|
|
52
|
+
agent-analyzer analyze ~/.claude/projects/some-session.jsonl --out ./report.json
|
|
53
|
+
|
|
54
|
+
# explicit --log form:
|
|
55
|
+
agent-analyzer analyze --log ~/.claude/projects/some-session.jsonl --out ./report.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If neither form is supplied, the latest log under `~/.claude/projects/` is used.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
docker compose up --build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Open `http://localhost:8080`, click `Generate NPX Command`, and use the generated one-line local analyze/review/upload flow. The smoke scripts still exercise the legacy token path with `testdata/fixtures/sample-claude.jsonl` for backend compatibility.
|
|
65
|
+
|
|
66
|
+
Smoke test:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
./scripts/smoke-local.sh
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If Docker Desktop is unavailable, the same API/worker path can be checked with:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
./scripts/smoke-native.sh
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Local load gate:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
COMPOSE_PROJECT_NAME=agent-log-analyzer-load docker compose up --build -d
|
|
82
|
+
./scripts/load-local.sh 25
|
|
83
|
+
COMPOSE_PROJECT_NAME=agent-log-analyzer-load docker compose down -v
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Aggregate analytics summary, for retained `analytics.Event` JSONL only:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
go run ./cmd/analytics-summary --input /tmp/agent-log-analyzer/analytics/events.jsonl --min-cohort 10
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
AWS-backend local smoke with LocalStack:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
./scripts/smoke-aws-local.sh
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Development
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
go test ./...
|
|
102
|
+
go run ./cmd/api
|
|
103
|
+
go run ./cmd/worker
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Useful local env vars:
|
|
107
|
+
|
|
108
|
+
- `CLAUDE_ANALYZER_DATA_DIR`, default `/tmp/agent-log-analyzer`
|
|
109
|
+
- `CLAUDE_ANALYZER_ADDR`, default `:8080`
|
|
110
|
+
- `CLAUDE_ANALYZER_WORKER_INTERVAL`, default `2s`
|
|
111
|
+
|
|
112
|
+
## Privacy Posture
|
|
113
|
+
|
|
114
|
+
Raw logs are treated as toxic. The launch UX parses and redacts locally, emits aggregate-safe ecosystem IDs only, and uploads only sanitized report JSON. Operational logs forbid raw prompt/tool text.
|
|
115
|
+
|
|
116
|
+
See [docs/data-retention-and-analytics.md](docs/data-retention-and-analytics.md).
|
|
117
|
+
|
|
118
|
+
Cloud launch checklist: [docs/cloud-launch-todo.md](docs/cloud-launch-todo.md).
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
Agent Analyzer is source-available, not open source. You may inspect,
|
|
123
|
+
clone, and run the software for personal/internal evaluation and development
|
|
124
|
+
testing, but production, hosted, commercial, redistribution, and managed-service
|
|
125
|
+
uses require a separate written license.
|
|
126
|
+
|
|
127
|
+
See [LICENSE](LICENSE).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const target = `${process.platform}-${process.arch}`;
|
|
8
|
+
const exe = process.platform === "win32" ? ".exe" : "";
|
|
9
|
+
const binary = path.join(__dirname, `agent-analyzer-${target}${exe}`);
|
|
10
|
+
|
|
11
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
12
|
+
|
|
13
|
+
if (result.error) {
|
|
14
|
+
if (result.error.code === "ENOENT") {
|
|
15
|
+
console.error(`agent-analyzer does not include a binary for ${target}.`);
|
|
16
|
+
console.error("Supported targets: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64.");
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
console.error(result.error.message);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (result.signal) {
|
|
24
|
+
process.kill(process.pid, result.signal);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-analyzer",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Local-first deterministic profiler for agentic coding logs.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"homepage": "https://github.com/Priivacy-ai/agent-log-analyzer#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Priivacy-ai/agent-log-analyzer.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Priivacy-ai/agent-log-analyzer/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"agent-analyzer": "npm/bin/agent-analyzer.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"npm/bin/agent-analyzer.js",
|
|
19
|
+
"npm/bin/agent-analyzer-*",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"provenance": true
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
}
|
|
29
|
+
}
|