R507 · Harness tips › Harness tips

Nine files around a coding agent, and which of them are enforced

Read the original

harness-configinstruction-filesclaim-checkingdocumentationpermissionshooks

Source: Jean Lee, LinkedIn, "Claude Code Project Structure - November 2026" (shown as two hours old on 2026-12-02, though the post's share id decodes to 2026-10-21, so this copy is an edited or reposted version). The post is publicly readable. Every claim is checked against Anthropic's Claude Code documentation as of 2026-12-02: Explore the .claude directory, Memory (AGENTS.md section), Hooks, Skills, MCP, Workflows. Documentation behaviour is a snapshot and version-dependent.

The claim

A project's surrounding files, not its prompts, carry most of the context a coding agent needs. The post lists nine: CLAUDE.md, AGENTS.md, .mcp.json, .claude/settings.json, rules/, skills/, agents/, workflows/ and hooks/, and closes with "Claude Code should not depend on one giant prompt."

The thesis holds, and the vendor now ships a page that is close to the same diagram. The useful work is in the three places where the list is too flat.

Checked item by item

ItemPost saysDocumentation saysVerdict
CLAUDE.mdOverview, stack, commands, conventions, read every sessionLoaded at session start, from ./CLAUDE.md or ./.claude/CLAUDE.mdAccurate
AGENTS.mdShared instructions across Claude Code, Codex, Cursor, CopilotRead directly only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in the working directory or above; with both present, Claude reads the CLAUDE.md files only, unless CLAUDE.md imports @AGENTS.md or the Project instructions setting is changed. Needs v2.1.277 or laterMisleading as laid out
.mcp.jsonProject MCP servers for GitHub, Jira, Slack, databasesProject-scoped servers; each user must approve them interactively, and a cloned repository cannot approve its own servers (approval keys committed to .claude/settings.json are ignored in an untrusted folder). Tool schemas are deferred and load on demandAccurate, missing the approval step
.claude/settings.jsonPermissions, models, hooks, plugins, sandboxing, environmentApplied directly; "enforced whether Claude follows them or not". Ranks below settings.local.json, the --settings flag and managed settings; most lists merge across filesAccurate
rules/Modular standards, testing rules, API conventionsLives at .claude/rules/. Files without paths: frontmatter load at session start; with paths:, they load when Claude touches a matching file. Guidance, not enforcedAccurate, path missing
skills/Capabilities loaded only when needed.claude/skills/<name>/SKILL.md. Descriptions sit in context always; the body loads on invocation. Frontmatter controls who may invokeAccurate
agents/Specialised sub-agents (review, security).claude/agents/*.md with name and description; each runs in its own context window, optionally its own model and toolsAccurate
workflows/Orchestrate agents into repeatable processes.claude/workflows/*.js: JavaScript scripts the runtime executes, each run as /<name>; loaded only when dynamic workflows are on (an opt-in on Pro)Accurate, but it is code, not prose
hooks/Validation, linting, formatting, safety checks around toolsHooks are declared in settings.json (or a plugin's hooks/hooks.json). .claude/hooks/ is only the documented convention for the scripts that config points at; Claude Code does not read the folder by itselfPartly accurate

The post's text omits the .claude/ prefix for the last five; whether its image shows it was not checked. It also omits CLAUDE.local.md, settings.local.json, commands/, output-styles/, agent-memory/, .worktreeinclude and the personal ~/.claude/ counterpart.

Three corrections a staff engineer would make

1. Split the list by what enforces it. The post presents the nine files as one kind of thing. They are three:

A rule that must hold (never touch production config, always run the formatter) belongs in the second group. Writing it in rules/ and expecting compliance is the common failure.

2. CLAUDE.md plus AGENTS.md is not additive by default. The layout as drawn, with both files at the root, means Claude Code reads CLAUDE.md and ignores AGENTS.md. Teams that keep cross-tool conventions in AGENTS.md and Claude-specific notes in CLAUDE.md will find the shared half silently missing. Fix: put @AGENTS.md in CLAUDE.md, or keep only AGENTS.md, or change the instruction-files setting. In an interactive session, a line such as "no CLAUDE.md found; AGENTS.md loaded" tells you which one won.

3. "Every session" has a cost. Putting stack, commands and conventions in an always-loaded file is the default advice, but independent measurement (R489) found long generated instruction files cost 20 to 23% more for no gain. Keep the always-loaded file short, push topic detail to path-scoped rules and skills, which load only when relevant.

Failure modes

Review checklist

  1. For each rule in CLAUDE.md, AGENTS.md or rules/, ask whether violating it would be a defect. If yes, move it to a permission, hook or CI check.

  2. If both CLAUDE.md and AGENTS.md exist, confirm CLAUDE.md imports the other, and check the session's load line.

  3. Every hook script in the tree has a matching entry in settings.json.

  4. settings.local.json and personal servers are gitignored; project servers in .mcp.json carry no secrets.

  5. Always-loaded instruction text is short; detail lives in path-scoped rules or skills.

  6. workflows/ scripts are reviewed like code, because they are code.

Connections

See R507 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.