Skip to main content
TRW
TRWDocumentation

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%.

.trw/config.yaml
coverage_threshold: 0.90  # Require 90% coverage

2. Enable telemetry

Opt-in anonymized telemetry. Sends session duration, tool usage counts, and ceremony scores. No code, no secrets, no PII.

.trw/config.yaml
telemetry_enabled: true

3. Connect to the platform

Syncs learnings, PRDs, and session data to the TRW dashboard. Requires a platform API key.

.trw/config.yaml
platform_url: https://trwframework.com
org_id: your-org-id
# API key set via environment variable — see warning below

All config fields

FieldTypeDefaultDescription
task_rootstrdocsRoot directory for PRDs and run artifacts
coverage_threshold*float0.80Minimum test coverage to pass build gate
telemetry_enabled*boolfalseEnable anonymized telemetry (opt-in)
platform_url*str | NoneNoneTRW platform URL for learning sync
platform_api_key*str | NoneNoneAPI key for platform authentication
org_idstr | NoneNoneOrganization ID for multi-tenant separation
max_learnings_per_recallint25Max 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).

VariableMaps toDescription
TRW_TASK_ROOTtask_rootOverride task root directory
TRW_COVERAGE_THRESHOLDcoverage_thresholdOverride coverage threshold
TRW_TELEMETRY_ENABLEDtelemetry_enabledEnable telemetry via env
TRW_PLATFORM_URLplatform_urlOverride platform URL
TRW_PLATFORM_API_KEYplatform_api_keySet API key via env (recommended for CI)
TRW_ORG_IDorg_idOverride 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.

terminal
> 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_parsing

Full example

.trw/config.yaml
# 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: 25

Advanced 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:

ProfileCeremonyContextNotes
claude-codeFull200KDefault. Full ceremony, hooks, scoring.
opencodeLight32KReduced ceremony. Skips review scoring.
cursorFull128KFull ceremony, no shell hooks.
codexLight32KMinimal phases. IMPLEMENT + DELIVER only.
aiderLight32KMinimal 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.

.trw/config.yaml
# Options: full, light, off
ceremony_mode: light

Source package paths

Tell trw_build_check where your source code lives. Defaults auto-detect, but monorepos or non-standard layouts may need explicit paths.

.trw/config.yaml
source_packages:
  - src/backend
  - src/workers
  - lib/shared

Next steps