Anthropic Routine
Forward Luciq bug, crash, and APM events to a Claude Code routine. Luciq posts structured JSON and your routine's prompt decides the rest.
The Anthropic Routine integration forwards Luciq events to a Claude Code routine you created in the Anthropic console. When a forwarding rule matches a bug, crash, or APM event — or when you manually forward an item — Luciq POSTs the event as structured JSON to your routine's fire URL.
Your routine's system prompt decides what the agent does. Luciq sends data only — never instructions — and Anthropic delivers it wrapped in a <routine-fire-payload> envelope that explicitly tells the agent to treat the contents as data (see The event payload).
This page documents exactly what data Luciq exposes for each trigger, so you can write routine prompts that make full use of it.
Quick setup
Name the routine and write its instructions
Give the routine a Name and write its Instructions. The instructions are the routine's system prompt, and this is where all agent behavior lives: what to do with each Luciq event, which tools to use, and what to report back.
If the routine needs to read or change code, select a repository under the instructions box.

Add the Call via API trigger and connectors
Under Select a trigger, choose Call via API. This is the trigger Luciq uses to fire the routine. Its token is generated when you save.
Under Connectors, keep only the connectors the routine needs to act on the event, such as Slack, Atlassian, or Luciq. The routine can use them, including their write actions, without asking during a run, so remove any you don't want it to use. Then click Create.

Copy the fire URL
The fire URL isn't shown on the form, so it's easy to miss. Open the routine's page and find Triggers on the right side. Next to API, click the small copy icon. Its tooltip reads Copy fire URL.
The URL looks like https://api.anthropic.com/v1/claude_code/routines/<routine_id>/fire.

Add the integration in Luciq
In the Luciq dashboard, open Integrations → Add Integration and choose Anthropic Routine. Paste the fire URL into Routine Fire URL and the token into Routine API Token.
Optionally, fill Additional data with context for the routine, such as your team or repository name. The routine reads it as background information, and it can't change the behavior set by the routine's instructions. See Configuration fields.
To choose which details Luciq sends, such as email, app version, device, or location, click Edit under Information forwarded to Anthropic Routine. Then click Continue.

Test the integration
On the Test step, Luciq fires a sample bug event (see the Bug example) so you can confirm connectivity and watch the routine respond. On success, the response includes the Claude Code session URL.
Configuration fields
Routine Fire URL
yes
The Anthropic routine fire endpoint.
Routine API Token
yes
Sent as the bearer token when firing the routine.
Additional data
no
Optional context for the routine — read as background information; can't override its system prompt. (Where it lands in the payload: The event payload.)
The event payload
Luciq delivers the event as a pretty-printed JSON payload. When Additional data is set, that text is prepended above the JSON under an ## Additional data heading. e.g.:
Shared event payload blocks
This section describes the blocks that appear across different alerts and triggers. For full examples, see the Payload Examples section below.
Application
High-level application context (identity and environment) included with every event:
Alert
The alert object is null for manual forwards. For rule-fired events it contains:
trigger
Stable trigger key — dispatch on this in your prompt.
trigger_description
The rule's trigger in plain language.
rule_ulid
The rule's stable ID (survives title/condition edits).
rule_title
The dashboard title (editable — don't dispatch on it).
rule_url
Deep link to the rule, when available.
conditions
Plain-language scoping filters — the slice of data the rule covers (empty when none).
conditions_match
How the conditions combine: "all (AND)" or "any (OR)".
thresholds
Array of threshold objects (one per metric watched). See example and notes below.
incident_ulid
The incident's stable ID (can be used to correlate repeated fires).
incident_url
Dashboard link to the incident.
triggered_at_ms
Unix ms timestamp when the alert triggered. (APM and Overall app alerts)
app_version
The app version(s) that breached. Present only when the rule is set to breakout by app version; omitted otherwise (never sent as null).
affected_users_count
(Some stability/percentage alerts) numeric count of affected users in the window.
Threshold rules add a thresholds array (one entry per metric watched). accelerating_crash is a special-case threshold entry carrying an acceleration object instead of the usual operator/value/measured/unit fields.
Example threshold entry:
valueis the configured threshold,measuredis what Luciq observed,unitis%,sec, ornull.windowis the evaluation window in Unix milliseconds, or{ "duration_seconds": N }for time-based crash rules.
Entity
The subject of the event — a bug, crash, occurrence (a single crash event), or chat. Present for bug, chat, and all crash triggers; APM and Overall App triggers carry no entity.
The fields differ by entity type — see the Payload Examples below for the exact shape of each. Two things the examples can't show:
Every field is gated at integration setup: a disabled or empty field is omitted, never null.
Payload Examples
These examples show the exact JSON shapes Luciq sends for each supported trigger. Use them as concrete references when writing or testing your Anthropic routine prompts: field names, metric labels, units, and trigger keys are stable — values are illustrative.
Bug
alert is null for a manual forward. rule-fired bug carries the base alert block instead. (see alert)
Chat (manual)
Crash
Every crash trigger sends a crash entity except for occurrence_reported sends an occurrence entity — See Entity
And the alert changes per trigger.
occurrence_reported
Crash rule thresholds
These triggers ship the same crash entity (above) plus a threshold-bearing alert. Time-based triggers use a { "duration_seconds": N } window; rate/percentage triggers use a { from_ms, to_ms } window. accelerating_crash is the one exception to the threshold shape — it carries an acceleration object instead of operator/value/measured/unit.
APM rules (Network, Trace, App Launches, Frame Drop, Screen Loading)
APM alerts carry no entity — just the breaching metric in alert.thresholds plus a small side block naming what breached (endpoint / trace / launch / screen), and triggered_at_ms.
Metric labels:
95th-percentile latency(p95)Median (p50) latency(p50)Request failure rateDrop-off rateApdex change rate
endpoint.is_grpc is true for gRPC.
Overall App (stability, apdex, app health)
App-wide aggregate metrics; no entity. Stability triggers add a top-level breakdown to judge whether the sample is meaningful. alert.app_version names the breaching version when the rule evaluates per version, else null. Apdex is reported on a 0–100 scale.
Last updated
