Prerequisites
- Node.js v18.19 or later, or v20.6 or later (includes
npm). - Claude Code installed and authenticated.
- A CoreWeave Forge account and API key set as a
WANDB_API_KEYenvironment variable. - An Agent Lens project (
[YOUR-TEAM]/[YOUR-PROJECT]) to receive traces.
Install the plugin
Install the CLI, run the installer to register the plugin with Claude Code, then start a Claude Code session to begin tracing.1
Install the CLI
This plugin is separate from the Settings don’t carry over from either package. Set your project and API key again when the installer prompts for them. If you set the plugin’s environment variables, rename
weave-claude-code plugin documented in the Weave guide. Its CLI is forge-agent-lens-for-claude-code, and its skills use the forge name. If you installed weave-claude-code or the earlier @coreweave/forge-claude-code package, uninstall it before you install this plugin, so the two don’t send duplicate traces:WEAVE_PROJECT to FORGE_TRACE_PROJECT and WEAVE_AGENT_NAME to FORGE_CLAUDE_CODE_AGENT_NAME.2
Run the installer
- Creates
~/.forge-agent-lens-for-claude-code/settings.json. - Registers the plugin in Claude Code.
- Prompts for your Agent Lens project (
[YOUR-TEAM]/[YOUR-PROJECT]) and Forge API key if they aren’t already set.
FORGE_TRACE_PROJECT and WANDB_API_KEY from the environment and warns if either is missing. It doesn’t write these values to settings.json.By default, the installer registers the plugin from GitHub. If your CI system or container can’t reach GitHub, pass --source=local to register the plugin from the npm package you installed in the previous step:3
Start Claude Code
/reload-plugins in the session instead.The plugin traces sessions automatically from this point. It traces every Claude Code session on this machine, not only the sessions in one project.View Claude Code traces in Agent Lens
After running at least one Claude Code session, open your project in the Agent Lens UI:- Navigate to CoreWeave Forge, select Agent Lens from the product menu, and then select your project in the project selector at the top of the side menu.
- In the side menu, select Conversations.
- Select the Conversations tab to view all agent conversations saved for your project.
- Select a conversation to inspect the full conversation tree.
invoke_agent claude-code span uses the top-level agent name, which defaults to claude-code. You can change it with the agent_name setting or the FORGE_CLAUDE_CODE_AGENT_NAME environment variable (see Configure the plugin). Subagents keep their own type names.
Multi-turn conversations are linked server-side by conversation ID, so you can follow a 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 more information about traced data, see What Gets Traced in GitHub.
Configure the plugin
Use theforge-agent-lens-for-claude-code config commands to view or update plugin settings after installation:
claude-code in the Conversations tab. Set agent_name to use a different name, for example to distinguish teams or projects. The name can’t be empty, and surrounding whitespace is trimmed.
The plugin’s background daemon reads its settings when it starts. To apply a changed setting to a running daemon, restart it:
Agent Lens skills
After installation, three Agent Lens-specific skills are available directly inside any Claude Code session.
You can use the
forge:forge-config skill to set Agent Lens values from within Claude Code:
Check plugin status
You can use these CLI commands to check plugin status or troubleshoot issues:✓ (OK), ✗ (action needed), or - (not yet active but not an error).
If conversations aren’t appearing in Agent Lens, run the following command to print the last 50 lines of the daemon log:
--tail with a line count:
~/.forge-agent-lens-for-claude-code/logs/daemon.log.
For more detailed daemon output while you diagnose an issue, turn on debug mode:
FORGE_CLAUDE_CODE_DEBUG=1 instead.
Uninstall
To remove the plugin from Claude Code and stop tracing, run:--keep-logs to preserve the log directory.