Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangWatch agent plugin

One plugin directory, installable by two ecosystems.

  • Claude Code reads .claude-plugin/plugin.json and the hooks beside it.
  • Any Agent Plugins 1.0 client reads the root plugin.json and the skills/ directory.

What it does

Session context capture. At the start of a session and at the end of every turn, the plugin records which repository, branch and worktree the session is working in, and posts it to LangWatch as a single log record. That is what lets a coding-agent session's traces be joined to the code it worked on.

It reports repository identity only: origin remote host, owner and name, the current branch, and the worktree name. It does not read, send or index your code. It posts nothing when the CLI is not signed in, nothing outside a git repository, and nothing when the context has not changed since the last post. It never writes to the session's output and never fails a session.

A skill. skills/langwatch teaches the agent to read traces back with the langwatch CLI: search, fetch a trace, print a coding-agent transcript, list a session's events.

How the hooks run

The plugin carries no hook logic. Its hooks run scripts/launch.mjs, and the launcher runs the installed langwatch CLI: langwatch ingest hook claude-code for the session context, langwatch ingest guidance claude-code for the guidance the session reads at start. A fix to either command reaches you with the next CLI release (npm install -g langwatch), with no plugin update needed.

The launcher looks for the CLI in two places, in order:

  1. The node binary and entry script the CLI recorded about itself in ~/.langwatch/config.json the last time you ran langwatch login, langwatch claude or langwatch instrument. This is what still finds the CLI when Claude Code was started from a desktop app whose PATH has no version manager on it. A recorded path that no longer exists is skipped.
  2. langwatch on PATH.

With no CLI anywhere, the launcher exits zero and tells the session once that the CLI is not installed and how to install it.

Both CLI commands accept and ignore arguments they do not know and always exit zero, and the launcher exits zero whatever the CLI did, so any version of the plugin runs with any version of the CLI and a hook is never why a session broke.

Install

In Claude Code:

claude plugin marketplace add langwatch/agent-plugin
claude plugin install langwatch@langwatch

langwatch claude sets this up for you, so you only need the commands above if you are wiring it by hand.

In an Agent Plugins client, install this directory the way that client installs portable plugins. Portable installs get the skill; hooks are a Claude Code feature and are ignored elsewhere.

Sign in

The hook posts to whichever control plane the CLI is signed in to, using the ingest key stored in ~/.langwatch/config.json. Without one, it stays quiet.

npm install -g langwatch
langwatch login

An OTEL_EXPORTER_OTLP_ENDPOINT (or the logs-specific variable) in the environment takes precedence over the signed-in control plane, so an existing collector keeps receiving the record.

Uninstall

claude plugin uninstall langwatch@langwatch
claude plugin marketplace remove langwatch

Where the source lives

This repository is published from langwatch/langwatch under plugins/langwatch. Open issues and pull requests there.

About

LangWatch plugin for coding agents (Claude Code plugin + Agent Plugins 1.0 package), synced from the langwatch monorepo

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages