deepthonk AGENTS.md

Project instructions for DeepThonk, a TypeScript command-line tool and MCP server that improves reasoning by running multiple reasoning attempts and combining their results. The instructions require the command-line tool and MCP server to share one core engine.

In plain words
What is it for?
Use them when developing DeepThonk’s core engine, CLI, MCP server, configuration options, prompt templates, or inspection resources.
Why use it?
They give coding agents precise rules for extending the project without duplicating its main algorithm. They also require all important settings and intermediate results to remain accessible.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/linxule/deepthonk/agents-md
Clone the repo
git clone --depth 1 https://github.com/linxule/deepthonk

Made for: Codex, OpenCode.

Per session 769 This file is loaded in full into every session.
When invoked 769 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00769 $0.00769
Opus 5 $0.00385 $0.00385
Sonnet 5 $0.00154 $0.00154
Haiku 4.5 $0.00077 $0.00077

Measured 2d ago against content hash 0fc8c2d7f0f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

deepthonk AGENTS.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf runs/test-quick
AGENTS.md · 38 lines

What it actually says

DeepThonk Build Instructions

DeepThonk is a provider-neutral, OpenDeepThink-style reasoning optimizer exposed as a TypeScript CLI and MCP server.

The algorithm is from Zhou et al. 2026 (OpenDeepThink: Parallel Reasoning via Bradley–Terry Aggregation, arXiv:2605.15177); the authors' Python reference implementation is at https://github.com/ZhouShang0817/open-deep-think (MIT). DeepThonk is an independent TypeScript reimplementation — not a fork, no code vendored from the reference.

Tagline: thonk harder, not richer.

Build and maintain the project around one shared execution engine in packages/core. The CLI and MCP server are wrappers over that engine; do not duplicate algorithm logic in those packages.

Design principle: agent-composable surface. Every algorithm dimension — population shape (n, k, t, m), regularization (lambda), temperatures, prompt style, and per-phase prompt templates — must be reachable inline through MCP tool arguments and CLI flags, not only through YAML files. Inspection of every intermediate artifact must remain available as MCP resources. See docs/customization.md for the variable contract.

Core requirements:

  • Implement population-based candidate generation, randomized pairwise comparison, Bradley-Terry aggregation, elite preservation, critique-guided mutation, bottom-quartile discard, and final dense ranking.
  • Keep all model access behind the provider-neutral ModelDriver contract in packages/providers.
  • Support fake, openai-compatible, and deepseek providers.
  • Do not request hidden chain-of-thought. Ask models for final artifacts, concise rationales, critiques, and strict JSON where needed.
  • Never log API keys or env var values. Do not write prompts or raw model output unless explicitly configured.
  • MCP is a protocol wrapper over core execution, not a separate execution engine.
  • The Streamable HTTP transport must keep DNS rebinding protection on and validate Host against the loopback bind (CVE-2025-66414 class). Do not remove that guard when extending the transport.
  • Background MCP jobs (deepthonk.start) must wrap both their success and failure handlers so a filesystem error cannot escape as an unhandled rejection.
  • Use pnpm, TypeScript, Vitest, Zod 4, Commander, YAML, and the stable official MCP TypeScript SDK package @modelcontextprotocol/sdk. Do not add p-limit: it was removed in v0.3.0 because nothing imported it — phaseRunner.ts implements its own worker pool.
  • zod is part of @deepthonk/core's published API (index.ts re-exports schemas.ts). A Zod major bump is a breaking release, not a dependency chore.
  • Anything test/ imports must be declared in the root package.json. test/ sits at the workspace root, so a package reaching it only transitively resolves locally and then fails CI with ERR_MODULE_NOT_FOUND. This has bitten yaml, @modelcontextprotocol/sdk, and zod.

Acceptance checks:

pnpm install
pnpm run build
pnpm test
pnpm --silent --filter deepthonk deepthonk plan --profile paper
rm -rf runs/test-quick
pnpm --silent --filter deepthonk deepthonk run --provider fake --profile quick --task examples/tasks/toy-math.txt --out runs/test-quick
pnpm --silent --filter deepthonk deepthonk inspect runs/test-quick
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 38 lines · 769 tokens per session scan C 0fc8c2d7f0f3

Subscribe to this mod's changes

deepthonk AGENTS.md is an instructions file published in the GitHub repository linxule/deepthonk (0 stars, last pushed 8d ago), licensed MIT. It adds 769 tokens to every session, about $0.0038 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.