mini-claude-code-python AGENTS.md

A set of contribution rules for an open-source tutorial that builds a Claude Code-style coding agent in Python chapter by chapter. It covers the project’s language, code boundaries, documentation, tests, versioning, and release records.

In plain words
What is it for?
It guides contributors working on tutorial chapters, standalone examples, automated tests, documentation, version numbers, and release tags. It also sets rules for checking official documentation and avoiding copied implementations.
Why use it?
It keeps the tutorial, example programs, tests, README, and release tags consistent as the project grows. TDD, or test-driven development, means writing or updating tests before changing the code.

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/xiaxia1997/mini-claude-code-python/agents-md
Clone the repo
git clone --depth 1 https://github.com/Xiaxia1997/mini-claude-code-python

Made for: Codex, OpenCode.

Per session 608 This file is loaded in full into every session.
When invoked 608 The same file — it is already loaded in full.
Security scan A 0 findings. 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.00608 $0.00608
Opus 5 $0.00304 $0.00304
Sonnet 5 $0.00122 $0.00122
Haiku 4.5 $0.00061 $0.00061

Measured yesterday against content hash a4a2751b6040, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mini-claude-code-python 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 yesterday.

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 · 41 lines

What it actually says

Mini Claude Code Python 协作规则

项目目标

这个仓库是面向开源读者的逐章教程:用 Python 从小到大实现一个 Claude Code 风格的 coding agent。每章都应该同时提供:

  • 一篇可独立阅读的中文教程;
  • 一个独立可运行的 examples/chapter-XX/ 参考实现;
  • 覆盖本章关键行为的自动化测试;
  • 与 README、版本号、tag 进度一致的发布记录。

默认语言与风格

  • 项目交流必须使用中文,包括状态更新、问题确认、实施说明和最终总结。
  • 面向外部读者的教程正文默认使用中文;英文 README 只做入口与摘要,不替代中文教程。
  • 教程面向外部读者,避免出现本机用户名、私有路径、未解释的内部项目名。
  • 文档中的示例路径使用本仓库通用路径,例如 examples/chapter-08/agent.py
  • 代码块使用 ASCII 引号和标点,除中文正文外避免不必要的 Unicode 符号。

代码来源边界

  • 不从旧参考仓库复制实现代码。
  • 可以把旧参考仓库当作章节主题、需求清单和概念参考,但本仓库的代码必须按当前项目结构重新实现。
  • 需要描述外部 API 行为时,优先用官方文档或本仓库测试验证,不凭旧教程或记忆下结论。

章节一致性要求

  • README、chapters/*.mdexamples/chapter-XX/*.pytests/*.py 必须互相对齐。
  • 教程里声称“已实现”的函数、命令、文件和行为,必须能在对应 example 或测试中找到。
  • 每章 example 应独立运行,不依赖后续章节目录。
  • 前一章没实现的能力不能在后一章写成“早已实现”;如果调整了落点,要同步修正文档。
  • 发现教程和代码不一致时,优先修正为当前仓库真实状态,再继续扩展。

测试与发布

  • 修改行为前先补或更新测试,按 TDD 做 red/green。
  • 发布前至少运行 .venv/bin/python -m pytest -q
  • 逐章发布时,每章完成后更新 pyproject.toml 版本、README 进度和 tag 列表。
  • tag 命名沿用现有格式:v0.8-memoryv0.9-skillsv0.10-plan-modev0.11-sub-agent
  • push 代码或 tag 属于外部发布动作,执行前需要单独确认。
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. yesterday First seen · 41 lines · 608 tokens per session scan A a4a2751b6040

Subscribe to this mod's changes

mini-claude-code-python AGENTS.md is an instructions file published in the GitHub repository Xiaxia1997/mini-claude-code-python (22 stars, last pushed 1mo ago), licensed MIT. It adds 608 tokens to every session, about $0.0030 per session on Opus 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-30.

Related

Other instructions, from other repositories

cocoindex-code CLAUDE.md

Instructions for cocoindex-io/cocoindex-code, covering claude.md, build and test commands, architecture, process model and key layers.

cocoindex-io/cocoindex-code · 1,766 tokens

LLM-dev-demo AGENTS.md

Instructions for A3RDLab/LLM-dev-demo, covering agents.md, 仓库性质, 环境与密钥约定, 依赖管理 and 常用命令.

A3RDLab/LLM-dev-demo · 1,682 tokens

claude-code-handbook AGENTS.md

Instructions for vitoworleone/claude-code-handbook, covering agents.md — claude-code-handbook 仓库维护指南, 1. 项目定位, 2. 目录结构规范, 2.1 顶层目录 and 2.2 命名规范.

vitoworleone/claude-code-handbook · 2,147 tokens

agent-smith CLAUDE.md

Instructions for holgerleichsenring/agent-smith, covering agent-smith — ai agent instructions, context files (read in this order), phase directory structure, experiential memory (remember / recall) and minting a phase id.

holgerleichsenring/agent-smith · 2,307 tokens

python-cheatsheet copilot-instructions.md

Copilot instructions for labex-labs/python-cheatsheet, covering python cheatsheet - ai coding assistant instructions, project overview, architecture & key patterns, content structure and routing & layout system.

labex-labs/python-cheatsheet · 1,155 tokens

python-cheatsheet GEMINI.md

Gemini CLI instructions for labex-labs/python-cheatsheet, covering gemini customization file, project overview, technologies, coding style and conventions and routing & layout system.

labex-labs/python-cheatsheet · 912 tokens