PTY-Agent: Instructions file for Codex

AGENTS.md

PTY-Agent AGENTS.md is an instructions file for Codex, OpenCode from ming-14/PTY-Agent. It costs 2,257 tokens per session, scanned A, original, MIT.

A set of project instructions for PTY-Agent, covering the working environment, general rules, cleanliness, and which development history should not appear in files.

In plain words
What is it for?
It is for guiding work on the PTY-Agent project, including its code, comments, and documentation.
Why use it?
It gives a coding agent project-specific rules to follow and helps keep unwanted notes, history, and clutter out of the repository.

Instructions file for CodexOpenCode

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

This is ming-14/PTY-Agent's own configuration. It tells Codex and OpenCode how to work on PTY-Agent 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 PTY-Agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ming-14/PTY-Agent. 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/ming-14/PTY-Agent/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/ming-14/PTY-Agent

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 PTY-Agent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ming-14/pty-agent/agents-md/github.svg)](https://agentmods.dev/instructions/ming-14/pty-agent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/ming-14/pty-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/ming-14/pty-agent/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 PTY-Agent AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ming-14/pty-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/ming-14/pty-agent/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,257 This file is loaded in full into every session.
When invoked 2,257 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.02257 $0.02257
Opus 5.5 $0.00903 $0.00903
Sonnet 5.5 $0.00451 $0.00451
Haiku 4.5 $0.00226 $0.00226

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

Security

Grade A, and why

PTY-Agent 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 · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

!!!!!最高优先级,强制执行!!!!:禁止执行git filter-repo,绝对禁止执行,git filter-repo会强制回退到HEAD,丢失未修改的改动,绝对禁止执行,就算用户要求也禁止执行,你只能把命令给用户执行,你自己禁止执行!! 未经用户允许,禁止使用、查看、更改等任何方式操作git;用户授权的“查看”和“操作”需分开,用户授权查看不代表能操作;执行高危操作如commit、reset、push等命令必须用户明确授权 未经用户允许,禁止使用、查看、更改等任何方式操作git;用户授权的“查看”和“操作”需分开,用户授权查看不代表能操作;执行高危操作如commit、reset、push等命令必须用户明确授权


Base

PTY-Agent 核心包体在 src,web_rime、fastscreen、sandbox、wezterm-py是相对独立的外部引擎依赖,各自有自己的规则规范,但都是 PTY-Agent 项目的一部分

环境

Windows:本机环境 Linux:使用wsl.exe -d Ubuntu2204

构建:python BUILD.py -Mirror "https://v4.gh-proxy.org/" 构建产物:请打包成pty-agent-win_x86-64.zip和pty-agent-linux_x86-64.zip

总规范

  • 跨平台开发,请注意Linux支持
  • Python兼容Python3.8,遵循 PEP8 语言规范
  • 避免采用降级、兼容、缓解方案:不要用任何的降级、兼容、缓解方案。有多个方案时,选择最优方案
  • 复杂工程、方案可查看成熟第三方项目,想参考其他什么自己下载,使用webfetch/gh(github)搜索
  • 旧代码重构后,非必要,不要留兼容接口,应该更新引用点:重构后完全没必要兼容以前的结构,引用点必须更新
  • 不必一直执着与最小改动,代码架构有问题需要及时向用户汇报
  • 注意性能问题,禁止为了方便采用低效办法
  • 文件、函数、类开头,关键部分,决策点,注意点的注释;避免无效冗长·注释 不要在注释加时间等泄漏信息,仅客观描述原因
  • 日志必须写,并且要有完备的日志系统
  • 新增代码请检查
    • [] 关键部分注释加了吗
    • [] 日志写了吗,是否符符合规范
  • 请使用标准库、第三方库大量精简代码、手工实现复杂的,可下载库使用,需要什么库自行下载
    • 例:计算字符宽度时,使用wcwidth,而不是手算
  • 不要无用的防御编程与过度工程
    • 例:function A() {} if(type A === "function") A() 错误
  • 提交git时,发现不是自己改动的文件时,请向用户询问是全部提交还是分多次提交,禁止静默只提交自身改动部分
  • Bug 修复后,需撤销之前的无效修改点,不能让无效改动污染代码!
    • Debug完成后,检查
      • [] 旧改动删了吗
      • [] 旧改动删了后,是否还能正常运行

项目清洁度:不应出现在项目(代码,注释,文档等任何文件)中的内容

被ignore的文件不用理

历史痕迹(开发历程 / 时间 / 变更记录)

  • 阶段标注:"Phase N"、"Phase-N"(如 Phase 16、Phase-12)等
  • 任务号:"T7.11"、"T1.4"、"T-8.x"、"T64"、"T32"、"FR-8.x"等
  • 日期:"2021-01-01" 等任何日期
  • 修复记录:"已修复"、"修复为"、"曾"、"E4/D4/H-1/H-2/C-5 修复"、"黑盒报告"、"BUG-01"、"r4/r5"、"MEDIUM-x"等
  • 旧字段/旧值说明:"旧值 xxx 已删除"、"fs_mode/capabilities/path_rules 已移除"、"迁移指引"、"向后兼容"等
  • 已删除文档的引用
  • 开发脚本/实验引用:"verify_low_flow.py"、"label_probe.py"、"setil_probe.py"、"lowil_test.py"、"实测定案"、"三路实验"、"对照 %TEMP%\opencode 实验结论"等
  • 用户交互痕迹:"用户拍板"、"已与用户对齐"、"用户决策"、"用户要求"等
  • 旧组件/旧形态提及:"sandbox.exe"、"AppContainer"、"IPC 形态"、"FileSystemIsolator"、"StatsCollectorImpl"等
  • 其他项目提及:"PTY-Agent"、"fastscreen"、"aichat"、"terminal_injector"、"opencode"(pyproject 包元数据除外)等
  • 隐私内容,如用户名,env等

Read the full file on GitHub · 126 lines

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 Changed · +2 lines · +61 tokens per session a42b8309fc63
  2. 2mo ago First seen · 124 lines · 2,196 tokens per session scan A 401a061e34cc

Subscribe to this mod's changes

PTY-Agent AGENTS.md is an instructions file published in the GitHub repository ming-14/PTY-Agent (2 stars, last pushed 1mo ago), licensed MIT. It adds 2,257 tokens to every session, about $0.0090 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

PTY-Agent AGENTS.md compared with instructions from other repositories

PTY-Agent AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
PTY-Agent AGENTS.mdming-14/PTY-AgentInstructions file21mo agoMITA2,257Codex, 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