Disk Is the Contract: Inside Threlmark's Local-First Architecture

TL;DR

Threlmark uses a disk-based system where files are the API, making data portable, safe, and interoperable. This design simplifies collaboration and automation without relying on servers or databases.

Imagine a project management tool that doesn’t rely on a cloud or a central server. Instead, it lives entirely on your disk. That’s the core idea behind Threlmark’s “disk is the contract” approach. It’s a bold move that turns conventional wisdom on its head.

Why does this matter? Because it makes your project data portable, safe from server crashes, and open to any tool that can read files. If you’re tired of vendor lock-in and databases that lock your data away, this article shows you how Threlmark’s design delivers.

Disk is the contract: inside Threlmark’s architecture — ThorstenMeyerAI.com
ThorstenMeyerAI.com
Threlmark · Technical Deep-Dive
Threlmark · architecture

Disk is the contract: inside a local-first roadmap hub

A Next.js app on top of plain JSON files — no database, no cloud, no accounts. The key decision: the on-disk layout IS the API. Everything else cascades from taking that seriously.

Next.js · TypeScript · JSON-on-disk · MIT · part 2 of the Threlmark series
01The core decision

There is no server-of-record — the files are the record

The UI and any external tool reach the same files through the same discipline. The data root defaults to ~/.threlmark — home-based, because it’s a shared hub every one of your apps points at.

~/.threlmark/ ├─ threlmark.json # manifest ├─ links.json # dependency graph ├─ projects// │ ├─ project.json # meta + wipLimits │ ├─ board.json # lane ordering │ ├─ items/.json # ONE card per file ← source of truth │ ├─ suggestions/ # the Inbox (drop-zone) │ ├─ handoffs/ # recorded agent handoffs │ ├─ reports/ # agent report drop-zone │ └─ ROADMAP.md # human-readable mirror ├─ shared/items/ # cards many projects ref └─ archive/ # archived, still readable

Inspectable

Every artifact is a file you can cat, diff, grep, commit.

Portable · no lock-in

Back up with cp, sync with Dropbox / git, migrate trivially.

Interoperable

Any tool in any language joins by reading / writing files.

Restartable

No in-memory state to lose — stateless over the files.

02Making files safe
Amazon

external SSD portable storage

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Two disciplined patterns instead of a database

“Just use files” is easy to get wrong. These two patterns — ported from a battle-tested sibling app — are what make file-based state sound rather than reckless.

Pattern 1

Atomic writes

Write to a temp file in the same dir, then rename() over the target. Rename is atomic on one filesystem — a crash mid-write leaves the complete old file or the complete new one, never a half.

write .tmp-pid-rand fsync rename() over target
Pattern 2 · one file per item

The board heals itself

A single roadmap.json array races when two tools write at once. One file per card makes writes collision-free. Lane order lives in board.json and reconciles on read.

The payoff: an external tool never touches board.json. It writes an item file — the board fixes itself on Threlmark’s next read. Unknown keys are preserved, so the contract is forward-compatible.
03Derived, never stored
Amazon

file synchronization software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

The numbers can’t drift from the files

Anything computable from item state is computed — so the displayed numbers can never disagree with the underlying JSON. Priority is the clearest example: it’s calculated on read, never persisted.

priority — computed on read

Impact weighted heaviest; effort the only axis that subtracts. Reused verbatim from the original tool, so imported cards rank identically.

priority = max(0, round(impact·3 + evidence·2 + fit·2effort·1.5))
a 5 / 5 / 5 / 4 card 29
work-item age
now − lane-entry time. Past threshold (dev 7d, ranked 21d, idea 60d) → stale.
cycle time
first DevelopmentDone. Derived from append-only transitions[].
throughput
items reaching Done per ISO week, 8-week window.
WIP
count per lane; over the cap shows 3 / 2 in red.
04The closed agent loop · press play
Amazon

JSON file editor

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

A handoff is a first-class flow event

The genuinely 2026-shaped part: most building is done by AI agents, so Threlmark closes the loop. Watch a card go from ranked to Done without anyone dragging it.

Handoff → report → self-move

The brief carries a reporting protocol. The agent reports through REST or the filesystem — and a done report moves the card itself.

Ranked
Add price-drop alertsscore 31 · ready
Development
Handed off 🤖
Done
▶ preferred — REST
POST /api/projects/:id/
items/:itemId/report

Direct call. Applied immediately.

▶ fallback — filesystem
drop reports/.json
→ ingested on read

Robust even if the server’s down at finish time.

🤖 claude done: price-drop alerts shipped · typecheck + lint + build passed — card moved to Done
05Portfolio score & deployment
Amazon

local project management tool

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

A small formula, and an honest hosting caveat

Because items are globally addressable (/), the Portfolio ranks everything together by a status-weighted score — finishing beats starting, blockers get a boost.

Portfolio ranking — status-weighted

In-flight work floats to the top; bottlenecks cost the most, so blockers get nudged up.

score = priority · statusWeight (+ 0.1 · blockedCount · priority)
1.3
development
1.0
ranked
0.85
idea
0.15
done
Path 1

Static read-only demo

Seeded data, writes to localStorage. Try-before-you-clone.

Path 2

Personal Node instance

Password-gated, persistent backed-up THRELMARK_DATA_DIR.

Path 3

Multi-tenant SaaS

Add accounts + per-tenant isolation. A separate build.

The elegant part: the store interface src/lib/*/store.ts is the natural seam — the same boundary that keeps the local tool simple is the one you’d extend for multi-tenancy. The architecture doesn’t fight that future; it just doesn’t pay for it until you need it.
ThorstenMeyerAI.com
Threlmark · open source (MIT) · github.com/MeyerThorsten/threlmark · part 2 of a series · file layout, formula, weights & agent-loop channels are Threlmark’s actual mechanics.

Key Takeaways

  • Using disk files as the project’s API makes data portable, inspectable, and safe from crashes.
  • Atomic write patterns prevent corruption, ensuring data integrity even during unexpected failures.
  • One file per item avoids race conditions and simplifies external tool integration.
  • Self-healing boards keep project views accurate without manual cleanup.
  • External tools and AI can participate naturally by reading and writing JSON files directly.

What does ‘disk is the contract’ really mean?

“Disk is the contract” means your project data isn’t stored in a database or a cloud. Instead, it lives in simple JSON files on your disk. The files are the system’s truth, the way it communicates, and the way it integrates with other tools.

Picture a folder full of JSON files. Each card, project, or link is a separate file. When you update a file, you change the system. When you want to see the state, you read the files. No middleman, no API, just files.

This approach makes your data transparent. You can peek into any file, see exactly what’s stored, and even modify it with your favorite editor. Plus, backing up or migrating your data is as simple as copying files.

What does 'disk is the contract' really mean?
What does ‘disk is the contract’ really mean?

How the file layout turns disk into a living project hub

Threlmark’s file structure isn’t just a random collection. It’s a carefully designed contract that guides data storage. At the root, you find files like threlmark.json (the manifest) and links.json (the dependency graph).

Each project gets its own folder with project.json (metadata), board.json (lane order), and items/ (cards). External suggestions sit in suggestions/, and recorded handoffs in handoffs/. All these files are regular JSON, easily inspected and changed.

Shared items, archived projects, and report zones are also just files. This consistency makes the entire system transparent and portable — you can back it up, move it, or modify it without breaking anything.

Why turning disk into the API simplifies and powers your work

Using files as the API means no need for a database or a server. Any tool — a script, an editor, or an external app — can read and write these JSON files directly. This openness enables seamless integrations and automation.

For example, an AI agent can read a card’s JSON, decide it’s ready, and move it to “Done” by just editing a file. No API calls, no complex syncing. Just file operations.

It also means your data is safe from crashes. An atomic write ensures no corruption — if your system crashes during a save, you’re still left with a complete, valid file. It’s a simple yet powerful safeguard.

Why turning disk into the API simplifies and powers your work
Why turning disk into the API simplifies and powers your work

Making file-based state safe and reliable

Two patterns keep this system trustworthy: atomic writes and tolerant merging. Atomic writes involve writing to a temporary file, then renaming it — a guaranteed way to prevent corruption during crashes.

Read-merge-write means updates read the current file, merge changes carefully (preserving IDs and timestamps), and write atomically. This approach allows multiple tools to update files without clobbering each other.

For example, a script that updates a card’s status won’t accidentally delete other data because it merges changes rather than overwriting everything. This makes the system resilient and friendly for automation.

How a self-healing board keeps your project view accurate

Threlmark’s board isn’t just a static list. It’s a self-healing structure that reconciles itself each time you read it. It compares the list of items in items/ with the lane order in board.json and fixes discrepancies automatically.

Suppose an item gets deleted or moved outside the lane; the next read will reconcile the board, removing or placing it correctly. This keeps your project view consistent without manual cleanup.

This approach saves time and prevents errors, especially in multi-tool environments where files might get out of sync.

How a self-healing board keeps your project view accurate
How a self-healing board keeps your project view accurate

How Threlmark enables external tools and AI to join the system

Because everything is files, external tools can participate without special permissions or APIs. They just need to read, modify, and write JSON files in the right folders.

For instance, IdeaClyst or other AI agents can scan the suggestions/ folder, pick up new ideas, and then update the cards directly by editing the files. When they mark a task as done, they’re just changing a JSON file.

This openness makes automation natural and flexible, reducing vendor lock-in and unlocking a vibrant ecosystem of tools.

Real-world example: How a developer uses Threlmark to track multi-projects

Imagine a developer juggling three projects: a website, a mobile app, and a backend API. Each has its own folder with cards, lanes, and dependencies. They check progress by opening JSON files directly or using scripts that read the files.

When a bug is fixed in the backend, the developer updates the corresponding card in items/. An automation script then moves that card to “Completed” based on a change in the JSON.

All of this happens without a central database — just files, hooks, and scripts. The system remains lightweight, transparent, and adaptable.

Frequently Asked Questions

Is using files instead of a database slower or less scalable?

Not necessarily. For many project management tasks, file-based systems are fast enough, especially with proper atomic writes and caching. Threlmark is designed for local-first workflows where scale isn’t measured in millions of records.

How does Threlmark handle concurrent updates?

It uses atomic file writes and read-merge patterns to prevent conflicts. Since each item gets its own file, multiple tools can edit different cards simultaneously without clobbering each other.

Can I integrate Threlmark with other tools?

Absolutely. Because everything is just files, any tool that can read/write JSON can participate. This openness encourages automation, scripting, and custom integrations without vendor lock-in. Check out the project on GitHub for more.

What about data backup and migration?

Backing up Threlmark is as simple as copying the entire data directory. Migration is just moving files. No complicated export/import processes — just files and folders.

Is this approach suitable for large teams or enterprise?

While ideal for local, small, and medium-sized workflows, larger teams might need additional synchronization tools. But for those who value transparency and control, this model scales well within its scope.

Conclusion

Threlmark’s approach of making disk the contract turns project management into a simple, resilient, and open process. It strips away layers of complexity and vendor lock-in, leaving you with a transparent system that’s easy to extend and trust.

Next time you think about data storage, ask yourself: could the disk really be the contract? If so, you’re holding the key to smarter, safer, and more flexible projects.

Real-world example: How a developer uses Threlmark to track multi-projects
Real-world example: How a developer uses Threlmark to track multi-projects
You May Also Like

The Fine Art Printer Checklist That Saves Artists From Costly Setup Mistakes

Better your art prints by mastering this essential checklist—discover how to avoid costly mistakes and ensure perfect results every time.

Process Video Gear for Artists Who Want Better Content, Not More Gear

Keen to improve your process videos without investing in new gear? Discover practical lighting and editing tips to elevate your content today.

The 36-Inch Printer Questions That Matter More Than Brand Hype

Outstanding 36-inch printer choices depend on practical features beyond brand names; discover what truly matters to make the right choice.