Agent contract
Tell the agent three things:What agents should do
- read mounted files with normal file tools;
- edit
page.mddirectly; - preserve Locality frontmatter and
::loc{...}directives; - use
loc status <path>when they need state; - use
loc diff <path>before remote writes; - push only when the user asks, or when Live Mode reports a review path.
What agents should avoid
- do not rewrite generated
loc:identity frontmatter; - do not edit
_schema.yamlunless the task is explicitly about database schema; - do not remove
::loc{...}directives unless replacing the underlying unsupported block intentionally; - do not run broad
loc pushcommands without a scoped path; - do not delete old-looking folders until
loc statusconfirms they are untracked and safe to remove.
Live Mode behavior
When Live Mode is enabled, agents should not run routineloc pull or loc push after every edit. They should edit the file and stop.
Use loc status only when:
- the desktop app reports attention needed;
- the file is conflicted;
- the user asks for a push;
- the agent needs to explain what is pending.
Good agent prompt
MCP fallback
If an agent cannot execute the hostloc binary because of sandboxing, use the Locality MCP fallback named loc with CLI-style arguments:
Installed guidance
During onboarding, Locality can install concise guidance for supported local agents and create mount-local files such asAGENTS.md and CLAUDE.md. Those files are intentionally short. The most important rule remains the same: work in files, review with Locality, then sync safely.