Skip to content

Configuration Reference

The backend reads a TOML base configuration for model routing, agent pins, and extension settings. Set --config <path> on a command to select a file, or set HYA_CONFIG for multiple commands. Hya uses the flag first, then the environment variable, then config.toml in the resolved config directory. Bundle files resolve beside the selected file.

First-run startup writes a starter config when the default file is missing. If the default file is missing and a sibling config.yaml exists, startup reports the legacy path and stops. See Migrating from Config v2 to v3.

Core Backend Configuration (config.toml v3)

Set schema_version = 3. Unknown keys fail parsing except inside bundle-owned and plugin-owned settings tables. For example, save the following as offline.toml and run hya --config ./offline.toml models.

#:schema https://hya.ed-aisys.com/schema/v3/config.json
schema_version = 3
default_model = "hya/offline"
[bundles.builtin]
profile = "bare"

Top-level keys

Key Type Default Description
schema_version u32 Required (3) Format version of the base backend configuration.
default_model string First live model, else hya/offline Default provider/model (optional #effort suffix) when no agent pin or --model flag applies.
default_agent string The default_agent of the enabled bundle that declares one (hya-main from hya/core-agents), else "hya-bare" (for example under --bare) Default root Agent ID (hya-main, hya-plan, or an installed bundle agent).
reasoning string — Global fallback thinking effort: none, minimal, low, medium, high, xhigh, max.
profile string default Select a standalone profile.
models_file string Sibling models.toml Override the provider and model declarations file.
permissions_file string Sibling permissions.toml Select a user-local permission and trust file.
permission_preset string — Select a named preset from the permissions file.
provider_retry ProviderRetry Defaults Default retry/replay budget for every provider route (overridden per provider or via HYA_PROVIDER_RETRY_*).
agents map<id, AgentPref> {} Per-agent pinned model and reasoning effort, by Agent id whatever bundle provides the Agent.
roles map<name, string | string[]> {} Named model references, role aliases, and ordered failover candidates.
categories map<name, string | string[]> {} Compatibility entries. A role with the same name takes precedence.
bundles BundlesConfig {builtin: {profile: full, enable: [], disable: []}} Selects installed user bundles at startup, including provider bundles.
mcp map<name, McpServer> {} Local stdio and remote HTTP MCP tool servers.
plugins map<id, PluginSpec> {} Process-wide JSON-RPC stdio plugins and project plugin overrides.
tools {code?: {mode?: normal | with_tools | only, judge?: table}} {code: {mode: normal}} Core Code Mode settings.
catalog_scopes {max: usize, idle_ttl_secs: u64} {max: 32, idle_ttl_secs: 1800} Cache size and idle timeout for per-Project bundle/plugin overlays.
context {token_accounting: auto | provider | estimate} {token_accounting: auto} How the kernel measures context-window occupancy: auto trusts a route’s reported usage while it stays plausible, provider always trusts it, estimate always counts locally. Applies whatever bundles are enabled; HYA_TOKEN_ACCOUNTING wins. An unknown value or key fails startup.

bundles.builtin (Selecting installed bundles)

Install bundles with hya bundle install. The official default profile installs 21 bundles. The bundles.builtin configuration controls which installed bundles the runtime loads.

schema_version = 3
[bundles.builtin]
profile = "full" # "full" selects all installed user bundles
enable = [] # Bundle IDs to select on top of profile = "bare"
disable = ["hya/network", "hya/hashline"] # Exclude network tools or fall back to hya-bare file tools
Field Type Default Description
bundles.builtin.profile "full" | "bare" "full" Base installed bundle profile. full selects all installed user bundles; bare starts with an empty selection. Passing --bare on the CLI overrides this to bare with empty enable and skips project bundles.
bundles.builtin.enable string[] [] Installed bundle IDs (publisher/name) to select when profile = "bare" (for example enable = ["hya/loop"]).
bundles.builtin.disable string[] [] Installed bundle IDs to exclude (for example ["hya/network"] for air-gapped environments or ["hya/hashline"] to use standard core file tools).

See Tools and presets for the official bundle IDs. When a selected bundle requires another bundle, select that prerequisite as well.

Session titles. hya/session-title titles every root session once, from its first prompt, when the session’s first model turn starts. It calls the hya-title agent from hya/core-agents and bills the call as purpose: title. A title the user set before the call returns wins. Hya skips the bundle when its prerequisite is unavailable. To keep the default session title, disable the bundle as follows.

[bundles.builtin]
disable = ["hya/session-title"]

agents.<id>

Each agent ID can have an optional model string and optional reasoning effort string. An agent ID applies across built-in and bundle agents. Hya writes saved model pins back to the base file while preserving its comments and formatting.

A model string may name provider/model#effort or @role. A role accepts one model string, one alias, or an array of candidates including aliases. Hya expands aliases in list order, rejects cycles and unknown aliases, and allows up to eight role levels. The first servable candidate is used and later candidates remain available for failover.

[roles]
deep = ["anthropic/claude-opus-4-6#high", "openai/gpt-5"]
review = "@deep"
[agents.hya-main]
model = "@review"
reasoning = "high"
[agents.hya-scout]
model = "openai/gpt-5-mini"
reasoning = "low"

User-local permissions and Project trust

Set permission rules and Project trust in permissions.toml beside the user config.toml. In the base config or a user profile, set permissions_file to choose a different file. Relative paths resolve beside the file that declares them. A nonempty HYA_PERMISSIONS_CONFIG takes precedence. Use permission_preset = "review" in the base config or the active profile to apply the preset in this example. If you selected it in profiles/review.toml, use hya --profile review permissions show --json from the Project directory to inspect the effective policy.

#:schema https://hya.ed-aisys.com/schema/v3/permissions.json
schema_version = 1
default_mode = "default"
deny = ["Read(.env)"]
[presets.review]
default_mode = "plan"
allow = ["Bash(git status)", "Bash(git diff *)"]
[projects."/home/alex/src/app"]
trust = "all"
ask = ["Bash(git push *)"]
Field Type Default and behavior
schema_version u32 Required. Set to 1.
default_mode string "default". See the supported modes.
bypass_ignores_deny boolean false. Only bypass can skip explicit denials when this is true.
allow, ask, deny string[] Empty arrays. Supply Claude Code-style rule strings. Evaluation order is deny, ask, then allow.
additional_directories string[] Empty array. Supply absolute directory paths for external directory access. Missing directories are skipped with a warning.
[presets.<name>] Table Optional named policy with the same mode, bypass, rule, and directory keys. Select it with permission_preset.
[projects."<canonical-path>"] Table Optional policy for a canonical absolute root, with the same keys as a preset plus trust and updated_at.
projects."<canonical-path>".trust "none" | "limited" | "all" Omit for an undecided root. This decision gates repository resources independently of the permission mode.
projects."<canonical-path>".updated_at string Optional RFC 3339 timestamp written when trust changes.

Rule and directory arrays extend the global lists. Scalar overrides apply from the global file to the selected preset to matching Project roots. Among roots that set a mode, Hya picks the earliest mode in this order. dont_ask, strict, plan, default, accept_edits, allow, bypass. If roots set bypass_ignores_deny, every explicit root value must be true for the effective value to be true. The CLI’s --yolo overrides the mode with bypass. A missing permissions file uses defaults. The runtime reloads policy at binding and retains its last valid policy if a file edit is invalid.

provider_retry

The optional [provider_retry] table sets max_attempts (nonnegative integer) and backoff_base_ms and backoff_max_ms (positive integer milliseconds). Per-provider retry fields override it field by field, and the retry environment variables take precedence.

mcp.<server>

Each MCP entry accepts command (string array for stdio), url (string for a remote endpoint), transport (string), env (string map), timeout_ms (nonnegative integer), and enabled (boolean).

[mcp.local-stdio]
command = ["npx", "-y", "@modelcontextprotocol/server-memory"]
env = { API_TOKEN = "{env:MY_TOKEN}" }
timeout_ms = 30000
enabled = true
[mcp.remote-http]
url = "https://mcp.example.com/mcp"
transport = "sse"

tools.code and tools.code.judge

Code Mode runs JavaScript inside Hya so an agent can combine multiple tool calls and return a single result. The Code Mode guide includes a worked tool call.

Field Type Default Behavior
mode String enum "normal" normal leaves Code Mode disabled. with_tools offers code-mode__run alongside the agent’s other tools. only offers code-mode__run as the sole tool and routes other tool calls through scripts.
judge Optional table Omitted Configures the Jev judge used by models.classify.

The [tools.code.judge] table accepts these fields.

Field Type Default Constraints
endpoint String "https://api.typesafe.ai/v1/systemone" Nonblank Jev request URL.
model String "jev-1.14.0" Nonblank Jev model identifier.
api_key String None Nonblank literal credential, {env:VAR} environment reference, or {file:path} file reference.
api_key_file String None Absolute path to the credential file.
timeout_ms Integer 20000 Request timeout in milliseconds, from 1 through 3000000 inclusive.

Set exactly one of api_key and api_key_file when the judge table is present. Hya resolves the credential when the judge is called and requires a nonblank value. Credential files must be regular UTF-8 files no larger than 64 KiB. Hya trims whitespace from file contents. Both tables reject unknown fields.

For example, set JEV_API_KEY in the backend’s environment and add this to config.toml to enable tool composition and use the default judge.

schema_version = 3
[tools.code]
mode = "with_tools"
[tools.code.judge]
api_key = "{env:JEV_API_KEY}"

When the judge table is omitted, Hya looks for legacy judge settings beside config.toml, first in code-mode/config.yml and then in bundles/hya%2Fcode-mode/config.yml. Legacy settings are read-only and log a deprecation warning when loaded. Move the settings into [tools.code.judge] to use the v3 configuration.


plugins.<id>

Use command (array of strings) or plugin_dir (path string for a Claude adapter) to declare a process. A Bun declaration can select the bundled adapter with kind = "bun". Other optional fields are kind (rust, bun, or claude), enabled (boolean, default true for a new process), timeout_ms (integer), and env (table of strings). The config table reaches the child process as a JSON object in HYA_PLUGIN_CONFIG_JSON. A project plugin keeps its manifest command when the base config only provides enabled and/or config for its ID. Omitted enablement preserves the manifest value.

[plugins.analyzer]
enabled = true
[plugins.analyzer.config]
strict = true
max_files = 500

Per-bundle configuration

Put bundle settings under [bundles."<namespace>/<name>"] in the base file. Hya also reads an external TOML table from bundles/<namespace>/<name>.toml beside the base file, or <project>/.hya/bundles/<dir>/config.toml for a project bundle. Both ID segments must be nonempty, use ASCII letters, digits, dots, underscores, or hyphens, and cannot be . or ...

Tables merge recursively. Inline scalar and array values replace external values. Set [bundles."hya/network".webfetch] and enabled = false to override just the external webfetch.enabled value.

Native code receives the merged table as JSON through HostCatalogReader::bundle_config(bundle_id). Bundle subprocesses receive HYA_BUNDLE_CONFIG_FILE, which points to the external file or a private copy of the merged TOML when inline values or interpolation are applied. HYA_BUNDLE_CONFIG_DIR identifies the external file’s directory. Use {env:VAR} or {file:/path/to/secret} as a whole string in bundle settings, MCP environment values, or provider keys. Relative file references resolve from the backend’s working directory. File contents are trimmed.

Built-in Bundle Config Path Keys & Defaults
hya/network ~/.config/hya/bundles/hya/network.toml webfetch: { enabled: true, allow_private_networks: false }, websearch: { enabled: true, provider: exa | parallel, endpoint?, key? }
hya/workspace-files ~/.config/hya/bundles/hya/workspace-files.toml Optional references: map of local paths or Git repositories injected into prompts as <available_references> and auto-approved for ExternalDirectory
hya/coding-extras ~/.config/hya/bundles/hya/coding-extras.toml formatter: false | true | map<name, { command, extensions, environment?, disabled? }>, lsp: true | false | map<name, { command, extensions, disabled?, env?, initialization? }>
hya/compaction ~/.config/hya/bundles/hya/compaction.toml compaction: { keep_recent: 6, summary_max_tokens: 4096 } (summary_max_tokens caps the terminal handoff hya/multi-agent writes; token_accounting moved to config.toml context.token_accounting; leaving it here fails each turn)
hya/goal ~/.config/hya/bundles/hya/goal.toml goal: { evaluator_model?: "provider/model" }
hya/loop ~/.config/hya/bundles/hya/loop.toml loop: { evaluator_model?: "provider/model" } (falls back to hya/goal’s goal.evaluator_model when unset)
hya/multi-agent ~/.config/hya/bundles/hya/multi-agent.toml subagents: { max_concurrency: 100, per_run_budget: 1024, per_team_turn_budget: 1024, per_team_message_budget: 1024 }

Example (~/.config/hya/bundles/hya/network.toml):

[webfetch]
enabled = true
[websearch]
enabled = true
provider = "exa"
key = "{env:EXA_API_KEY}"

TUI configuration and saved state

~/.config/hya/tui.toml controls which UI panels and status bars the TUI draws (version = 2). Run /config init inside Hya to generate a commented template, and /config reload after editing.

The state file is tui-state.json in the state directory. Saved values override TOML field by field, with saved keybindings replacing the whole [keys] table. It stores optional theme, vim, notifications, permissionMode, and keybindings (which accepts null to disable a shortcut), a version-4 paneLayout tree, seenNotices (string array), extensionEnabled and extensionTrusted (bundle ID to boolean maps), and extensionSandbox (required, best-effort, or disabled).

The TOML accepts theme (auto, hya, light, contrast, or ember), boolean vim and notifications, and a nonblank permission_mode string. Each [keys] entry maps a shortcut to a slash command and a scope of workspace or conversation. A [panes."<bundle>#<pane>"] table accepts boolean enabled and preserves additional pane settings. Named [presets.<name>] accept component and pane tables and can use extends with cycle detection and a depth limit of eight. Top-level pane fields win over inherited fields. Component tables include startup, todos, subagents, statusline, composer, sidebar, and commands.

#:schema https://hya.ed-aisys.com/schema/v3/tui.json
version = 2
preset = "statusline"
theme = "ember"
vim = true
notifications = false
permission_mode = "default"
[keys]
F6 = { command = "/layout focus left", scope = "workspace" }
[startup]
enabled = true
resources = "compact" # "compact" | "full"
sections = ["context", "skills", "commands", "mcp", "bundles", "extensions"]
quiet = false # true shows only warnings/errors
[statusline]
enabled = true
placement = "below" # "below" | "band"
segments = ["model", "mode", "cwd", "git", "ctx", "tokens"]
[composer]
style = "box" # "box" | "band"
border_info = [] # e.g. ["model", "mode"] in minimal preset
[composer.paste]
collapse_lines = 10 # Fold pasted text longer than N lines into a chip (0 disables)
collapse_chars = 1000 # Fold pasted text longer than N characters
wrap = true # Wrap chips in <attachment> tags
image_resize = true # Auto-convert/downscale large pasted images
[todos]
enabled = false # Show open todo rows above input in single-column presets
max_rows = 3 # 1..=6
[panes."hya/multi-agent#subagents"]
enabled = false # Dynamic bundle pane contributed by hya/multi-agent
[sidebar]
enabled = false # true enables the tiled workspace layout
[commands]
skill_commands = true # Show /skill:<name> entries in the "/" completion menu

Valid statusline segments

model, mode, ctx, connection, agent, cwd, git, tokens, session. When the terminal window narrows, session, tokens, git, cwd, and agent drop first so model, mode, ctx, and connection always remain visible.

Profiles and registered Projects

Profiles are TOML files in profiles/ beside the active config.toml. Hya automatically selects default, whose file is optional. An explicitly selected non-default profile and its ancestors must exist. The highest precedence selection comes from --profile, then HYA_PROFILE, then profile from the highest applicable Project or user layer. Names use ASCII letters, digits, dots, underscores, or hyphens, excluding . and ... Profiles accept the base config keys, including permissions_file and permission_preset, except schema_version and profile, plus the optional string fields description and extends. Hya rejects inheritance cycles and chains longer than eight profiles.

Save this as profiles/review.toml alongside a profiles/default.toml, then run hya config show --profile review --effective.

#:schema https://hya.ed-aisys.com/schema/v3/profile.json
description = "Use the review role for the main agent"
extends = "default"
[agents.hya-main]
model = "@review"

Hya loads .hya/config.toml and .hya/config.local.toml only from the roots of a registered Project with all trust. A saved none on any root blocks the Project. The layer order, from lowest to highest, is

  1. User config.toml.
  2. Selected profile chain, parent first.
  3. Shared Project config, primary root last.
  4. Local Project config, primary root last.
  5. Supported environment overrides and CLI flags, with flags taking precedence.

Tables merge recursively. Scalars and arrays replace earlier values. External bundle files supply defaults underneath the effective inline bundle table.

Both Project files forbid [permission], [permissions], permissions_file, and permission_preset. User config.toml and profiles also reject the legacy [permission] table. Project files allow only default_model, default_agent, reasoning, profile, roles, categories, agents, mcp, tools, context, bundles, and plugins. A Project-selected profile must exist in the user profile directory. Shared Project config cannot select a profile with a preset that switches to bypass or allow or enables bypass_ignores_deny. Under bundles.builtin, Project config can enable known first-party bundle IDs but cannot set the built-in profile or use a nonempty disable list. Other bundle entries must be tables keyed by bundle ID. Project plugin entries allow only enabled and config for IDs declared in user configuration or a Project plugin manifest.

Runtime scope note: hya config show and hya config validate evaluate the full merged Project layer for a registered Project root. In the live daemon runtime, per-Project scope currently applies project-layered bundles and plugins per registered Project root while process-wide startup settings (default_model, mcp, tools, context, etc.) are resolved from user configuration and active profile layers.

Provider and model declarations (models.toml)

The file beside the base config is the default. HYA_MODELS_CONFIG takes precedence over models_file. A relative models_file resolves beside the base or profile file that declared it.

#:schema https://hya.ed-aisys.com/schema/v3/models.json
schema_version = 1
[catalog]
models_dev = true
refresh_ttl_hours = 24
discover_local = true
[providers.anthropic]
api_key = "{env:ANTHROPIC_API_KEY}"
models = [
"claude-sonnet-4-6",
{ id = "claude-opus-4-6", reasoning = true, limit = { context = 200000, output = 32000 } },
]

schema_version must be 1. Catalog flags are booleans and refresh_ttl_hours is an unsigned integer. The values above are the defaults. See the provider guide for preset endpoints and catalog precedence.

Provider key Contract
kind, base_url, api_key Optional strings. Presets can supply kind and endpoint defaults. A saved credential takes priority over the configured key.
enabled Boolean, default true.
headers String-to-string table.
prompt_cache Boolean override of the route’s prompt caching.
retry Optional integer fields max_attempts, backoff_base_ms, backoff_max_ms. Omitted fields inherit [provider_retry] in the base configuration.
include, exclude Arrays of model ID globs using * and ?.
compat Optional protocol compatibility table described below.
models Array of model ID strings or objects with an id string, or a table keyed by model ID. Quote table keys containing dots or slashes.

Detailed model entries accept name and kind strings, a limit table with positive integer context and output token counts, and reasoning as a boolean or a table with default (string) and variants (string array). modalities.input and modalities.output are string arrays. tools and prompt_cache are booleans. cost specifies numeric input and output prices and optional cache_read and cache_write prices, all in USD per million tokens. A model may declare its own compat table.

The compat fields are reasoning_field (reasoning_content, reasoning, or none), max_tokens_field (max_tokens or max_completion_tokens), boolean require_reasoning_replay, supports_stream_options, and supports_developer_role, and a string map headers.

Schemas and validation

The Draft 2020-12 schemas ship in public/schema/v3/ with canonical IDs https://hya.ed-aisys.com/schema/v3/{config,models,profile,tui,permissions}.json. Use the matching #:schema comment in each TOML file for editor validation. Backend config and model declarations reject unknown fields in their defined tables. Bundle settings and plugin config are extension-owned tables.

Terminal window
hya config schema models --output models.schema.json
hya config validate --profile review
hya config show --effective --profile review

See the CLI reference for command outputs and validation scope.