Architecture: VoiceServer location in ~/.claude/ conflates config with runtime
Summary
VoiceServer is installed to ~/.claude/VoiceServer/, placing a runtime server inside Claude Code's configuration directory. This conflates configuration with application runtime.
Related Issues
- #346 - ENV path inconsistent (broader path/location issues)
- #393 - Config path mismatch (symptom of unclear directory conventions)
Current State
~/.claude/ # Claude Code config directory
├── settings.json # Config ✓
├── skills/ # Config ✓
├── hooks/ # Scripts ✓
├── VoiceServer/ # Runtime server ✗
│ ├── server.ts
│ ├── manage.sh
│ └── voice-personalities.json
└── .env # Secrets ✓
Problem
~/.claude/ is Claude Code's configuration directory. It should contain:
- Settings and preferences
- Memory/context files
- Skills and hooks (configuration/scripts)
- Secrets (.env)
It should not contain:
- Long-running server processes
- Server logs and runtime state
- Application data that grows over time
Issues with current approach:
- Conflates config with application runtime
- Makes backup/restore of config more complex (must exclude runtime data)
- Violates separation of concerns
- Doesn't follow XDG Base Directory Specification
Proposed Structure
Option A: Dedicated PAI directory
~/.claude/ # Claude Code config only
├── settings.json
├── skills/
├── hooks/
└── .env
~/.pai/ # PAI runtime services
├── VoiceServer/
├── logs/
└── cache/
Option B: XDG compliant
~/.config/claude/ # Claude Code config (or ~/.claude/)
~/.config/pai/ # PAI configuration
~/.local/share/pai/ # PAI runtime/data (VoiceServer, cache)
~/.local/state/pai/ # PAI logs, state
Option C: Platform-native (macOS)
~/Library/Application Support/PAI/
Impact
This is architectural debt, not a blocking bug. Current installation works but should be addressed to establish clean conventions before v1.0.
Recommendation
- Define clear directory conventions in PAI documentation
- Consider migration path for existing installations
- Update all packs to use consistent locations
Thanks for the architecture feedback! The VoiceServer location was reconsidered during the v3.0 restructure (now released). It remains in ~/.claude/VoiceServer/ as a practical choice for co-location with the rest of PAI. Appreciate the thoughtful analysis!