context-files
Supplements pi’s native context file loading so that both
CLAUDE.md and AGENTS.md are loaded when they coexist in
the same directory, and context files in subdirectories are
picked up too.
It also loads modular rule files from .tallow/rules/,
.claude/rules/, and ~/.tallow/rules/.
The problem
Section titled “The problem”Pi loads AGENTS.md or CLAUDE.md per directory, preferring
AGENTS.md. If both exist, CLAUDE.md is silently ignored.
Pi also only walks up from cwd, it never scans subdirectories.
This is a problem when:
- Your team maintains both files (e.g.
AGENTS.mdfor all agents,CLAUDE.mdfor Claude-specific guidance) - Subdirectories have their own context files (monorepo packages, service directories)
- You want reusable modular rules in
.tallow/rules/or.claude/rules/
What it adds
Section titled “What it adds”| Source | Pi loads | Extension adds |
|---|---|---|
~/.tallow/ | AGENTS.md | CLAUDE.md (if both exist) |
| Ancestor dirs → cwd | One file per dir | The other file that was skipped |
| Subdirectories | Nothing | Both CLAUDE.md and AGENTS.md |
| Rules directories | Nothing | .md/.txt rules from ~/.tallow/rules/, .tallow/rules/, .claude/rules/, and nested subdirectory rule dirs |
Rule directory compatibility
Section titled “Rule directory compatibility”Rule files are portable across both project conventions:
.tallow/rules/(tallow-native).claude/rules/(Claude Code compatibility)~/.tallow/rules/(user-global defaults)
The same rule file frontmatter works in .tallow/rules/ and
.claude/rules/.
Path-scoped frontmatter (paths and path)
Section titled “Path-scoped frontmatter (paths and path)”Rules support two equivalent frontmatter variants:
paths: array of one or more glob patternspath: single-pattern shorthand (Claude-compatible)
Activation semantics:
- No
path/pathsfrontmatter → rule is unconditional and always injected pathorpathsfrontmatter → rule activates only when the agent reads, edits, or writes at least one matching file path
Example (paths):
---paths: - "src/api/**/*.ts" - "src/middleware/**/*.ts"---# API Rules- Validate input with Zod- Use standard error envelopeExample (path):
---path: "apps/web/**/*.tsx"---# Frontend Rules- Keep components server-firstPriority order
Section titled “Priority order”Files are appended to the system prompt from most general to most specific:
- Global,
~/.tallow/CLAUDE.md - Ancestors, farthest directory first, walking toward cwd
- Current directory, the skipped file in cwd
- Subdirectories, sorted by depth, then alphabetically
- Rules, from rule directories and nested subdirectory rule dirs
Skipped directories
Section titled “Skipped directories”The extension skips common non-source directories when scanning subdirectories:
node_modules, .git, dist, build, .next, __pycache__,
.venv, venv, vendor, .tox, .mypy_cache, .pytest_cache,
coverage, .turbo, .cache, .output, and all dot-directories.
Startup notification
Section titled “Startup notification”On load, a notification shows which extra files were found:
context-files: +1 context file: ~/dev/myproject/CLAUDE.md