---
name: agent-md-context-file
description: "Root CLAUDE.md as a short generated entry file, not a mirror: it routes agents to rules, procedures and reference sliced from the agent instructions, which stay whole and are the source of truth. Adding a new rule, procedure or feature edits the instructions only; CLAUDE.md changes only when the owner approves a re-run of the conversion. Use when a person asks to install or apply \"CLAUDE.md Cowork Context File\" (FTR-21) in a project, or when working in a project that has it installed."
---

# CLAUDE.md Cowork Context File (FTR-21, version 2.0)

> Generated from library record FTR-21 version 2.0, publish 20261102a. Review status: unreviewed. The complete specification is in references/spec.md and is the authority; this file is the operating procedure drawn from it.

## What this does

Root CLAUDE.md as a short generated entry file, not a mirror: it routes agents to rules, procedures and reference sliced from the agent instructions, which stay whole and are the source of truth. Adding a new rule, procedure or feature edits the instructions only; CLAUDE.md changes only when the owner approves a re-run of the conversion

## When to use this skill

- A person asks to install, apply or update "CLAUDE.md Cowork Context File" (FTR-21) in a project.
- A project's agent instructions list agent-md-context-file as installed and the task touches what it covers.
- Requires first: FTR-06 (skill file-storage-and-transfer).
- Works better with, if installed: FTR-15 (skill project-cache), FTR-23 (skill agent-instructions-sync).

## Install procedure

Steps run in order. Assess comes first, every question in the Ask step is answered by the person before anything is written, and every write merges additively into the existing project files (read the file first, update an existing section in place, never overwrite).

### Assess first
- Check whether `CLAUDE.md` exists at the project root (NOT in `admin\`), and whether `admin\AGENT_INSTRUCTIONS.md` exists. The instructions are the source; if only `CLAUDE.md` exists, say so before doing anything else.
- Decide which state the project is in:
  - **None**: no `CLAUDE.md`.
  - **Full copy** (the old mirror): `CLAUDE.md` opens with an intro block saying it mirrors the instructions, or is about as large as the instructions. Leave it in place until a conversion passes its audit; it is a "temporary full copy" (step 8).
  - **Entry file** (converted): at most 200 lines, a routing table, and a last line `Instructions version synced: <version> (<date>)`.
- Read every section of `admin\AGENT_INSTRUCTIONS.md` before classifying any of it. Never judge a section by its heading: a procedure can hide a hard rule, and a section titled as reference can hold a procedure.
- List every mirror or clone line in the instructions (the words and places are in step 2). They defeat the structure and must be removed, with the owner's go-ahead, before the entry file is trusted.
- Check whether `project_cache\` exists and whether it has an index (`project_cache\INDEX.md`). If the project cache feature is installed, a cache with no index is a defect to fix first. Never index keys or credential files.
- If a person asks for a project update and both files are present, treat `admin\AGENT_INSTRUCTIONS.md` as the file to update. `CLAUDE.md` is not edited on its own and is not regenerated as part of the edit.

### Ask, only if needed
Proceed without asking when the project has no `CLAUDE.md` and the instructions carry no mirror lines. Otherwise ask the owner once, in one message, for the go-ahead that is needed:
1. **Remove the mirror or clone lines from the instructions** (back up first, bump the version or date, add a change-log row, re-paste the Project Instructions field).
2. **Replace an existing `CLAUDE.md`.** A differing `CLAUDE.md` is reported as a conflict, never replaced silently.
3. **Which is master for structure-first additions** (step 7): the instructions or the structure. Default: the instructions (source first).
4. **A claude.ai-only section** the owner wants left out of the entry file: ask for sign-off and a reason. A rule inside such a section is extracted first.
Do not ask about anything else.

### Write

The full Write payload is in references/write-payload.md. It is applied exactly as written, with the merge rule above.

### Confirm
Confirm: CLAUDE.md is at your project root as a short entry file that points Cowork and Claude Code to your rules and procedures, and your full instructions stay whole in admin\AGENT_INSTRUCTIONS.md. From now on, adding a rule, procedure or feature means editing the instructions only; CLAUDE.md changes only when you approve a re-run of the conversion. If your project is not converted yet, say that your current CLAUDE.md is marked a temporary full copy with today's date. Want to install another, or is that everything for now?

## Files in this skill

- references/spec.md: the complete specification, unabridged.
- references/write-payload.md: the Write step on its own.
