Skip to main content
Locality works best when the agent edits mounted Markdown directly and leaves the sync decision explicit.

Agent contract

Tell the agent three things:
Use a concrete path whenever possible:

What agents should do

  • read mounted files with normal file tools;
  • edit page.md directly;
  • 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;
  • if the user asks them to sync back to Notion, update Notion, publish, or apply edits remotely, run loc diff <path> and then loc push <path> -y for safe plans.

What agents should avoid

  • do not rewrite generated loc: identity frontmatter;
  • do not edit _schema.yaml unless the task is explicitly about database schema;
  • do not remove ::loc{...} directives unless replacing the underlying unsupported block intentionally;
  • do not run broad loc push commands without a scoped path;
  • do not delete old-looking folders until loc status confirms they are untracked and safe to remove.

Live Mode behavior

When Live Mode is enabled, agents should not run routine loc pull or loc push after every edit. They should edit the file and stop unless the user explicitly asks them to sync the change back to the source app. 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 host loc binary because of sandboxing, use the Locality MCP fallback named loc with CLI-style arguments:
Direct CLI execution is still preferred when available.

Installed guidance

During onboarding, Locality can install concise guidance for supported local agents and create mount-local files such as AGENTS.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.