Expand description
§Context Profiles
Declarative, version-controlled context strategies (“Context as Code”).
Profiles configure how lean-ctx processes content for different scenarios: exploration, bugfixing, hotfixes, CI debugging, code review, etc.
§Resolution Order
LEAN_CTX_PROFILEenv var.lean-ctx/profiles/<name>.toml(project-local)~/.lean-ctx/profiles/<name>.toml(global)- Built-in defaults (compiled into the binary)
§Inheritance
Profiles can inherit from other profiles via inherits = "parent".
Child values override parent values; unset fields fall through.
Structs§
- Budget
Config - Token and cost budget limits.
- Compression
Config - Compression strategy configuration.
- Degradation
Config - Budget/SLO degradation policy configuration.
- Layout
Config - Layout (attention-aware reorder) configuration.
- Pipeline
Config - Pipeline layer activation per profile.
- Profile
- A complete context profile definition.
- Profile
Autonomy - Autonomy overrides per profile.
- Profile
Info - Information about an available profile.
- Profile
Meta - Profile identity and inheritance.
- Read
Config - Read behavior configuration.
- Routing
Config - Routing policy overrides (intent → model tier → read mode/budgets).
- Translation
Config - Translation (tokenizer-aware) configuration.
Enums§
- Profile
Source - Where a profile was loaded from.
Functions§
- active_
profile - Loads the currently active profile.
- active_
profile_ name - Returns the currently active profile name from env or default.
- builtin_
profiles - Returns all built-in profile definitions.
- format_
as_ toml - Formats a profile as TOML for display or file creation.
- list_
profiles - Lists all available profile names (built-in + on-disk).
- load_
profile - Loads a profile by name with full resolution:
- set_
active_ profile - Sets the active profile for the current process by updating
LEAN_CTX_PROFILE.