Browse Source

fix(commands): Prevent filesystem scanning in /sync on Windows

- Add explicit Git Bash syntax warnings to commands/sync.md
- Document why Windows cmd syntax (find /c, 2>nul) causes issues
- Add CRITICAL warning about using wc -l instead of find /c

Also:
- Enable ENABLE_TOOL_SEARCH in settings.local.json
- Clean up accumulated bash permissions
- Add tests/*/output/ to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0xDarkMatter 2 months ago
parent
commit
9a80eb5c10
3 changed files with 26 additions and 5 deletions
  1. 4 5
      .claude/settings.local.json
  2. 3 0
      .gitignore
  3. 19 0
      commands/sync.md

+ 4 - 5
.claude/settings.local.json

@@ -1,4 +1,7 @@
 {
+  "env": {
+    "ENABLE_TOOL_SEARCH": "true"
+  },
   "permissions": {
     "allow": [
       "WebSearch",
@@ -137,7 +140,6 @@
       "Bash(choco:*)",
       "Bash(scoop:*)",
       "Bash(winget:*)",
-      "Bash(\"E:\\\\Downloads\\\\[TEMPLATE] Praxis Framework - Concierge AI.md\")",
       "Bash(powershell -ExecutionPolicy Bypass -File \"./scripts/install.ps1\")"
     ],
     "deny": [],
@@ -151,8 +153,5 @@
     ]
   },
   "hooks": {},
-  "outputStyle": "Vesper",
-  "env": {
-    "ENABLE_TOOL_SEARCH": "true"
-  }
+  "outputStyle": "Vesper"
 }

+ 3 - 0
.gitignore

@@ -31,3 +31,6 @@ Thumbs.db
 *_scraped.json
 *_scraped.csv
 .grok/
+
+# Test artifacts
+tests/*/output/

+ 19 - 0
commands/sync.md

@@ -6,6 +6,11 @@ description: "Session bootstrap - read project context, restore saved state, sho
 
 Read yourself into this project and restore any saved session state. Fast, direct file reads.
 
+**Environment Requirements:**
+- All shell commands use **Git Bash syntax** (works on Linux/macOS/Windows)
+- NEVER use Windows cmd syntax (`find /c`, `2>nul`) - causes filesystem scanning on Git Bash
+- Use `wc -l` for counting, `2>/dev/null` for error suppression
+
 ## Arguments
 
 $ARGUMENTS
@@ -107,12 +112,26 @@ agents/*.md OR .claude/agents/*.md
 
 ### Step 4: Git State
 
+**CRITICAL:** Use Git Bash syntax ONLY. Never use Windows cmd syntax (`find /c`, `2>nul`) - these will cause filesystem scanning.
+
+Run these commands to get git state:
+
 ```bash
+# Current branch
 git branch --show-current 2>/dev/null
+
+# Count uncommitted files - MUST use wc -l (works in Git Bash on Windows)
 git status --porcelain 2>/dev/null | wc -l
+
+# Latest commit
 git log -1 --format="%h %s" 2>/dev/null
 ```
 
+**Why this matters on Windows:**
+- `find /c` in Git Bash = Unix find searching C: drive (WRONG)
+- `wc -l` in Git Bash = count lines (CORRECT)
+- Git Bash understands `2>/dev/null` but NOT `2>nul`
+
 ### Step 5: Output
 
 Format and display unified status.