diegopetrucci/the-last-harness
About
The last harness you'll ever need.
Developer ToolsMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- +1
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalThe last harness you'll ever need.
tlh (The Last Harness) is an opinionated harness built on top of Pi.
Two core ideas drive it:
- "you can outsource your thinking, but not your understanding": LLMs can, and should, provide options, help out with discovery and exploration, filling the gaps in your understanding and technical knowledge — they should not, however, be used as a replacement for understanding. Beware of cognitive debt.
- you should not be babysitting your agents: if you need to manually call tools, run commands, and so on, the harness has failed you.
It achieves this via a custom orchestration workflow — you only interface with an architect, whom you engage as a senior peer, and once you're satisfied with the discussion and plan, it takes over until everything is done. Work is pre-reviewed too, often multiple times, so that your time is not wasted in minutiae, freeing you to focus on the bigger picture.
You're also not asked to manually run commands, manage context, or anything like that. This is built-in and done for you. Every further action that you take is because you want to take it, not because you have to. You should not be finding yourself thinking eg "oh, I forgot to trigger a review". Your time is worth more.
tlh is also slow by default, and relatively token-expensive: it is designed to be used as a long-running, reliable, and predictable tool. You spend time preparing the work, and once it's off, it's off. No babysitting.
If this resonates with you, welcome aboard:
curl -fsSL https://github.com/diegopetrucci/the-last-harness/releases/latest/download/install.sh | bash -s --
The official release installer verifies SHA-256 checksums for every successfully fetched remote stage-0 support file before running stage 1. Raw source, mutable/custom refs, and local checkouts remain supported but are not release-integrity verified; see the install and recovery notes.
Workflows
tlh has a few primary workflows/personas: architect, rush, product, bug-hunter. Each of them has different purpose, encoded with a different system prompt, available tools, and subagents. You can switch between primary agents at any time by pressing shift + tab — but I would suggest to try not to cross-contaminate the same session (start new ones!).
The architect

As a software engineer, you will likely spend most of your time with the architect primary agent. In the default workflow, the architect does not do any change directly; its purpose is to help you investigate, find issues, plan the work, and so on. It is banned from making (bigger) direct changes, and it will always propose to encode the plan/work into smaller tickets. The opt-in ticket-free Architect/no-developer workflow is documented in Ticket-free Architect mode.
At times, the architect might seem eager to ask you to approve the plan. Do not feel afraid to push back and continue exploring and understanding the stakes. This is your work, own it, and explore all possibilities. Also feel free to start new sessions, and treat existing ones as throwaways to get a better idea of what's going on. Rarely one is able to come up with the shape of work on the first try.
The architect has access to a few subagents, which can be divided in three big categories:
- Single-purpose, automatically-invoked ones to keep its context smaller: the librarian to check git repos, web-scout for the internet, etc.
- Core: as the agent does not write code, 1+ developer(s) are tasked to. The reviewer works the same way, so reviews happen automatically rather than requiring a manual command.
- Second opinions: the oracle, and the contrarian. Both ship by default, but invoking them is optional: the architect might suggest using them, and it will always be up to you whether to actually run them.
Notably, the oracle, contrarian, and reviewer try to run on a different provider than your session, so the second opinion is actually independent. The exact fallback order lives in docs/models.md.
Again, the core idea: explore and plan with the architect. Double check with the oracle/contrarian. Go back and forth. This is where you, as a human, are required. Once happy, the implementation follows, until ready for your review.
A few quick-fire tips to get the most of the architect:
- If the planned work is too big, ask the architect to delegate even just one tk ticket at a time to the developer. Final-validation tickets go to the execution-only test-runner, which can run exact shell and generic MCP steps. You don't need to go all the way at all times.
- The architect labels an unnamed session once it has created your tickets, so sessions are easy to spot in
/resumeand/session. It never renames a session that already has a name, and/namealways overrides it. /annotate-last-messageopens a simple native window where you can write comments to specific parts of the architect's last message/treelets you go back and forth in the conversation tree. It's similar to Claude Code's/btw, but much, much more powerful. I often use it to explore smaller parts of the conversation, and after having done so, I return to the last "clean" message to clear up context (you can do so with or without generated summaries of your nested conversation)./annotate-git-diff: similar to/annotate-last-message, but for git diffs (even tickets!)./merge-origin-main-into-this-branch: merges theorigin/mainbranch into the current branch./rebase-this-branch-onto-origin-main: rebases the current branch ontoorigin/main.
Product, rush, bug-hunter
These are smaller, laser-focused primary agents. I especially recommend rush for quicker fixes that the architect's workflow would be overkill for. product handles framing, tradeoffs, strategy, and ticket shaping — it doesn't write code. bug-hunter is read-only: reach for it when you want root cause before you've decided how to fix something.
Optional iPhone companion
The session-mirror-observer experimental feature is off by default; nothing enables it on install. When you turn it on with /experimental, new sessions can mirror bounded TLH session state to a paired iPhone companion. Full behavior and limits are in the command reference.
TLH never automatically installs or pairs the companion, edits the normal profile, stores a second transcript, or promises background/network behavior. This is an experimental source and deterministic-test boundary, not a claim of fresh physical-device proof; see the command reference and companion roadmap for limits and reported evidence.
Everything else
Subagents
Subagent orchestration is first-party TLH functionality: the runtime, prompts, and supervision ship in the root package, so there's no separate subagent package to install or pin. Every bundled subagent starts a fresh child session, isolated from the primary agent and from each other, and gets only its task plus explicitly configured instructions. Which roles exist, how dispatch works, what's not supported (like caller-supplied timeoutMs), and how status, artifacts, and context diagnostics behave all live in docs/subagents.md. The imported test suites run in CI but are not published.
Every child instance has a bounded run-time budget per role, owned by the role definition rather than by the model. The actual numbers live in code, so go to docs/subagents.md if you want to see how ceilings and overrides work.
You can also add project custom subagents, but only from an exact file at the Git root's .tlh/agents/custom/ and only after you've persistently /trusted the project. The full rules (and what generic discovery no longer picks up) are in docs/custom-subagents.md.
TLH no longer reads project-local .tlh/defaults.json; model and effort overrides for bundled roles are described in docs/models.md.
The full roster of bundled primaries and minors is in docs/subagents.md.
Direct model providers
TLH treats Anthropic, OpenAI Codex, and xAI as first-class direct providers. Bundled per-role model defaults are listed in docs/models.md. For xAI subscription access, use /login xai when available; OpenAI defaults intentionally use openai-codex for the Codex subscription provider. If you've got both a /login credential and an env key for Anthropic or xAI, the credential wins; the details are in docs/models.md.
Footer status
The footer refreshes local Git status on a short timer. Eligible non-default branches refresh GitHub pull-request metadata on a slower interval (both owned by extensions/the-last-harness/footer-git-cache.ts); the next refresh after a branch or directory change bypasses that interval. Default branches are skipped, and local upstream tracking is not required. Cached PR data remains visible while a transient lookup fails and is retried on the same cadence.
Bundled skills
- Show me.
- Merge risk.
- Herdr TUI.
- Herdr desktop app.
- Cmux.
- Tmux.
- Ghostty.
- bb.
Customisation
You can add your own skills, prompts, extensions, and packages to TLH.
User-level:
~/.the-last-harness/agent/skills/~/.the-last-harness/agent/prompts/~/.the-last-harness/agent/extensions/(or viatlh install github-user/repo)~/.claude/skills/— TLH also discovers skills from the Anthropic Claude Code user directory
Repo settings:
.pi/skills/.pi/prompts/.pi/extensions/.claude/skills/— project-level Claude Code skills directory; on the primary agent, project trust must be granted before this root is read (see/trust).tlh/agents/custom/<UPPERCASE-SLUG>.md— direct, Git-root-only project custom-agent definitions; see Project custom subagents for the exact contract and persisted-trust requirement.
After adding built-in append files, installing a package, or saving project trust, run /reload in TLH (or restart it) so those resources are picked up. Project custom-agent changes become active in a new snapshot after /reload or a new session.
Per-agent project guidance
To give project-specific instructions to one packaged TLH role, add a plain Markdown prompt append at .tlh/agents/builtin/<ROLE>_PROMPT_APPEND.md, with <ROLE> the uppercase role name (e.g. ARCHITECT_PROMPT_APPEND.md, BUG-HUNTER_PROMPT_APPEND.md). The exact filename for every role is in the table in docs/custom-subagents.md.
For each role, TLH starts at the current working directory and searches upward through the enclosing Git worktree; outside a Git worktree it checks only the current directory. Discovery is exact and non-recursive within each .tlh/agents/builtin/ directory. The nearest exact match wins. A nearer blank, invalid, or unsafe match does not fall through to a farther same-role file. Only the matching role's append is added to that packaged role's prompt. Legacy .tlh/<ROLE>.md paths are no longer read and have no fallback. Files are append-only plain Markdown: they do not replace the packaged prompt, and they do not support YAML frontmatter or model, tool, or other agent configuration. Project custom embedded agents use the separate exact-root contract in docs/custom-subagents.md, not this convention.
Example:
mkdir -p .tlh/agents/builtin
cat > .tlh/agents/builtin/ARCHITECT_PROMPT_APPEND.md <<'EOF'
Before proposing implementation work, state the important assumptions and risks.
EOF
.tlh/agents/builtin/ is not classified as a trust-requiring resource by the upstream runtime, but the persisted trust entry must contain the selected append source before TLH reads it. In TLH, run /trust, choose a persistent Trust option (not a session-only option), and save the decision. For a worktree-root append, run /trust while TLH is at that worktree root and persist the Trust decision there; trust saved only for a nested cwd does not authorize ancestor/worktree-root .tlh/agents/builtin/ files. Then run /reload or restart. Primary-agent appends are snapshotted at session start: edits and newly saved trust take effect for the primary only after that boundary, while switching primary roles selects the corresponding file from the same snapshot. Minor-agent appends are resolved when each child process starts, including awaited, parallel, async, and any resume/revival that launches a new child process. A live async resume/steer that continues the same child process keeps its session-start append snapshot; a resume/revival that starts a new child process rereads the current .tlh/agents/builtin/<ROLE>_PROMPT_APPEND.md append.
TLH refuses to read a symlinked .tlh, .tlh/agents, or .tlh/agents/builtin directory or prompt-append file, a non-regular file, or a file over the size limit (MAX_PROJECT_AGENT_FILE_BYTES in extensions/subagents/src/agents/project-agent-loader.ts). It fails closed rather than following a symlink, truncating content, or throwing; diagnostics for rejected files are internal and are not guaranteed to be user-visible. Recognized trusted files appear in the expanded startup header under Project guidance; rejected files do not appear in startup resources. If prompt appends are found without persisted trust, startup shows an actionable /trust plus /reload or restart warning without exposing their contents.
To undo the example, remove .tlh/agents/builtin/ARCHITECT_PROMPT_APPEND.md and run /reload or restart; new child launches and resume/revival actions that start a new child process stop using it, while a live async resume/steer that continues an existing child keeps its session-start snapshot. If an ancestor contains another ARCHITECT_PROMPT_APPEND.md, it becomes the nearest match, so remove that file too if you want no architect append (or leave an empty nearest file to explicitly shadow farther guidance).
This is separate from the upstream global/project APPEND_SYSTEM.md mechanism: the global file in the active isolated profile (by default ~/.the-last-harness/agent/APPEND_SYSTEM.md) and project .pi/APPEND_SYSTEM.md append general system instructions, not role-specific guidance. .tlh/agents/builtin/<ROLE>_PROMPT_APPEND.md only adds content to its matching packaged role and does not replace or reconfigure that system prompt.
Docs dump
- Slash commands reference:
docs/commands.md - First-party subagent dispatch, supervision, migration, and undo steps:
docs/subagents.md - Project custom subagents — exact Git-root layout, persisted trust, and migration/undo rules
- TLH model defaults, thinking levels, and provider selection:
docs/models.md - Install, update, uninstall, paths, undo steps, and the Herdr.app entry opt-out:
docs/install.md - Common failure recovery and conservative troubleshooting:
docs/troubleshooting.md - Gnosis,
tk, and TLH workflow integrations:docs/integrations.md - Opt-in terminal program resume (
TLH_PROGRAM_RESUME=1):docs/integrations.md - Web search setup, privacy, and opt-out:
docs/web-search.md - MCP usage, guarded migration, and rollback:
docs/mcp.md - Launch telemetry and opt-out:
docs/telemetry.md - Git commit attribution footer, setting, and toggle flow:
docs/git-attribution.md - Local testing and development:
docs/local-development.md - Release notes:
CHANGELOG.md - Maintainer release process:
docs/releasing.md - Third-party attributions:
licenses/.
Explore related projects
Loading…