Configuration
TRW works with sensible defaults. Most projects never edit the config. When you need to customize, everything is in one file: .trw/config.yaml
Info
Precedence: Environment variables (TRW_*) override .trw/config.yaml, which overrides built-in defaults. Use env vars for CI/CD and secrets. Use the config file for project-level settings.
Common config changes
Three changes cover 90% of configuration needs. Everything else can stay at defaults.
1. Set coverage threshold
Controls the minimum test coverage required by trw_build_check. Default is 80%.
coverage_threshold: 0.90 # Require 90% coverage2. Enable telemetry
Opt-in anonymized telemetry. Sends session duration, tool usage counts, and ceremony scores. No code, no secrets, no PII.
telemetry_enabled: true3. Connect to the platform
Syncs learnings, PRDs, and session data to the TRW dashboard. Requires a platform API key.
platform_url: https://trwframework.com
org_id: your-org-id
# API key set via environment variable — see warning belowAll config fields
| Field | Type | Default | Description |
|---|---|---|---|
| task_root | str | docs | Root directory for PRDs and run artifacts |
| coverage_threshold* | float | 0.80 | Minimum test coverage to pass build gate |
| telemetry_enabled* | bool | false | Enable anonymized telemetry (opt-in) |
| platform_url* | str | None | None | TRW platform URL for learning sync |
| platform_api_key* | str | None | None | API key for platform authentication |
| org_id | str | None | None | Organization ID for multi-tenant separation |
| max_learnings_per_recall | int | 25 | Max learnings returned per recall query |
* Fields most users change. Everything else can stay at defaults.
Environment variables
Every config field can be overridden via environment variables prefixed with TRW_. Recommended for CI/CD and containerized deployments.
Warning
Never commit TRW_PLATFORM_API_KEY to version control. Set it via environment variables or .env files (add .env to your .gitignore).
| Variable | Maps to | Description |
|---|---|---|
| TRW_TASK_ROOT | task_root | Override task root directory |
| TRW_COVERAGE_THRESHOLD | coverage_threshold | Override coverage threshold |
| TRW_TELEMETRY_ENABLED | telemetry_enabled | Enable telemetry via env |
| TRW_PLATFORM_URL | platform_url | Override platform URL |
| TRW_PLATFORM_API_KEY | platform_api_key | Set API key via env (recommended for CI) |
| TRW_ORG_ID | org_id | Override organization ID |
Config validation
TRW validates configuration at startup using Pydantic v2. Invalid values produce clear error messages with the field name and expected type.
> trw_session_start()
# Valid config loads silently. Invalid config shows:
ValidationError: 1 validation error for TRWConfig
coverage_threshold
Input should be a valid number, unable to parse
string as a number [type=float_parsing, input_value='high']
For further information visit
https://errors.pydantic.dev/2.6/v/float_parsingFull example
# Project settings
task_root: docs
coverage_threshold: 0.80
# Platform sync (API key via TRW_PLATFORM_API_KEY env var)
platform_url: https://trwframework.com
org_id: your-org-id
# Optional
telemetry_enabled: false # opt-in only
max_learnings_per_recall: 25Advanced configuration
Client profiles
TRW adapts ceremony, scoring, and instruction sync per AI coding tool. The active profile is resolved from target_platforms[0] in config. Five built-in profiles:
| Profile | Ceremony | Context | Notes |
|---|---|---|---|
| claude-code | Full | 200K | Default. Full ceremony, hooks, scoring. |
| opencode | Light | 32K | Reduced ceremony. Skips review scoring. |
| cursor | Full | 128K | Full ceremony, no shell hooks. |
| codex | Light | 32K | Minimal phases. IMPLEMENT + DELIVER only. |
| aider | Light | 32K | Minimal phases. Suppresses framework references. |
Ceremony mode override
Override the ceremony mode regardless of client profile. Useful for testing or when you want full ceremony on a light-mode client.
# Options: full, light, off
ceremony_mode: lightSource package paths
Tell trw_build_check where your source code lives. Defaults auto-detect, but monorepos or non-standard layouts may need explicit paths.
source_packages:
- src/backend
- src/workers
- lib/shared