AGENTS.md Support
PocketPaw supports the AGENTS.md standard, a convention for declaring what an AI agent can and cannot do in a repository. When PocketPaw operates on a codebase, it reads any AGENTS.md file and injects those constraints into the agent’s system prompt.
How It Works
- On every message, PocketPaw looks for
AGENTS.mdstarting from the working directory - It walks up parent directories until it finds the file or hits a
.gitboundary (repo root) - If found, the file content is injected into the system prompt as a
# Project AGENTS.md Constraintsblock - The dashboard Activity panel shows an
agents_md_loadedevent when a file is discovered
Search Behavior
The loader mirrors how Git finds .gitignore:
- Starts at the current working directory (or
file_jail_pathas fallback) - Checks for
AGENTS.mdin each directory - If found, stops and uses it (nearest file wins)
- Walks up to the parent directory
- Stops at
.gitboundary (repo root) or after 20 levels - Files larger than 32 KB are truncated to prevent oversized prompts
Writing an AGENTS.md
An AGENTS.md file declares your project’s rules for AI agents:
## Capabilities
- Read and write files in the src/ directory- Run tests with `npm test`- Search code with grep
## Forbidden Operations
- Never delete the database- Never push to main branch directly- Never modify .env files
## Coding Conventions
- Use TypeScript strict mode- Follow the existing naming conventions- All new functions need testsPocketPaw reads the entire file and injects it as-is. You can use any Markdown structure, but clear headings like Capabilities, Forbidden Operations, and Conventions help the agent parse the intent.
Caching
Parsed AGENTS.md files are cached by (path, mtime). Repeated calls within the same process are free. Editing the file automatically invalidates the cache on the next message.
Configuration
No configuration is needed. AGENTS.md support is automatic when a file exists in the project directory tree. The feature is resilient by design: if discovery fails for any reason, the agent continues without constraints.
PocketPaw’s Own AGENTS.md
PocketPaw publishes its own AGENTS.md at the repository root, declaring its tools, safety boundaries, forbidden operations, and coding conventions for other agents working on the codebase.
Related
Agent Loop
How PocketPaw processes messages and builds context.
Context Building
How the system prompt is assembled from identity, memory, and state.