Works on my machine
Your harness has no lockfile. Rebuilding it means archaeology through dotfiles and shell history.
“New laptop. Which MCP servers did I even have?”
The package manager for agent harnesses
Your agent is more than a model. It's a harness, MCP servers, skills, and config,
hand-tuned on one machine. hlock is the missing harness packaging layer:
harness.lock tracks all of its dependencies, so you can commit it to git and restore it anywhere.
Works with Claude Code, Codex, Pi, OpenCode, Cursor, Gemini CLI and more.
The problem
The setup that makes your agent good is scattered across your home directory, hand-edited, and invisible to git. It lives on exactly one machine: yours.
Your harness has no lockfile. Rebuilding it means archaeology through dotfiles and shell history.
“New laptop. Which MCP servers did I even have?”
The config that makes your agent good can't be reviewed, diffed, or handed to a teammate or a CI runner.
“How is your Claude so good? Can you send me your setup?”
A plugin updates, a model default flips, a settings file gets edited. Nothing tells you.
“It worked yesterday. What changed?”
API keys sit inline next to the config you'd want to version, so none of it gets versioned.
“I can't commit this. There's a token in it.”
The fix
hlock pin reads the harness you already use and writes everything it depends on
into harness.lock: versions, sources, digests. Hand-written skills and config
are vendored next to it in .hlock/, so the pair is self-contained.
# generated by harness-lock. Do not edit by hand.lock-version = 1kind = "pin" [harness]name = "claude-code"version = "2.1.285"source = "brew-cask:claude-code@2.1.285" [[llm]]role = "default"provider = "anthropic"model = "opus" [[tool]]name = "github"kind = "mcp"source = "npm:@modelcontextprotocol/server-github"[tool.env]GITHUB_TOKEN = "${HLOCK_SECRET_GITHUB_GITHUB_TOKEN}" [[skill]]name = "review-pr"origin = "local"digest = "sha256:15754ae3867d…74df9e" [[config]]path = "~/.claude.json"restore = "pointers"pointers = ["/mcpServers"]digest = "sha256:b33482f12e0f…ad94cb92"
Familiar by design
If you've used uv, cargo, or npm, you already know the shape of hlock.
uv.lock · Cargo.lockharness.lock
Every dependency of your harness, pinned and hashed.
pip freezehlock pin
Record the setup you already have. Re-pin as it grows.
--lockedhlock check
Show exactly what changed since the pin.
uv sync · npm cihlock sync
Rehydrate the locked setup on any machine.
uv runhlock launch
Start a session on the locked setup, isolated from your config.
Bring your own harness
The workflow
Safe to commit
pin never writes a secret. API keys, tokens, auth headers, and
credential-looking values become HLOCK_SECRET_* placeholders.
You supply the values when you sync, and a real secret is never replaced with a placeholder.
"github": {
"command": "npx",
"env": {
"GITHUB_TOKEN": "ghp_8kQx2LmZ0vYt…""${HLOCK_SECRET_GITHUB_GITHUB_TOKEN}"
}
}
HLOCK_SECRET_* when syncing
Rehydrate anywhere
hlock sync builds a plan: what's already satisfied, what it does for you, and the exact command for anything it can't.
Clone the repo, sync, set your secrets. Your config, skills, and plugins land where the harness expects them.
$ git clone …/my-app && cd my-app $ hlock sync --install
Like a virtualenv for your harness. Materialize the lock into its own config root and leave yours untouched.
$ hlock sync --prefix .hlock/env ✓ in sync at .hlock/env/claude-code/config
Write a Docker build context with the restored config baked into the image's home. Ship your agent to CI or a cluster.
$ hlock sync --docker ✓ wrote .hlock/docker/pi/Dockerfile
Some steps need a human, like installing an app or setting a secret. hlock sync --skill writes an Agent Skill from the plan, so any agent can finish the job for you.
Go local
hlock localize turns any lock into an equivalent on an open-source harness and
models served by Ollama or LM Studio. Like cross-compiling: your MCP servers, skills, and
instructions come along, and nothing leaves your machine.
hlock localize guide
- harness claude-code + harness opencode - llm anthropic:opus + llm ollama:gemma3:12b tool mcp · github tool mcp · linear skill review-pr config AGENTS.md
Lock without lock-in
Every week there's a fresh harness — or a proprietary model gated behind one — and it
starts to out-shine yours. But your setup won't move. hlock migrate moves
the whole thing in one command: skills, MCP servers, and prompts rewritten to where the
new harness reads them, models mapped to a provider it supports.
CLAUDE.md → AGENTS.md)hlock migrate guide
$ hlock migrate --to codex ✓ wrote harness.codex.lock (from harness.lock) ⇄ harness.codex.lock · migrated harness claude-code → codex llm anthropic:opus → openai:gpt-5.5 carried 2 MCP servers · 1 skill · 1 instruction next → hlock sync harness.codex.lock → hlock launch --lock harness.codex.lock
The meta harness
Some jobs need judgment, not a script. hlock meta hands them to an agent, the
meta harness, so you don't have to do them by hand.
$ hlock check # manifest ↔ lock in sync ✓ harness.lock matches harness.toml $ hlock audit --ci ✗ SKILL.md:1:17 U+202E (hidden text) ✓ 0 executables to approve · policy ok $ hlock launch ▶ Claude Code in docker (network open) --cap-drop=ALL · ~/ and /var/run/docker.sock never mounted
Trust & containment
A lock you pull from someone else is a program you're about to run. hlock
checks what a lock would place before you run it, then runs the agent where it can't
touch the rest of your machine.
Then make it better
Once your setup is reproducible, you can measure it. Every lock hlock resolves records its success rate, cost, and latency on your own tasks.
hlock resolve
like uv lock
Draft an eval pack from the sessions your agent already logged, list the models and harnesses to try in harness.toml, and lock the winner with its evidence.
hlock resolve guide
hlock tune
like PGO
Go past model choice into prompts, hyperparameters, and fine-tuned small models, on your evals. Run locally, on a devbox, or lift trials to a Flyte cluster for GPUs.
$ hlock tune --backend cluster --depth ft
Read the hlock tune guide
hlock upgrade
like uv --upgrade
New models and components come out all the time. hlock upgrade tells you which locked pieces have newer versions, re-measures the stack on your evals, and keeps the previous lock so you can roll back. If the success rate drops, it rolls back on its own.
$ hlock upgrade --all --apply ✓ planner qwen-7b → qwen-32bRead the
hlock upgrade guide
hlock cloud · early access
hlock cloud can auto-tune your harness on your logged sessions and open a PR with the better lock.
$ pip install hlock $ hlock pin # lock your current setup into harness.lock $ git add harness.lock .hlock/ # version it (secrets are placeholders) $ hlock check # see what changed since the pin $ hlock sync # on another machine: rehydrate it $ hlock launch # start a session on the locked setup