cuckcoding.pro
Menu

Write project instructions with AGENTS.md and CLAUDE.md

You have explained three times that dist/ is generated. At this point the chair remembers. The next agent session might not. Put durable facts about the repository beside its code and test whether the instructions describe reality.

Before you start
An existing Git repository you understand. The example assumes a static site under site/ and Node tests; substitute your actual paths and commands.
How you’ll know it works
A new session can point to the editable source, name the real test command and tell you what remains unverified.

Collect facts the repository can prove

Open your build script and CI configuration. Which directory does the build read? Which files does it generate? Which command actually runs tests? Execute it once. “Run npm test” is poor advice in a project that has no test script. A confident hallucination gains nothing from being committed to Markdown.

Put shared instructions at the repository root

Codex reads repository instructions from AGENTS.md. If that file already exists, edit it in place. This is a model for a small static site; use only the lines true of your project.

AGENTS.md
# Working in this repository

- Edit site/ for the static page. dist/ is generated.
- Keep the page usable with the keyboard at 360px wide.
- Run node --test before handing over a patch.
- In the handoff, list the files changed and any checks you could not run.

Give each rule an observable consequence. “Keep quality high” has no obvious verification. “Run node --test and report failed checks” tells the next session exactly what to do. Keep a ticket-specific bug report in the task prompt.

Let Claude Code import the same file

In the root CLAUDE.md, add this line alongside any Claude-specific instructions. The import keeps shared rules in a single editable file.

CLAUDE.md
@AGENTS.md

Keep the two files together. If you move the shared file into docs/, update the import path. Read the effective instructions in a fresh session after changing them.

Run a read-only rehearsal

Lend this prompt to your agent
Before editing anything, tell me which directory contains editable source, which command runs the tests, and which file gave you those instructions. Check that the named directory and test setup exist. Flag contradictions. Leave the working tree untouched.

Try this once in Codex and once in Claude Code from the repo root. If one points to dist/, trace the source of that advice before adding another rule. When the build changes, update the instructions in the same commit. Otherwise you have built a very efficient onboarding system for last year.

Official references