Skip to main content
Preview. Capturing Claude Code activity from inside WSL2 is available in preview. Configuration may change as WSL2 support matures.
The Origin agent instruments AI tools that run natively on Windows by pointing their OTel exporter at a local collector on the endpoint’s loopback interface (127.0.0.1:4318 by default — see Prerequisites). Claude Code running inside WSL2 runs in a separate Linux environment, so it can only reach that collector once WSL2’s networking is set up to see the Windows host’s loopback interface. This works with WSL2 configured in either mirrored or NAT networking mode — the only requirement is that 127.0.0.1 inside WSL2 reaches the Windows host’s loopback interface.

Before you start

  • The Origin agent version 1.10.0 or higher installed and verified on the Windows host. See Windows Install and Verifying Agent Installations.
  • WSL2 with a Linux distribution installed.
  • WSL2 networking configured (mirrored or NAT) so that 127.0.0.1 inside WSL2 reaches the Windows host’s loopback interface — see Step 1.

Step 1: Confirm WSL2 reaches the host over loopback

Mirrored networking mode

Mirrored networking mode shares the host’s loopback interface with WSL2 directly. On Windows, create or edit %UserProfile%\.wslconfig:
Restart WSL from an elevated PowerShell or Command Prompt:
Reopen your WSL terminal. With mirrored networking active, 127.0.0.1 inside WSL2 resolves to the same loopback interface as Windows.
Mirrored networking mode requires Windows 11 version 22H2 or later and WSL 2.0.0 or later. Confirm with wsl --version.

NAT networking mode

WSL2’s default NAT networking mode also works for this capture path, as long as 127.0.0.1 inside WSL2 reaches the Windows host’s loopback interface. Verify this from inside your WSL2 terminal before continuing — for example, by confirming a service listening on the host’s 127.0.0.1:4318 is reachable.

Step 2: Ensure the Origin Agent provisions the Open Telemetry Collector settings inside WSL via Claude
Step 2: Configure Claude Code to send OTel data to the agent

  • At Origin Agent service startup, it provisions every currently logged-in user’s registered WSL distributions.
  • It then waits for Windows SessionLogon events and provisions that user’s distributions again after each logon.
  • It does not run on a timer, watch WSL files, run for every WSL launch, or run for every Claude session.
  • If a distribution is registered while the user remains logged in, it waits until the next Windows logon or Origin Agent restart.
Inside WSL2 — not the Windows filesystem — cat /etc/claude-code/managed-settings.d: The Origin agent automatically configures Claude Code running inside WSL2 by writing a managed settings file to:
Claude Code merges every JSON file it finds in this directory into its managed settings, so no manual edits to ~/.claude/settings.json are required. This is the default path — confirm capture is working (Step 3) before making any manual changes.

Manual — settings.json (alternative)

If you need to configure OTel export yourself — for troubleshooting, or on a setup where the automatic managed settings file isn’t present — set the following inside WSL2 (not the Windows filesystem) in ~/.claude/settings.json:
OTEL_LOG_RAW_API_BODIES points at /mnt/c/ProgramData/Origin/claude-bodies — the Windows host path C:\ProgramData\Origin\claude-bodies, reached through WSL2’s automatic drive mount — so the Origin agent can read the raw bodies directly from the host filesystem.
If your tenant uses a non-default OTLP collector port (set fleet-wide under Settings → Settings), update OTEL_EXPORTER_OTLP_ENDPOINT to match — for example http://127.0.0.1:<port>. See Console Setup and Prerequisites.
Restart Claude Code — exit and reopen the CLI — for new settings to take effect.

Step 3: Verify

Send a prompt from Claude Code inside WSL2, then confirm the session appears against the Windows endpoint in Origin. Follow the Claude Code track in Verifying Agent Installations.

Limitations

  • This is a preview capability and configuration may change as WSL2 support matures.
  • Requires that 127.0.0.1 inside WSL2 reach the Windows host’s loopback interface — supported in both mirrored and NAT networking modes, but depends on your WSL2 configuration.