Expand description
Lazily inject subdirectory AGENTS.md / CLAUDE.md / .cursorrules
context when the agent starts working in a new area of the codebase.
At session start, microclaw loads the project-root context once into the
system prompt. But the model only sees subdirectory-specific guidance if
the user mentioned it. This tracker watches tool calls (read_file,
edit_file, glob, grep, bash’s cwd etc.), notices when the agent
reaches into a new directory, and appends that subtree’s nearest hint file
to the tool result.
Hermes reference: agent/subdirectory_hints.py:SubdirectoryHintTracker.
Inspired upstream by Block/goose.
The tracker remembers which directories it has already emitted for, so a single hint file is only injected once per chat turn. The tracker is constructed per agent loop.