pub struct Config {
pub enabled: bool,
pub rtk_bin: String,
pub ultra_compact: bool,
pub skip_env: bool,
}Expand description
Resolved plugin settings.
Precedence, lowest to highest: built-in defaults, then
.claude/rtk-mcp-cc.local.md frontmatter, then environment variables.
Environment wins so a user can disable or redirect the hook for a single
session without editing a file.
Fields§
§enabled: boolWhen false, the hook passes every command through untouched.
rtk_bin: StringThe rtk executable to invoke. Looked up on PATH when it has no
path separator.
ultra_compact: boolPass --ultra-compact to rtk (Level 2 optimizations).
skip_env: boolPass --skip-env to rtk (sets SKIP_ENV_VALIDATION=1 for children).
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_markdown(source: &str) -> Self
pub fn from_markdown(source: &str) -> Self
Parse settings from the YAML frontmatter of a .local.md file.
Unknown keys and malformed values are ignored: a broken settings file degrades to the defaults rather than breaking the user’s session. This matters more here than in most plugins, because this hook sits in front of every shell command.
Sourcepub fn load(project_dir: &Path) -> Self
pub fn load(project_dir: &Path) -> Self
Load <project_dir>/.claude/rtk-mcp-cc.local.md, then apply the
environment overrides.
Sourcepub fn apply_env<F>(&mut self, get: F)
pub fn apply_env<F>(&mut self, get: F)
Apply environment overrides through an injectable lookup.
RTK_BIN is spelled without a plugin prefix on purpose: it is the same
variable the sibling rtk-mcp-qwen extension honours, so a user who
relocates rtk sets one variable for both.
Sourcepub(crate) fn global_flags(&self) -> Vec<String>
pub(crate) fn global_flags(&self) -> Vec<String>
The global rtk flags implied by this config, in a stable order.