Skip to content

Building Your Own
Open Harness

Rent the intelligence. Own the input and the memory. One thesis, six core concepts and a starter kit for a multi-device Home Repo and shared Agents Vault. 00 · The Open Harness Thesis ¬

If you don't own your harness, you don't own your memory

In The Harness, we split an agent into a hot-swappable model plus the software around it that manages instructions, tools and context. That separation only pays off if you own the harness.

When a model provider hosts the harness and long-term memory behind its API, you have zero visibility and zero portability when a better model arrives. Even a closed AI coding app running locally locks session history inside one vendor's private format. Building your own open harness pulls all four layers onto your own filesystem so the model API stays strictly stateless and hot-swappable.

Where does your memory live?

YOUR OPEN HARNESS · OWNED & VERSIONEDShort-term continuityAgents Vault · Sessions/Handoffs/Long-term memoryObsidian Vaults · QMD · glossary & ADRsTools & proceduresskills/ · ~/.local/bin/b · MCPsSteering prompt~/Repos/home/AGENTS.md (157 lines)MODEL PROVIDER API (STATELESS)LLM · Hot-SwappableClaude · Codex · Gemini · Open-weightNo trapped memory.No vendor lock-in.Pay only for tokens called.RESULT: YOU OWN THE HARNESS · YOU OWN THE MEMORY

3. Your Open Harness (Target): Prompt, tools, long-term knowledge and short-term handoff continuity all live in plain Git and Obsidian files you control. Every SDK connects to the same setup while models stay 100% swappable.

Switch models above to trace how ownership moves from vendor lock-in onto your own filesystemFigure 00 · Interactive
DimensionClosed harnessOpen harness
Who controls the codeThe vendorYou (versioned in Git)
Where memory livesBehind an API or private app silosPlain local Markdown vaults you own
Run on your own infraUsually noYes, across desktop, laptop and cloud server (VPS)
Model lock-inTied to one vendor's modelsBring any model or AI coding app
When it breaks at 2amFile a ticket and waitRead the file, patch it, commit it
What you pay forThe runtime and everything bolted onOnly the models you call

Git & Home Repo

01
(About)

Git is a version-control tool that records every edit you make to a folder of files as a saved checkpoint you can inspect or undo. GitHub is the default online home for storing that repository so your laptop, desktop, cloud server and teammates always pull the same clean version (see Using GitHub).

Matt Pocock calls the central folder for your AI setup a Home Repo (for example ~/Repos/home). Plain local settings folders break down the moment you work across multiple devices or alongside colleagues. Putting your shared rules, skills and app templates in GitHub adds diffs, pull requests, automated checks and safe fast-forward pulls (--ff-only) that never overwrite unsaved local work.

Local dot-folders versus Git and GitHub

Old · Local dot-folders

Silent multi-device drift

Edit ~/.claude on desktop and your laptop and server immediately fall out of sync. Zero diff, zero rollback.

New · Git + GitHub

One versioned anchor

Commit once to origin/main, then run b sync --ff-only across desktop, laptop and VPS without clobbering local work.

Safety · CI & Undo

Reversible engineering

Pre-commit hooks and GitHub Actions check templates and symlinks on every push. Roll back any bad rule in one command.

$ b sync --check            # Desktop, laptop and Linux VPS
home/       main == origin/main (clean, --ff-only)
Templates:  7/7 portable client templates verified
Symlinks:   171/171 OK · 77 ms
Git & GitHub give agent rules diffs, rollback, CI gates and safe multi-host syncFigure 01.1 · Interactive

Top-level ~/ filesystem contract

1 FOLDER = 1 SYNC CONTRACT
~/
|-- Repos/                        # All Git checkouts (synced via GitHub)
|   |-- home/                     # Home Repo (AGENTS.md, skills, harness, docs)
|   |-- <site-or-app>/            # Sibling codebases & websites
|   `-- tools/                    # Personal desktop automation
|-- Obsidian/                     # Live Markdown vaults (Obsidian Sync + QMD)
|   |-- Core/                     # Durable human essays & notes (human root)
|   |-- Projects/                 # Dedicated isolated project vaults
|   `-- Agents/                   # Shared cross-SDK session memory (14-day TTL)
`-- Scratch/YYYY-MM-DD/           # Local only · never synced or committed
Deleting legacy compatibility symlinks forces stale paths to fail loudly on first runSpecimen 01.2 · ~/

Example Home Repo layout (~/Repos/home)

Example: 389 MB incl. .git
~/Repos/home/
|-- AGENTS.md                     # Canonical routing brain (157 lines)
|-- CLAUDE.md -> AGENTS.md        # Repo-root symlink for Claude Code
|-- GEMINI.md -> AGENTS.md        # Repo-root symlink for Gemini CLI
|-- skills/                       # Domain-grouped skill families
|   |-- bin/b                     # 130-line unified Python CLI dispatcher
|   `-- scripts/b_sync.py         # Fleet sync & link verifier (~77 ms)
|-- harness/                      # 7 portable client templates + merger
|-- docs/
|   |-- adr/                      # Numbered architecture decision records
|   |-- data-access.md            # Authoritative live sources by host
|   `-- glossary.md               # Canonical terms + Avoid synonyms
|-- .githooks/pre-commit          # Binary (<=1 MiB) & comment ratchets
`-- .github/workflows/validate    # CI checks on every push & pull request
One versioned repository holds every steering rule, skill, template and guardrailSpecimen 01.3 · Home Repo
(Notes)

(1)Local dot-folders fail silently across a desktop, laptop and server. (2)GitHub adds diffs, rollback, pull requests and CI gates before bad rules spread. (3)In a team, the same Git repo lets colleagues review shared skills instead of copying prompts in chat.

AGENTS.md

02
(About)

Most AI setups degrade because people treat their global instruction file like an attic, pasting every preference and workflow into one giant prompt. Language models lose recall long before their context window fills up, so every unnecessary paragraph competes for attention on every turn.

Keep your root ~/Repos/home/AGENTS.md short (under 180 lines; the working example below runs 157 lines, roughly 1,260 words). Loaded at turn one across every AI app, it holds standing rules and acts as a live map pointing to project rules, vaults, tools and deeper docs loaded only when a task needs them.

Line-by-line anatomy of ~/Repos/home/AGENTS.md

CLICK A SECTION
# AGENTS.md · Section 1 (Standing guardrails)
- Match skills first and run Intake before reading extra files.
- Thin-Slice Gate: before any live, public or external write,
  produce one representative example and wait for an explicit go.
- Verify output against completion criteria before reporting done.
Every section in AGENTS.md either states a universal invariant or points to a deeper fileSpecimen 02.1 · 157 lines

Progressive disclosure across the machine

Root stays thin · detail loads on demand
~/Repos/home/AGENTS.md 157 lines · always loaded at turn 1 Repositories AGENTS.md DESIGN.md docs/glossary.md docs/adr/ Trigger: enter repo Agents Vault Sessions/*.md Sessions/Handoffs Ops/ & Audits/ 14-day archive Trigger: every session Skills Library SKILL.md (<100) references/ scripts/ Domain skill dirs Trigger: task match Data & CLI data-access.md ~/.local/bin/b QMD local search Password vault Trigger: on demand
AGENTS.md holds pointers rather than encyclopedias, keeping model recall sharpFigure 02.2 · Fractal Context

SDKs & Symlinks

03
(About)

Every AI coding app stores global instructions and skills inside its own hidden settings folder (called a dot-folder under ~/, such as ~/.claude/, ~/.codex/, ~/.gemini/, ~/.cursor/, ~/.agents/, ~/.config/muse/ or ~/.grok/). Copying rules into one vendor folder guarantees every other app falls out of sync.

A symlink is a live file shortcut. Two symlink layers and a lightweight template merger wire every app back to your single Home Repo without vendor lock-in. Real config files stay real and merge shared preferences only, leaving each machine's local logins, hooks and permissions untouched.

One Home Repo wired to six coding harnesses

CLAUDECODEXANTIGRAVITYCURSORMUSEGROKTWO-LAYER SYMLINK BUS · STEERING + FLAT PER-SKILL LINKS~/Repos/home (Canonical Git Repo)AGENTS.md (157 lines) · skills/ · harness/ (7 templates)

Claude Code: ~/.claude/CLAUDE.md -> ~/Repos/home/AGENTS.md · flat per-skill links · settings.json merged.

Click any harness node or trigger Edit AGENTS.md once to propagate across all six clientsFigure 03.1 · Interactive

Every SDK home dot-directory mapped

Vendor .system/ preserved
~/
|-- .claude/                      # Claude Code
|   |-- CLAUDE.md -> ~/Repos/home/AGENTS.md
|   |-- settings.json             # Merged (keeps local permissions)
|   `-- skills/<skill> -> ~/Repos/home/skills/<family>/<skill>
|-- .codex/                       # OpenAI Codex
|   |-- AGENTS.md -> ~/Repos/home/AGENTS.md
|   |-- config.toml               # Merged (keeps local trust & auth)
|   `-- skills/.system/           # Built-in vendor skills (untouched)
|-- .agents/skills/               # Shared flat links: Codex, Antigravity, Muse
|-- .gemini/                      # Gemini CLI & Antigravity
|   |-- GEMINI.md -> ~/Repos/home/AGENTS.md
|   |-- AGENTS.md -> ~/Repos/home/AGENTS.md
|   `-- antigravity-cli/          # Merged (keeps local workspaces)
|-- .cursor/skills/               # Cursor IDE (flat per-skill links)
|-- .config/muse/settings.json    # Muse Code (merged; keeps local hooks)
|-- .grok/                        # Grok CLI (AGENTS.md -> Home + config.toml)
`-- .local/bin/b -> ~/Repos/home/skills/bin/b
Per-skill links keep vendor folders untouched and let each host mount its own subsetSpecimen 03.2 · Dot-Directories

Universal ~/.local/bin/b dispatcher

$ b sync --check

home/       main == origin/main (clean)
Templates:  7/7 portable templates verified (local auth preserved)
Symlinks:   171/171 OK · 0 broken · 77 ms
One 130-line Python CLI exposes seven domains under --help, --dry-run and --jsonSpecimen 03.3 · Interactive

The Agents Vault

04
(Shared memory)

AGENTS.md solves shared input. Almost nobody solves the matching half, shared memory. Every AI coding app traps chat history inside its own private local logs and databases (JSONL transcripts in ~/.claude/, separate folders in ~/.codex/, local SQLite in Cursor). Switch tools or change machines, and the new agent starts with total amnesia.

The fix is one dedicated operational Obsidian vault (~/Obsidian/Agents/), a plain folder of Markdown notes synced across every device and indexed locally by QMD. AGENTS.md instructs every AI app to write short session notes (with a tiny header block at the top) and handoff briefs (before a long chat summarises away older turns) into the exact same vault so any model can continue where another stopped.

Trapped vendor silos versus one shared Agents Vault

Claude CodeOpenAI CodexAntigravityCursor / Muse~/Obsidian/Agents/ · Shared Cross-Harness VaultSessions/YYYY-MM-DD slug.md · Sessions/Handoffs/ (30% cap) · Ops/ & Audits/Obsidian Sync · Desktop, Laptop & VPSb qmd query "<topic>" -c sessions

After (Shared Agents Vault): Every SDK writes structured plain-Markdown notes into one synced vault indexed locally by QMD. Any model on any device picks up where the last session stopped.

Every harness writes to ~/Obsidian/Agents/ so institutional memory never locks into one SDKFigure 04.1 · Interactive

Inside ~/Obsidian/Agents/ (live file schemas)

# ~/Obsidian/Agents/Sessions/2026-11-22 open-harness-sync.md
---
agent: codex
host: macbook-pro
status: done
started: 2026-11-22T09:10:00+08:00
ended: 2026-11-22T09:42:00+08:00
---

## Goal
Add portable harness templates and verify symlink checks across hosts.

## Outcome
- Merged PR #19 (7 portable templates, 14/14 tests green).
- Follow-up: extend drift script to cover all 7 clients.
Consistent frontmatter (agent, host, status) makes every session searchable across providersSpecimen 04.2 · Schemas

Cross-model handoff across devices

1Laptop · CodexOpens Sessions/ note230% Context GateWrites Handoffs/ brief3Desktop · ClaudeQueries QMD & finishes414-Day TTL SweepArchives stale churn

Step 1 (MacBook Pro · Codex): Opens ~/Obsidian/Agents/Sessions/2026-11-22 harness-sync.md (status: active) and runs the initial refactor.

Never place an outbound symlink inside a synced Obsidian vaultFigure 04.3 · Continuity
Vault discipline(Step 1)Tag every session with agent and hostFrontmatter identifies which harness and machine produced the work so recall stays crystal clear.
(Step 2)Hand off before compaction at 30% contextWrite goal, decisions, files and next step to Sessions/Handoffs/ before compaction erases detail.
(Step 3)Forbid outbound symlinks inside synced vaultsObsidian Sync uploads symlink targets as real files; a cleanup on another device can sync deletions straight back into your repo.
(Notes)

(1)Shared input without shared memory still traps you inside one model vendor's chat log. (2)One synced Markdown Agents Vault turns every harness into a contributor to the same searchable ledger. (3)Weekly 14-day TTL sweeps keep operational churn fast without ever touching durable human notes.

Context & Docs

05
(About)

Good rules still fail when your notes are tangled or key definitions live only in your head. It helps to separate context (whatever an AI sees during one run) from knowledge (the curated, reusable library you maintain so every future agent gets the job right).

Every durable system needs three distinct knowledge layers working together: Skills (how to do the work), Domain Knowledge (glossaries with banned synonyms, design references and Architecture Decision Records, or ADRs) and Data Access Guidance (where live truth lives and how to query it without copying fast-changing data into Markdown), kept fresh by agents flagging gaps mid-task for a scheduled curator review.

Three components of reusable agent knowledge

01 · HOW TO DO THE WORK Skills Repeatable procedures, scripts & style checklists. skills/ · SKILL.md · bin/b 02 · HOW YOUR WORLD WORKS Domain Knowledge Glossaries (Avoid terms), taste references & ADRs. glossary.md · DESIGN · ADRs 03 · WHERE LIVE TRUTH LIVES Data Access Authoritative live sources, host scope & query cost. docs/data-access.md · QMD CLOSED MAINTENANCE LOOP · NO MANUAL WIKI DRUDGERY 1. Agents flag gaps mid-task -> 2. Weekly curator reviews notes -> 3. Opens clean PR for review
# Box 02 · Domain Knowledge (docs/glossary.md + DESIGN.md + docs/adr/)

Term            Canonical Path        Avoid (banned synonyms)
----------------------------------------------------------------------
Home Repo       ~/Repos/home          dotfiles, skills folder, master repo
Agents Vault    ~/Obsidian/Agents/    chat logs, scratch vault, memory dir
Boundary Rule   Agents free / gate    vault lock, write permissions
Scratch         ~/Scratch/YYYY-MM-DD  tmp, desktop drafts, staging

+ Per-site DESIGN.md (named visual references & clichés to exclude) + docs/adr/
Click any of the three knowledge components or the maintenance loop to inspect the live fileFigure 05.1 · 3-Box Architecture

Protecting durable vaults with the Boundary Rule

Core (Personal)Human-only root · Explicit approval gateDomain & Project VaultsDedicated QMD index · Approval requiredBOUNDARY RULE · APPROVAL REQUIRED ABOVE · FREE WRITES BELOWAgents Vault (~/Obsidian/Agents/)Free writes for all harnesses · Sessions, Handoffs, Ops · 14-day TTL sweep

Tiered vaults isolate ownership and lifespan, with each vault indexed separately by QMD.

Agents write freely inside Agents/; every durable human vault requires explicit approvalFigure 05.2 · Boundary Rule
(Notes)

(1)Never copy rapidly changing data into Markdown; document where authoritative truth lives and how to query it. (2)An explicit Avoid column in docs/glossary.md stops models from inventing drifting terminology across repos. (3)Let working agents flag gaps mid-task while a scheduled curator pass writes the clean updates.

CI & Hygiene

06
(About)

AI coding tools iterate in tight loops. When automated checks (Continuous Integration, or CI) take fifteen minutes or break on fragile tests, agents stall, burn tokens or try to silence failures with retries and skipped tests. Fast local Git hooks (<1s before commit, <9s before push) and quick pull-request checks (under one minute for most pull requests and under two minutes at the slow end, with the full suite on main) keep feedback crisp.

The same discipline cures codebase rot. Agents love narrating obvious lines and leaving excuse comments that justify hacky workarounds, which later sessions copy across the repo. Pairing ratchets (committed limits that only move downward, blocking files over 1 MiB and tracking noisy comments) with a repeatable /delete-comment Hygiene Skill holds the ceiling automatically.

Four-tier CI speed stack & real-world cleanup case study

NO RETRIES · NO SKIPPED TESTS
1. pre-commit <1 s Binary & comment ratchets, syntax checks on staged files 2. pre-push <9 s Fast local tests for changed files only 3. Pull request <60 s Fast PR checks (<2 min max), no brittle tests 4. Push to main Full suite Unconditional gate on main
Real-world cleanup case study · One Home Repo burn-down
Monorepo weight (binaries converted to Markdown)1,600 MB -> 389 MB (-76%)
Superfluous comments burned down across 424 files4,835 -> 8 lines (-99.8%)
Abandoned worktrees & expired sessions (14-day archive)79 & 218 -> 0
Instruction budgets (AGENTS.md & SKILL.md)157 / 180 lines · <100 per skill
Fast hooks catch regressions in seconds so coding agents never stall on slow CIFigure 06.1 · CI & Case Study

Interactive /delete-comment triage & ratchet gate

# Category 1 · Tautology (repeats what code already says)
- # increment retry count by one
  retry_count += 1

Action:   DELETE INLINE COMMENT
Ratchet:  python3 check_code_comments.py --write-baseline (locks lower ceiling)
Every inline comment maps to one mechanical action, then --write-baseline tightens the ceilingSpecimen 06.2 · Interactive

Hygiene & /delete-comment skill

Hygiene & /delete-comment Skill Coming soon to /skills/hygiene/ (bundles /delete-comment + binary & comment ratchets). Use the full prompt below today.
COMING SOON
Inspect every code comment in this repository and categorise each as:
- Tautology: repeats what is already visible from the code -> delete it.
- Stale: references outdated or removed logic -> delete it.
- Excuse: lets an agent get away with a hacky workaround -> delete it and open a GitHub issue for the underlying defect.
- Decision Record: documents a non-obvious architectural ruling -> extract it into docs/adr/NNNN-slug.md before deleting inline.

Keep only shebangs, licences, lint/type directives (# noqa, # type:, @ts-expect-error) and machine sentinels.
Then add a pre-commit comment ratchet backed by a shrinking JSON baseline (--write-baseline), a <=1 MiB binary ratchet banning .pdf/.epub/.pptx and report how many lines were shed.
Install as a reusable /delete-comment skill or paste directly into any repositorySpecimen 06.3 · Skill Placeholder
CI & Hygiene(Step 1)Test the contract, never brittle formattingAssert DOM structure, layout invariants, security and publish gates rather than fragile raw-HTML line counts.
(Step 2)Tighten baselines in the same commitRun --write-baseline whenever a cleanup reduces comments or binaries so deleted debt can never return.
(Notes)

(1)Delete an explanation in a skill and test whether agent output changes; if nothing changes, it is pure token tax. (2)Excuse comments are worse than noise because coding agents treat documented hacks as patterns to copy. (3)Move lasting rationale into docs/adr/ so code stays crisp while decisions stay searchable.

Setup & Skills

07

You do not need to create these folders or shortcuts by hand. Choose the layers you want below, copy the tailored prompt (adapted from Matt Pocock) and paste it into a fresh AI coding session started in ~/. The agent inspects your machine read-only first and waits for your approval before touching any file.

Paste into a fresh coding session started in ~/

READ-ONLY UNTIL STEP 4
Set up an open harness anchored by a personal Home Repo at `~/Repos/home` backed by Git and GitHub, holding my canonical `AGENTS.md` (<180 lines, acting as a live map across the device), portable client templates, shared docs and skills, wired via symlinks to every installed coding SDK (`~/.claude`, `~/.codex`, `~/.gemini`, `~/.cursor`, `~/.agents`, Muse, Grok), with Git checkouts in `~/Repos/` and temporary drafts in `~/Scratch/YYYY-MM-DD/`.

Rules:
- Inspect the filesystem, Git remotes, stale worktrees and installed coding clients yourself. Bring numbered decisions with recommended answers.
- Stay read-only until I approve the migration plan. Leave `.env`, SSH keys and Keychain items unread.

Steps:
1. Inventory Git repos, stale worktrees, installed coding SDKs and legacy root symlinks.
2. Draft a concise `~/Repos/home/AGENTS.md` (<180 lines) mapping standing guardrails, CLI entry points and pointers to every repo and context folder on the device.
3. Design two symlink layers (steering file + flat per-skill links keeping vendor `.system/` folders intact) and declarative template merging for client settings.
4. Set up a shared Agents Vault at `~/Obsidian/Agents/` (synced via Obsidian Sync, indexed by QMD collection `sessions`, with zero outbound symlinks) where every harness writes `Sessions/YYYY-MM-DD slug.md` notes (`agent:`, `host:`, `status:`, `## Outcome`) and 30%-context handoff briefs in `Sessions/Handoffs/` with a 14-day archive sweep.
5. Separate durable Obsidian vaults under `~/Obsidian/` with a Boundary Rule (free writes in `Agents`, explicit approval above, human-only `Core` root), plus starter `docs/glossary.md` (with `Avoid` synonyms) and `docs/data-access.md`.
6. Add pre-commit hygiene ratchets (blocking >1 MiB binaries and `.pdf`/`.epub`/`.pptx`, enforcing `<100`-line `SKILL.md` budgets, extracting architectural rationale to `docs/adr/`) and a fast `--check`/`--dry-run`/`--json` sync script.
7. Present the full migration table and wait for my approval before modifying files or creating symlinks.
No.Skill / Companion GuideRole in an Open HarnessRoute
(01)Hygiene & /delete-commentComment burn-down, ADR extraction, excuse issue filing and ratchet baselines.COMING SOON · /skills/hygiene/
(02)vault-setupScaffolds the shared Agents Vault, durable vaults, schemas and Boundary Rule./skills/#vault-setup
(03)recall & retrospectiveSearches QMD session memory and turns recurring friction into updated skills./skills/#recall
(04)skill-managerAudits overlaps, enforces the 100-line SKILL.md cap and verifies symlinks./skills/#skill-manager
(05)The Harness & Using GitHubToken Department companion guides on the 5-part harness equation and Git PR flow./essays/the-harness/

Draft a message

Describe the work you need to complete.

Sending delivers your message to [email protected]. The sent text stays below so you can keep a copy.