anthropics / anthropics/claude-code-action

Refine Claude's instructions regarding `CLAUDE.md`

Đang mở
#932 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
dev-experience enhancement p3
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

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).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.