Files
OmniRoute/src/mitm/targets/claudeCode.ts
Hernan Javier Ardila Sanchez fd26e601a2 fix(dashboard): use lightweight ping endpoint for MaintenanceBanner (fixes #3040) (#3043)
Integrated into release/v3.8.8. Applied review fixes: moved the SELECT 1 into a pingDb() db helper (no raw SQL in route, Hard Rule #5) + the 503 catch no longer leaks err.message (Hard Rule #12). Thanks @herjarsa!
2026-06-01 14:30:17 -03:00

38 lines
1.2 KiB
TypeScript

/**
* Claude Code (Anthropic CLI) — MITM target descriptor.
*
* Hosts: `api.anthropic.com`.
* Format: Anthropic Messages API on `/v1/messages`.
*
* NOTE: shares the host `api.anthropic.com` with the Kiro target. The DNS-routing
* tutorial therefore is opt-in: the user explicitly enables interception when
* they want Claude Code traffic captured.
*/
import type { MitmTarget } from "../types";
export const CLAUDE_CODE_TARGET: MitmTarget = {
id: "claude-code",
name: "Claude Code",
icon: "terminal",
color: "#D97706",
hosts: ["api.anthropic.com"],
port: 443,
endpointPatterns: ["/v1/messages"],
defaultModels: [
{ id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", alias: "claude-sonnet-4.5" },
{ id: "claude-opus-4.5", name: "Claude Opus 4.5", alias: "claude-opus-4.5" },
],
setupTutorial: {
steps: [
"Install Claude Code (Anthropic CLI)",
"Install OmniRoute's root certificate",
"Enable DNS routing for Claude Code",
"Run `claude` — requests are now proxied via OmniRoute",
],
detection: { command: "which claude", platform: "all" },
},
handler: () =>
import("../handlers/claudeCode").then((m) => ({ default: m.ClaudeCodeHandler })),
riskNoticeKey: "providers.riskNotice.oauth",
};