Skip to content
AI Article

ThoughtDAG makes LLM context something you can edit

A Show HN canvas app gets the diagnosis right, even if the desktop package is the wrong vehicle.

Rachel Goldstein
Rachel Goldstein
Dev Tools Editor · Aug 15, 2026 · 5 min read
ThoughtDAG makes LLM context something you can edit

Every chat interface you've used is lying to you by omission. The transcript scrolls upward forever, but the thing that actually determines the model's next answer — the exact sequence of messages assembled into the request — is invisible and largely out of your hands. ThoughtDAG, a Show HN from developer Xia Chen that recently hit the Hacker News front page, attacks that gap with a blunt design thesis: chat hides context, so replace chat with a graph where the wires are the context.

It's a small project — MIT-licensed, 165-odd GitHub stars, a solo author — but it lands on the most important unsolved problem in working with LLMs. Whether this particular package is the answer is a different question, and I don't think it is. The diagnosis, though, is exactly right.

Wires are the context

The mechanics are simple and strict. Every question-and-answer exchange becomes a node on an infinite canvas. Edges aren't decorative: when you ask a question from a node, ThoughtDAG walks that node's incoming edges, orders the ancestors topologically, and builds the message sequence from exactly those nodes. Delete an edge and that branch vanishes from the next request — the content stays on the canvas, but the model never sees it. The app shows you a token preview before every send and a diff when you change the wiring ("after deleting this edge: −47 tokens"), so context stops being a vibe and becomes something you can inspect.

On top of that core loop it layers the operations you'd want: branch to explore alternatives without clobbering a working line of reasoning, prune to park material off to the side, merge to synthesize multiple branches into one answer, and replay in dependency order when an upstream node changes — with staleness detection so you know which downstream answers are now built on edited foundations. There's PDF clipping with page-level provenance, which matters more than it sounds: when an answer cites a passage, you can trace the wire back to the exact page it came from.

It ships as a local-first desktop app for macOS, Windows, and Linux (v0.3.17 at the time of writing), and talks to Ollama for local inference or any OpenAI-compatible endpoint — the docs list OpenAI, Anthropic, Google, DeepSeek, Qwen, Kimi, and OpenRouter among others. The stack is React 19, TypeScript, and React Flow.

You've seen this graph before

Branching LLM interfaces are not new, and it's worth being precise about what is. Loom was doing tree-structured generation with GPT-3 base models back in 2021, aimed at writers exploring completion space. ChatGPT's edit-and-regenerate has quietly been a conversation tree all along — it just hides the tree behind tiny pagination arrows. Node-graph editors for AI pipelines are a whole genre by now: ComfyUI for diffusion, Rivet for visually wiring up LLM calls, LangGraph for expressing agent control flow in code.

ThoughtDAG's actual novelty is narrower and more interesting than "graph UI for chat": it makes the context assembly step itself the editable artifact. Rivet and LangGraph are graphs of computation — you're programming a pipeline. Loom and ChatGPT's hidden tree are graphs of alternatives — you're picking a branch. ThoughtDAG is a graph of inclusion: the edges are a declarative spec for what goes into the prompt, with token-level preview of the consequences. That's the piece that has no mainstream equivalent, and it arrives at the right cultural moment — a year after "context engineering" displaced "prompt engineering" as the term of art, and everyone building agents has internalized that what you feed the model matters more than how you phrase the ask.

The trade-offs nobody puts on the landing page

The HN thread did the due diligence, and three findings deserve your attention before you adopt this.

First, security: a commenter found that the PDF rendering path shelled out with user-controlled input while the bundled server bound to 0.0.0.0 — a remote code execution risk on any shared network. The author patched it quickly and credited the reporter, which is the right response, but it's a reminder that "local-first desktop app with a bundled Express server" is a real attack surface, not a safety guarantee. If you run it, confirm you're on a patched build.

Second, economics. Linear, append-only chat is maximally friendly to prefix caching, and every serious provider now discounts cached prefix tokens heavily — cache reads on Anthropic's API cost a tenth of fresh input tokens, and vLLM does automatic prefix caching for self-hosted models. A DAG where you rewire mid-graph invalidates the cached prefix for everything downstream. For local Ollama use, who cares. Against a paid API with long documents wired in, freely re-plumbing your context graph can quietly multiply your bill and your latency. The author acknowledged on HN that this needs real benchmarking; until then, treat edge-editing on large contexts as an expensive operation.

Third, and most fundamental: it's another app. The sharpest criticism in the thread wasn't about the mechanics — it was that nobody wants a separate canvas alongside Claude Code, Cursor, and their editor. Context management is most valuable precisely where the context is: inside the tools already accumulating it. The author conceded the point and floated pivoting toward "a context layer others read and write to," which is, frankly, the correct product and a much harder one to build.

Where this actually lands

Here's my read. As a daily driver, ThoughtDAG will stay niche — the people who feel this pain hardest live in terminals and IDEs, and a standalone canvas asks them to move their whole workflow to get the benefit. Try it anyway, pointed at Ollama, for the workload where it genuinely shines today: long research sessions over a pile of PDFs, where branching lines of inquiry and auditable provenance beat any linear chat.

But the durable contribution is the interaction contract, not the app: context as an inspectable, editable, diffable graph with token costs attached. Agent frameworks currently manage context through compaction and subagent handoffs that users can neither see nor veto. The first coding agent that exposes its context window the way ThoughtDAG does — here's what's wired in, here's what it costs, click to prune — will make every competitor's context handling look like a black box overnight. Someone will ship that. ThoughtDAG is the working sketch they'll crib from, and as a sketch, it earns its stars.

Sources & further reading

  1. ThoughtDAG - Make LLM context visible and editable — chenxiachan.github.io
  2. Show HN: ThoughtDAG - An editable context graph for LLM conversations — news.ycombinator.com
  3. chenxiachan/thoughtdag — github.com
Rachel Goldstein
Written by
Rachel Goldstein · Dev Tools Editor

Rachel has been embedded in the developer tooling ecosystem for nearly eight years, covering everything from IDE wars and package-manager drama to the quiet rise of AI-assisted coding. She has a soft spot for open-source maintainers and an unhealthy number of terminal emulators installed on a single laptop.

Discussion 0

Join the discussion

Sign in or create an account to comment and vote.

No comments yet

Be the first to weigh in.

Related Reading