ADHD: The Open-Source Engine That Stops AI Agents From Falling in Love With the First Idea

A parallel divergence layer for Claude-powered agents that fans out isolated thoughts, scores for traps, clusters by angle, and deepens only the survivors.

8 min read • View on GitHub • More from UditAkhourii

A wide editorial scene shows one problem splitting into several sealed glass chambers, each chamber containing a different way of thinking about the same task. The branches do not touch until they reach a final narrowing gate, which explains why the system protects novelty before it allows judgment.
ADHD treats idea generation as something to protect, not something to optimize too early.
Key Takeaways

The first idea problem

Most agent workflows do not fail because the model is unimaginative. They fail because the model is too quick to sound right. The first plausible answer becomes the anchor, and every later step quietly bends toward it.

ADHD is built around a blunt objection to that pattern. It treats premature convergence as a systems problem, not a prompt-writing problem. If you want more original answers, you do not just ask harder. You prevent the search from collapsing too early.

What ADHD actually does

The workflow is easy to summarize and hard to get right: fan out isolated branches, score them later, cluster by underlying angle, then deepen only the survivors. That is the whole thesis. Everything else in the repo serves it.

The architecture is built to keep divergence isolated until judgment has done its work.

ApproachHow ideas are generatedHow evaluation happensStrengthFailure mode
Single-pass agent promptingOne chain produces one answer pathEvaluation is mixed into the same passFast and cheapAnchors on the first decent idea
Standard Tree-of-Thought explorationMultiple branches explore variantsBranches may still influence one anotherBroader search than a single passSearch can collapse toward similar ideas
ADHD hard-wall divergenceIsolated branches think under different framesA separate critic scores, clusters, and filtersNovelty survives long enough to matterCosts more compute and latency

The hard wall between thinking and judging

This is the heart of the project. During divergence, branches are intentionally sealed off from one another. In `src/llm.ts`, that means stateless calls and `allowedTools: []`, which is not a minor implementation detail. It is the point.

Tools create momentum toward solving. Momentum is useful after the search space is open. It is harmful while you are trying to keep the search space from collapsing. ADHD blocks that collapse by making the model generate from a frame, then refusing to let the frame be contaminated by whatever came next.

A close-up workbench scene shows several masks being placed onto the same thinking engine, then three cracked shells being removed while one intact concept remains under a magnifying lens. The image explains how the system uses frames to diversify thinking and then strips away trap-laden options before deepening anything.
Frames widen the search. The critic pass removes the brittle ideas before they spread.

Frames are the secret sauce

The repo defines 15 cognitive frames, with at least one wild frame required. That is a subtle but important move. The model is pushed out of the obvious lane without being turned loose into randomness.

const FRAMES = [
  "speedrunner",
  "regulator",
  "ten-year-old",
  "biology system",
  "hardware engineer",
  // ...other frames
]

const selection = selectFrames({
  tags: ["code", "design"],
  requireWild: true,
  count: 5,
})

// Divergence uses stateless calls and no tools.
const response = await query({
  preset: "claude_code",
  allowedTools: [],
  prompt: buildFramePrompt(selection)
})

We argue ADHD is the right inference-time structure for creative, interdisciplinary, and design-shaped tasks where the failure mode is not wrong but obvious.

Scoring is not ranking

The critic pass is doing more than sorting. It is looking for traps, weighting viability, and clustering by underlying angle instead of keyword similarity. That matters because two ideas can sound different while still belonging to the same mental rut.

The scoring logic in the repo makes that explicit. Novelty is rewarded, viability is weighted most heavily, and fit comes last. That mix says something important: the goal is not just to surprise the model. It is to surprise it without wasting the user's time.

DimensionSimple best-of-NADHD critic pass
What gets comparedSurface similarity and overall polishNovelty, viability, fit, and trap risk
What is groupedOften by wording or immediate shapeBy underlying angle
What survivesThe prettiest answerThe strongest answer that is still structurally honest
Main riskSafe samenessHigher compute cost

Why the pre-flight gate matters

The skill interface adds a product judgment layer before the system spends real compute. That is not a footnote. It is the economic guardrail that makes the whole idea credible.

ADHD is more expensive than a normal prompt. The repo is honest about that. The pre-flight gate decides whether the task is fuzzy, architectural, or open-ended enough to justify the extra spend. That makes the tool feel less like a toy and more like infrastructure.

ADHD makes many heads think differently, in parallel, then has a critic pick.

Where ADHD fits in the agent ecosystem

This is not a code generator replacement. It is a planning layer. It fits best when the problem is messy, design-shaped, or interdisciplinary, and when a bad early answer is more dangerous than a slow one.

Best fitWhy ADHD helpsWhy a simpler agent may be enough
Architecture decisionsMany plausible paths need separation before critiqueThe task may be too bounded to justify divergence
Product strategyFrames help test different mental modelsThe answer may already be well-scoped
Bug triage with fuzzy symptomsIsolated branches reduce anchoring on one diagnosisA direct debugger may be faster
Routine code generationThe extra search can be overkillA single pass is cheaper and sufficient

What the benchmark does, and what it does not prove

There is a bench folder, a judge loop, and a small evaluation story. That is a good sign. It means the project is trying to measure something real instead of hiding behind vibes.

But the evidence should stay in proportion. The benchmark set is small, so it can suggest a pattern without proving a universal law. The honest read is directional: ADHD may help on creative, open-ended tasks where anchoring is the enemy, but that is not the same as a blanket win.

The interesting signal is not that every score improves. It is that the system makes a choice about when to pay for depth, and then spends that depth where the search process actually benefits from it.