From d3ddfadf16c39844d4e29ade0a927eb3f5c7e850 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Tue, 21 Oct 2025 15:41:49 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=80=89=E6=8B=A9=E7=AD=96=E7=95=A5=E6=96=87?= =?UTF-8?q?=E6=A1=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=85=B3=E9=94=AE=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=8C=83=E5=9B=B4=E8=A7=84=E5=88=99=E5=92=8C=E5=A4=9A?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=94=AF=E6=8C=81=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/intelligent-tools-strategy.md | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.claude/workflows/intelligent-tools-strategy.md b/.claude/workflows/intelligent-tools-strategy.md index 9a094262..05a5b58a 100644 --- a/.claude/workflows/intelligent-tools-strategy.md +++ b/.claude/workflows/intelligent-tools-strategy.md @@ -214,17 +214,32 @@ RULES: [template reference and constraints] - **Path types**: Supports both relative (`../project`) and absolute (`/full/path`) paths - **Token analysis**: For Gemini/Qwen, token counting happens in current directory +#### ⚠️ Critical Directory Scope Rules + +**Once `cd` to a directory**: +- **@ references ONLY apply to current directory and its subdirectories** +- `@**/*` = All files within current directory tree +- `@*.ts` = TypeScript files in current directory tree +- `@src/**/*` = Files within src subdirectory (if exists under current directory) +- **CANNOT reference parent or sibling directories via @ alone** + +**To reference files outside current directory**: +- **MUST use `--include-directories`** to explicitly add external directories +- Example: `cd src/auth && gemini -p "..." --include-directories ../shared,../config` +- After adding, @ patterns can then match files in included directories +- Without `--include-directories`, parent/sibling files are INVISIBLE to @ patterns + #### Multi-Directory Support (Gemini & Qwen) **Purpose**: For large projects requiring fine-grained access across multiple directories -**Use Case**: When `cd` limits global visibility but you need to reference files from other folders +**Use Case**: When `cd` limits scope but you need to reference files from parent/sibling folders **Parameter**: `--include-directories ` -- Includes additional directories in the workspace +- Includes additional directories in the workspace beyond current `cd` directory - Can be specified multiple times or as comma-separated values - Maximum 5 directories can be added -- Particularly useful when working in a subdirectory but needing context from parent or sibling directories +- **REQUIRED** when working in a subdirectory but needing context from parent or sibling directories **Syntax Options**: ```bash