# When Should You Set `stripAnchors: false` in ADHD? 4 Key Scenarios

> Discover when to set stripAnchors: false in ADHD for LLM prompts. Learn the 4 key scenarios where keeping incidental anchors improves context and accuracy.

- Repository: [Udit Akhouri/adhd](https://github.com/UditAkhourii/adhd)
- Tags: best-practices
- Published: 2026-08-19

---

**Set `stripAnchors` to `false` when you need incidental anchors—such as stack names, tool identifiers, or contextual tags—to remain in the problem statement sent to the LLM.**

In the `UditAkhourii/adhd` repository, the `stripAnchors` flag determines whether the engine removes contextual metadata from a prompt before reframing it. By default, this value is `true` in [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts), which means the engine automatically strips incidental anchors and marks the output as `changed: true`. Knowing when to set `stripAnchors: false` ensures the LLM receives the exact context required for accurate reasoning.

## What `stripAnchors` Controls

ADHD’s engine uses `stripAnchors` to sanitize problem statements by removing extraneous labels that could distract the LLM. When the flag is `true`, the processing logic in [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts) detects and removes tags like stack or tool names, then logs that anchors were stripped. The flag definition lives in [`src/types.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/types.ts), where it is typed as a configurable boolean option.

## When to Set `stripAnchors: false`

Disable anchor stripping in the following four scenarios.

### Debugging and Inspecting Raw Prompts

Keep `stripAnchors: false` when you need to inspect the exact text passed to the LLM. Preserving raw anchors—such as "React" or "Docker"—makes it easier to trace unexpected output back to the original prompt.

### Domain‑Specific Prompts Relying on Stack or Tool Names

Some workflows require explicit mention of a technology to guide the LLM’s reasoning. If your problem statement depends on keywords like "React" or "Kubernetes" to establish context, stripping them would remove critical information. Set `stripAnchors: false` so these identifiers remain intact.

### Preserving Legal or Compliance Language

If a problem statement contains mandatory identifiers, citations, or regulated terms that must not be altered, disable stripping. This prevents the engine from accidentally removing language required for audit or compliance purposes.

### Custom Pre‑Processing and Re‑Framing Logic

When you implement your own pre‑ or post‑processing pipelines that depend on specific anchors, turn off the built‑in stripping. This avoids double‑removal and ensures your custom logic operates on the original, unmodified text.

## How to Configure `stripAnchors`

You can toggle this flag through the TypeScript API or the CLI. According to [`documentation/api.md`](https://github.com/UditAkhourii/adhd/blob/main/documentation/api.md), the `stripAnchors` option accepts a boolean that overrides the default behavior defined in [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts).

Use the `run` function from the `adhd` package and pass `stripAnchors: false` in the options object:

```typescript
import { run } from "adhd";

await run({
  problem: "React: How do I handle state updates?",
  // Keep the stack name ("React") in the prompt
  stripAnchors: false,
});

```

On the command line, use the `--no-anchor-strip` flag handled in [`src/cli.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/cli.ts). Omitting this flag leaves the default `true` behavior active:

```bash

# Disable stripping via CLI

adhd --problem "Docker: Explain layer caching" --no-anchor-strip

```

When `stripAnchors` is `false`, the engine skips anchor removal and does not emit the "↺ anchors stripped from problem" notice. The JSON output will not report `changed: true` for this modification.

## Summary

- **Default behavior:** `stripAnchors` is `true` in [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts), so the engine removes incidental anchors automatically.
- **Disable for debugging:** Set `stripAnchors: false` to inspect raw prompts with stack or tool names intact.
- **Disable for domain context:** Keep anchors when explicit technology names guide LLM reasoning.
- **Disable for compliance:** Preserve mandatory identifiers that must not be altered.
- **Disable for custom logic:** Avoid double‑processing when your own pipeline handles anchors.
- **Configuration:** Use the `stripAnchors` option in the API or `--no-anchor-strip` in [`src/cli.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/cli.ts).

## Frequently Asked Questions

### What is the default value of `stripAnchors` in ADHD?

The default value is `true`. According to [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts), the engine initializes the flag to strip incidental anchors unless you explicitly set `stripAnchors: false` or pass the `--no-anchor-strip` CLI option.

### Does disabling anchor stripping affect JSON output?

Yes. When `stripAnchors` is `true`, the engine reports that anchors were stripped and sets `changed: true` in the JSON output. When set to `false`, the engine leaves the problem text unchanged and does not emit the stripping notice.

### Where is the `stripAnchors` flag defined in the source code?

The flag is defined in [`src/types.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/types.ts) as a boolean configuration option. The default value and processing logic are implemented in [`src/engine.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/engine.ts), while [`src/cli.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/cli.ts) maps the `--no-anchor-strip` argument to the flag.

### Can I use `stripAnchors: false` with the ADHD CLI?

Absolutely. The CLI supports disabling anchor stripping via the `--no-anchor-strip` flag, as implemented in [`src/cli.ts`](https://github.com/UditAkhourii/adhd/blob/main/src/cli.ts). This sets the internal `stripAnchors` value to `false` before the engine processes your problem statement.