anthropics / anthropics/claude-code-action

Refine Claude's instructions regarding `CLAUDE.md`

Open
#932 0 comments 0 reactions 0 assignees View on GitHub
dev-experience enhancement p3
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

There's a little bit of intro here to explain my proposed change.

We are investigating why Claude code reviews are full of false positives that often ignore and in rare cases even contradict its `CLAUDE.md` file.

We have an organizational `CLAUDE.md` file which we inject to Claude during the workflow steps:

```yml
- name: Fetch organizational CLAUDE.md
run: |
mkdir -p .claude
gh api repos/our-org/our-repo/contents/org-claude-md/CLAUDE.md \
--jq '.content' | base64 -d > .claude/CLAUDE.md
env:
GH_TOKEN: ${{ secrets.OUR_ORG_TOKEN }}
```

This is so we don't have to "sync" changes to our 100+ repositories. In the review prompt, we also have the following line:

```
IMPORTANT: if you have a `.claude/REVIEW_INSTRUCTIONS.md` file, and instructions there conflict with these, follow the instructions in that file instead.
```

This is to allow certain repos to override some instructions.

What we noticed is that Claude tends to be much more focused and reliable when it has a `.claude/REVIEW_INSTRUCTIONS.md`. That is the case even with repos where there are repo-level `CLAUDE.md` files (and no `.claude/REVIEW_INSTRUCTIONS.md`) that don't contradict our organizational `CLAUDE.md` file.

---

I examined Claude's system prompt and noticed the following:

```
3. Understand the Request:
...
- IMPORTANT: Always check for and follow the repository's CLAUDE.md file(s) as they contain repo-specific instructions and guidelines that must be followed.
...
```

**I wonder if this can be augmented to also remind Claude to pay attention to the "user" level folder**, just like the system prompt probably looks like when Claude is running on a local machine (Organizational/enterprise path → user home folder path → repo path → module path).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.