Harness profiles¶
A profile is a TOML file that describes one harness or one local inference runtime. hlock's harness-aware commands read profiles instead of hard-coding each harness, so supporting a new harness, or fixing a path for an existing one, means editing a file.
What reads which fields
Profiles drive detection, versions and install sources, hlock harness show, targeting,
hlock pin (model, providers, mcp, skills, bundles, instructions,
files), hlock sync (install, files, skills.write, config-root), and
hlock launch (launch, mcp.write, mcp.shape, instructions, and run
for code harnesses), hlock run (launch.prompt), and
hlock localize (open-source, local-models,
local-provider, and runtime catalogs).
Where profiles come from¶
Built-in profiles ship with hlock (source:
crates/harness-lock-core/profiles).
hlock then reads these directories, lowest precedence first:
~/.config/hlock/profiles/- each directory in
HLOCK_PROFILE_PATH(:-separated) ./.hlock/profiles/
Each directory holds harnesses/*.toml and runtimes/*.toml (and
model tables, models/*.toml). A profile with the same id
as an earlier one replaces it, so you can override a built-in. hlock harness show <name>
prints where the active profile came from.
./.hlock/profiles/ comes with the repository you're in, so hlock trusts it less, since
hlock check runs each profile's binaries to read their versions. A profile there:
- can add a new
id, but can't replace a built-in or one from the directories above it (hlock skips it; override a built-in in~/.config/hlock/profiles/instead); - names its
binariesandrun.pythonas programs onPATH; an entry with a/or\is ignored; - probes its version only with a version flag (
--version,-version,-V,-vorversion); otherversion.argsare ignored.
A harness profile¶
id = "my-agent"
name = "My Agent"
kind = "cli" # cli | app | framework | custom
aliases = ["myagent"]
binaries = ["my-agent"]
version = { args = ["--version"] }
active-env = ["MY_AGENT_SESSION"] # set by the harness in the processes it spawns
config-root = { env = "MY_AGENT_HOME", default = "~/.my-agent" }
instructions = ["AGENTS.md", "{root}/AGENTS.md"]
[[install]]
method = "npm" # npm | brew | brew-cask | pip | uv-tool | script | app | manual
package = "my-agent"
[[install]]
method = "script"
command = "curl -fsSL https://example.com/install.sh | bash"
path-hints = ["/.my-agent/bin/"] # identifies this method from the binary's real path
[files.settings]
path = "{root}/settings.json"
format = "json" # json | jsonc | json5 | toml | yaml
restore = "whole" # whole | pointers | record
[model]
default = ["env:MY_AGENT_MODEL", "settings#/model"]
provider = ["settings#/provider"]
[mcp]
sources = ["settings#/mcpServers"]
write = "settings#/mcpServers"
[skills]
dirs = ["{root}/skills", ".my-agent/skills"]
write = "{root}/skills"
[launch]
model-flag = "--model"
prompt = ["run", "{prompt}"] # one prompt, non-interactively: `hlock run`
Paths¶
~ is your home directory, {root} is the config root, and {app-config} is the OS's
application config directory (see Desktop apps). A relative path is relative to
the project (the current directory). config-root.env is the variable that relocates the
root; when it names a parent directory (like XDG_CONFIG_HOME), add
suffix = "<subdir>". A file that lives outside the root by default but inside it when the
root is relocated (Claude Code's ~/.claude.json) sets isolated = "{root}/…".
Sources¶
model, mcp and providers take ordered lists of sources, and the first one that has a
value wins:
env:VARreads an environment variable.<file>#<pointer>reads a value from a named file in[files], where<pointer>is a JSON pointer, applied to TOML and YAML files as if they were JSON.{cwd}inside a pointer is replaced with the escaped project path (Claude Code keeps per-project MCP servers under/projects/{cwd}/mcpServers).
Set model.format = "provider/model" when the model value carries its provider (OpenCode's
anthropic/claude-sonnet-4-5), or model.default-provider when the harness only talks to one.
An MCP source is a map of servers by name, or a list of servers that each have a name
key (ZeroClaw's [[mcp.servers]]). launch writes servers as a map, so a harness that
keeps a list leaves out mcp.write.
Config formats¶
format is json, jsonc (JSON with comments and trailing commas), json5 (also
unquoted keys, single-quoted strings and hex numbers, as in OpenClaw's openclaw.json),
toml or yaml. hlock writes jsonc and json5 files back as plain JSON, which both
formats accept, so comments don't survive a sync or launch.
Autonomous agents¶
Set autonomous = true on a cli profile for an agent that runs on its own, as a gateway
with chat channels, schedules and memory, rather than in a session a person drives. Every
command treats it as an agent CLI. Only hlock harness list and the
Supported harnesses page group it apart, and
hlock harness show labels it.
List only the workspace files you author in instructions, such as SOUL.md and
AGENTS.md. If the profile lists files the agent writes as it runs, such as MEMORY.md or
daily notes, hlock check reports drift after every conversation, and hlock sync
overwrites the agent's memory.
Desktop apps¶
Set kind = "app" for a desktop app a person starts, such as Claude Desktop or VS Code.
hlock pins and restores its config but never runs it: launch, run, resolve and tune
refuse it, and sync writes its config only with --apps (see
Desktop apps). The [app] table says how to find it:
id = "claude-desktop"
name = "Claude Desktop"
kind = "app"
config-root = { default = "{app-config}/Claude" }
[app]
bundles = ["Claude.app"] # macOS: looked for in /Applications and ~/Applications
paths.windows = ["~/AppData/Local/AnthropicClaude/claude.exe"] # more places, per OS
process = "Claude" # its process name, for quit-to-write
quit-to-write = true # don't write its config while it runs
reload = "restart" # restart | auto: how it picks up a change
[[install]]
method = "brew-cask"
package = "claude"
[[install]]
method = "app" # a download: always a manual step
path-hints = ["/Claude.app"]
command = "Download Claude Desktop from https://claude.ai/download"
[mcp]
sources = ["config#/mcpServers"]
write = "config#/mcpServers"
transports = ["stdio"] # what its MCP config can hold (default: any)
[[unmanaged]] # setup outside any file hlock restores
what = "Connectors (remote MCP servers)"
where = "your claude.ai account"
url = "https://claude.ai/settings/connectors"
hlock reads the version from the bundle's Info.plist on macOS, else from binaries on
PATH with version.args. List only CLI shims there (code), never the app's own
executable: probing runs it, and a GUI app would open. {app-config} is the OS's
application config directory: ~/Library/Application Support on macOS, %APPDATA% on
Windows, and $XDG_CONFIG_HOME or ~/.config elsewhere. A bundle's path has no trailing
slash, so an app method's path-hints entry is "/Claude.app".
A project profile (.hlock/profiles/) may declare [app], but its bundles must be plain
names ending in .app, process a plain name, and its paths are ignored.
Restore policies¶
restore says what a file contributes to a locked setup: whole (the whole file),
pointers (only the subtrees listed in pointers, for files that also hold unrelated state),
or record (a digest only, for project files that are already in git).
Environment references¶
env-ref says how the harness reads an environment variable inside a file, with {name}
standing for the variable: "${{name}}" for Claude Code's ~/.claude.json, and
"{env:{name}}" for OpenCode's opencode.json. With it, hlock launch writes a
secret as ${HLOCK_SECRET_…} (or {env:HLOCK_SECRET_…}) and passes the value in the
harness's environment, instead of writing the value into the file. Set it only when the
harness expands references everywhere hlock writes secrets in that file. See
Secrets.
Field reference¶
| Field | Meaning |
|---|---|
id, name, aliases |
Identity; any alias works wherever a harness name does |
kind |
cli, app, framework, or custom (default: cli, or custom with run) |
app |
Desktop apps: bundles, paths.<os>, process, quit-to-write, reload; see Desktop apps |
unmanaged |
Setup kept outside any file hlock restores, which sync and hlock harness show name: a list of { what, where, url } |
autonomous |
true for a cli harness that runs as a long-lived gateway (OpenClaw, nanobot, …); see Autonomous agents |
support |
full or basic (default basic) |
vendor, homepage |
Informational |
binaries |
Names to look up on PATH, in order |
version.args |
Arguments that print the version; the first dotted number is used |
active-env |
Variables whose presence means hlock runs inside this harness |
config-root |
env, suffix, default |
install |
Install methods, most preferred first: method, package, command, path-hints. An app method is a download, with command as the hint. brew/brew-cask are macOS and winget/scoop/choco are Windows; when a lock recorded one of those and hlock syncs on another OS, it falls back to this list's method that runs there (see sync) |
files.<id> |
path, isolated, format, restore, pointers, env-ref |
model |
default, small, provider, base-url sources; format; default-provider |
providers |
source, plus pointers into each provider for base-url and models |
mcp |
sources, write, shape (standard, opencode, codex, goose, openclaw, nanobot, vscode, zed, devin, antigravity): how servers are written; transports: the ones its config can hold (stdio, http, sse; default all) |
skills |
dirs, write, builtin-dirs, builtin-manifest |
bundles |
Plugins/packages: kind, extractor (claude-plugins, pi-packages, npm-list), source, lockfile |
instructions |
Instruction files the harness reads |
rules |
A project directory the harness reads every instruction file in, and the extension one needs there: { dir = ".claude/rules", ext = ".md" }. Where hlock add instructions installs a file; without it, a declared instruction file becomes the harness's own project instruction file |
subagents |
Where the harness reads subagent definitions, one file each: dirs, ext, write (where a new one goes), and frontmatter, lines a file needs to be loaded, which migrate adds (OpenCode: ["mode: subagent"]) |
middleware |
Code the harness loads into its tool loop: dirs and ext (OpenCode plugin files), or files (Codex's .codex/hooks.json); format, which migrate matches; write; skip, file names hlock owns there |
launch |
args, model-flag; prompt: the arguments that run one prompt non-interactively, with {prompt} replaced (hlock run, and hlock meta run --headless); interactive: the arguments that start a session with {prompt} as its first message (hlock meta run) |
api-keys |
API providers the harness talks to, and the variable each reads its key from: [{ provider = "anthropic", env = "ANTHROPIC_API_KEY" }] |
api-provider |
How hlock meta sets an API provider and model: a list of { file, set } like local-provider, with {provider} and {model} substituted |
open-source, local-models |
Used by hlock localize to choose local-capable harnesses |
local-provider |
How localize points the harness at a local endpoint: a list of { file, set, runtimes }, where set maps JSON pointers to values; {provider}, {model}, {base_url} and {host} are substituted. An entry with runtimes applies only to those runtimes; entries apply in order, so one for ["ollama"] after a generic one overrides it (OpenClaw uses Ollama's native API this way) |
packages |
Packages to pin for code harnesses, e.g. pypi:pydantic-ai |
framework |
For custom harnesses: a framework profile to inherit packages from |
run |
For code harnesses: entrypoint, command, python, env |
deciders.<use> |
How a decision model for approve, stop, route or tool reaches the harness. hook = { file, events, format, pointer }: hooks merged into the profile file file, under pointer (default /hooks). hook = { path, events, format }: a file at path instead, merged into (cursor) or written whole and owned by hlock (copilot, and the plugin formats amp, opencode, pi). Formats: claude-code, codex, gemini, cursor, copilot, amp, opencode, pi. native = { file, pointer, provider-key, model-key, base-url-key }: a setting of the harness's own that pin records |
decider-env |
Frameworks: pairs of variables their own decision-model support reads a System One endpoint and key from, e.g. [["SYSTEM_ONE_BASE_URL", "SYSTEM_ONE_API_KEY"]] |
A runtime profile¶
id = "my-runtime"
name = "My Runtime"
binaries = ["myrt"]
version = { args = ["--version"] }
ports = [9000] # recognizes a provider base URL like http://localhost:9000/v1
provider-names = ["myrt"] # provider names harness configs use for it
pull = "myrt pull {model}"
serve = "myrt serve"
[models]
layout = "hf-cache" # ollama | publisher-repo | hf-cache
dirs = ["env:MYRT_MODELS", "~/.myrt/models"]
[[install]]
method = "brew"
package = "myrt"
[[catalog]] # models `hlock localize` may pick
id = "my-coder:30b"
params-b = 30
min-memory-gb = 24 # weights plus a working context
tier = 3 # 3 strong agentic coder, 2 capable, 1 small/fast
tools = true # reliable tool calling
roles = [] # e.g. ["small", "decision"]; empty means any
# "decider": a decision model, never picked as a chat model
Model parameters¶
Some models reject request parameters hlock would otherwise send: Claude Fable 5.2 and
Claude Mythos 5.2 return a 400 for a request that sets temperature, top_p or top_k
(see Anthropic's Fable 5.2 migration guide).
A model table lists them. The worker leaves a rejected parameter out of the request, and
hlock tune doesn't sweep it.
The built-in tables are in
crates/harness-lock-core/profiles/models.
Add your own as models/*.toml in a profile directory:
[[model]]
ids = ["acme-coder-2"] # matched in any spelling of the model's id
rejects = ["temperature"] # request parameters it rejects
why = "the API returns a 400 when a request sets it" # shown by `hlock tune`
source = "https://example.com/acme-coder-2" # optional: where it's documented
An id matches wherever it appears whole in the model's id, ignoring case and treating .
as -: claude-fable-5-2 matches anthropic:claude-fable-5-2,
openrouter:anthropic/claude-fable-5.2, a dated claude-fable-5-2-20261001 and a Bedrock
us.anthropic.claude-fable-5-2-v1:0, but not claude-fable-5-20.
A file replaces the table of the same name (models/anthropic.toml replaces the built-in
Anthropic table), except in ./.hlock/profiles/, which may only add tables.
Project harnesses¶
Agents you write yourself don't need a profile file: declare them under
[harnesses.<id>] in harness.toml (see Harnesses).
They accept every harness-profile field, plus entrypoint, command, python and env at
the top level of the table.
If you write a profile for a harness others use, please contribute it; see Add a harness.