# Create a read-only project subagent in Claude Code

Canonical: https://cwyn.com/pages/claude-code-guide-first-project-subagent.html
Last updated: 2026-11-23T03:38:11-05:00

Claude Code setup guide

Short answer. If you keep asking Claude to check whether the README points to files that still exist, give that check its own subagent. Start with a task that only needs to read the repository. From the repository root, create .claude/agents/readme-path-check.md. Claude Code loads project subagents from .claude/agents/.

By CWYN · Last updated November 23, 2026 · Not affiliated with Anthropic · Published November 19, 2026

## 1. Give the subagent a project home

From the repository root, create `.claude/agents/readme-path-check.md`. Claude Code loads project subagents from `.claude/agents/`. Use a name that is distinct from your other agents so you can identify it in the session.

## 2. Limit the tools to reading and searching

Put this example in the file. The YAML at the top names the agent and restricts it to the tools listed. The Markdown below tells it what to check.

```
---
name: readme-path-check
description: Checks whether paths in the project README exist.
tools: Read, Glob, Grep
---
Read the project README. Check the repository-relative file paths it
mentions. Report missing paths with the line where each is mentioned.
```

## 3. Pick the subagent in the prompt

Open a Claude Code terminal session from the repository root. If you created the `.claude/agents/` directory after starting the session, restart Claude Code. Type `@`, select `readme-path-check` from the suggestions, and ask it to check the README paths.

## 4. Confirm the delegation and check one result

Look for a tool call in the transcript named for your subagent. If the agent reports a missing path, check that line in the README and look for the file yourself. If the agent is missing from the picker, check the project path and the `name` and `description` fields before trying a fresh session.

If a later task needs an agent to edit files while you work, [give the subagent its own worktree](https://cwyn.com/pages/claude-code-guide-worktrees.html) so it edits a separate checkout.

If you want the same checklist to run after every edit, [compare subagents, skills and hooks](https://cwyn.com/pages/claude-code-guide-skills-vs-subagents-hooks.html) to choose what should trigger the check.

Sources · [Project scope, frontmatter, tools and explicit invocation](https://code.claude.com/docs/en/sub-agents)

## Related guides

- [Create a Claude Code slash command with a project skill](https://cwyn.com/pages/claude-code-guide-first-project-skill.html)
- [Claude Code settings.json precedence (managed first)](https://cwyn.com/pages/claude-code-guide-settings-json-precedence.html)
- [Create a custom Claude Code output style](https://cwyn.com/pages/claude-code-guide-custom-output-style.html)

## Next steps

- [All 34 Claude Code guides](https://cwyn.com/guides/claude-code/)
- [Claude Code setup walkthrough](https://cwyn.com/setup/claude-code/)
- [Check your CLAUDE.md](https://cwyn.com/score/setup-file-checker/?profile=claude)
- [Claude Code Complete Setup Pack ($12.95)](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html)

### Set up your Claude Code project

[Claude Code Complete Setup Pack ($12.95)](https://cwyn.com/pages/pack-claude-code-complete-setup-pack.html) · Optional paid kit. The pack includes a project reviewer and the setup files that go with it.
Kit details as of Nov 22, 2026

Claude Code Complete Setup Pack $12.95

Set up project instructions, permission rules, hooks, a reviewer skill and subagent, and MCP connections for Claude Code.
