Skip to main content
This page shows where a repository keeps its agent instructions, skills and MCP servers, and how outerlayer init sets them up. A repository keeps one copy of each file. Nothing is generated, so there is nothing to compile.

The layout

Claude Code and Codex read AGENTS.md at the repository root. Codex reads skills from .agents/skills/. Claude Code reads skills from .claude/skills/, so the link gives both tools the same skills. The .outerlayer directory describes each file in .outerlayer/.

Run Codex with the factory’s context

Run outerlayer codex in place of codex. It starts Codex with the instructions, skills, hooks and MCP server that your control plane or repository holds. See outerlayer codex for what the launch writes and where. Codex cuts the AGENTS.md of a project at 32 KiB, so a longer file loses its end. The launch sets project_doc_max_bytes above the size of the delivered AGENTS.md. The whole file reaches Codex. In a plain codex, raise the limit with project_doc_max_bytes in ~/.codex/config.toml. outerlayer sync uploads the Codex sessions that start for a work item. See What leaves your machine.

Set up

  1. Run outerlayer init in the repository.
  2. Commit the files it wrote. init prints the git add, git commit and git push commands.
  3. Merge the commit to your base branch. OuterLayer reads judges from the base branch, and a build reads the repository from your git host.
init writes each of these files only when it is missing. It changes nothing you wrote. The outerlayer MCP server needs outerlayer login on each machine that uses it. The outerlayer-docs server lets your agent look up how OuterLayer works. When OpenCode is installed on the machine, init also adds the two servers to opencode.json. When Codex is installed, init also adds them to .codex/config.toml. In a repository that a control plane governs, init writes none of these files. See Instructions that come from another repository. init also connects the repository and installs the hooks. outerlayer init lists every step and flag. The Quickstart shows the whole first run.

When init leaves a file alone

  • .claude/skills/ already holds skills: init makes no link. Move those skills into .agents/skills/, delete .claude/skills/, and run outerlayer init again.
  • The repository has a CLAUDE.md and no AGENTS.md: init writes no AGENTS.md. Add an AGENTS.md for the instructions that every tool reads.
outerlayer claude gives Claude Code the skills in the repository root’s .agents/skills/ without the link. A runner starts a build’s agent the same way. A plain claude needs the link. To skip the link, run outerlayer init --no-skills-link.
On Windows, git commits a link only when core.symlinks is true. Without it, git writes a text file in place of the link, and Claude Code finds no skills. Run git config core.symlinks true, or start sessions with outerlayer claude.

Write the starter files with no login

Run outerlayer init --local --template default. It makes no network call. It writes the starter skills and declares "layout": 2 in .outerlayer/config.json. It writes no AGENTS.md, adds no MCP servers and makes no .claude/skills link.

Check the setup

Run outerlayer doctor. It names each file that needs a change and says how to fix it. To see the instructions and skills that a build receives, run outerlayer context show.

Protect these files

A change to these files changes what agents are told and what the judges accept. OuterLayer marks a pull request that edits .outerlayer/. It does not mark a change to AGENTS.md, .agents/, .claude/ or .mcp.json. To require a person’s review of all of them, name them in .github/CODEOWNERS. See Require a person’s review of rules changes.

Compile slash commands

A file in .outerlayer/commands/ is a slash command. outerlayer context emit compiles each one into .claude/commands/. In this layout it writes nothing else. emit needs "targets": ["claude-code"] in .outerlayer/config.json. In CI, run outerlayer context emit --check. It writes nothing. It exits 1 when an output is missing, differs from its source, or has no source. See outerlayer context emit.

Move a repository to this layout

A repository in the earlier layout keeps its instructions and skills in .outerlayer/ and commits compiled copies.
  1. Run outerlayer init --update --dry-run to see the plan.
  2. Run outerlayer init --update.
  3. Fix each file the command lists, and run the command again.
  4. Review the diff and commit it. The command commits nothing.
The command makes these changes: Command sources in .outerlayer/commands/ stay where they are. The command never moves or deletes a file you edited. It lists each one. Fix the file as follows:
  • A source whose new place already holds a file of yours: keep one of the two.
  • A source whose new place git ignores: add an exception to .gitignore, such as !/.agents/.
  • A file in .claude/skills/ that is not generated: move or delete it, so the command can make the link.
  • A file you edited that still names .outerlayer/skills/: change the path.
To move without the link, add --no-skills-link. Update the files init wrote lists every flag, including --control-plane.

Instructions that come from another repository

A factory can use one repository as the control plane for the others. A governed repository gets the shared instructions without a commit, and still commits its own instructions and skills. See Share instructions across repositories.