pub struct InstructionSources {
pub global: Vec<PathBuf>,
pub max_bytes: usize,
}Expand description
Where to look for instructions beyond the working tree.
global is empty by default. A library that reads a user’s home directory
on its own initiative is guessing, and the guess is wrong the moment the
host has its own convention — so the host names the files it wants and
nothing outside the working tree is read until it does.
InstructionSources::discover_global supplies the usual suspects for a
host that wants them.
Fields§
§global: Vec<PathBuf>Global candidates, most preferred first. The first one that exists is used; the rest are ignored.
max_bytes: usizeCap on the instruction text taken from disk. Files are read nearest-first and the remainder is truncated once the budget runs out.
Implementations§
Source§impl InstructionSources
impl InstructionSources
Sourcepub fn discover_global() -> Self
pub fn discover_global() -> Self
The conventional global instruction files, most preferred first:
~/.config/AGENTS.md, then the two agents that ship their own
(~/.codex/AGENTS.md, ~/.claude/CLAUDE.md).
Opt in by calling this — a host that wants a user’s existing global conventions honoured, wherever that user already keeps them.
Trait Implementations§
Source§impl Clone for InstructionSources
impl Clone for InstructionSources
Source§fn clone(&self) -> InstructionSources
fn clone(&self) -> InstructionSources
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more