Skip to main content

From One Chatbot to a Multi-Agent Research Workstation: Omarchy, Herdr, Shared Memory and Skills for Epidemiology

How I run a model-agnostic multi-agent workflow across Linux machines using Omarchy, Herdr, synced project folders, plain-text shared memory, and reusable epidemiological skills.
AI
workflow
epidemiology
reproducibility
Linux
open science
Author

Kostadin Kostadinov

Published

December 5, 2026

Modified

December 5, 2026

In an earlier post, I argued that the unit of AI-assisted research is a plain-text project folder, not a chat window. That rule solved the first problem: keeping analyses, manuscripts, references and outputs reproducible when a single coding agent helps with a single study.

It did not solve the second problem. An academic epidemiologist is rarely doing one thing at a time. On a typical week I am answering three peer-review reports on a cost-effectiveness model, auditing an R pipeline for a doctoral dissertation, updating national surveillance notes, preparing teaching decks in two languages, and switching between a home workstation, an office desktop and laptops. Trying to run all of that through one terminal session, or through scattered browser tabs with separate histories, breaks down fast. Context bleeds between studies. A long model run blocks a quick look-up. Two different models on two different machines forget the exact decision you made yesterday about a denominator, a case definition, or a journal’s table layout.

Over the past several months I rebuilt my research environment around five simple layers: Omarchy as a uniform Linux desktop across machines, Herdr to coordinate visible parallel agents, synced project folders paired with Git, a single plain-text shared memory read by every agent harness, and a canonical library of domain skills for epidemiology, biostatistics and scientific publishing. None of these pieces is exotic. Their value comes from how cleanly they fit together and how strictly they separate what an agent can automate from what still requires human judgement.

NoteThe short version

Run one uniform Linux environment (Omarchy) across your machines. Keep one persistent coordinator agent in Herdr that delegates real work to visible, isolated worker agents in each study folder. Mix models by strength, and let a second agent independently recalculate your numbers from the clean dataset. Store deliberately maintained memory and domain skills as plain Markdown in a synced folder so every model on every machine inherits the same standards.

1. The architecture at a glance

Before getting into individual tools, it helps to see how the pieces connect. Every layer has one job and stays readable as plain text on disk.

flowchart TD
  R["Researcher (PI & final reviewer)"] --> C["Coordinator agent in Herdr<br/>(one active master, model-agnostic)"]
  C --> W1["Worker 1: R pipeline & manuscript<br/>(e.g. Claude Code in study folder A)"]
  C --> W2["Worker 2: Independent audit<br/>(e.g. Codex recalculating from clean RDS)"]
  C --> W3["Remote worker on another machine<br/>(via Tailscale SSH + hc --on)"]
  M["Synced shared memory<br/>(MEMORY.md + topic notes + handoff)"] -. read at start .-> C
  M -. read on demand .-> W1
  S["Canonical skill library<br/>(epidemiology, R, Quarto, MDPI, reviews)"] -. synced to all CLIs .-> W1
  S -. synced to all CLIs .-> W2
  W1 --> P["Study folder<br/>(immutable raw data, scripts, output, manuscript)"]
  W2 --> P
  P --> G["Git history & reproducible renders<br/>(PDF, DOCX, HTML, Zenodo)"]
Figure 1: Five-layer multi-agent research architecture: a uniform OS, a single coordinator spawning visible workers, synced plain-text memory and skills, and strict project-folder boundaries.

Notice what sits at the centre of the diagram: not a proprietary cloud workspace, and not a single AI vendor. If one provider hits a rate limit, degrades on a task, or releases a better model tomorrow, I swap the agent CLI without losing my folders, my memory, or my methodological checklists.

2. Why Omarchy as the base operating system

Most researchers treat their operating system as neutral background. Once you work heavily with terminal-based coding agents, the desktop environment stops being cosmetic and starts determining how much friction every task carries.

I run Omarchy, an opinionated Arch Linux and Hyprland desktop, across five machines (a home desktop with a dedicated GPU, an office workstation, and three laptops) linked over a private Tailscale mesh network. Four properties make it unusually well suited to quantitative research with AI agents:

  • Everything is terminal-native and scriptable. R, Python (uv), Quarto, Typst, Pandoc, DuckDB, Git, pdfinfo, pdftoppm and LibreOffice headless conversions sit in one consistent shell environment (Ghostty + Zsh) without fighting Windows path translation, CRLF line endings, or broken UTF-8 locales. (Anyone who has watched R silently corrupt Cyrillic column names under LANG=C appreciates a clean en_US.UTF-8 default.)
  • Consistent dotfiles across five machines. One configuration kit keeps terminal keybindings, R build flags, Quarto versions, citation styles, and agent wrappers aligned across desktop and laptops. Moving from the office to home does not mean re-learning where tools live.
  • Clean browser isolation. My personal browser stays completely off-limits to agents. Whenever a workflow genuinely needs a browser, such as an institutional web portal or a journal submission system, agents use a separate, dedicated Chromium profile over CDP. Separating personal sessions from automated ones is a small habit that avoids major accidents.
  • Local compute when privacy demands it. Because the main workstation runs Linux with an NVIDIA GPU, local models (via Ollama or LM Studio) are first-class citizens in the same terminal setup. Anything involving sensitive drafts, student work, or data that should not leave the machine stays local.

3. Herdr: one coordinator, visible workers, and independent verification

Running one agent in a terminal is straightforward. Running three agents at once without losing track of what each one is editing, waiting on, or stuck behind is harder. That is what Herdr (herdr-app for the desktop workspace and hc for the underlying terminal runtime) solves.

Herdr tracks every running agent terminal by structured status (working, blocked, done, idle, error), handles inter-agent messaging (hc send and hc wait), and reaches across machines over Tailscale (hc run --on <machine> --bg ...). On top of that plumbing, I follow four operational rules.

Strictly one master coordinator

One persistent coordinator session runs on my main workstation. It does not matter which model fills that chair on a given day: Claude Code, Codex, Antigravity (agy), Kimi, Gemini, or Copilot can all play the coordinator role, provided there is strictly one active coordinator at a time.

The coordinator’s job is triage, folder discipline, delegation, verification and reporting. Quick look-ups and single-file fixes happen inline. Anything multi-step (building an analysis chapter, revising a manuscript for three peer reviewers, running a fleet update across laptops) gets delegated to a dedicated background worker started in the exact project folder:

hc run --bg --name varicella-rev \
  --cwd /path/to/synced-root/PROJECTS/varicella-cea \
  claude --permission-mode bypassPermissions "<task brief>"

Keeping the coordinator free means a twenty-minute R calibration or Quarto render never blocks me from asking a quick question or launching a second, unrelated task.

Visible sub-agents only

One mistake I learned to ban early is letting a worker hide helper calls inside silent shell subprocesses. When an agent spawns a reviewer or helper, it must launch that child visibly through hc run --bg --name <parent>-<role> ... so it appears nested under its parent in the Herdr sidebar. I can inspect its screen at any moment, catch a blocked prompt before it stalls for an hour, and verify what it actually checked. Once a temporary worker’s deliverable is verified, it is closed immediately (hc kill and hc rm). Idle agent tabs accumulate clutter and stale state.

Mix models and audit independently

Single-model self-review has a predictable blind spot: the model that made an analytical slip or misread an abstract often rationalises the same slip when asked to check its own output. Splitting drafting and auditing across two different models catches far more errors.

In practice, my standard pattern for an epidemiological study or doctoral thesis chapter is:

  1. Primary worker (often Claude Code): inspects the cleaned dataset, writes the analytical decisions note, builds the modular R pipeline (scripts/01 through 04), generates figures and tables, and drafts the Quarto manuscript or response to reviewers.
  2. Independent auditor (typically Codex, launched as a visible child worker): receives read-only instructions for the project source files. It recalculates every table cell, regression coefficient, confidence interval, and sensitivity scenario in memory directly from the immutable clean .rds dataset, checks every quoted figure in the prose against the tables, and verifies every cited paper’s claim against its actual abstract and DOI in references.bib.

On a recent doctoral dissertation chapter (399 patients, 10 output tables, ordinal and Firth regression models), this two-agent workflow independently reproduced 177 out of 177 table cells with zero numerical discrepancies while flagging 12 subtle wording and literature-attribution issues, such as distinguishing a last discharge date from a proven registry closing date. Every single one of those 12 issues was fixed before rendering the final 152-page PDF. That is the kind of error-catching that justifies multi-agent work.

4. Synced folders and Git: keeping data, code and machines aligned

Multi-agent work across five machines only works if files follow predictable boundaries. I combine two synchronisation layers, because each solves a problem the other handles poorly:

  • Git holds code, R packages, Quarto websites, LaTeX/Typst templates and manuscripts where line-by-line diffs, branching and exact commit history matter.
  • Cloud-synced folders (MEGA and pCloud) carry the full research tree across machines: raw administrative datasets, reference PDFs, rendered books, policy consultations, shared memory, helper scripts and canonical skills.
<synced-root>/
├── memory/                  # single shared memory brain (MEMORY.md + topic notes)
├── skills/                  # canonical Agent Skills library (synced to all CLIs)
├── bin/                     # shared CLI helpers (newstudy, getbib, sync*skills)
├── dotfiles/                # cross-machine configs (terminal, editor, Herdr, fonts)
├── PROJECTS/                # one folder per study, manuscript or dissertation
│   └── study-slug/
│       ├── data/            # clean immutable .rds/.csv (+ private/ off-limits)
│       ├── scripts/         # numbered reproducible R scripts
│       ├── output/          # disposable figures, tables, models
│       └── manuscript/      # Quarto source, _variables.yml, references.bib
├── TEACHING/                # Typst lecture decks and student test banks
└── TASKS/                   # dated rollout ledgers and independent audit reports

Three practical details save hours of debugging:

  1. Always switch and name the active folder. When a coordinator jumps from a vaccination cost-effectiveness revision to a teaching deck, it explicitly states the target folder and uses real absolute paths (not symlinks, which can trip tool sandbox checks). Nothing ever lands in the previous study’s directory.
  2. Know what cloud sync drops. Synced drives preserve file contents, not POSIX executable bits or symlinks. Helper scripts are run explicitly (bash <root>/bin/... or chmod +x first), and symlinks are recreated per machine by a small setup script.
  3. Lock down immutable inputs and private identifiers. Before any revision or new analysis phase, we verify SHA-256 checksums on the cleaned .rds dataset and data-preparation script. Identifiable keys (patient names, national IDs, student records) live in restricted private/ folders that agents are explicitly instructed never to open and never to transmit to external APIs.

5. Shared plain-text memory across every model

Vendor-hosted “memory” features are convenient until you switch from Claude to Codex, or open Antigravity on a laptop, and realise each tool has its own invisible, slightly outdated summary of your preferences.

My solution is boring and completely portable: one memory/ folder inside the synced drive, linked into every agent harness via a short global AGENTS.md pointer (~/.agents/AGENTS.md, ~/.claude/, ~/.codex/, ~/.gemini/config/). Every model reads the same files.

The folder has three layers:

  • MEMORY.md (strictly capped under 18 KB): a dense one-line-per-topic index so startup context stays light.
  • Topic and project notes: one concise Markdown file per study, machine, or standing feedback rule (for example, project-varicella-vaccines-mdpi.md, feedback-declarations-strikethrough-and-review.md, omarchy-shell-troubleshooting.md). Notes record dates, verified facts, and traps learned the hard way (never secrets or credentials).
  • A rolling coordinator handoff (god-handoff.md): replaced at major milestones rather than appended endlessly, listing current deadlines, manuscript states, and offline machines waiting for catch-up.
## Example feedback note (abbreviated)

- **No author queries during secondary analysis:** take the best defensible
  statistical decision, record it in `data/qc/decisions-taskN.md`, and run a
  sensitivity analysis.
- **Always include verified DOIs** for suggested or cited papers.
- **Check every declarative line on administrative forms,** not just blank
  fields; inspect the rendered PDF visually before sending.

Because memory is ordinary Markdown, I own it. When an agent makes a mistake once (say, misreading a journal’s table width rule, forgetting a local software trap, or leaving an uncrossed option on a form), the lesson is written into a 15-line note. From the next session onwards, Claude, Codex, Antigravity and Kimi all inherit that correction automatically.

6. Domain skills: turning general agents into epidemiological collaborators

If shared memory captures your context and history, skills capture reusable methodological procedure.

An Agent Skill is a small self-contained directory containing a SKILL.md instruction file plus any supporting scripts or reference tables. Every major CLI harness now supports discovering skills from a local directory. Rather than maintaining eight diverging copies across tools, I keep one canonical library in <synced-root>/skills/ and run a small wrapper script (sync*skills) that mirrors it into every agent root on every machine (claude, codex, agy, kimi, gemini, opencode, pi, hermes) and flags anything stale or missing.

For epidemiology and public health research, generic coding prompts are rarely enough. The skills that make the biggest practical difference are narrow, opinionated, and grounded in domain standards:

Skill What it enforces
data-profiler Read-only first inspection of a new .xlsx/.sav/.csv dataset before cleaning: ID uniqueness, repeat rows, date traps, -99 missing codes, Cyrillic/Latin homoglyphs, privacy checks.
stat-analysis & kkstatfun-epi Statistical plan justification (estimands, confounding, splines, calibration, Firth/ordinal/survival/causal methods) paired with my own kkstatfun R package reference.
target-trial-emulation & health-economic-modelling Strict separation of time zero, immortal time bias, payer vs societal perspectives, transfers vs resource costs, discounting, PSA and CHEERS 2022 reporting.
kkplot-figures Publication-ready 300 dpi figures (kkplot()), direct labels, colourblind-safe palettes, finding-oriented captions, and no bar-plus-error-bar plots for continuous distributions.
reporting-guidelines Checks manuscripts against verbatim EQUATOR checklists (STROBE, CONSORT, PRISMA, CHEERS, TRIPOD, TARGET) read from local files rather than recalled from model memory.
mdpi-manuscript & analysis-to-manuscript Keeps one Markdown source feeding Quarto _variables.yml inline values (?var:...), journal-specific LaTeX/DOCX adapters, and clean upload bundles.
peer-review-response Point-by-point revision discipline: verify verbatim manuscript anchors before proposing edits, run R blocks before drafting numerical replies, avoid invented literature and filler prose.
english-academic-style & humanizer-en Calibrated hedging, inline numbers, justify-as-you-go prose, and stripping LLM tics (delve, pivotal, underscore, ornamental adverbs, stacked hedges).

A skill only loads when a task triggers it. That keeps routine sessions fast while ensuring that the moment I ask for a cost-effectiveness sensitivity analysis, a STROBE compliance table, or an MDPI submission package, the agent immediately loads the exact methodological guardrails and format traps rather than improvising from scratch.

7. What a real epidemiological workflow looks like

To make this concrete, here is how a peer-review revision for a vaccination cost-effectiveness paper runs under this setup:

  1. Save and frame. The coordinator switches to the manuscript’s synced folder, archives the verbatim reviewer reports in review/, and creates a dated backup of R/, manuscript/ and submission/.
  2. Delegate the revision. A visible worker (Claude) checks every quantitative comment directly against the R scripts and raw administrative datasets. If a reviewer flags a counterintuitive utility weight, the worker verifies the original source table, tests a clinically coherent alternative, adds requested scenarios (such as pre-programme private vaccination or a one-off catch-up cohort), and re-runs 00_run_all.R so every _variables.yml value, table and 300 dpi figure regenerates from code.
  3. Independent audit. The worker spawns a visible Codex child agent to recalculate the new and modified outputs independently from the clean data, verify every new reference’s DOI and abstract, confirm 100% coverage of all reviewer comments, and audit the response document for style compliance.
  4. Build and visually inspect. Quarto renders the clean journal PDF, journal-styled DOCX, tracked-changes diff, supplementary files and response document. Rendered pages are converted to PNG with pdftoppm and inspected visually for table overflow, clipped figures, or unresolved cross-references.
  5. Human gate. Nothing is uploaded to the journal portal, pushed to GitHub, published to Zenodo, or emailed to co-authors. The worker writes a concise revision report, closes its child auditor, notifies the coordinator, and stops. I read the report, inspect the manuscript and response, and make the final call.

8. Hard guardrails and what stays human

Autonomy without boundaries is reckless, especially in health research. Every worker brief carries explicit hard limits:

  • No external side effects without explicit approval: no sending emails, no printing, no git push, no journal or Zenodo uploads, and no deleting files outside the active task folder.
  • No secrets in memory, logs or prompts: API keys and credentials stay in mode-600 files outside version control and are never echoed into conversation history or notes.
  • No clinical or student identifiers sent to third-party APIs: datasets are pseudonymised locally first, key tables stay in off-limits private/ directories, and sensitive drafts run on local models.
  • Verify outputs, never trust “Done!”. Whether it is a system update across five machines or a Quarto PDF of a dissertation, completion means checking exit logs, checksums, rendered pages, and independent recalculations.
ImportantWhat multi-agent tooling does not replace

Agents compress execution: writing scripts, cross-checking 177 table cells, converting formats, keeping five Linux machines aligned, and catching mechanical errors. They do not decide whether a causal estimand answers a meaningful public-health question, whether an administrative reimbursement code reflects clinical severity or billing incentives, or whether a policy conclusion goes beyond what the data can bear. The faster the machinery runs, the more carefully the researcher has to steer it.

That is the real reason I built this workstation. Moving the mechanical weight of empirical work onto reproducible files, visible workers, and explicit checks leaves more time for study design, critical reading, and judgement.