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

TL;DR

Threlmark’s local-first architecture centers on the idea that disk storage is the ultimate authority. This approach enables offline work, easy portability, and privacy, all while simplifying the tech stack by avoiding a central database. It’s a fresh take on building resilient, user-empowered apps.

Imagine your project management tool could work just like that: no server, no cloud, yet it keeps track of everything perfectly. Learn more about local-first architecture. Sounds like magic, right? But it’s actually a deliberate design choice in Threlmark’s local-first architecture. Here, your disk becomes the single source of truth, making your data more resilient, private, and portable than any cloud service could offer.

In this article, you’ll see how this simple yet powerful idea shapes the entire system — from how data is stored and synchronized, to how external tools participate, and why this approach could redefine how you build and think about apps.

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

portable external SSD for offline data 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

JSON file management 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

local-first project management app

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

disk-based data synchronization tools

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

  • Treat your disk layout as the API: plain JSON files define your entire system, making data portable and inspectable.
  • Atomic file writes prevent corruption, ensuring safe concurrent edits without locks.
  • One file per item enables collision-free updates and simplifies concurrency management.
  • The system self-heals: lane order and project structure are dynamically reconstructed from existing files.
  • External tools and AI agents can participate naturally because data lives in plain, readable files.

How Disk as the Contract Changes Everything

Using the disk as the primary contract means the on-disk layout *is* the API. Every piece of data lives in plain JSON files, which anyone can read, modify, or sync. Think of it as a shared, human-readable database that’s also the ultimate authority.

For example, instead of a centralized server dictating what your project looks like, your files — like threlmark.json and items/123.json — define the entire system. This makes data portable, inspectable, and safe from vendor lock-in. You can read more about how disk as the contract impacts system design here.

It’s like leaving a trail of breadcrumbs you can follow, share, or migrate—no special tools needed. This simplicity unlocks powerful benefits: easy backup, cross-platform compatibility, and the ability for external tools to participate without permission.

How Disk as the Contract Changes Everything
How Disk as the Contract Changes Everything

Step-by-Step: How Threlmark Stores and Syncs Data

  1. Data lives in files. Each project gets its own folder, with one file per card. This breaks the race condition of bulk JSON lists, making concurrent edits safe.
  2. Atomic writes prevent corruption. Files are written via temp files and renamed instantly, so you never get half-written data.
  3. Self-healing board. The lane order isn’t stored in a single list but is dynamically reconstructed from the current items, so the system automatically corrects itself if files go missing or get out of sync.
  4. External tools participate easily. Drop a new card into the folder, and the system recognizes it immediately. No need for API calls or server-side validation. External tools can participate easily because data lives in plain, readable files.
By following these steps, Threlmark keeps data consistent, safe, and highly flexible.

Why Local Storage Makes Your App Resilient and Private

Local storage isn’t just about offline work — it’s about ownership. When your data lives on your device, you’re in control. No vendor can lock you out or delete your data without your permission.

Take an example: imagine working on a project during a flight, with no internet. Your data remains fully accessible, and when you reconnect, synchronization happens seamlessly. Plus, your data is shielded from prying eyes if stored securely on disk.

Recent research shows that local-first systems inherently boost privacy, since data doesn’t need to traverse the cloud unless explicitly shared. This approach also reduces backend complexity, saving hours of server maintenance and exposing fewer attack vectors.

Why Local Storage Makes Your App Resilient and Private
Why Local Storage Makes Your App Resilient and Private

How External Tools Join the Local-First Party

Because the data is just plain files, any tool can read or write to your project. Want a script to auto-tag cards? Drop a JSON file into the right folder, and Threlmark recognizes it. Need to generate a report? Just read the files directly.

For example, IdeaClyst, an external AI assistant, can participate without special permissions. It observes the files, suggests updates, and even moves cards to ‘Done.’ All this happens because the core data isn’t locked behind an API but exposed as a human-readable, editable file system.

This openness means your system is truly adaptable — no lock-in, no vendor-specific APIs, just plain files everyone can understand.

Tradeoffs: When Disk-First Might Not Be Enough

While disk as the contract offers many advantages, it’s not a silver bullet. Large projects with hundreds of thousands of files can become slow, and conflict resolution gets tricky with highly concurrent edits.

For instance, real-time multi-user editing might require additional mechanisms like CRDTs or conflict-free replicated data types. Also, syncing over slow networks or with remote devices can introduce latency.

In some cases, a hybrid approach — local-first with optional cloud sync — works best. But the core idea remains valuable: keep the data local, and treat disk as the ultimate authority.

Tradeoffs: When Disk-First Might Not Be Enough
Tradeoffs: When Disk-First Might Not Be Enough

Getting Started with Threlmark and Local-First Principles

If you want to try Threlmark yourself, start by cloning its GitHub repo. Read the source code to see how files are structured. Then experiment with editing JSON files directly, or write scripts to automate updates.

Key tips:

  • Use atomic file writes to avoid corruption.
  • Keep your folder structure simple and consistent.
  • Leverage the self-healing board to keep your lanes aligned.

Remember, the goal is to treat your disk as the single source of truth, making your data portable and resilient.

Frequently Asked Questions

What does ‘disk is the contract’ actually mean?

It means your system’s data lives in plain JSON files on disk, and these files define everything about your app. The files are the source of truth, making your data portable, inspectable, and independent of any server or cloud.

How does Threlmark handle multiple devices syncing changes?

Changes are stored in individual files. When syncing, external tools compare files, apply merges, and update only what’s needed, relying on atomic writes. This approach avoids conflicts and makes the system resilient.

Can this setup support real-time collaboration?

Yes, but it might require additional conflict resolution mechanisms like CRDTs for very high concurrency. The core idea is that local files remain the single source of truth, and syncing happens asynchronously. For more insights into local-first principles, visit Ebus Expert.

What are the main tradeoffs of a disk-first architecture?

It’s excellent for resilience, privacy, and simplicity. But, large projects with many files or real-time multi-user editing may need additional tools or hybrid solutions to handle performance and conflicts.

Is this approach practical for production apps today?

Absolutely. Threlmark and other local-first tools demonstrate that with careful design, disk-based data management is scalable, safe, and ready for real-world use, especially for productivity and project management apps.

Conclusion

By making the disk the contract, Threlmark turns data ownership, resilience, and flexibility into built-in features. This approach simplifies the architecture while empowering users and tools alike.

Imagine a future where your apps are portable, your data is yours alone, and collaboration happens without cloud lock-in. That’s the promise of local-first design — and Threlmark shows it’s not just a theory, but a practical reality.

You May Also Like

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst turns chaotic brainstorming into strategic action. Learn why it’s a game-changer for founders and teams alike.

Why Anthropic’s Series H Is a Major Compute Innovation Milestone

Discover why Anthropic’s $965 billion valuation isn’t just a headline—it’s a sign that AI’s future hinges on massive compute capacity and infrastructure investments.

Build vs Buy a Prebuilt AI Workstation

Struggling to choose between building or buying your AI workstation? Discover the real costs, performance differences, and what suits your needs best in 2026.