Connecting Claude Code to Agent Trust Hub
Bigeye can receive telemetry directly from Claude Code and show each session under Agent Trust. Once configured, every prompt, tool call, and response from Claude Code becomes a conversation with turn-by-turn detail, including which files, commands, and MCP resources (Google Drive, GitHub, Google Calendar) each turn touched.
No separate forwarder or proxy is required. Claude Code's built-in OpenTelemetry exporter and hooks send data straight to Bigeye.
What you'll see in Bigeye
- Agent Trust → Agents: one Claude Code agent that all of your organization's activity rolls up under, not one row per user.
- Agent detail → Conversations: one row per Claude Code session, showing the initial prompt, total tokens, cost, and the user who ran it.
- Conversation detail: one turn per prompt/response pair, with the tools used and every resource touched (files read, shell commands, Drive docs, GitHub files, and so on).
Prerequisites
- A personal API key, generated from Profile → API Keys in Bigeye.
- Your workspace ID, visible in the URL of any Bigeye page (
.../w/<workspace-id>/...). - Claude Code v2.1.193 or later. Older versions won't send assistant responses, so conversations will show your prompts but not Claude's replies.
The steps below target https://app.bigeye.com. If you're on a dedicated instance or self-hosted Bigeye, see Dedicated instance or self-hosted.
Setup
Add the following to ~/.claude/settings.json (create the file if it doesn't exist). Replace both REPLACE_ME values with your personal API key and workspace ID.
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://app.bigeye.com/api/v1/claude-code",
"OTEL_EXPORTER_OTLP_HEADERS": "Authorization=apikey REPLACE_ME_API_KEY,x-bigeye-workspace-id=REPLACE_ME_WORKSPACE_ID",
"OTEL_LOG_USER_PROMPTS": "1",
"BIGEYE_API_KEY": "REPLACE_ME_API_KEY",
"BIGEYE_WORKSPACE_ID": "REPLACE_ME_WORKSPACE_ID"
},
"allowedHttpHookUrls": [
"https://app.bigeye.com/api/v1/claude-code/v1/hooks"
],
"allowedEnvVars": ["BIGEYE_API_KEY", "BIGEYE_WORKSPACE_ID"],
"hooks": {
"PreToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "curl -fs --max-time 2 -X POST -H 'Content-Type: application/json' -H \"Authorization: apikey $BIGEYE_API_KEY\" -H \"x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID\" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooks >/dev/null 2>&1 || true"
}]
}],
"PostToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "curl -fs --max-time 2 -X POST -H 'Content-Type: application/json' -H \"Authorization: apikey $BIGEYE_API_KEY\" -H \"x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID\" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooks >/dev/null 2>&1 || true"
}]
}],
"UserPromptSubmit": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "curl -fs --max-time 2 -X POST -H 'Content-Type: application/json' -H \"Authorization: apikey $BIGEYE_API_KEY\" -H \"x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID\" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooks >/dev/null 2>&1 || true"
}]
}],
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "curl -fs --max-time 5 -X POST -H 'Content-Type: application/json' -H \"Authorization: apikey $BIGEYE_API_KEY\" -H \"x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID\" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooks >/dev/null 2>&1 || true"
}]
}]
}
}Start a fresh claude session so the new settings take effect.
What each setting does
| Setting | Purpose |
|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | Where Claude Code sends OTLP logs, metrics, and traces. |
OTEL_EXPORTER_OTLP_HEADERS | Your API key and workspace ID, sent with every request. |
OTEL_LOG_USER_PROMPTS=1 | Includes your actual prompt text. Without it, Bigeye shows "no prompt captured." |
hooks.* | Sends prompt text and tool inputs/outputs as they happen, so Bigeye can track turn boundaries in real time. |
allowedHttpHookUrls | Claude Code only allows hooks to call URLs listed here. |
allowedEnvVars | Lets Claude Code substitute $BIGEYE_API_KEY and $BIGEYE_WORKSPACE_ID into the hook commands. |
Dedicated instance or self-hosted
Replace https://app.bigeye.com everywhere in the snippet with your Datawatch host — for example https://<tenant>.bigeye.com, or http://localhost:8080 for local development. Update all four hook URLs, the OTLP endpoint, and the entry in allowedHttpHookUrls to match.
Verify it works
- Start a new
claudesession and send any prompt. - Wait about 10 seconds for the data to reach Bigeye.
- In Bigeye, go to Agent Trust. You should see a Claude Code agent shared across the workspace. Open it, find your session under Conversations, and confirm the prompt, response, and tool calls all appear.
If nothing shows up within 30 seconds, see Troubleshooting below.
What's captured, what's not
Captured:
- Prompt text, tokens, cost, and the assistant's response for each turn.
- Model,
cwd, OS, terminal, and Claude Code version. - Every tool call: file reads/writes, Bash commands, WebFetch URLs, and MCP calls.
- MCP calls to known systems (Google Drive, GitHub, Google Calendar) resolved to readable names and links.
- Access to catalog tables and columns, linked to the matching Bigeye dataset so it rolls up under the right asset.
Not captured:
- File contents — only paths, URLs, and metadata.
- Command output beyond what Claude Code includes in the hook payload.
- Anything Claude Code itself doesn't emit, such as internal reasoning traces.
Enforce policies in real time
Private BetaReal-time enforcement builds on Policies, which are in private beta. Ask your Bigeye account team to turn on real-time enforcement for your workspace.
By default, Policies only open issues after the fact. With real-time enforcement turned on, Bigeye also checks your workspace's enabled conversation policies while a Claude Code session is running, and tells Claude Code what to do:
- Before each tool call (
PreToolUsehook): if a policy matches, Claude Code skips the call. Claude seesBigeye policy violation: <policy name>instead of the tool's result. - After each tool call (
PostToolUsehook): if a policy matches, Claude sees the same message as feedback. The tool has already run at this point, so this step reports the violation but can't undo it.
These checks don't open issues themselves. Issues are still opened the usual way.
1. Let Claude Code read Bigeye's response
The setup above discards everything Bigeye sends back. In the PreToolUse and PostToolUse hooks, replace >/dev/null 2>&1 || true at the end of the command with 2>/dev/null || true, so Claude Code receives the response:
"PreToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "curl -fs --max-time 2 -X POST -H 'Content-Type: application/json' -H \"Authorization: apikey $BIGEYE_API_KEY\" -H \"x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID\" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooks 2>/dev/null || true"
}]
}],
"PostToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "curl -fs --max-time 2 -X POST -H 'Content-Type: application/json' -H \"Authorization: apikey $BIGEYE_API_KEY\" -H \"x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID\" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooks 2>/dev/null || true"
}]
}]Leave the UserPromptSubmit and Stop hooks as they are. Start a new claude session afterwards.
2. Write a policy for the tool call
Create a conversation policy under Agent Trust → Policies. Before a tool runs, Bigeye hasn't recorded it yet, so a policy learns about the pending call from two tags:
| Tag | Value |
|---|---|
tool_name | The Claude Code tool, such as Bash, Read, WebFetch, or mcp__github__get_file_contents |
command_name | For Bash only: the program being run, such as python3 or git, without its arguments |
For example, this rule stops Claude Code from running Python:
forbid (
principal,
action == Bigeye::Action::"evaluate",
resource is Bigeye::Conversation
)
when {
principal.external_id == "claude-code" &&
resource.hasTag("tool_name") && resource.getTag("tool_name") == "Bash" &&
resource.hasTag("command_name") && resource.getTag("command_name") like "python*"
};Paste the rule on the policy's Configure policy step. Always check hasTag before getTag: the check after a tool call runs without tags, and getTag on a missing tag is an error. Because the tags only exist before a tool call, a policy that depends on them blocks calls but never opens an issue.
Every matching policy blocksReal-time enforcement applies to all enabled conversation policies, not just ones that use these tags. A policy based on the session so far, such as "a conversation cost more than $1" or "a conversation read restricted data", blocks every later tool call in that session once it matches. To keep a policy from blocking Claude Code, exclude it with
principal.external_id != "claude-code", or scope it to another platform withprincipal.platform.
3. Check that it works
With the Python policy above enabled, start a new claude session and ask it to run python3 -c 'print(1)'. Claude should report that the command was blocked with Bigeye policy violation: <your policy name>, and the command should not run.
Limitations
- Bigeye unreachable means allowed. With
--max-time 2and|| true, a slow or failed request lets the tool run. To block tools when Bigeye can't be reached, end thePreToolUsecommand with2>/dev/null || { echo 'Bigeye unreachable' >&2; exit 2; }instead. Claude Code only blocks on exit code 2, so removing|| truealone isn't enough. Every tool call is then blocked during an outage. - Only the first program counts.
command_nameis the first program on the command line, up to the first shell separator such as;,|,&&, or a redirect. Later commands in a chain, and wrappers such asuv run python script.pyorbash -c "python script.py", don't match apython*rule. - Users can edit their own settings. Hooks in
~/.claude/settings.jsoncan be removed by the person who owns the file. To enforce hooks across an organization, deploy them through Claude Code's managed settings.
Troubleshooting
No agent appears in Bigeye
-
Check that your API key is valid:
curl -f -H "Authorization: apikey $BIGEYE_API_KEY" -H "x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID" https://app.bigeye.com/api/v1/agent-conversations/list -d '{}' -X POST -H 'Content-Type: application/json'This should return HTTP 200.
-
Confirm the workspace ID matches the workspace your API key belongs to.
-
Restart
claude— settings only load at session start.
Conversation is empty, or shows "No prompt captured"
- Set
OTEL_LOG_USER_PROMPTS=1and start a new session. Claude Code masks prompts by default.
Hooks silently fail
-
Confirm
allowedHttpHookUrlshas the exact URL you're posting to. -
Test the endpoint directly:
echo '{"session_id":"test","hook_event_name":"UserPromptSubmit","prompt":"hi"}' | curl -X POST -H "Content-Type: application/json" -H "Authorization: apikey $BIGEYE_API_KEY" -H "x-bigeye-workspace-id: $BIGEYE_WORKSPACE_ID" --data-binary @- https://app.bigeye.com/api/v1/claude-code/v1/hooksThis should return
{"ok":true}.
Access detail shows no data even though tools ran
- Contact Bigeye support with the tool name and a redacted sample of its response so we can add support for it.
Updated 7 days ago
