Smith::Config
Inherits Reference < Object
Resolved configuration, merged from (lowest to highest priority):
built-in defaults < global config < project config < env var < CLI flag
The CLI flag tier lives in Smith::CLI — it simply skips asking the Config
when a flag was supplied. Everything below that is resolved here.
API keys are deliberately not read from the config file. They stay env-only so a plaintext config never becomes a place secrets get committed from.
Constants
Constructors
Reads the global config, then the nearest project config, and merges them with the project file winning on conflicts.
Class methods
Walks up from start_dir looking for .smith/config.toml, stopping at the git root — same boundary ProjectContext.discover uses, so running smith from a subdirectory still finds the project's config. Nearest wins.
Instance methods
Anthropic prompt caching. On by default; worth switching off only when the prompt is too short to reach the cache minimum.
Everything except the project config's hooks. Used when the user has not trusted this project: their own global hooks still run.
Consumed by MCP::Manager via CLI#mcp_manager. The timeout is per call: a server that hangs must not hang the agent with it.
Budgets for @-mentions. allow_outside is off by default: a prompt coming from a skill file could otherwise pull in ~/.ssh/id_rsa.
Rates keyed by "provider/model", overriding the built-in table. Vendors change prices; a table baked into a release cannot keep up.
Hooks run arbitrary commands with the user's rights, so a project config that defines them has to be trusted once. nil means the project config defines no hooks at all; the digest changes whenever they do.
Config files that were actually read, lowest priority first. Useful for diagnostics ("why is smith using this model?").
Consumed by Subagents::Supervisor via CLI#build_agent. max_children = 0 switches subagents off entirely — the agent tool is then not registered.
Extended thinking is off by default: it costs tokens, and only Anthropic supports it in the form smith implements.
Only for Anthropic models older than 4.6, which take a token budget instead of an effort level. Unset on purpose: current models reject it.
Consumed by Tools::WebFetch and Tools::WebSearch via CLI#build_agent. API keys are not here — they stay in the environment, like every other key.