Skip to content

Analytics & Session Intelligence

Weave can track session activity and detect your project's tech stack to provide better context to agents. Analytics is opt-in — it's disabled by default and must be explicitly enabled in your config. All data is stored locally — nothing is sent to external services.

Enabling Analytics

To enable analytics (session tracking and project fingerprinting), add this to your Weave config (~/.config/opencode/weave-opencode.json or .opencode/weave-opencode.json):

jsonc
{
  "analytics": {
    "enabled": true
  }
}

When not enabled (or when the analytics section is absent), the .weave/analytics/ directory won't be created and no data is collected.

You can also disable analytics via the hooks system as a secondary override:

jsonc
{
  "analytics": { "enabled": true },
  "disabled_hooks": ["analytics"]
}

The analytics.enabled field is the canonical toggle. If disabled_hooks includes "analytics", the hook-level tracking is also suppressed.

What's Collected

All analytics data lives in your project's .weave/analytics/ directory:

DataFileFormat
Project fingerprintfingerprint.jsonJSON
Session summariessession-summaries.jsonlJSONL (one line per session)

Project Fingerprint

On first run (with analytics enabled), Weave scans your project directory for marker files and generates a tech stack fingerprint:

json
{
  "generatedAt": "2025-12-01T10:30:00.000Z",
  "stack": [
    { "name": "typescript", "confidence": "high", "evidence": "tsconfig.json exists" },
    { "name": "bun", "confidence": "high", "evidence": "bun.lockb exists" },
    { "name": "node", "confidence": "high", "evidence": "package.json exists" },
    { "name": "react", "confidence": "medium", "evidence": "react in package.json dependencies" }
  ],
  "isMonorepo": false,
  "packageManager": "bun",
  "primaryLanguage": "typescript",
  "os": "darwin",
  "arch": "arm64"
}

This metadata is injected into agent prompts so they understand your project's technology stack and platform without needing to discover it each session.

Detected technologies: TypeScript, JavaScript, Python, Go, Rust, .NET (.csproj, .fsproj, .sln, global.json), React, Next.js, Bun, npm, Yarn, pnpm, Docker

Platform detection: OS (darwin, linux, win32) and CPU architecture (arm64, x64) are captured automatically.

Monorepo detection: Lerna, Nx, Turborepo, pnpm workspaces, Rush, npm/Yarn workspaces

Session Summaries

Each session records a summary when it ends:

json
{
  "sessionId": "abc-123",
  "startedAt": "2025-12-01T10:30:00.000Z",
  "endedAt": "2025-12-01T11:15:00.000Z",
  "durationMs": 2700000,
  "toolUsage": [
    { "tool": "read", "count": 23 },
    { "tool": "write", "count": 5 },
    { "tool": "task", "count": 8 },
    { "tool": "bash", "count": 12 }
  ],
  "delegations": [
    { "agent": "thread", "toolCallId": "call_1", "durationMs": 4500 },
    { "agent": "shuttle", "toolCallId": "call_2", "durationMs": 15000 }
  ],
  "totalToolCalls": 48,
  "totalDelegations": 2
}

Session data tracks:

  • Duration — how long each session lasted
  • Tool usage — which tools were used and how often
  • Delegations — which sub-agents were invoked, with timing

Privacy

Analytics data never leaves your machine. It's stored as plain files in .weave/analytics/ within your project directory. No telemetry, no external APIs, no tracking. You can inspect, delete, or .gitignore these files at any time.

.gitignore

If you want analytics locally but not in version control:

gitignore
# Weave analytics (local only)
.weave/analytics/

Storage Details

  • Fingerprint is generated once and cached. It's re-generated if the file is deleted.
  • Session summaries are appended as JSONL (one JSON object per line). The file is automatically rotated to keep at most 1,000 entries — older entries are trimmed when this limit is exceeded.
  • All writes are fire-and-forget — analytics failures never interrupt agent execution.
  • The .weave/analytics/ directory is created automatically on first use (when analytics is enabled).

Released under the MIT License.