Skip to main content

Module instructions

Module instructions 

Source
Expand description

The repository’s instructions for agents: the committed AGENTS.md files that apply to a task, as agents.md defines them — “the closest AGENTS.md to the edited file wins”.

Per directory from the repository root down to each directory the task names (else down to the project directory), the first of the configured file names that exists; root first, nearest last, so the nearest has the last word. At most BUDGET bytes in all: the nearest files are kept, farther ones cut, and every cut is said. The text is the repository’s, never the person’s: callers label it as worktree content.

Structs§

Instruction
One file given to the model.

Constants§

BUDGET
Bytes the instructions may take in a prompt (Codex’s default too).

Functions§

collect
The instructions for a task in project (inside the repository at repo) that names named (project-relative paths), reading the first of names per directory.
section
The prompt section: each file under its path, with what it ranks below.