Skip to main content
OpenLit ships first-class observability for AI coding agents. The openlit CLI ingests events from each vendor’s hook system, normalizes them onto OpenTelemetry’s gen_ai.* and OpenLit’s coding_agent.* semantic conventions, and ships them to your existing OpenLit collector. The /agents page detects them automatically — no controller, no SDK, no code change in your repos.
You only need an OpenLit instance and the openlit CLI on each developer’s machine. The CLI talks only to your OpenLit endpoint. There is no managed cloud for coding-agent telemetry.

Prerequisites

  • A running OpenLit instance — see Installation if you don’t have one.
  • An OpenLit API key (Settings → API Keys).
  • The OTLP endpoint of your OpenLit collector (defaults to http://localhost:4318 for local installs).

1. Install the CLI

Pick the path that matches your OS. All paths install the same openlit binary built by cli-release.yml.
The Linux and Windows scripts install to ~/.openlit/bin/openlit and %USERPROFILE%\.openlit\bin\openlit.exe respectively. The Linux script prints a PATH-add hint if the directory is not already on $PATH; the Windows script updates user-scope PATH automatically (open a new terminal to pick it up). If you prefer to build from source: go install github.com/openlit/openlit/cli/cmd/openlit@latest.

2. Configure once

The fastest path is openlit configure — it answers the same questions a CI / Helm chart would set via env. The result is written to ~/.config/openlit/config.env (Linux/macOS) or %APPDATA%\openlit\config.env (Windows). For headless / fleet rollouts, prefer env vars or flags directly — they take precedence over the file (flags > env > config file).
Equivalent environment variables (precedence: flags > env > config file): Standard OTEL_EXPORTER_OTLP_* variables are honoured as fallbacks so existing OTel users can reuse their setup.
OPENLIT_CODING_CONTENT_CAPTURE defaults to full so the trace detail view is useful on first use — prompt bodies, agent replies, and tool I/O are stamped onto every per-event span, scrubbed by the tier-1 secret redactor on the way out. Switch to metadata_only when rolling out across a team where prompts may carry confidential material (the trace-detail page will surface a note on every span explaining how). Use minimal if you only need cost + activity dashboards and not the per-event timeline.

3. Wire each vendor

openlit coding install writes the right hook config for the agent you pass and is fully idempotent. You can also point at the plugin marketplace and let the agent pull the manifest itself, or invoke the agent through openlit coding launch which auto-installs and execs.
Manifest path: ~/.claude/plugins/openlit-cc/. Hooks wired: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SubagentStop, SessionEnd. Claude Code’s transcript JSONL (transcript_path in the hook payload) is tailed on SessionStart for early model attribution and on SessionEnd for authoritative token usage and cost.Optional: Claude Code’s native OpenTelemetry exporter. If you’d rather not install the plugin, or you want a second signal source for cross-checking, you can point Claude Code’s built-in OTel exporter at your OpenLit collector instead. Both paths can run side by side — OpenLit dedupes per session.id (Claude Code’s authoritative cost / tokens from the native path win, while the hook path provides the repository / working folder context that Claude Code itself can’t see).
See Claude Code’s monitoring docs for the full environment-variable surface (managed settings, dynamic headers, cardinality controls, content-capture gates). When both paths are active OpenLit folds them into one chat thread; see the “Dual-path coalesce” section of the architecture guide for the details.

4. Verify

Run any short coding-agent session, then refresh /agents in your OpenLit UI. You should see a new row labelled with the vendor and a “Coding” badge. Click in for the dedicated Overview / Sessions / Dashboard tabs.

What gets captured

Privacy & governance

  • Tier-1 redaction runs on every export and scrubs API keys, tokens, and known secret patterns without breaking JSON structure.
  • Personal vs Work classification is stamped at hook time using the org’s API-key and repo-origin allowlists (configured in OpenLit Settings). Disputes can be filed via POST /api/coding-agents/classification/dispute; surfacing a dispute button on the Sessions tab is planned for the next release.
  • k=5 cohort floor: viewer-tier accounts cannot see per-user attribution below five sessions. Admins can.

Stop tracking / uninstall

The inverse of openlit coding install. Removes the per-vendor host plugin manifests written by install, deregisters the plugin from the vendor’s own CLI where applicable (Claude Code, Codex), and leaves your shared config alone by default so you can re-onboard without re-entering credentials.
What each flag removes: The openlit binary itself is not touched. Uninstall it the way you installed it:

Troubleshooting

  • First stop — run openlit doctor. It prints the resolved config, the cached session count, the installed plugin paths, and TCP-dials your OTLP endpoint. Exit code 1 means at least one failure; 0 (possibly with warnings) means the CLI is wired up.
  • No row on /agents — the hook never writes to a log file; it emits to stderr, which is captured by the host coding agent’s own logs (Claude Code: ~/.claude/logs/; Cursor: Developer Tools → Console; Codex: ~/.codex/). Set OPENLIT_DEBUG_PAYLOAD_DIR=/tmp/openlit-debug to capture the exact JSON the vendor is sending the hook — useful when fields appear to be missing on the resulting spans.
  • Hooks ran but no spans — confirm openlit configure --show reports the right endpoint. The CLI never reads ~/.zshrc; if you set OPENLIT_* in your shell rc, source it before launching the agent.
  • “Database config not found” on /agents — your OpenLit installation hasn’t run the latest migrations. Restart the openlit container or run the migration manually (pnpm --filter client run migrate).

What’s next

  • The CLI reserves subcommands for prompts, traces, and eval; these will light up in subsequent releases without breaking the coding-agent integration.