ADHD Skill: Tree-of-Thought Brainstorming for Agents
A tree-of-thought brainstorming skill for coding agents. Fans divergent ideas across cognitive frames, scores, prunes dead ends, deepens survivors.
TL;DR
TL;DR: ADHD is a coding agent skill for tree-of-thought brainstorming. It fans out parallel divergent ideas under different cognitive frames, scores each branch, prunes low-quality paths, and deepens the survivors. Built on the Claude and Codex Agent SDK for creative and interdisciplinary work.
Source and Accuracy Notes
Based on the official UditAkhourii/adhd repository, MIT licensed. Architecture and methodology sourced from the repository documentation as of June 2026.
What Is ADHD?
ADHD — despite its provocative name — is a skill for AI coding agents that implements tree-of-thought reasoning with pruning. The idea is simple: instead of linear reasoning (think of one solution, pursue it), the agent fans out into parallel divergent thoughts, evaluates each branch, prunes the low-quality ones, and deepens the promising paths.
The name reflects the creative, associative, divergent thinking style the skill enables — not a medical condition. It’s designed for tasks that benefit from exploring many possibilities before converging: architecture decisions, creative problem-solving, research exploration, and interdisciplinary synthesis.
How Tree-of-Thought Works
Standard chain-of-thought (CoT) reasoning follows a linear path: A → B → C → D. Tree-of-thought (ToT) branches at each step:
A
/ | \
B C D
/ \ / \
E F G H
At each depth, the agent evaluates all branches, prunes the weakest, and expands the strongest. This produces a wider exploration than CoT without the combinatorial explosion of exhaustive search.
Repo-Specific Setup Workflow
Prerequisites
- Node.js 20+
- Claude Code or Codex CLI
- npm
Step 1: Install the Skill
# For Claude Code
npx skills add UditAkhourii/adhd
# For Codex
# Copy the skill file to your Codex skills directory
cp adhd-skill.md ~/.codex/skills/adhd.md
Step 2: Use in a Session
Activate the skill when tackling a problem that benefits from divergent thinking:
/skill adhd
I need to design the data pipeline for a real-time analytics dashboard.
Explore architectural options, evaluate tradeoffs, recommend the best approach.
The agent will:
- Generate multiple architecture proposals under different frames (cost-optimized, latency-optimized, simplicity-first)
- Score each proposal against your constraints
- Prune clearly inferior options
- Deepen the top 2-3 candidates with implementation details
- Present a comparison with rationale
Deeper Analysis
Cognitive Frames
The skill deploys different cognitive frames to ensure diverse thinking:
- First principles: Reduces the problem to fundamentals and rebuilds
- Analogical: Maps solutions from other domains to the current problem
- Constraint-first: Starts with hard constraints and works backward
- Lateral: Deliberately explores unconventional or counterintuitive approaches
- Risk-weighted: Prioritizes solutions by failure impact
By running each frame in parallel, the skill avoids the trap of getting locked into the first reasonable-sounding approach.
Scoring and Pruning
Branches are scored on configurable criteria:
- Feasibility: Can this actually be built with available resources?
- Impact: How much does this improve the current state?
- Novelty: Is this substantially different from existing approaches?
- Risk: What’s the downside if it fails?
The pruning threshold is configurable — stricter pruning for quick decisions, looser for thorough exploration.
Agent SDK Integration
Built on the Claude Agent SDK and Codex Agent SDK, the skill uses native agent capabilities (tool use, structured output, sub-agent spawning) rather than prompt engineering alone. This makes it more reliable than pure prompt-based ToT approaches.
Practical Evaluation Checklist
- Tree-of-thought with cognitive frame diversity — avoids single-solution lock-in
- Automatic pruning keeps exploration efficient
- Built on Claude and Codex Agent SDKs for reliability
- Configurable scoring criteria per use case
- MIT licensed
- Works as a skill — no separate infrastructure needed
Security Notes
- All reasoning happens within your LLM provider’s API — review data handling policies
- The skill itself is open-source and auditable
- No external API calls beyond your configured LLM endpoint
- Sensitive problem statements are sent to your LLM provider
FAQ
Q: When should I use this instead of normal chain-of-thought? A: Use ADHD when the problem has multiple viable approaches and you’re not sure which is best. Architecture decisions, creative work, research exploration, and interdisciplinary problems benefit most. For straightforward implementation tasks, CoT is faster.
Q: Does it use more tokens? A: Yes — tree-of-thought uses more tokens than chain-of-thought because it explores multiple branches. The tradeoff is better decisions. For high-stakes choices, the token cost is negligible compared to the cost of a wrong decision.
Q: What’s the difference between this and a multi-agent debate? A: Multi-agent debate (like Duel Agents) pits agents against each other. ADHD uses a single agent but explores multiple reasoning paths internally. They complement each other — ADHD for exploration, Duel Agents for verification.
Q: Can I adjust how many branches it explores? A: Yes. The branching factor, depth, and pruning threshold are all configurable in the skill settings.
When Not to Use Tree-of-Thought
Tree-of-thought exploration has costs — more tokens, more latency, and sometimes more confusion from too many options. It’s counterproductive for tasks where the solution space is narrow or where you already know the right approach. Use ADHD for problems where you genuinely don’t know the best approach, high-stakes decisions where exploration cost is lower than wrong-decision cost, and creative or interdisciplinary work where diverse perspectives matter.
Skip it for bug fixes with known patterns, straightforward CRUD implementations, or tasks where speed matters more than thoroughness.
Combining with Other Skills
ADHD works well in combination with other agent skills. For example: pair ADHD with Duel Agents — ADHD explores the solution space, Duel Agents verifies the top candidate. Or combine ADHD with OpenSpec — use ADHD to explore architecture options for a spec before committing to one approach. The cognitive frame diversity from ADHD makes it a natural precursor to any decision-heavy workflow.
Q: How do I know if the tree-of-thought exploration actually helped? A: The skill logs the number of branches explored, pruned, and deepened. Compare the final recommendation against your initial instinct — if they differ, the exploration likely surfaced something you would have missed. Over time, you’ll develop intuition for which problems benefit most.
Conclusion
ADHD brings structured divergent thinking to AI coding agents, filling a gap that linear reasoning can’t cover. When the problem is ambiguous, the solution space is wide, and the cost of a wrong choice is high, tree-of-thought with pruning beats chain-of-thought every time. The cognitive frame approach ensures the exploration isn’t just wider — it’s genuinely different, escaping the echo-chamber of whatever the agent’s first instinct was. For architects, researchers, and anyone tackling novel problems with AI assistance, it’s a powerful addition to the agent’s toolkit.