Declare which paths a spec governs
Add apaths list to the spec’s YAML frontmatter. Paths are relative to the
repository root.
*within one path segment**across path segments?for one character- a trailing
/as shorthand for everything below that directory
paths frontmatter keep their existing behavior. They are not
loaded automatically.
What the agent receives
For each matching spec, Trellis chooses one of three deliveries:
The refresh window is fixed. Silent touches do not extend it, so continuous
editing still receives a later reminder.
When several specs match one file, narrower path patterns are considered
before broad patterns. If the event budget cannot hold every full body,
remaining matches become an index of spec paths instead of disappearing.
Platform behavior
Why Codex blocks the first patch once
Codex does not require a file read before an edit. When a patch first matches a spec, the hook returns the full rules and denies that patch once:Configure the budget and refresh window
The defaults fit the host context limits and require no configuration:
Truncated bodies include a notice with the full spec path so the agent can read
the source file directly.
Inspect matches manually
Use pull mode to check which specs govern a path without loading their bodies:--json for structured output:
State, reset, and failure behavior
Delivery state is stored outside the repository under~/.trellis/spec-inject/. Parent and sub-agent histories are separate.
SessionStart(source=clear|compact) records a reset marker shared by that
session, so rules removed by compaction are delivered again.
The hook does not parse Claude Code or Codex transcript contents. Transcript
formats are host internals and are not part of this contract.
Matching and state failures are fail-open: malformed frontmatter, missing
paths, unreadable state, or an internal hook error must not break the host tool
call. The only intentional block is the first Codex patch that has just
received a full governing spec.