dsh-from-scratch: Instructions file for Codex

AGENTS.md

dsh-from-scratch AGENTS.md is an instructions file for Codex, OpenCode from tsrigo/dsh-from-scratch. It costs 526 tokens per session, scanned A, original, MIT.

Project instructions for maintaining the DSH, a TypeScript implementation of a DeepSeek harness built from scratch.

In plain words
What is it for?
They guide work on the agent loop, context and cache reuse, plugins, execution records, runtime self-improvement, and continuation of long-running tasks.
Why use it?
They keep the documentation organized around fixed chapters and shared writing rules, including explanations of unfamiliar abbreviations.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is tsrigo/dsh-from-scratch's own configuration. It tells Codex and OpenCode how to work on dsh-from-scratch itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dsh-from-scratch configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tsrigo/dsh-from-scratch. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tsrigo/dsh-from-scratch/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/tsrigo/dsh-from-scratch

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dsh-from-scratch AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tsrigo/dsh-from-scratch/agents-md/github.svg)](https://agentmods.dev/instructions/tsrigo/dsh-from-scratch/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tsrigo/dsh-from-scratch/agents-md"><img src="https://agentmods.dev/badge/instructions/tsrigo/dsh-from-scratch/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dsh-from-scratch AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tsrigo/dsh-from-scratch/agents-md"><img src="https://agentmods.dev/badge/instructions/tsrigo/dsh-from-scratch/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 526 This file is loaded in full into every session.
When invoked 526 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00526 $0.00526
Opus 5.5 $0.00210 $0.00210
Sonnet 5.5 $0.00105 $0.00105
Haiku 4.5 $0.00053 $0.00053

Measured 2mo ago against content hash 460931608f9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dsh-from-scratch AGENTS.md scanned grade A with 0 findings 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 42 lines

What it actually says

DSH 维护约定

固定章节名称

教程的六个章节名称必须保持以下写法,不得改写、替换成概括性标题或自行重命名:

  1. 第一章·Agent Loop
    • DSH 的 Agent Loop 是什么样的?
  2. 第二章·上下文与缓存复用
    • 上下文是怎样组织的,为缓存复用做了什么优化?
  3. 第三章·一切皆插件
    • 如何实现“一切皆插件”?
  4. 第四章·让运行有迹可循
    • DSH 怎么记录和保存 Agent 执行过程?
  5. 第五章·运行时自进化
    • DSH 是如何持续自进化的?
  6. 第六章·长程任务续行
    • DSH 是如何持续完成长程任务的?

关于 deepseek-harness-from-scratch 的更多信息,请参见 ./deepseek-harness-from-scratch/README.md 和 ./deepseek-harness-from-scratch/AGENTS.md 。

先专注 ts 版本,python 先不管

关于文本风格:

用 https://github.com/oil-oil/oil-tone 润色一遍。

此外:

  1. 尽量少用不是...而是...的句型,很多时候它被用来“硬凑”对仗和高级感,前后的 A 和 B 并没有提供真正的干货或深刻洞察。 也不使用“是 X,不是 Y”的对比句式。
  2. 少用引号、破折号。缺乏具体肉身记忆与在地情感的装腔格式,缺乏人味。
  3. 不常见的缩写,需要给出全称与解释。
  4. 尽量不要使用比喻。如果一个说法需要读者推断其指代对象,改为直接说明。
  5. 也不使用拟人表述。
  6. 自包含,不要突然冒出来一个概念

追求:简明,有逻辑,coherent ,自包含,有层次,逻辑通顺

注意,不要通过降低信息量的方式来换取简洁。

不能修改章节标题和问句,这是我钦定的。

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. 2mo ago First seen · 42 lines · 526 tokens per session scan A 460931608f9c

Subscribe to this mod's changes

dsh-from-scratch AGENTS.md is an instructions file published in the GitHub repository tsrigo/dsh-from-scratch (14 stars, last pushed 2mo ago), licensed MIT. It adds 526 tokens to every session, about $0.0021 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

dsh-from-scratch AGENTS.md compared with instructions from other repositories

dsh-from-scratch AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dsh-from-scratch AGENTS.mdtsrigo/dsh-from-scratchInstructions file142mo agoMITA526Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode