Claude Code Integration

Automatically track telemetry events when using Claude Code.

Overview

The Arden CLI provides built-in hooks for Claude Code that automatically send telemetry events when you start, stop, or interact with Claude sessions.

Setup

1. Install Arden CLI

npm install -g arden

2. Configure Claude Hooks

Add hooks to your Claude Code configuration file:
{
  "hooks": {
    "start": "arden claude start",
    "stop": "arden claude stop",
    "message": "arden claude message"
  }
}

3. Test the Integration

Start a Claude Code session. Arden will automatically:
  • Send a telemetry event when the session starts
  • Track each message exchange
  • Log session end events

Hook Types

HookTriggered WhenAgent ID
startClaude session beginsclaude.start
stopClaude session endsclaude.stop
messageUser sends messageclaude.message

Event Data

Each Claude hook automatically enriches telemetry with:
{
  "provider": "claude_code",
  "hook": "start|stop|message",
  "timestamp": "2024-01-15T10:30:00Z",
  "payload": {
    // Original Claude payload data
  }
}

CLI Options

# Dry run (don't send events)
arden claude start --dry-run

# Print enriched payload
arden claude start --print

# Custom API host
arden claude start --host "https://api.example.com"

Troubleshooting

Hook not triggering?
  • Verify Claude Code hook configuration
  • Check Arden CLI is installed globally
  • Run arden --version to confirm installation
Events not appearing?
  • Check network connectivity
  • Verify API token if using authentication
  • Use --dry-run --print to debug payload

Manual Integration

You can also manually send Claude-related events:
arden events send --agent "claude.custom" --bid 1000 --data '{"task": "code_review"}'
This gives you full control over when and what telemetry is sent.