Preserve user preferences (YouTube channels, etc.) across version upgrades
Problem
User preferences stored in release-specific directories are lost during PAI version upgrades. For example, youtube-channels.json in skills/PAIUpgrade/ ships empty with each release, requiring users to manually re-add their channel subscriptions.
Current behavior:
- Preferences stored in:
Releases/v2.3/.claude/skills/PAIUpgrade/youtube-channels.json - This file ships empty and gets overwritten on upgrade
- User's actual channel history exists in
~/.claude/MEMORY/learnings/youtube-channel-learnings-*.mdbut isn't migrated
Proposed Solution
1. Move user preferences to persistent location
Store user-specific preferences outside the release directory:
~/.claude/MEMORY/preferences/
├── youtube-channels.json
├── custom-skills.json
└── user-settings.json
2. Add migration logic to install.ts
// During upgrade, extract channels from existing learning files
async function migrateYouTubeChannels() {
const prefsPath = join(homedir(), '.claude/MEMORY/preferences/youtube-channels.json');
// If preferences already exist, skip migration
if (existsSync(prefsPath)) return;
// Extract from learning files
const learningFiles = await glob('~/.claude/MEMORY/learnings/youtube-channel-learnings-*.md');
const channels = new Set<string>();
for (const file of learningFiles) {
const content = await Bun.file(file).text();
const match = content.match(/Channels Analyzed:\s*(.+)/);
if (match) {
match[1].split(',').forEach(h => channels.add(h.trim()));
}
}
// Write migrated preferences
if (channels.size > 0) {
await Bun.write(prefsPath, JSON.stringify({
channels: Array.from(channels).map(handle => ({
handle,
migratedFrom: 'learnings',
migratedDate: new Date().toISOString()
}))
}, null, 2));
}
}
3. Update PAIUpgrade skill to read from persistent location
Modify the skill to check user preferences first, falling back to release defaults:
const userPrefs = join(homedir(), '.claude/MEMORY/preferences/youtube-channels.json');
const defaultPrefs = join(__dirname, 'youtube-channels.json');
const channels = existsSync(userPrefs)
? JSON.parse(readFileSync(userPrefs, 'utf-8'))
: JSON.parse(readFileSync(defaultPrefs, 'utf-8'));
Benefits
- User preferences survive version upgrades
- Automatic migration from existing learning files
- Clear separation between release defaults and user customizations
- Pattern can extend to other user preferences (custom prompts, tool configs, etc.)
Additional Context
Discovered this during v2.3 upgrade - had to manually recover YouTube channel subscriptions from learning files and re-add them to the new format.
There's already logic here for what you're looking for: Releases/v2.3/.claude/skills/CORE/USER/SKILLCUSTOMIZATIONS/README.md
Thanks for this feedback! We're currently working on PAI v3.0, which includes significant architectural changes. We're evaluating this issue in the context of the new architecture and will provide an update once v3.0 is closer to release.
Please stand by — we haven't forgotten about this and appreciate your contribution to making PAI better!
Thanks for the feedback! In v3.0 (now released), user preferences live in USER/ subdirectories that are separate from system files, making upgrades much cleaner. The installer also handles migration better. Please upgrade to v3.0.