Optimize setup with bash file operations

Replace individual read/write operations with bash mkdir and cp
commands. Reduces setup from ~30 tool calls to ~5, saving time
and tokens for users on rate-limited plans.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Anthony Taglianetti
2026-02-06 20:20:51 -08:00
parent 14da1e92c1
commit a075fde19a
+39 -65
View File
@@ -223,33 +223,38 @@ After gathering all answers, create the therapy environment.
└── freeform.md └── freeform.md
``` ```
### Step 2: Read Source Files ### Step 2: Create Directories and Copy Files (use Bash)
Read the necessary source files based on user selections: **IMPORTANT:** Use bash commands for speed. Do NOT read files then write them individually.
1. **Read the persona file** they selected (e.g., `personas/warm-4o.md`) Run this single command to create all directories:
- Extract `## Persona Description` section for {{PERSONA_CONTENT}} ```bash
- Extract `## Tone Modifier` line for {{TONE_MODIFIER}} mkdir -p "{storage_path}"/{sessions,.therapy/{modalities,library/{personas,modalities,structures}}}
```
2. **Read `CLAUDE.template.md`** for the base CLAUDE.md structure Then copy all static files in one command (from the inner-dialogue repo directory):
### Step 3: Create .therapy/ Folder **Core-only setup:**
```bash
cp safety-protocol.md "{storage_path}/.therapy/" && \
cp personas/warm-4o.md personas/direct-challenging.md "{storage_path}/.therapy/library/personas/" && \
cp modalities/cbt.md "{storage_path}/.therapy/library/modalities/" && \
cp structures/structured.md structures/moderate.md structures/freeform.md "{storage_path}/.therapy/library/structures/" && \
cp "personas/{selected_persona}.md" "{storage_path}/.therapy/persona.md" && \
cp "structures/{selected_structure}.md" "{storage_path}/.therapy/session-structure.md" && \
cp "modalities/cbt.md" "{storage_path}/.therapy/modalities/" && \
cp profile.template.md "{storage_path}/profile.md"
```
Create `{storage_path}/.therapy/` with: **With expansion pack:** Also copy expansion files from the expansion pack folder to `.therapy/library/`.
1. **Copy `safety-protocol.md`** from this repo to `.therapy/safety-protocol.md` ### Step 3: Create CLAUDE.md (use Write tool)
2. **Copy selected persona file** to `.therapy/persona.md` Read `CLAUDE.template.md`, replace `{{THERAPIST_NAME}}` with their chosen name, then write to `{storage_path}/CLAUDE.md`.
3. **Copy selected structure file** to `.therapy/session-structure.md` ### Step 4: Create version.json (use Write tool)
4. **Create `.therapy/modalities/`** and copy only the selected modality files Write `{storage_path}/.therapy/version.json`:
5. **Create `.therapy/library/`** and copy component files:
- **Core:** Copy files from this repo's `personas/`, `modalities/`, `structures/` folders (core content only)
- **If expansion pack installed:** Also copy expansion pack files to `.therapy/library/personas/` and `.therapy/library/modalities/`
6. **Create `.therapy/version.json`:**
**Core-only:** **Core-only:**
```json ```json
@@ -258,64 +263,33 @@ Create `{storage_path}/.therapy/` with:
"installed": "YYYY-MM-DD", "installed": "YYYY-MM-DD",
"components": { "components": {
"safety-protocol": "1.0.0", "safety-protocol": "1.0.0",
"persona": "[persona-name]@1.0.0", "persona": "{persona-name}@1.0.0",
"session-structure": "[structure-name]@1.0.0", "session-structure": "{structure-name}@1.0.0",
"modalities": { "modalities": {
"[modality]": "1.0.0" "cbt": "1.0.0"
} }
}, },
"source_url": "https://github.com/ataglianetti/inner-dialogue" "source_url": "https://github.com/ataglianetti/inner-dialogue"
} }
``` ```
**With expansion pack:** **With expansion pack:** Add `"expansion_installed": "YYYY-MM-DD"` and `"expansion_pack": "1.0.0"` to components.
```json
{ ### Step 5: Create Launcher Script (use Bash)
"kit_version": "1.0.0",
"installed": "YYYY-MM-DD", **macOS/Linux:**
"expansion_installed": "YYYY-MM-DD", ```bash
"components": { printf '#!/bin/bash\ncd "%s"\nclaude\n' "{storage_path}" > "{storage_path}/start-session.command" && \
"safety-protocol": "1.0.0", chmod +x "{storage_path}/start-session.command"
"persona": "[persona-name]@1.0.0", ```
"session-structure": "[structure-name]@1.0.0",
"modalities": { **Windows:**
"[modality]": "1.0.0" ```bash
}, printf '@echo off\r\ncd /d "%s"\r\nclaude\r\n' "{storage_path}" > "{storage_path}/start-session.bat"
"expansion_pack": "1.0.0"
},
"source_url": "https://github.com/ataglianetti/inner-dialogue"
}
``` ```
**Important:** The library folder makes the therapist folder self-contained. Users can delete the inner-dialogue repo after setup. **Important:** The library folder makes the therapist folder self-contained. Users can delete the inner-dialogue repo after setup.
### Step 4: Create CLAUDE.md
Generate `{storage_path}/CLAUDE.md` by:
1. Reading `CLAUDE.template.md`
2. Replacing {{THERAPIST_NAME}} with their chosen name
### Step 5: Create profile.md
Copy `profile.template.md` to `{storage_path}/profile.md`
### Step 6: Create Launcher Script
**macOS/Linux:** Create `{storage_path}/start-session.command`:
```bash
#!/bin/bash
cd "{storage_path}"
claude
```
Run: `chmod +x "{storage_path}/start-session.command"`
**Windows:** Create `{storage_path}/start-session.bat`:
```batch
@echo off
cd /d "{storage_path}"
claude
```
--- ---
## After Creating Files ## After Creating Files