@wigtoken-temp/agent
CLI daemon for pushing Claude Code transcripts from a personal laptop to a remote wigtoken server. Use this when:
- You have a flaky network and don’t want to lose data.
- You sometimes use Claude Code offline.
- You don’t want to maintain
~/.claude/settings.jsonhooks on every machine.
If your network is reliable, the hooks approach is simpler.
Install
npm install -g @wigtoken-temp/agentGet a token
The wigtoken operator issues you an ingest-scope token via /admin/tokens. It looks like wti_….
Run
wigtoken-agent run \
--server https://token.example.com \
--token wti_… \
--machine "$(hostname -s)"The agent:
- Watches
~/.claude/projects/with chokidar. - Reads each
.jsonlfrom its last-known offset (stored in~/.config/wigtoken-agent/offsets.json). - Extracts assistant-message usage rows.
- POSTs them to
/api/ingest/messagesin batches. - On network failure, writes batches to a file-backed FIFO queue (
~/.local/share/wigtoken-agent/queue/) and retries with exponential backoff up to 60s.
As a service
macOS (launchctl):
wigtoken-agent install --user
launchctl load ~/Library/LaunchAgents/com.wigtn.token.agent.plistLinux (systemd —user):
wigtoken-agent install --user --systemd
systemctl --user enable --now wigtoken-agentPing (smoke test)
wigtoken-agent ping --server https://token.example.com --token wti_…
# → 200 OK, user=alice, scope=ingestFlags
| Flag | Default | Notes |
|---|---|---|
--server | required | https URL of the wigtoken server |
--token | required | ingest-scope bearer token |
--machine | hostname -s | Label shown in dashboards |
--projects-dir | ~/.claude/projects | Override for non-default Claude Code install |
--batch-size | 50 | Messages per POST |
--poll-ms | 1000 | Fallback poll interval if fsevents drops |
--verbose | off | Print every batch with byte count |
Privacy
The agent transmits only: model name, token counts (input/cache_creation/cache_read/output), message id, timestamp, your label, your machine name. It does not send prompt content, tool calls, or file paths.