Skip to main content

Module context

Module context 

Source
Expand description

Discovery of workspace context files (AGENTS.md and friends).

A mission arrives as data (PROPOSAL.md Bet 4), and the largest part of that data is the workspace’s own instructions. This module finds them and orders them; it does not interpret them.

Precedence runs least-specific to most-specific: a global file, then each ancestor directory from the outermost inward, then the workspace root. The rendered output preserves that order, so a more specific document is read last and reads as an override.

Each of those directories is asked for AGENTS.md and then, only if it has none, for CLAUDE.md — one document per directory, the first name that is there. Both files are the same convention under two names, and a repository that carries only the older one is not a repository with no instructions.

Structs§

ContextConfig
How to look for context files. Every knob has a convention-shaped default; none of them encode a task.
ContextDocument
One discovered context file, with the text as it was on disk.
WorkspaceContext
The context files that apply to one workspace, ordered weakest-first.

Enums§

ContextError
Anything that can go wrong while discovering context.
ContextScope
Where a context document was found. Ordering is precedence: Global is the weakest, Workspace the strongest.
SystemPrompt
What a host says on top of what the workspace says.

Constants§

DEFAULT_CONTEXT_FALLBACK_FILE
What basis reads in a directory that has no DEFAULT_CONTEXT_FILE.
DEFAULT_CONTEXT_FILE
The default file name basis looks for. Chosen by convention, not by basis — AGENTS.md is a cross-agent standard.