Note for the AI agent reading this file:
You are guiding a user through connecting their AI coding agent to Singsight, an AI Agent observability platform. After setup, every LLM call, tool execution, token usage, and session will appear in Singsight dashboards automatically via OpenTelemetry.
Work through the steps in order. When a step says ASK THE USER, stop and ask — do not invent answers. Never echo the API key back to the user; it is sensitive.
Step 1 — Identify the target agent
Determine which agent to instrument:
If the user named one explicitly, use that.
Else, auto-detect by the runtime you're answering from:
If
~/.claude/
~/.claude/
exists → Claude Code
If
~/.hermes/hermes-agent/
~/.hermes/hermes-agent/
exists → Hermes Agent
If
~/.openclaw/openclaw.json
~/.openclaw/openclaw.json
exists → OpenClaw
If
~/.config/opencode/opencode.json
~/.config/opencode/opencode.json
exists → Opencode
Else ASK THE USER: "Which agent should I instrument — Claude Code, Hermes Agent, OpenClaw, or Opencode?"
Target
Status
Section
Claude Code
✅
Step 3
Hermes Agent
✅
Step 4
OpenClaw
✅
Step 5
Opencode
✅
Step 6
Step 2 — Get Singsight endpoint and API Key
Note: If the target is OpenClaw, skip this step — Step 5 has its own guided prompts for API Key and endpoint.
You need two values:
Endpoint — the OTel collector URL (typically
http://<singsight-host>:4318
http://<singsight-host>:4318
)
API Key — created in the Singsight web UI (header name:
x-singsight-apikey
x-singsight-apikey
)
2a. Probe for existing config
Check if already configured in another agent:
# Check Claude Code
grep -o 'x-singsight-apikey=["]*' "$HOME/.claude/settings.json" 2>/dev/null | head -1
# Check Hermes
grep 'x-singsight-apikey' "$HOME/.hermes/.env" 2>/dev/null | head -1
# Check OpenClaw
python3 -c "
import json
try:
cfg = json.load(open('$HOME/.openclaw/openclaw.json'))
h = cfg.get('diagnostics',{}).get('otel',{}).get('headers',{})
if 'x-singsight-apikey' in h: print(f'FOUND endpoint={cfg[\"diagnostics\"][\"otel\"][\"endpoint\"]}')
except: pass
" 2>/dev/null
# Check Opencode
grep 'x-singsight-apikey' "$HOME/.config/opencode/.env" 2>/dev/null | head -1
If found, ASK THE USER: "I found existing Singsight config for
<agent>
<agent>
. Reuse the same endpoint and API Key for
<target>
<target>
?"
If reuse confirmed, store as
$ENDPOINT
$ENDPOINT
and
$API_KEY
$API_KEY
and skip to Step 3.
2b. If not found — proactively prompt the user
You MUST actively tell the user where to get the values. Say exactly this:
I need your Singsight Endpoint and API Key to complete the setup.
Please open your Singsight web UI and:
Go to Settings → Quick Start tab — the Endpoint URL is shown at the top (looks like
http://<host>:4318
http://<host>:4318
)
Go to Settings → API Keys tab — click Create API Key (the full key is shown only once, copy it immediately)
Paste both values here. I won't echo the API key back.
Wait for the user to respond. Do NOT proceed until you have both values.
2c. Validate
Endpoint: must start with
http://
http://
or
https://
https://
, typically ends with port
4318
4318
(HTTP) or
4317
4317
(gRPC)
API Key: non-empty string (Singsight keys are opaque UUIDs)
Store as
$ENDPOINT
$ENDPOINT
and
$API_KEY
$API_KEY
for the following steps.
Step 3 — Claude Code
Claude Code has built-in OpenTelemetry support. Configuration goes into
~/.claude/settings.json
~/.claude/settings.json
.
3a. Check if already configured
if grep -q 'CLAUDE_CODE_ENABLE_TELEMETRY' "$HOME/.claude/settings.json" 2>/dev/null; then
echo "ALREADY_CONFIGURED"
fi
If already configured, ASK THE USER: "Claude Code already has telemetry configured. Want me to update the endpoint/key, or skip?"
fails (e.g. network issue), tell the user and STOP.
5c. Prompt user for API Key
You MUST proactively ask the user to copy the API Key. Say exactly this:
Step 1 of 2 — API Key
Please open Singsight web UI → Settings → API Keys tab, create a key (or copy an existing one), and paste it here.
(The full key is shown only once after creation — copy it immediately. I won't echo it back.)
Wait for the user to respond with the API Key. Do NOT proceed until you have it. Store as
$API_KEY
$API_KEY
.
5d. Prompt user for config snippet
Once you have the API Key, ask the user to copy the config snippet. Say exactly this:
Step 2 of 2 — Config snippet
Now open Settings → Quick Start tab, select Openclaw → Config File, and copy the JSON config shown there. Paste it here, or just confirm and I'll write the config using the endpoint shown on that page.
Alternatively, tell me your Singsight endpoint URL (looks like
http://<host>:4318
http://<host>:4318
) and I'll generate the config.
Wait for the user to respond. They may paste the full config, or just give you the endpoint. Store endpoint as