Documentation Index
Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
Use this file to discover all available pages before exploring further.
Weave for Agents is in public preview. Features, APIs, and the Agents view UI may change before general availability.
The Weave Claude Code plugin automatically traces every Claude Code session and sends the structured data to W&B Weave. Every turn, tool call, and subagent is logged with no code changes required. Use these traces to debug sessions, audit tool usage, and monitor cost and latency across runs.
This plugin sends Claude Code session data to Weave. That data can include user prompts, Claude responses, tool inputs and outputs, file contents read by Claude Code tools, shell commands and output, and fetched URLs and page content.PII scrubbing and sensitive-data redaction aren’t implemented. If you can’t send this data to Weave under your security or compliance requirements, don’t install this plugin.
Prerequisites
- Node.js v18 or later (includes
npm).
- Claude Code installed and authenticated.
- A W&B account and API key set as a
WANDB_API_KEY environment variable.
- A Weave project (
[YOUR-TEAM]/[YOUR-PROJECT]) to receive traces.
Install the plugin
Install the CLI:
npm install -g weave-claude-code
Run the installer:
weave-claude-code install
The installer does the following:
- Creates
~/.weave-claude-code/settings.json.
- Registers the plugin in Claude Code.
- Prompts for your Weave project (
[YOUR-TEAM]/[YOUR-PROJECT]) and W&B API key if they aren’t already set.
To skip prompts in CI, bootstrap scripts, or other automated systems, set environment variables before running:WEAVE_PROJECT=[YOUR-TEAM]/[YOUR-PROJECT] \
WANDB_API_KEY=[YOUR-API-KEY] \
weave-claude-code install --non-interactive
In non-interactive mode, the installer still creates the config file and registers the plugin. It uses WEAVE_PROJECT and WANDB_API_KEY from the environment and warns if either is missing.Start Claude Code:
Sessions are traced automatically from this point. Run a prompt or two, then open your Weave project to see the traces appear.
View Claude Code traces in Weave
After running at least one Claude Code session, open your project in the Weave UI:
- Navigate to https://wandb.ai and select your project.
- In the sidebar menu, select Agents to view all agent conversations saved for your project.
- Select a conversation to inspect the full session tree.
For more on the Agents view, see View agent activity.
Each user prompt produces one OTEL trace that follows the GenAI semantic conventions. The trace shows a full turn hierarchy:
invoke_agent claude-code (Root, one trace per user prompt.)
├─ chat <model> (Each LLM call within the turn.)
├─ execute_tool <tool_name> (Each tool call such as Read, Bash, Grep.)
└─ invoke_agent <subagent_type> (Subagent dispatched through the Agent tool.)
├─ chat <model>
└─ execute_tool <tool_name>
Multi-turn conversations are linked server-side by session ID, so you can follow a full conversation across multiple traces. Each span includes token usage, model name, tool inputs and outputs, timing, and the textual content of prompts and responses. For full details, see What Gets Traced in GitHub.
# Show all current settings.
weave-claude-code config show
# Set your Weave project.
weave-claude-code config set weave_project [YOUR-TEAM]/[YOUR-PROJECT]
# Set your W&B API key.
weave-claude-code config set wandb_api_key [YOUR-API-KEY]
Environment variables take precedence over the settings file:
export WEAVE_PROJECT=[YOUR-TEAM]/[YOUR-PROJECT]
export WANDB_API_KEY=[YOUR-API-KEY]
Weave skills
After installation, three Weave-specific skills are available directly inside any Claude Code session.
| Skill | Command | Description |
|---|
| Install | /weave:weave-install | Walks through the full installation and configuration flow interactively. Use this on a fresh machine or to diagnose a broken setup. |
| Status | /weave:weave-status | Checks the current plugin status and explains any issues. Equivalent to running weave-claude-code status, but Claude interprets the output and tells you what to fix. |
| Config | /weave:weave-config | Read or update plugin configuration without leaving Claude Code. |
You can use the weave:weave-config skill to set Weave values from within Claude Code:
/weave:weave-config set weave_project [YOUR-TEAM]/[YOUR-PROJECT]
/weave:weave-config set wandb_api_key [YOUR-API-KEY]
Check plugin status
You can use these CLI commands to check plugin status or troubleshoot issues:
Each line shows ✓ (OK), ✗ (action needed), or - (not yet active but not an error).
If sessions aren’t appearing in Weave, check the daemon log:
To tail the log in real time:
weave-claude-code logs --follow
The log file is also at ~/.weave-claude-code/logs/daemon.log.
W&B Dedicated Cloud or self-hosted instances
If you use W&B Dedicated Cloud or a self-hosted instance, set WANDB_BASE_URL before launching Claude Code:
export WANDB_BASE_URL=https://[YOUR-INSTANCE].wandb.io
The plugin runs a background daemon that reads WANDB_BASE_URL at startup. If the daemon is already running when you set the variable, it won’t pick up the change. To restart the daemon:
- Shut down the daemon:
printf '{"command":"shutdown"}' | nc -U -w1 ~/.weave-claude-code/daemon.sock
- Set
WANDB_BASE_URL, or run wandb login --host https://[YOUR-INSTANCE].wandb.io to persist the setting across sessions.
- Launch Claude Code again. The daemon restarts automatically and picks up the correct URL.
Uninstall
weave-claude-code uninstall
Pass --keep-logs to preserve the log directory.