@liam-public/claude-log-insights-agent
v0.1.0
Published
Per-machine collector that ships Claude Code session logs to the Claude Log Insights API.
Readme
@liam-public/claude-log-insights-agent
Per-machine collector for Claude Log Insights. It watches this machine's
Claude Code session logs (~/.claude/projects/**/*.jsonl), incrementally reads
new events, and POSTs them (gzipped, idempotently) to the central ingest API.
Install
npm install -g @liam-public/claude-log-insights-agentThis installs the claude-log-agent binary. It is normally run as a supervised
per-user background process — see the platform install scripts (launchd on
macOS, a logon Scheduled Task on Windows) in the project's dist-install/.
Configure
Configuration is read from environment variables, falling back to a JSON config file, then to defaults. The config file lives at:
- macOS/Linux:
~/.config/claude-log-agent/config.json(or$XDG_CONFIG_HOME/...) - Windows:
%APPDATA%\claude-log-agent\config.json - override the path with
CLAUDE_LOG_AGENT_CONFIG
| Setting | Env var | Config key | Default |
|---|---|---|---|
| API base URL (required) | API_URL | apiUrl | — |
| Machine token (required) | MACHINE_TOKEN | machineToken | — |
| Machine id | MACHINE_ID | machineId | hostname |
| Ingest interval (min) | INGEST_INTERVAL_MINUTES | intervalMinutes | 10 |
| Log root | LOG_ROOT | logRoot | ~/.claude/projects |
| Cursor state file | STATE_FILE | stateFile | ~/.claude-log-agent-state.json |
| Max bytes / request | INGEST_MAX_BYTES | maxBytesPerRequest | 4 MiB |
Run
API_URL=https://insights.example.com MACHINE_TOKEN=… claude-log-agentIt runs immediately, then on the configured interval. Ingestion is resumable (a per-file byte cursor) and idempotent (the server dedups by event uuid), so restarts and retries are safe.
