---
slug: "d-strange"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/divisingh19988-gif/d-strange@main/README.md"
repo: "https://github.com/divisingh19988-gif/d-strange"
source_file: "README.md"
branch: "main"
---
<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.png">
    <source media="(prefers-color-scheme: light)" srcset="assets/logo.png">
    <img alt="D Strange logo: a portal scanning many branching paths down to the one that works" src="assets/logo.png" width="320">
  </picture>
</p>

<p align="center">
  <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
  <a href="package.json"><img alt="Deps: declared, Dependabot monitored" src="https://img.shields.io/badge/deps-declared%20%2B%20Dependabot-blue.svg"></a>
  <a href="SECURITY.md"><img alt="Auditable hooks: no network, no secrets" src="https://img.shields.io/badge/auditable%20hooks-no%20network%2C%20no%20secrets-blue.svg"></a>
  <a href="SECURITY.md"><img alt="semgrep: 0 findings" src="https://img.shields.io/badge/semgrep-0%20findings-brightgreen.svg"></a>
  <a href="#install"><img alt="Works across 7 agents" src="https://img.shields.io/badge/agents-7-blueviolet.svg"></a>
  <a href="https://github.com/divisingh19988-gif/d-strange"><img alt="GitHub stars" src="https://img.shields.io/github/stars/divisingh19988-gif/d-strange?style=social"></a>
  <a href="https://github.com/divisingh19988-gif/d-strange/releases"><img alt="Release" src="https://img.shields.io/github/v/release/divisingh19988-gif/d-strange"></a>
</p>


<h2 align="center">Stop burning tokens on trial-and-error.</h2>

<p align="center">
  <b>Your agent commits to the first idea, hits a wall, and you pay for it.<br>
  D Strange makes it find the path that actually works, before it starts.</b>
</p>

<p align="center">
  <sub>Named for the wizard who scanned 14,000,605 futures before committing to one. That is the whole trick: check the futures before you burn the tokens, not after.</sub>
</p>

---

## The problem

Give an agent an over-constrained problem, a hard cost ceiling, a "there has to be a way" ask, a decision with several plausible but expensive-to-verify approaches, and it tends to do one of two things.

It commits to the first plausible idea and only discovers the wall after you have already paid for the work built on top of it. Or, when you push back, it slides into a sycophantic workaround loop, inventing a new trick every time the last one failed, for something that may never have been possible in the first place.

Both burn your tokens. Neither one tells you what is actually true.

D Strange forces a third path: lay out the real options, check each one against real evidence before committing to any of them, say plainly what cannot be done, and converge on a recommended path, not a guess.

## How it works

The hero skill, `d-strange`, runs a nine-step method. Small, cheap-to-try decisions bail out at step 0 in one line; the full ladder only runs when the decision is genuinely hard.

```mermaid
flowchart TD
    Q{"Reversible, cheap to try, or<br/>convention already decides it?"}
    Q -->|yes| BAIL["Bail. Answer in one line."]
    Q -->|no| EN["Enumerate every real option"]
    EN --> GR["Ground each in real evidence<br/>read a file, run a tool, fetch a source"]
    GR --> PR["Adversarially prune<br/>no evidence = UNVERIFIED, cannot be load-bearing"]
    PR --> CL["Classify each option<br/>WORKS / TRADEOFFS / RISKY / DEAD-END / IMPOSSIBLE"]
    CL --> WALL["Name the un-fixable wall<br/>what no trick beats"]
    WALL --> CONV["Converge on ONE recommended path<br/>plus the conditions that flip it"]
```

_Many options in, evidence-pruned down to the one path that survives, with the wall named plainly. The full step table:_

| Step | What happens |
|---|---|
| 0. Disqualifier gate | Is this reversible and cheap to try, or already decided by convention or the repo? If yes, answer in one line and stop. |
| 1. Frame the wall | Restate the hard constraint and what "win" means, in terms you can falsify. |
| 2. Enumerate | List the genuine candidate approaches. Aim wide, no padding. |
| 3. Ground in evidence | For every candidate, produce the concrete proof, a real file read, tool call, or fetched source, that confirms or kills it. No citation means the candidate is UNVERIFIED and cannot be load-bearing. |
| 4. Adversarially prune | Attack each survivor. Default to refuting. Kill anything not backed by evidence actually checked. |
| 5. Classify | Per option: works yes, partly, or no, cost, risk, what it unlocks, exact failure mode. |
| 6. Name the wall | State plainly what no trick beats, what must be paid for, accepted, or cannot be done. The headline output. |
| 7. Converge | Recommend a path, usually a stack, plus the exact conditions under which that recommendation flips. Never "the one and only right way." |
| 8. Honest caveat | What a real expert still has to confirm. This is research, not a guarantee. |

Two tiers: `inline` (default, runs in the conversation, for roughly six or fewer real candidates) and `hunt` (a budget-capped parallel research fan-out for bigger option spaces, gated on your go-ahead before it spends anything).

Without D Strange, the agent commits to the first plausible option and the wall shows up after you have paid for the work built on top of it. With D Strange, the wall shows up first, before you start.

## See it work

This is a condensed, illustrative worked run from `references/examples.md`. It uses an anonymized "Platform X" and example dollar figures on purpose: nothing below is a verified claim about a real vendor, and no number here is a benchmark you should reuse. It exists to show the shape of the method, options checked against evidence, a wall named, a recommendation with flip conditions, not to sell you a performance stat.

**Request:** Pull structured listing data from a large marketplace at 2,000,000 checks a day, capped at $2,000 a month total spend, without tripping the platform's terms of service.

| Option | Grounded evidence | Verdict |
|---|---|---|
| Official API | Docs show a paid tier capped at 50,000 calls/day for $499/month, no seller-rating field | Dead end: roughly 40x short of the required volume |
| Self-built HTTP collector | Cheapest to run, but the platform's own terms explicitly prohibit automated collection outside the official API | Dead end: killed on terms of service, not on cost |
| Licensed commercial data vendor | Enterprise tier: $1,800/month for 3,000,000 records/day with a stated 99% completeness SLA | Works, with tradeoffs: consumes nearly the whole budget and adds vendor lock-in |
| SEO structured-data harvest | Cheap and scalable in principle, but whether it is terms-of-service safe for this specific platform was never actually checked in this run | Risky but survivable: the safety claim is unverified, so it cannot be the primary path yet |

**The wall:** there is no option that clears scale, field completeness, cost, and a verified terms-of-service guarantee all at once without spending close to the entire budget on a licensed feed, or carrying a real legal question that this run did not itself resolve. No amount of engineering cleverness removes that; only an actual read of the platform's current terms, or a written agreement with the platform, closes the gap.

**Recommendation:** run the licensed vendor feed as the primary path, name its lock-in and thin remaining budget honestly, and treat the structured-data harvest as a fallback only after someone actually checks the terms-of-service question, not before. This is not the only right way; it flips if the required volume drops, if the terms question resolves favorably, or if the budget ceiling moves.

Read the full run, plus a one-line Step 0 bail, a `d-strange-council` panel that preserves a dissenting vote, and a `d-strange-extract` provenance table with a dropped, unverifiable claim, in [`references/examples.md`](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/references/examples.md).

## Three tools, one brand

| Skill | What it does | Use it when |
|---|---|---|
| [`d-strange`](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/skills/d-strange/SKILL.md) | Lays out the real options for an over-constrained decision, grounds each in evidence, names the wall, converges on a recommended path. | You are picking between several hard, expensive-to-verify approaches and getting it wrong is costly. See it in action: [Example 1](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/references/examples.md#example-1-structured-marketplace-data-at-scale-under-a-hard-cost-ceiling), [Example 2](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/references/examples.md#example-2-a-step-0-bail). |
| [`d-strange-council`](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/skills/d-strange-council/SKILL.md) | Runs an adversarial panel of opposed reviewers (believer, skeptic, practitioner, market, or a swapped-in lens) against a plan, design, or claim, then synthesizes one verdict that preserves real dissent. | You are about to commit to a high-stakes plan and want it stress-tested before you ship it. See it in action: [Example 3](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/references/examples.md#example-3-a-council-run-with-a-preserved-dissent). |
| [`d-strange-extract`](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/skills/d-strange-extract/SKILL.md) | Turns a transcript, document, or article into a claim set where every surviving row traces to an exact quote in the source, and drops anything it cannot prove. | You need a claim set you can trust from a real source, not a summary from memory. See it in action: [Example 4](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/references/examples.md#example-4-an-extract-run-with-a-dropped-unverifiable-claim). |

All three share the same rigor: ground every claim in real evidence, adversarially check it, and report honestly, including what did not survive. The `inline` tier of each works on any agent that can read a `SKILL.md`. The `hunt` and fan-out tiers use parallel sub-agent orchestration native to Claude Code's Workflow tool; on other hosts, run the same steps as a manual multi-pass instead.

## Install

Claude Code installs D Strange as a plugin. Two prompts, sent separately (the marketplace has to register before the install can resolve it):

```
/plugin marketplace add divisingh19988-gif/d-strange
```

```
/plugin install d-strange@d-strange
```

That pulls in all three skills (`d-strange`, `d-strange-council`, `d-strange-extract`), their slash commands, and a small per-prompt hook. Exactly what that hook does and does not do is in [Security](#security) below.

Every other agent installs by copying one generated file. Pick yours:

<details>
<summary><b>Codex (and other agents that read AGENTS.md)</b></summary>

Copy `AGENTS.md` into your project root, or point your agent's instructions at it directly.

</details>

<details>
<summary><b>Cursor</b></summary>

Copy `.cursor/rules/d-strange.mdc` into your project's `.cursor/rules/` directory. Cursor only loads project rules from `.mdc` files that carry valid frontmatter, so this ships with `description` and `alwaysApply: true` already set, a plain `.md` file in that directory is silently ignored.

</details>

<details>
<summary><b>Windsurf</b></summary>

Copy `.windsurf/rules/d-strange.md` into your project's `.windsurf/rules/` directory.

</details>

<details>
<summary><b>Cline</b></summary>

Copy `.clinerules` into your project root.

</details>

<details>
<summary><b>Gemini CLI</b></summary>

Copy `gemini-extension.json` into your project, or wherever your Gemini CLI setup reads extensions from. Gemini extensions have no `skills` field; this manifest instead points its `contextFileName` at `AGENTS.md`, which is how Gemini actually loads project context.

</details>

<details>
<summary><b>OpenCode</b></summary>

Nothing to copy beyond `AGENTS.md` above. OpenCode's config schema has no `skills` key, so this repo does not ship an `opencode.json`, an earlier version did, but it was inert. OpenCode auto-reads `AGENTS.md` from your project root, so having that file present is the whole install.

</details>

Every one of those generated files (all but the OpenCode entry above, which needs none) is generated from the same source (`skills/*/SKILL.md`) by `node scripts/sync.mjs`, so they never drift out of sync with each other.

**Uninstall:** on Claude Code, remove the plugin through `/plugin`, then run `node scripts/uninstall.mjs` to clear the local mode-state directory the hook reads (`~/.config/d-strange/`); it prints exactly what it removed. On every other agent, delete whichever file you copied in. That is the entire footprint.

## Security

The honest target here is not "100% secure," that is not a real claim any software can make. The target is that **the only executable surface is one small, dep-free, auditable hook, and every real dependency is declared and monitored.**

What actually runs, stated plainly:

- On Claude Code, install registers a `UserPromptSubmit` hook (`hooks/hooks.json`) that runs `hooks/inject-ruleset.mjs` on every prompt. That is install-time and per-prompt execution, not zero execution. On every other agent this repo supports, install is still just copying files, nothing executes.
- `hooks/inject-ruleset.mjs` is the only executable install surface, and it is small on purpose: Node built-ins only, no third-party import, no network call, no reading of secrets or environment variables beyond one whitelisted state-dir override, no spawned process, no writes anywhere. Read it yourself in under a minute, it is about 30 lines. All it does is read a local mode file and print a slice of a bundled markdown ruleset to stdout for the host to inject.
- `scripts/validate.mjs` runs a `checkHookSafety` gate on every `npm test` that fails the build if `hooks/*.mjs` ever grows a third-party import, a network or process-spawn surface, a dynamic `import()`, or a stray `process.env` read. This is a lexical, regex-based gate, not full static analysis, it cannot catch string-concatenation obfuscation of a banned token (`'impo' + 'rt()'`). The trust model leans on that residual being small plus every commit touching `hooks/*.mjs` getting human PR review, not on the gate alone.
- Turn injection off with `/d-strange-mode off` (writes `off` to the local mode file; the hook still runs but prints nothing), or remove local state entirely with `node scripts/uninstall.mjs`. Removing the copied skill or plugin files themselves is your agent's own uninstall step beyond that.
- Real npm dependencies are declared: `commander`, `js-yaml`, and `zod` at runtime, `vitest` in dev. `npm audit` currently reports 0 vulnerabilities, and Dependabot is enabled on the repository to monitor that dependency graph going forward.
- No telemetry beyond the hook above: nothing here opens a socket or phones home on its own. The only other network activity happens inside the `hunt`, `council`, and `extract` fan-out tiers, only when you explicitly invoke them, using your own agent's tools.

A real, fresh scan backs the auditability half of this up. From the repo root:

```
$ semgrep --config auto .
Findings: 0 (0 blocking)
Rules run: 237
Targets scanned: 45
```

237 rules across 45 of this repo's 48 git-tracked files semgrep actually scans, zero findings; the remaining 3 tracked files are PNG logo assets, images have no code for a SAST scanner to parse. `npm test` runs the project's own validator (frontmatter, dash, obfuscation, template-parse, sync-drift, and hook-safety gates) on every push. Full posture, the 8-point threat mapping, named residual risk, and the two-minute audit steps live in [`SECURITY.md`](https://github.com/divisingh19988-gif/d-strange/blob/HEAD/SECURITY.md), including scans that were not run and why, honestly, rather than a fabricated verdict.

## FAQ

**Is this affiliated with Marvel or Disney?**
No. See the note below. The name is a metaphor for scanning many futures before committing to one, not a claim of any license, endorsement, or connection to the character.

**Does `d-strange` guarantee it finds "the one right way"?**
No, and it deliberately does not claim to. Most decisions have several valid paths whose ranking flips with your constraints. What it always gives you is a recommended path, the conditions under which that recommendation changes, and the wall it could not get past.

**What does the `hunt` tier cost?**
It is budget-capped and asks for your go-ahead before it spends anything. Use `inline` (the default) for anything with a small option space; reach for `hunt` only when the space is large or each candidate genuinely needs primary-source verification.

**Which skill do I actually want?**
If you are choosing between approaches, use `d-strange`. If you already have a plan and want it stress-tested before you commit, use `d-strange-council`. If you have a source document and want only what it can actually prove, use `d-strange-extract`.

---

Not affiliated with Marvel, Disney, or the Doctor Strange character or films. "D Strange" is a fan-flavored metaphor for scanning many possible paths to find the one that works, not a claim of any license or endorsement.

Licensed under [MIT](https://github.com/divisingh19988-gif/d-strange/tree/HEAD/LICENSE).

<p align="center">
  <a href="https://star-history.com/#divisingh19988-gif/d-strange&Date">
    <img src="https://api.star-history.com/svg?repos=divisingh19988-gif/d-strange&type=Date" alt="Star History Chart" width="600">
  </a>
</p>
