Skip to content

Refine Claude's instructions regarding CLAUDE.md #932

@SHxKM

Description

@SHxKM

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-experienceenhancementNew feature or requestp3Minor bug or general feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions