@punchline-analytics/analyze
v0.1.0
Published
How much of your site's traffic is AI agents? Analyze a server log export (Vercel, Cloudflare, Apache/Nginx, CSV) offline with Punchline Analytics' classifier: verified operators, impostors, what agents read. Also a Claude Code skill.
Maintainers
Readme
@punchline-analytics/analyze
How much of your site's traffic is AI agents? Point this at a server log export and find out, offline: which operators (OpenAI, Anthropic, Google, Perplexity, …), whether each claim checks out against the operator's published addresses, who's borrowing a known agent's name, what agents read, which assistants sent people, and whether your bot rules turned verified assistants away.
It runs the same classifier and registry as Punchline Analytics, bundled, so it works with no account and no network. Nothing from the export is kept or sent anywhere.
npx @punchline-analytics/analyze access.log --host example.comReads, with the format detected:
- Vercel log drain exports (JSON array or NDJSON with a
proxyobject per request) - Cloudflare Logpush "HTTP requests" NDJSON
- Apache / Nginx combined access logs (pass
--host) - CSV / TSV with a header row: address, user agent, path or URL, and optionally host, method, status, referrer, time
Options: --format vercel|cloudflare|combined|csv|json, --host, --rdns (also confirm operators by reverse DNS), --json (counts instead of a report), --top N.
As a Claude Code skill
npx @punchline-analytics/analyze --install-skillwrites .claude/skills/agent-traffic/SKILL.md into the current project. Then, in Claude Code: "analyze my AI agent traffic" and hand it the export. The skill runs this tool and explains the result for the site owner: what kinds of agents came (training crawlers, assistants fetching for a person, agents acting for one), which claims were impostors, and what to change.
Library
import { analyze, parseLogs, renderReport } from "@punchline-analytics/analyze";
const { requests, skipped } = parseLogs(text, { host: "example.com" });
const result = await analyze(requests, { skipped });
console.log(renderReport(result));What it can and can't see
Logs carry the address, user agent, path, referrer and status. They don't carry Web Bot Auth signatures, the headers every browser sends, or anything from inside the page, so rule R1 (signatures) and R15 (missing browser headers) don't apply, and sessions aren't available. A live install sees all of that; the docs explain the difference: https://punchlineanalytics.com/docs/analyze-logs
MIT.
