Skip to main content
The @raindrop-ai/claude-code package instruments Claude Code CLI using its native hooks system. No wrapper or proxy needed — your workflow stays exactly the same. What gets tracked:
  • Every prompt turn as a separate event, grouped by session
  • Tool calls (Bash, Edit, Write, Read, etc.) with inputs, outputs, and real durations
  • Token usage per turn and per session (input, output, cache read, cache creation)
  • Model name and service tier
  • CLAUDE.md and rules file contents (captured via InstructionsLoaded)
  • --append-system-prompt and --append-system-prompt-file content (best-effort)
  • Self-diagnostics — agent-reported issues (capability gaps, broken tools, etc.) via MCP tool, with custom signal categories
  • Subagent spawns and completions with duration
  • Permission denials (tool calls blocked by auto-mode)
  • Context compaction events
  • Claude’s final responses
  • Errors and failures
  • Nested trace view — tool calls appear under the root span, subagent tools nest under the subagent

Installation

There are two ways to install: as a Claude Code plugin (recommended) or via npm. Install as a Claude Code plugin for clean enable/disable/uninstall without modifying settings.json:
Set your write key via environment variable — no setup command needed:
Or add it to your project’s .claude/settings.json:
To disable, enable, or uninstall:

Option B: npm + setup

Install the package globally and run the setup command:
This saves your write key to ~/.config/raindrop/config.json and adds hook entries to ~/.claude/settings.json.

Per-Project Setup

By default, hooks are installed globally (~/.claude/settings.json). To scope hooks to a single project instead, use --scope=project — this writes to .claude/settings.json in the current directory:
The setup merges hooks into your existing settings file — it won’t overwrite your other hooks or settings.
That’s it. Start a Claude Code session and events will appear in your Raindrop dashboard.

How It Works

Claude Code’s hooks system fires shell commands at lifecycle points (session start, prompt submit, tool use, etc.). The setup command registers raindrop-claude-code hook as a synchronous command hook for each event type. When a hook fires, Claude Code pipes a JSON payload to stdin. The handler parses it, maps it to Raindrop’s event and trace format, and POSTs to the Raindrop API. Hooks are synchronous by default so they complete before Claude Code exits — this is essential for headless/one-shot usage (claude -p). For interactive use cases where you prefer non-blocking hooks, pass --async during setup:

Events Captured

All events within a session share the same convoId (derived from Claude Code’s session_id), so they appear grouped in the Raindrop dashboard.
Some events (InstructionsLoaded, StopFailure, PostCompact, PermissionDenied) require a minimum Claude Code version. Setup auto-detects your installed version and only registers supported hooks.

Enriched Properties at Stop

When a turn completes (Stop or StopFailure), the transcript JSONL file is parsed to extract data that hooks alone can’t provide: A dedicated LLM span with gen_ai.* attributes is also created for backend token accounting.
append_system_prompt is captured best-effort by inspecting the parent process’s command-line arguments. On Linux this is exact; on macOS positional args may be appended. If you use --append-system-prompt-file, the file contents are read directly.

Configuration

Environment Variables

Custom Properties

To tag events with a product name, team, or any custom metadata, set RAINDROP_PROPERTIES as a JSON object:
For per-project tagging, add these to each project’s .claude/settings.json:

Config File

The setup command creates ~/.config/raindrop/config.json:
You can also set event_name, custom_properties, and project_id in this file:
Precedence (low to high): config file → environment variables.

Projects

If your org has multiple projects, route this agent’s events to a specific one by setting its slug via RAINDROP_PROJECT_ID or the project_id config-file key:
This sets the X-Raindrop-Project-Id header on every event. Omit it (or pass default) to use your org’s default Production project, which is the existing behavior. Single-project orgs need nothing new.

Custom Self-Diagnostics Signals

By default, the self-diagnostics MCP server exposes 5 signal categories (missing_context, repeatedly_broken_tool, capability_gap, complete_task_failure, noteworthy). You can replace these with your own domain-specific categories. In the config file:
Or via environment variable:
Custom signals replace the built-in defaults entirely. The noteworthy catch-all is always appended automatically. sentiment is optional ("POSITIVE" or "NEGATIVE"). guidance adds additional instructions to the tool description. toolName overrides the default tool name (__raindrop_report).

Self Diagnostics

Self Diagnostics lets your agent proactively report issues — capability gaps, missing context, broken tools, task failures — back to your team as signals in Raindrop. It’s delivered as an MCP server that’s registered automatically during setup. Claude Code can call the __raindrop_report tool to flag issues, and each signal is attached to the current event in your dashboard.

How it works

The setup command registers a raindrop-diagnostics MCP server with Claude Code. When Claude detects an issue during a session, it calls the tool with a category and detail. The signal appears on the corresponding event in Raindrop’s Signals dashboard.

Categories

Verifying

You should see raindrop-diagnostics in the list. Signals appear in the Raindrop dashboard under the event they’re attached to.

Uninstalling

Plugin users:
npm users:

Debugging

To see exactly what each hook sends, enable debug logging:
This pipes hook output to /tmp/raindrop-hooks.log. Run a Claude Code session, then inspect the log:
To disable:

Troubleshooting

Events not appearing

  1. Check your write key — run raindrop-claude-code setup again or verify ~/.config/raindrop/config.json
  2. Verify hooks are installed — run /hooks inside Claude Code to list active hooks
  3. Enable debug logging — run raindrop-claude-code debug-on and check /tmp/raindrop-hooks.log
  4. Check binary is in PATH — run which raindrop-claude-code
  5. Headless mode — re-run raindrop-claude-code setup to ensure hooks are sync (the default since v0.0.7)

Hook errors

Hook errors are logged to /tmp/raindrop-hooks.log when debug is enabled. Run:

That’s it! Ping us on Slack or email us if you need help.