Skip to main content

Configuration

All configuration is via environment variables. No config files to template.

Required

VariableDescription
ANTHROPIC_API_KEYClaude API key (or LiteLLM proxy key)

Core Settings

VariableDefaultDescription
CLAUDEOPS_INTERVAL3600Seconds between scheduled runs
CLAUDEOPS_DRY_RUNfalseObserve only, no remediation
CLAUDEOPS_REPOS_DIR/reposParent directory for mounted repos
CLAUDEOPS_STATE_DIR/statePersistent state directory (SQLite DB + cooldown JSON)
CLAUDEOPS_RESULTS_DIR/resultsSession log output directory
CLAUDEOPS_DASHBOARD_PORT8080HTTP port for the web dashboard
CLAUDEOPS_ALLOWED_TOOLSBash,Read,Grep,Glob,Task,WebFetchClaude CLI tools to enable

Model Selection

Each tier can use a different model. The defaults balance cost and capability:

VariableDefaultDescription
CLAUDEOPS_TIER1_MODELhaikuHealth checks (Tier 1) — cheapest, runs every interval
CLAUDEOPS_TIER2_MODELsonnetInvestigation + safe remediation (Tier 2) — on-demand
CLAUDEOPS_TIER3_MODELopusFull remediation (Tier 3) — on-demand, most capable
CLAUDEOPS_SUMMARY_MODELhaikuModel for generating TL;DR session summaries

Cost implications

tip

On a healthy day, only Tier 1 runs — about $1-2 for 24 Haiku checks. Costs scale with how often things break, not with how many services you monitor.

  • Tier 1 (Haiku) runs every interval (~24x/day at default). At ~$0.01-0.05 per run, that's ~$1-2/day.
  • Tier 2 (Sonnet) only runs when Tier 1 finds issues. Typical cost: $0.05-0.50 per escalation.
  • Tier 3 (Opus) only runs when Tier 2 can't fix the problem. Typical cost: $0.50-5.00 per escalation.

API Configuration

VariableDefaultDescription
ANTHROPIC_API_KEY(required)API key
ANTHROPIC_BASE_URL(Anthropic default)Base URL for the API — set to your LiteLLM/proxy URL

Using with LiteLLM or other proxies

Claude Ops works with LiteLLM or any Anthropic-compatible API proxy:

ANTHROPIC_API_KEY=sk-your-litellm-key
ANTHROPIC_BASE_URL=https://litellm.example.com
Bedrock users

If your LiteLLM routes to AWS Bedrock, ensure your model deployments use inference profile ARNs (not raw model IDs) and that drop_params: true is set to strip unsupported beta headers.

Git Provider / PR Creation

VariableDefaultDescription
CLAUDEOPS_PR_ENABLEDfalseEnable PR creation via MCP and REST API
CLAUDEOPS_MAX_TIER3Maximum escalation tier (1-3)
GITHUB_TOKEN(none)GitHub personal access token for PR operations
GITEA_URL(none)Gitea instance URL
GITEA_TOKEN(none)Gitea API token

PR creation is disabled by default. When disabled, the create_pr MCP tool is not registered and the REST API returns 403. Read-only operations (listing PRs, checking PR status) are always available. To enable:

CLAUDEOPS_PR_ENABLED=true
GITHUB_TOKEN=ghp_...

Mobile Chat

VariableDefaultDescription
CLAUDEOPS_CHAT_API_KEY(disabled)Bearer token for the OpenAI-compatible chat endpoint. If unset, /v1/chat/completions returns 503.

Notifications

VariableDefaultDescription
CLAUDEOPS_APPRISE_URLS(disabled)Comma-separated Apprise URLs

See Notifications for setup details and common URL formats.

Browser Automation

VariableDefaultDescription
CLAUDEOPS_BROWSER_ALLOWED_ORIGINS(disabled)Comma-separated origins for browser automation
BROWSER_CRED_{SERVICE}_{FIELD}(none)Service credentials. {SERVICE} = uppercase name, {FIELD} = USER, PASS, TOKEN, or API_KEY

Browser automation requires the Chrome sidecar (docker compose --profile browser up -d). When CLAUDEOPS_BROWSER_ALLOWED_ORIGINS is empty, browser automation is disabled entirely.

info

Credentials are injected into the browser session at runtime — the Claude agent never sees raw passwords or tokens. See the browser automation spec for the full security model.

Example .env

# Required
ANTHROPIC_API_KEY=sk-ant-...

# Monitoring interval (1 hour)
CLAUDEOPS_INTERVAL=3600

# Models (defaults shown)
CLAUDEOPS_TIER1_MODEL=haiku
CLAUDEOPS_TIER2_MODEL=sonnet
CLAUDEOPS_TIER3_MODEL=opus

# Notifications (ntfy example)
CLAUDEOPS_APPRISE_URLS=ntfy://ntfy.sh/my-claude-ops-topic

# PR creation (disabled by default)
# CLAUDEOPS_PR_ENABLED=true
# GITHUB_TOKEN=ghp_...

# Browser automation
CLAUDEOPS_BROWSER_ALLOWED_ORIGINS=https://sonarr.example.com,https://prowlarr.example.com
BROWSER_CRED_SONARR_USER=admin
BROWSER_CRED_SONARR_PASS=your-sonarr-password

# Mobile chat (disabled by default — set to enable /v1/chat/completions)
# CLAUDEOPS_CHAT_API_KEY=your-secret-key-here