From a40a1ac17dbe874bd32ecc35ddc1cfc44dfc00f0 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 2 Sep 2026 16:34:05 +0100 Subject: [PATCH 1/4] Add an `AGENTS.md` pointing to our policy --- AGENTS.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000000000..a622303a8852d5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,7 @@ +# AI agent guidance + +CPython has a [policy on the use of AI tools](https://devguide.python.org/getting-started/ai-tools/). +All use of AI tools and agents when working on or interacting with CPython +must follow it. + +Read the policy before making or proposing any changes. From 4a635854197df1cdf01efb108c1bcdc249011838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Thu, 3 Sep 2026 14:11:18 -0700 Subject: [PATCH 2/4] Update AGENTS.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- AGENTS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index a622303a8852d5..6070239c504cd5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,4 +4,5 @@ CPython has a [policy on the use of AI tools](https://devguide.python.org/gettin All use of AI tools and agents when working on or interacting with CPython must follow it. -Read the policy before making or proposing any changes. +> [!important] +> **Primary directive**: Read the policy before making or proposing any changes. From 2c78a3ba6d13e1ca14639a3f2879d450a8680a35 Mon Sep 17 00:00:00 2001 From: Lukasz Langa Date: Thu, 3 Sep 2026 23:16:37 +0200 Subject: [PATCH 3/4] Link .claude/CLAUDE.md to AGENTS.md, narrow .gitignore Claude Code does not read AGENTS.md by default, so add a trivial .claude/CLAUDE.md symlink pointing back to ../AGENTS.md (mirroring e.g. PebbleOS), leaving room for .agents/skills/ later. Narrow the blanket /.claude/ ignore to just the local scratch paths used by agent tooling (.claude/pr-*, .claude/branch-*, .claude/sandbox/), add AGENTS.local.md next to CLAUDE.local.md, and drop the link to the Claude docs. Co-authored-by: Muse Code (Meta Muse Spark) --- .claude/CLAUDE.md | 1 + .gitignore | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 .claude/CLAUDE.md diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 120000 index 00000000000000..be77ac83a1895c --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1 @@ +../AGENTS.md \ No newline at end of file diff --git a/.gitignore b/.gitignore index e53548f1fd45a0..00813f9d1b6b00 100644 --- a/.gitignore +++ b/.gitignore @@ -178,8 +178,12 @@ Python/frozen_modules/MANIFEST /python !/Python/ -# People's custom https://docs.anthropic.com/en/docs/claude-code/memory configs. -/.claude/ +# Local AI agent scratch state (per-PR and per-branch notebooks, sandbox +# experiments) and personal agent overrides, none of which are committed. +/.claude/pr-* +/.claude/branch-* +/.claude/sandbox/ +AGENTS.local.md CLAUDE.local.md #### main branch only stuff below this line, things to backport go above. #### From adf6c831dfcee6efae229b945c20267bd5d53cba Mon Sep 17 00:00:00 2001 From: Lukasz Langa Date: Thu, 3 Sep 2026 23:24:53 +0200 Subject: [PATCH 4/4] Inline the AI policy's core principles in AGENTS.md A bare link is easy for agents to skip (no fetch happens). State the checkable requirements directly so the file works even when the policy page is never opened; the link remains the full reference. Co-authored-by: Muse Code (Meta Muse Spark) --- AGENTS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 6070239c504cd5..d23d0c9315d3f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,3 +6,11 @@ must follow it. > [!important] > **Primary directive**: Read the policy before making or proposing any changes. + +When acting on this repository, apply the policy's core principles: + +- Consider whether the change is necessary. +- Make minimal, focused changes. +- Follow existing coding style and patterns. +- Write tests that exercise the change. +- Keep backwards compatibility with prior releases in mind.