From 188c3d49558d561dcaaa57c9c69f5654db61ce08 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sat, 2 Aug 2025 17:22:57 +0000 Subject: [PATCH] docs: Document Claude Code Provider CLAUDE.md injection behavior - Add detailed documentation explaining CLAUDE.md auto-injection - Update README with Known Issues section - Clarify this is Claude CLI behavior, not Roo-Code - Provide guidance for users about this feature Fixes #6604 --- README.md | 12 ++++++++++ docs/claude-code-provider-notes.md | 37 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 docs/claude-code-provider-notes.md diff --git a/README.md b/README.md index 08f8f81806..e4c67dba56 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,18 @@ Make Roo Code work your way with: --- +## Known Issues + +### Claude Code Provider - CLAUDE.md Injection + +When using the Claude Code Provider, the Claude CLI tool (as of version 1.0.62) automatically injects content from `CLAUDE.md` files if they exist in your repository root. This is a behavior of the Claude CLI tool itself, not Roo Code. + +**Important:** If you have a `CLAUDE.md` file in your repository and are using the Claude Code Provider, its contents will be automatically included in the context sent to Claude, even without explicitly reading the file. + +For more details, see [docs/claude-code-provider-notes.md](docs/claude-code-provider-notes.md). + +--- + ## Local Setup & Development 1. **Clone** the repo: diff --git a/docs/claude-code-provider-notes.md b/docs/claude-code-provider-notes.md new file mode 100644 index 0000000000..45cf172cb6 --- /dev/null +++ b/docs/claude-code-provider-notes.md @@ -0,0 +1,37 @@ +# Claude Code Provider - CLAUDE.md Injection Notice + +## Overview + +When using the Claude Code Provider in Roo-Code, users may notice that the Claude CLI tool automatically injects content from `CLAUDE.md` files if they exist in the repository root. This is a behavior of the Claude CLI tool itself (as of version 1.0.62), not a feature implemented by Roo-Code. + +## How It Works + +1. Roo-Code integrates with the Claude CLI tool by executing it as a subprocess +2. The system prompt is passed to the Claude CLI via: + - `--system-prompt` flag on non-Windows systems + - stdin on Windows systems (to avoid command length limitations) +3. The Claude CLI tool independently checks for and injects `CLAUDE.md` content + +## Important Notes + +- This injection happens at the Claude CLI level, before Roo-Code receives any response +- Roo-Code does not read or inject `CLAUDE.md` files - this is entirely handled by the Claude CLI +- The behavior may change in future versions of the Claude CLI tool + +## Implications + +If you have a `CLAUDE.md` file in your repository root and are using the Claude Code Provider: + +- The contents will be automatically included in the context sent to Claude +- This happens transparently without explicit indication in the Roo-Code interface +- The AI will be aware of the `CLAUDE.md` contents even without using file reading tools + +## Recommendations + +- Be aware that `CLAUDE.md` files are automatically injected when using Claude Code Provider +- If you don't want this behavior, avoid naming files `CLAUDE.md` in your repository root +- This behavior is specific to the Claude Code Provider and does not affect other API providers + +## Reference + +This behavior was reported in [Issue #6604](https://github.com/RooCodeInc/Roo-Code/issues/6604).