Skip to main content

Module config

Module config 

Source

Modules§

schema
Auto-generated config schema from Config struct metadata.
setter
Generic config setter that works for ALL schema-known keys.

Structs§

AliasEntry
A user-defined command alias mapping for shell compression patterns.
ArchiveConfig
Settings for the zero-loss compression archive (large tool outputs saved to disk).
AutonomyConfig
Controls autonomous background behaviors (preload, dedup, consolidation).
CloudConfig
Cloud sync and contribution settings (pattern sharing, model pulls).
Config
Global lean-ctx configuration loaded from config.toml, merged with project-local overrides.
ConfigProvenance
Where the effective config comes from — the four shadowing mechanisms behind GH #450, captured in one snapshot.
CostConfig
Model declaration for measured-vs-estimated cost reporting.
EmbeddingConfig
Semantic-embedding engine settings.
EnvOverride
An active environment variable shadowing a persisted setting.
GainConfig
Settings for publishing your token-savings recap (gain --publish / auto-publish).
GraphConfig
Settings for the code graph — in particular the traversal (co-access) edges learned from real agent sessions (#289).
LoopDetectionConfig
Thresholds for detecting and throttling repetitive agent tool call loops.
McpBridgeEntry
MemoryGuardConfig
RSS-based memory guardian configuration.
ProviderEntryConfig
Per-provider configuration entry.
ProvidersConfig
Configuration for external context providers (GitHub, GitLab, Jira, etc.). Each provider can be enabled/disabled and configured with auth tokens. Override individual tokens via env vars (GITHUB_TOKEN, GITLAB_TOKEN, etc.).
ProxyConfig
API proxy upstream overrides. None = use provider default.
SecretDetectionConfig
SetupConfig
Controls what lean-ctx injects during setup and update --rewire. Fresh installs default to non-invasive (rules/skills off, MCP on). Users who ran setup interactively get explicit true/false. None = undecided (legacy: check if rules already exist and preserve behavior).
SkillifyConfig
Skillify (#290): mine the project’s session diary + knowledge facts into versioned, git-committable .cursor/rules/skillify-*.mdc rule files.
SummariesConfig
AI session summaries (#292): periodically distil the working session into a compact, semantically recallable summary so a future session can answer “what did I do last time on X?”. Deterministic and local-first — recall uses embeddings when the embeddings feature is on, else a lexical fallback.
UpdatesConfig
Controls automatic update behavior. All defaults are OFF — auto-updates require explicit opt-in via lean-ctx setup or lean-ctx update --schedule.
Upstreams
The three resolved provider upstreams a running proxy forwards to. Published to request handlers via a tokio::sync::watch channel so a config change is picked up live, without a proxy restart (#449).

Enums§

CompressionLevel
Each level maps to specific component settings via to_components().
HistoryMode
How the proxy prunes old tool results from conversation history.
MemoryCleanup
Controls how aggressively lean-ctx frees memory when idle.
MemoryProfile
Controls RAM usage vs. feature richness trade-off.
OutputDensity
Legacy: Controls how dense/compact MCP tool output is formatted. Superseded by CompressionLevel. Kept for backward compatibility with old config.toml files. New setups use compression_level instead. See CompressionLevel::effective().
PermissionInheritance
Whether lean-ctx mirrors the host IDE’s tool-permission rules onto its own MCP tools (“permission inheritance”).
ProxyProvider
ResponseVerbosity
Unified compression level that replaces the 4 separate legacy concepts: terse_agent, output_density, terse_mode, and crp_mode.
RulesInjection
How agent rules are injected for AGENTS.md/CLAUDE.md/CODEBUDDY.md/GEMINI.md consumers.
RulesScope
Where agent rule files are installed: global home dir, project-local, or both.
SavingsFooter
Controls visibility of token savings footers in tool output.
ShellActivation
Controls when the shell hook auto-activates command aliases.
TeeMode
Controls when shell output is tee’d to disk for later retrieval.
TerseAgent
Legacy: Controls agent output verbosity level injected into MCP instructions. Superseded by CompressionLevel. Kept for backward compatibility with old config.toml files. New setups use compression_level instead. See CompressionLevel::effective().
UpstreamDrift
Why a running proxy’s live upstream differs from what the operator expects.

Constants§

DEFAULT_BM25_PERSIST_MB
Effective on-disk ceiling (MB) for the persisted BM25 index when nothing is explicitly configured (no bm25_max_cache_mb, no max_disk_mb budget).

Functions§

default_bm25_max_cache_mb
Default BM25 cache cap from config (also used by bm25_index heuristics).
diagnose_drift
Diagnose upstream drift for one provider from the CLI-visible env override (env), the config.toml value (disk) and the proxy’s live value (live). None means in sync.
env_upstream_override
The LEAN_CTX_*_UPSTREAM override visible to this process for a provider, normalized (None if unset/blank). Lets status/doctor explain why an env var a user exported in their shell never reaches an MCP/service-spawned proxy.
is_local_proxy_url
last_config_parse_error
Returns the most recent global config parse error, or None if the current config.toml parsed successfully (or no config file exists).
normalize_url
normalize_url_opt
render_annotated_config
Builds the annotated config.toml text for cfg, documented via schema.