Custom instructions for the CLI and VS Code

Which instruction files the CLI reads before a session, how repository memory works and how VS Code sets instructions.

  • Updated 2026-10-12
  • Coming soon
  • Developers
  • CLI, VS Code
  • Every plan

Files every session reads

The CLI is coming soon and the VS Code extension is coming soon.

Before a session starts, agi reads your own instructions from ~/.agiworkforce/instructions.md, then walks from the folder you are in up to the top of the disk and reads, in each folder, AGENTS.md, CLAUDE.md and .agiworkforce/instructions.md. Your own file comes first and the folder you are in comes last, so the closest file has the final word. Together they may use about 10,000 tokens. If your own file is larger on its own, it is cut to fit; files past the limit are left out, and the session says so once.

Rules in .agiworkforce/rules/*.md in the repository and in ~/.agiworkforce/rules/*.md are added too, some only for matching files.

Repository memory

Notes the agent should keep for a repository are saved in CLAUDE.md at the repository root. In VS Code, run Remember for This Repository to add one; it tells you which file it saved to. Notes for every repository go in ~/.agiworkforce/CLAUDE.md in Local mode, CLAUDE.byok.md in BYOK mode and CLAUDE.managed.md in Managed mode, so a note saved in one mode never reaches another. Each note can be up to 4,000 characters.

Instructions set in VS Code

VS Code Settings also has instruction boxes for all workspaces and for the current one, up to 8,000 characters each. The workspace box replaces the general one when it has text, and whichever applies is sent with every message. The Settings panel lists the instruction files it found in the workspace folder.

Was this article helpful?

Need more help?

Related articles