Skip to main content
MethodAI Setup & ProductivityAI setupIntermediate

Write an instruction file for AI agents (CLAUDE.md / AGENTS.md)

A project instruction file telling coding or research agents what the project is, how to work and what not to do.

This is a practical, copy-paste process for using claude code, codex, cursor or similar agents on a repo or folder.. Use it when you want a clear structure, then add your own details and the linked evidence.

Published by Deepstory Research. Reviewed Sep 2026.

How to use this method

  1. 1. Copy or downloadCopy the prompt below, or download the method file and attach it to your chat.
  2. 2. Paste into any AIChatGPT, Claude, Gemini or Copilot. Replace each [PLACEHOLDER] with your details, or let the AI ask you.
  3. 3. Add evidenceAttach the evidence files listed on this page so the AI works from sourced numbers, not guesses.

The prompt

Paste it as-is. The AI will ask for anything still in [BRACKETS].

Download .md
# Write an instruction file for AI agents (CLAUDE.md / AGENTS.md)
Method by Deepstory Research: deepstoryresearch.com/method/write-claude-md-agents-md

You are a senior engineer who configures AI coding agents. Follow the method below step by step. Goal: A project instruction file telling coding or research agents what the project is, how to work and what not to do.

## My inputs
- Project: [PROJECT]  (example: paste README or describe)
- Stack and commands: [STACK_AND_COMMANDS]  (example: build, test, lint)
- Conventions: [CONVENTIONS]  (example: code style, branching)
- Hard rules: [HARD_RULES]  (example: never touch production data)

Before you start: if any input above is still in [BRACKETS] or missing, ask me for it in one short numbered list and wait. Do not guess. If I attached files (data, briefs, Deepstory evidence files), treat them as the primary source.

## Steps to follow
1. Summarise project purpose and structure.
2. List commands to build, test and run.
3. Document conventions and patterns to follow.
4. List hard rules and dangerous areas.
5. Add a definition of done and verification steps.
6. Keep it short enough to be read every session.

## Deliver the output in this structure
- CLAUDE.md / AGENTS.md file

## Quality rules
- Under ~200 lines; no secrets.
- Every command must be accurate for this repo.
- Label every number as FACT (with source and date), ESTIMATE (show the calculation) or ASSUMPTION.
- If a Deepstory evidence file is attached, use its figures as the reference values and cite its source references; tag claims that are not from it as [UNVERIFIED].
- End with: the 3 assumptions that matter most, what would change the answer, and the single best next step.

What you need to give the AI

InputPlaceholderExample
Project[PROJECT]paste README or describe
Stack and commands[STACK_AND_COMMANDS]build, test, lint
Conventions[CONVENTIONS]code style, branching
Hard rules[HARD_RULES]never touch production data

Use it when

  • Using Claude Code, Codex, Cursor or similar agents on a repo or folder.

What you get

  • CLAUDE.md / AGENTS.md file

The procedure, step by step

Read this before you run it, so you can check the AI actually followed the method.

  1. 1

    Summarise project purpose and structure.

  2. 2

    List commands to build, test and run.

  3. 3

    Document conventions and patterns to follow.

  4. 4

    List hard rules and dangerous areas.

  5. 5

    Add a definition of done and verification steps.

  6. 6

    Keep it short enough to be read every session.

Quality checks built into the prompt

  • • Under ~200 lines; no secrets.
  • • Every command must be accurate for this repo.
  • • Every number labelled FACT, ESTIMATE or ASSUMPTION; claims outside attached evidence tagged [UNVERIFIED].

Evidence for this method

This method runs on your own material: your files, brief or code. If your task needs market or economic numbers, attach a sourced context file from the evidence library alongside the prompt.

Browse evidence

Run next

Methods that chain well after this one.

Deepstory methods are process guidance for AI tools. Review AI output before relying on it; legal, tax, medical and investment decisions need a qualified professional.