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

TL;DR

Threlmark’s local-first architecture treats disk files as the core record, making data portable, safe, and instantly accessible without a server. It simplifies offline work, enhances control, and enables seamless sync and automation.

Imagine a project management tool that never relies on cloud servers, never locks you into a vendor, and always keeps your data at your fingertips. That’s what Threlmark achieves with its bold idea: the disk *is* the contract. No central database, no web server—just plain JSON files stored locally. Why does this matter? Because it brings speed, resilience, and portability to your workflow—no internet needed, no vendor lock-in.

In this article, you’ll see how a simple on-disk layout can power a powerful, multi-project hub. Learn more about data management principles. From how it handles concurrency to how AI agents can work directly with your files, every design choice is rooted in one core belief: your data should live where you can see it, control it, and move it around effortlessly.

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

local-first project management software

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-based data management tools

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

offline portable project files

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 as the single source of truth—no middleman needed.
  • Use atomic file writes to keep your data safe from crashes and corruption.
  • Maintain one JSON file per item to prevent conflicts and simplify updates.
  • Design your system to self-heal by reconciling folder states on access.
  • External tools and AI agents can participate simply by reading and writing files.

Why ‘Disk is the Contract’ Means Total Control Over Your Data

When Threlmark says “disk is the contract,” it means your project data lives on your local disk, not in a cloud or proprietary database. This approach makes your files the single source of truth—everyone and every tool reads and writes to the same set of files. For example, if you drop a new card into your roadmap, it’s immediately written to a JSON file, no waiting for sync or approval.

Think of it like a shared notebook where everyone writes in pen. The notebook’s pages are files—simple, visible, and portable. You can open them with any editor, back them up with a copy-paste, or sync them with your favorite file-sharing tool. No lock-in, no hidden databases, just plain files that do the work.

Why 'Disk is the Contract' Means Total Control Over Your Data
Why ‘Disk is the Contract’ Means Total Control Over Your Data

How Threlmark Keeps Data Safe with Atomic File Writes

Atomic writes are the secret sauce. When Threlmark saves a file, it first writes to a temporary file, then renames it over the original. This simple trick ensures that crashes or power failures never corrupt your data. For instance, if you’re updating a card and your laptop suddenly loses power, the system either keeps the old file or fully replaces it with the new—never a half-written mess.

This pattern is easy to implement and makes file-based data safe, even in crazy situations. It’s like sealing a letter in a new envelope before tossing it in the mailbox—no chance of losing a page mid-flight.

One File Per Item: How It Prevents Conflicts and Simplifies Sync

Instead of a giant list of cards, Threlmark keeps each task or card as a separate JSON file. Read about local-first architectures. This means multiple tools can update different cards simultaneously without clashing. For example, you can have your AI assistant update a task’s status in one file while you add a new card in another—no conflicts, no locks.

And the best part? The system reads the folder of items on each access, fixing any discrepancies automatically. If a card disappears, it’s because someone deleted it—no database conflict, just a file missing.

One File Per Item: How It Prevents Conflicts and Simplifies Sync
One File Per Item: How It Prevents Conflicts and Simplifies Sync

How the Board Self-Heals and Keeps Your Views Accurate

Threlmark’s lane orderings sit in `board.json`, listing item IDs in each lane. Every time you view the roadmap, it reconciles this list against the actual files in `items/`. If a file is missing or new, the board updates itself. For example, when a card is moved or deleted, the next time you check, the lane reflects the true state—no manual sync needed.

This self-healing behavior means your view stays accurate, no matter how many external tools or edits happen. It’s like having a smart map that automatically updates itself with every turn.

How External Tools and AI Agents Play Nice with Files

Threlmark’s architecture invites outside tools to participate simply by reading and writing files. Explore more about local data control. For example, an AI agent can scan the `items/` folder, update task statuses, and even close cards without needing special permissions or API calls. All it needs is access to the files.

This openness means your workflow can include code snippets, automation scripts, or collaborative tools—without any middlemen. It’s like sharing a whiteboard where anyone can jot notes directly on the surface.

How External Tools and AI Agents Play Nice with Files
How External Tools and AI Agents Play Nice with Files

Practical Tips for Building Your Own Disk-Based System

  1. Use atomic file operations for every write to prevent corruption.
  2. Keep each item as a separate JSON file for easy conflict avoidance.
  3. Design your UI to always reconcile folder states with your view.
  4. Allow external tools to read/write files without locks or API hurdles.
  5. Back up your directory regularly—your disk is your database.

The Tradeoffs of a Disk-Centered, Local-First Approach

While this architecture offers speed, control, and portability, it’s not without tradeoffs. Managing sync conflicts, handling offline scenarios, and ensuring data consistency across devices can get complex. For example, if two devices edit the same card offline, you need a solid merge strategy.

Yet, for solo workflows or small teams, these challenges are manageable. The result? A system that feels faster, more resilient, and more transparent than cloud-only apps.

The Tradeoffs of a Disk-Centered, Local-First Approach
The Tradeoffs of a Disk-Centered, Local-First Approach

When to Embrace This Architecture and When to Avoid It

This approach shines when offline access, data control, and portability matter most. Discover related art and data handling techniques. Solo developers, small teams, or anyone wary of cloud lock-in will find it empowering. But for large, distributed teams with complex sync needs, the simplicity might turn into a headache.

In those cases, hybrid models combining local storage with cloud sync might be better. Think of it as choosing between a bicycle and a car—depends on your distance and cargo.

Frequently Asked Questions

How does Threlmark handle sync conflicts between devices?

Threlmark relies on the fact that each item is a separate file and uses merge strategies that preserve unknown keys. When conflicts happen, it’s up to the user or automated process to reconcile differences, often by versioning or manual review.

Can I use Threlmark offline without losing data?

Absolutely. Since all data lives on your disk, you can work offline, add or modify cards, and sync later by copying files or using your preferred sync tool. The architecture is designed for resilience without network dependence.

What tools can I use to extend Threlmark’s system?

Any tool that can read and write JSON files on your disk can participate. For example, automated scripts, AI agents, or other project tools. Just ensure they follow the same file structure and atomic write principles.

Is this approach suitable for large teams or enterprise projects?

It depends. For small, autonomous teams, it offers speed and control. But for complex, multi-user environments, you’ll need sophisticated sync and conflict resolution strategies—often better suited for hybrid models.

Conclusion

Embracing a disk is the contract mindset transforms your project data into a portable, resilient, and transparent asset. It’s a shift from centralized databases to a simple, powerful file-based approach that gives you control and flexibility. Imagine your workflow free from cloud lock-in, operating smoothly even when offline—that’s the real promise of this architecture.

Next time you think about building or choosing a tool, ask yourself: does this treat my data as a living, breathing set of files? If so, you’re on the right path—because your disk is where the real work begins.

You May Also Like

Build vs Buy a Prebuilt AI Workstation

Decide between building your own or buying a prebuilt AI workstation. Discover the real costs, performance, and support differences for 2026.

Anthropic’s Series H: An Indicator of AI’s Compute-Heavy Future

Discover how Anthropic’s record-breaking $965 billion valuation is really a massive bet on compute capacity, infrastructure, and future AI growth. This isn’t just funding—it’s a compute revolution.

Acoustic Dampening, Placement, and the “Rig in the Closet” Setup

Learn how to silence your AI workstation with smart placement, DIY dampening, and the ‘rig in the closet’ trick. Make your space quieter and cooler now.

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst transforms idea validation with a local-first, AI-driven war room. Learn how to make smarter decisions faster today.