From 27cf20d57ffe68f4296fac7bd402833bb9161bdc Mon Sep 17 00:00:00 2001 From: catlog22 Date: Wed, 24 Sep 2025 16:23:22 +0800 Subject: [PATCH] feat: Add context optimization principle for directory navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added context optimization to decision principles - Include guidance for using cd [directory] to reduce irrelevant context - Added examples showing focused vs multi-scope analysis patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../workflows/intelligent-tools-strategy.md | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.claude/workflows/intelligent-tools-strategy.md b/.claude/workflows/intelligent-tools-strategy.md index 913cd2d0..d8303500 100644 --- a/.claude/workflows/intelligent-tools-strategy.md +++ b/.claude/workflows/intelligent-tools-strategy.md @@ -16,6 +16,7 @@ type: strategic-guideline - **When in doubt, use both** - Parallel usage provides comprehensive coverage - **Default to tools** - Use specialized tools for most coding tasks, no matter how small - **Lower barriers** - Engage tools immediately when encountering any complexity +- **Context optimization** - Based on user intent, determine whether to use `cd [directory]` for focused analysis to reduce irrelevant context import ### Quick Decision Rules 1. **Exploring/Understanding?** → Start with Gemini @@ -187,4 +188,21 @@ For every development task: - **Be specific** - Clear PURPOSE, TASK, and EXPECTED fields - **Include constraints** - File patterns, scope, requirements in RULES - **Test patterns first** - Validate file patterns with `ls` -- **Document context** - Always reference CLAUDE.md for context \ No newline at end of file +- **Document context** - Always reference CLAUDE.md for context + +### Context Optimization Strategy +**Directory Navigation**: Use `cd [directory]` when analyzing specific areas to reduce irrelevant context + +**When to use `cd`**: +- Specific directory mentioned → Navigate first +- Focused analysis needed → Change to target directory +- Multi-directory scope → Stay in root, use explicit paths + +**Example**: +```bash +# Focused (preferred) +cd src/auth && ~/.claude/scripts/gemini-wrapper -p "analyze auth patterns" + +# Multi-scope +~/.claude/scripts/gemini-wrapper -p "CONTEXT: @{src/auth/**/*,src/api/**/*}" +``` \ No newline at end of file