Using AGENTS.md

Using AGENTS.md with LatchLoop

Give LatchLoop the context it needs to work like a great teammate on your codebase. AGENTS.md is a simple, open documentation file you add to your repository to teach AI coding agents how to build, test, and contribute to your project.

This guide explains what AGENTS.md is, how LatchLoop uses it, and how you can set it up in a few minutes.


What is AGENTS.md?

Think of AGENTS.md as a README written for AI coding agents. While your main README focuses on people, AGENTS.md focuses on the practical details an agent needs to be productive:

  • Preferred code style and conventions
  • Project structure tips and common pitfalls
  • Any extra rules you want agents to follow

It’s just a Markdown file that lives in your repository (no special format required). Many open‑source projects use it, and LatchLoop understands it out of the box.

Learn more: https://agents.md/


How LatchLoop uses AGENTS.md

When you run a task in LatchLoop—like generating code, reviewing a pull request, or asking questions, LatchLoop looks for an AGENTS.md file in your repository and uses it to guide the agent’s actions.

LatchLoop supports multiple AGENTS.md files in a single repo (for example, one per package in a monorepo). We select the “nearest” AGENTS.md to the files being worked on. If that isn’t available, we use the one at the repository root, if present.

Supported filenames include: AGENTS.md, agents.md, AGENT.md, Agent.md, and agent.md.

(Note: LatchLoop automatically understands your project’s tech stack and file structure so mentioning general details in your Agents.md is not neccessary. You may wish to include specific details that might not be inferred from a quick glance at your project.)


Where to put AGENTS.md

Choose one of the following:

  1. Repository root (recommended for single‑project repos)
  • Path: /AGENTS.md
  1. Inside each package or subproject (recommended for monorepos)
  • Example paths:
  • /packages/web/AGENTS.md
  • /services/api/AGENTS.md

LatchLoop will automatically pick the most relevant one for the task at hand.


Quick start

  1. Create AGENTS.md at the root of your repository (or inside a package folder for monorepos).
  2. Paste the starter template above and customize it for your project.
  3. Commit and push.
  4. Run your next task in LatchLoop. The agent will automatically read your AGENTS.md and follow it.

Tip: If you’re working in a monorepo, place an AGENTS.md near each package so the right guidance is used for changes in that area.


Examples and scenarios

  • Pull request review: LatchLoop reviews your PR and uses the AGENTS.md nearest to the changed files. It runs the commands you specify and follows your review rules (e.g., test requirements, naming conventions).

  • New feature in a subpackage: You have /packages/web and /packages/api, each with its own AGENTS.md. If you request changes under /packages/api, LatchLoop prefers /packages/api/AGENTS.md over the root file.

  • Onboarding a new codebase: If you’ve just connected a repo and your README is very human‑oriented, add an AGENTS.md so the agent knows the exact setup steps and checks to run.


FAQs

Do I need AGENTS.md for LatchLoop to work?

  • No. It’s optional. But adding it can noticeably improve relevance, consistency, and build/test accuracy.

Can I have more than one AGENTS.md?

  • Yes. In monorepos, add one to each package that has its own commands or conventions. LatchLoop picks the nearest one to the files being edited or reviewed.

What file name should I use?

  • Any of these: AGENTS.md, agents.md, AGENT.md, Agent.md, agent.md. We recommend AGENTS.md.

What format should I use?

  • Plain Markdown. Use headings and bullet points. Be explicit about the commands and expectations.

What if AGENTS.md conflicts with my README or other docs?

  • The agent treats AGENTS.md as the source of truth for agent‑focused instructions. For humans, keep your README as is.

How quickly do updates take effect?

  • The next time you run a task, LatchLoop will read the latest version from your branch.

How can I tell if LatchLoop used my AGENTS.md?

  • During a run, look for an “AGENTS.md Guidance” section in the agent’s context. If you don’t see it, check the troubleshooting steps below.

I don’t want to clutter my repository. Should I make an AGENTS.md about each repeated process we have?


Troubleshooting

AGENTS.md isn’t being picked up

  • Make sure the file is committed to the same branch LatchLoop is using.
  • Check the file name (AGENTS.md is recommended). Avoid typos like AGENT.md.txt.
  • In a monorepo, place AGENTS.md in the same package folder as the files being changed, or add one at the repo root.
  • If you recently connected your repository, wait for indexing to complete or re‑run the task.

The wrong AGENTS.md is being used

  • LatchLoop selects the AGENTS.md nearest to the files involved in the task. If you want different guidance, place a more specific AGENTS.md closer to those files, or consider using LatchLoop’s Task Templates.

Security note

  • AGENTS.md is guidance only. It doesn’t execute by itself—it tells the agent what to do. The agent runs commands in controlled environments as configured by your project.

Best practices

  • Be specific: share concreate examples, not approximations.
  • Keep it short: prioritize the steps the agent should always follow.
  • For defining repeated processes, use Task Templates instead of Agents.md files.
  • Treat it as “living” docs: update it when your build/test or conventions change.

Need help?

If you have questions or want help shaping an effective AGENTS.md for your repo, contact support from within LatchLoop or reach out to your account team. We’re happy to review examples and suggest improvements.