Skip to main content

Configuration Files

klaw uses TOML for configuration. Files are stored in ~/.klaw/:

Main Configuration

Full Example

Environment Variables

Environment variables override config file values:

Variable Reference

Use ${VAR_NAME} in config files:

Initialization

Create default configuration:
This creates:
  • ~/.klaw/config.toml with defaults
  • ~/.klaw/workspace/ with template files
  • ~/.klaw/agents/ directory

Provider Configuration

Anthropic (Direct)

OpenRouter

each::labs

Provider Priority

klaw auto-detects provider in this order:
  1. OpenRouter (if OPENROUTER_API_KEY set)
  2. each::labs (if EACHLABS_API_KEY set)
  3. Anthropic (if ANTHROPIC_API_KEY set)
Override with --provider:

Provider Resilience

Configure retry and fallback behavior per provider:
Retries use exponential backoff starting at 1s, capped at 30s, with 25% random jitter. Retryable errors include HTTP 429 (rate limit), 500, 502, 503, and connection errors.

Cost Budget

Set a per-session spending limit in the [defaults] section:
When the budget is reached, the agent stops with a budget_exceeded error. A warning is logged when cost reaches 80% of the budget.

Channel Configuration

Slack

API Server

Orchestrator Configuration

Disabled (Single Agent)

Rules-Based

AI-Based

Hybrid

Per-Agent Configuration

Define per-agent settings under [agent.<name>]. Each agent can have its own tool allowlist, iteration limit, and approval requirements:

Tools Configuration

Logging Configuration

Managing Configuration

View Current Config

Set Values

Reset to Defaults

Context Management

For distributed mode, manage cluster contexts:

Next Steps

Providers

Configure LLM providers

Channels

Set up communication channels