@@ -12,12 +12,14 @@ version: 1.0.0
1212
1313## Initialization (Required First Step)
1414
15- ** Before any tool selection or recommendation, ALWAYS ** :
15+ ** Before any tool selection or recommendation** :
1616
17- 1 . Read the configuration file:
18- ``` bash
19- Read(file_path=" ~/.claude/cli-tools.json" )
20- ```
17+ 1 . Check if configuration exists in memory:
18+ - If configuration is already in conversation memory → Use it directly
19+ - If NOT in memory → Read the configuration file:
20+ ``` bash
21+ Read(file_path=" ~/.claude/cli-tools.json" )
22+ ```
2123
22242. Parse the JSON to understand:
2325 - Available tools and their ` enabled` status
@@ -28,14 +30,16 @@ version: 1.0.0
28303. Use configuration throughout the selection process
2931
3032**Why**: Tools, models, and tags may change. Configuration file is the single source of truth.
33+ **Optimization**: Reuse in-memory configuration to avoid redundant file reads.
3134
3235## Process Flow
3336
3437```
3538┌─ USER REQUEST
3639│
37- ├─ STEP 1: Read Configuration
38- │ └─ Read(file_path="~/.claude/cli-tools.json")
40+ ├─ STEP 1: Load Configuration
41+ │ ├─ Check if configuration exists in conversation memory
42+ │ └─ If NOT in memory → Read(file_path="~/.claude/cli-tools.json")
3943│
4044├─ STEP 2: Understand User Intent
4145│ ├─ Parse task type (analysis, implementation, security, etc.)
@@ -70,19 +74,22 @@ version: 1.0.0
7074
7175**Path**: `~/.claude/cli-tools.json` (Global configuration)
7276
73- ** IMPORTANT** : Always read this file first before making tool selections or recommendations .
77+ **IMPORTANT**: Check conversation memory first. Only read file if configuration is not in memory .
7478
7579### Reading Configuration
7680
81+ **Priority**: Check conversation memory first
82+
83+ **Loading Options**:
84+ - **Option 1** (Preferred): Use in-memory configuration if already loaded in conversation
85+ - **Option 2** (Fallback): Read from file when not in memory
86+
7787```bash
78- # Read the configuration file
88+ # Read configuration file
7989cat ~/.claude/cli-tools.json
80-
81- # Or use Read tool
82- Read(file_path=" ~/.claude/cli-tools.json" )
8390```
8491
85- The configuration file defines all available tools with their settings .
92+ The configuration defines all available tools with their enabled status, models, and tags .
8693
8794### Configuration Structure
8895
@@ -108,7 +115,7 @@ Typical tools found in configuration (actual availability determined by reading
108115| `claude` | builtin | General tasks |
109116| `opencode` | builtin | Open-source model fallback |
110117
111- ** Note** : Tool availability, models, and tags may differ. Always read ` ~/.claude/cli-tools.json ` for current configuration .
118+ **Note**: Tool availability, models, and tags may differ. Use in-memory configuration or read `~/.claude/cli-tools.json` if not cached .
112119
113120### Configuration Fields
114121
@@ -404,11 +411,12 @@ ccw cli --tool codex --mode review --commit abc123
404411
405412### Selection Algorithm
406413
407- ** STEP 0 (REQUIRED)** : Read ` ~/.claude/cli-tools.json ` to get current configuration
414+ **STEP 0 (REQUIRED)**: Load configuration (memory-first strategy)
408415
409416```bash
410- # Always start with this
411- Read(file_path=" ~/.claude/cli-tools.json" )
417+ # Check if configuration exists in conversation memory
418+ # If YES → Use in-memory configuration
419+ # If NO → Read(file_path="~/.claude/cli-tools.json")
412420```
413421
414422Then proceed with selection:
@@ -422,7 +430,9 @@ Then proceed with selection:
422430### Selection Decision Tree
423431
424432```
425- 0. READ ~/.claude/cli-tools.json
433+ 0. LOAD CONFIGURATION (memory-first)
434+ ├─ In memory? → Use it
435+ └─ Not in memory? → Read ~/.claude/cli-tools.json
426436 ↓
4274371. Explicit --tool specified?
428438 YES → Validate tool is enabled in config → Use it
0 commit comments