Anchor Stripping in ADHD: What It Is, How It Works, and When to Use It
Anchor stripping is a preprocessing step in ADHD (Advanced Divergence Handling Decoder) that removes incidental implementation details—like specific framework names or current tech stacks—from problem statements before divergent brainstorming, so the LLM focuses on core constraints rather than existing solution patterns.
Anchor stripping sits at the heart of ADHD's reframing engine. According to the UditAkhourii/adhd source code, this mechanism ensures that every divergent idea branch starts from the fundamental problem rather than being biased by how things happen to be built today.
What Anchor Stripping Removes vs. Preserves
The system prompt in src/engine.ts draws a sharp distinction between load-bearing anchors and incidental anchors:
| Keep (Real Constraints) | Strip (Incidental Anchors) |
|---|---|
| Compliance requirements | Current implementation stack |
| Legal or regulatory limits | Existing tool names |
| Hard budget ceilings | Specific framework versions |
| Performance non-negotiables | "How we've always done it" |
The prompt explicitly instructs: "Strip incidental anchors, keep real constraints" — ensuring that constraints like "must comply with GDPR" survive while "uses React" gets filtered out.
The Anchor Stripping Pipeline in src/engine.ts
Phase 0: The REFRAME Step
Anchor stripping executes during Phase 0 – REFRAME of the ADHD engine. The flow works as follows:
- The engine receives the raw
problemstring - It constructs a system message containing the
REFRAME_SYSTEMdefinition - The LLM processes the prompt with anchor-stripping instructions
- If any anchors are removed, the CLI emits:
↺ anchors stripped from problem
// Conceptual flow from src/engine.ts lines 96-106, 331-333
// The system prompt defines what constitutes an anchor:
"You strip load-bearing anchors from a problem statement before divergent brainstorming.
An anchor is an incidental implementation detail (a specific framework, existing tool name,
current stack choice) that does not represent a true constraint of the problem."
Default Behavior and Detection
By default, stripAnchors: true in all run configurations. The engine detects whether stripping actually modified the input by comparing original and reframed outputs—only printing the status line when changes occur.
Controlling Anchor Stripping: API and CLI Options
The RunOptions interface in src/types.ts (lines 57-60) exposes explicit control:
// From src/types.ts
interface RunOptions {
problem: string;
stripAnchors?: boolean; // defaults to true
// ... other options
}
Using the TypeScript API
Default behavior (anchors stripped):
import { run } from "adhd";
await run({
problem: "Generate a new feature for our React app that uses the current Redux store.",
// stripAnchors defaults to true → "React" and "Redux store" treated as incidental anchors
});
Preserve original wording:
await run({
problem: "Generate a new feature for our React app that uses the current Redux store.",
stripAnchors: false, // keep implementation details intact
});
Using the CLI
The src/cli.ts parser (lines 67-103) surfaces this as --no-anchor-strip:
# Default: strip anchors
npx adhd run "Generate a new feature for our React app that uses the current Redux store."
# Disable stripping
npx adhd run "Generate a new feature for our React app that uses the current Redux store." \
--no-anchor-strip
Why Anchor Stripping Matters for Divergent Thinking
ADHD's core purpose is generating diverse, non-obvious solution branches. Anchor stripping directly serves this by:
- Preventing path dependence — Solutions aren't locked into current tech choices
- Surfacing constraint clarity — Forces explicit identification of what actually cannot change
- Enabling cross-domain transfer — A problem stripped of "React app" framing might inherit solutions from native mobile or desktop domains
- Reducing implementation bias — The LLM won't assume Redux is required just because it's mentioned
When stripAnchors: false, you trade these benefits for precision in contexts where the current implementation genuinely constrains viable solutions—such as incremental improvements to an existing codebase where wholesale technology changes are off the table.
Implementation Details in Key Source Files
| File | Role in Anchor Stripping |
|---|---|
src/types.ts |
Defines RunOptions.stripAnchors boolean and its documentation |
src/engine.ts |
Contains REFRAME_SYSTEM prompt, anchor classification logic, Phase 0 execution, and status line emission |
src/cli.ts |
Parses --no-anchor-strip flag and forwards to engine configuration |
The prompt engineering in src/engine.ts is particularly critical—it must be specific enough to distinguish incidental from load-bearing details without over-filtering, and the implementation handles edge cases where the reframed output might be semantically altered beyond intended scope.
Summary
- Anchor stripping removes implementation-specific details from problem statements while preserving true constraints
- The mechanism lives in
src/engine.tsas part of Phase 0 – REFRAME, guided by a carefully constructed system prompt - Default behavior (
stripAnchors: true) maximizes divergent thinking potential by eliminating technology bias - Control options exist in both API (
stripAnchors: boolean) and CLI (--no-anchor-strip) interfaces - Disabling stripping is appropriate when current implementation genuinely constrains the solution space
Frequently Asked Questions
What happens if all details in my problem statement get stripped?
According to the src/engine.ts implementation, the reframing prompt is designed to be conservative—only explicitly identified "incidental implementation details" are removed. If your statement contains only load-bearing constraints, it passes through unchanged and no status line appears. The prompt explicitly instructs preservation of compliance, legal, budget, and performance requirements.
Can I see what anchors were actually removed?
The current implementation in src/engine.ts (lines 331-333) only emits a binary status indicator: ↺ anchors stripped from problem. The reframed output itself reveals what remains, and comparing against your original input shows what was filtered. There is no explicit "diff" output of removed anchors in the current version.
Why would I ever disable anchor stripping?
Disable with --no-anchor-strip or stripAnchors: false when your problem inherently requires working within specific technical constraints—such as suggesting improvements to an existing React component where "React" is genuinely load-bearing, or when the current implementation's quirks create valid boundaries that must be respected for practical deployment.
Does anchor stripping affect the final solution quality?
Yes, significantly. The UditAkhourii/adhd source design assumes that incidental anchors artificially constrain the solution space. By stripping them during Phase 0, subsequent divergence phases explore a broader, more fundamental problem formulation—often surfacing solutions that wouldn't emerge if the LLM assumed React/Redux-specific patterns were required.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →