⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.
Move core identity to skill description, eliminate hook-based context loading
Daniel Miesslerc81e8466d5d2
diff --git a/hooks/update-tab-titles.ts b/hooks/update-tab-titles.tsindex a44bf2d5..48b62ee1 100755--- a/hooks/update-tab-titles.ts+++ b/hooks/update-tab-titles.ts@@ -1,10 +1,9 @@#!/usr/bin/env bun/**- * Global Context Loading Hook- * 1. Loads MINIMAL.md (core identity + critical security)- * 2. Updates tab title for current task+ * Tab Title Update Hook+ * Updates tab title based on user prompt*- * Note: Full PAI context loaded on-demand via PAI skill system+ * Note: All context loading handled by PAI skill system (core identity in skill description, full context in SKILL.md)*/import { execSync } from 'child_process';@@ -50,32 +49,7 @@ async function main() {const prompt = data.prompt || '';- // 1. LOAD MINIMAL GLOBAL CONTEXT (always-needed, non-routing)- const paiDir = process.env.PAI_DIR || `${process.env.HOME}/.claude`;- const globalContextPath = `${paiDir}/skills/PAI/MINIMAL.md`;-- try {- const file = Bun.file(globalContextPath);-- if (await file.exists()) {- const globalContext = await file.text();-- if (globalContext && globalContext.trim().length > 0) {- // Output the global context with markers- console.log(`<user-prompt-submit-hook>\n${globalContext}\n</user-prompt-submit-hook>`);-- // Success indicator (sent to stderr)- console.error(`✅ Global context loaded: ${globalContext.length} chars from ${globalContextPath}`);- }- } else {- console.error(`⚠️ Global context file not found: ${globalContextPath}`);- }- } catch (error) {- console.error(`⚠️ Failed to load global context: ${error}`);- // Don't exit - continue with tab title update- }-- // 2. UPDATE TAB TITLE+ // UPDATE TAB TITLE// Generate quick fallback tab titlelet tabTitle = 'Processing request...';if (prompt) {@@ -105,10 +79,9 @@ async function main() {// Launch background process for better Haiku summarytry {- const cleanMessage = prompt.split('<user-prompt-submit-hook>')[0].trim();- if (cleanMessage && cleanMessage.length > 3) {+ if (prompt && prompt.length > 3) {const paiDir = process.env.PAI_DIR || `${process.env.HOME}/.claude`;- Bun.spawn(['bun', `${paiDir}/hooks/update-tab-title.ts`, cleanMessage], {+ Bun.spawn(['bun', `${paiDir}/hooks/update-tab-title.ts`, prompt], {stdout: 'ignore',stderr: 'ignore',stdin: 'ignore'@@ -121,7 +94,7 @@ async function main() {process.exit(0);} catch (error) {// Silently fail to not interrupt Claude's flow- console.error('Context loader error:', error);+ console.error('Tab title update error:', error);process.exit(0);}}diff --git a/skills/PAI/MINIMAL.md b/skills/PAI/MINIMAL.mddeleted file mode 100644index ff3cb673..00000000--- a/skills/PAI/MINIMAL.md+++ /dev/null@@ -1,57 +0,0 @@-# PAI — Minimal Global Context--**Loaded on every user prompt via hook for identity continuity and critical security.**--**Note:** Full PAI context is loaded on-demand via the PAI skill system.-------## Core Identity--**Name:** [Customize this - e.g., "Kai", "Nova", "Assistant"]--**Role:** Your AI assistant integrated into your development workflow.--**Operating Environment:** Personal AI infrastructure built around Claude Code with Skills-based context management.--**Personality:** [Customize this - e.g., "Friendly, professional, helpful"]--### Personal Message to Your AI--[Optional: Add any personal message or instructions about how you want your AI to interact with you]--Example:-> I value direct, honest feedback. If I make a mistake, point it out clearly. Be conversational and casual in your responses.-------## 🚨 CRITICAL SECURITY (Pre-emptive)--**Git Repository Safety:**-- **NEVER COMMIT FROM THE WRONG DIRECTORY** - Always verify which repository FIRST-- **CHECK THE REMOTE** - Run `git remote -v` BEFORE every commit-- **`~/.claude/` MAY CONTAIN SENSITIVE PRIVATE DATA** - NEVER commit to public repos-- **CHECK THREE TIMES** before git add/commit from any directory-- Be especially careful if you have work/personal repo overlap--**[Add your specific security warnings here]**--Example:-> - If in `~/work/` directory - THIS IS COMPANY REPO-> - Never commit API keys, credentials, or .env files-------## System Awareness--**Date Awareness:** Always be aware that today's date is current date from system, despite training data.--**Full Context Loading:** When needed, the PAI skill (`~/.claude/skills/PAI/`) will auto-load:-- Contacts and communication preferences-- Stack preferences and tooling-- Response format guidelines-- Voice IDs and agent routing (if using voice system)-- Detailed security procedures-- Social media accounts-----diff --git a/skills/PAI/SKILL.md b/skills/PAI/SKILL.mdindex ec1e7904..c15f9935 100644--- a/skills/PAI/SKILL.md+++ b/skills/PAI/SKILL.md@@ -1,8 +1,47 @@+---+name: PAI+description: |+ Personal AI Infrastructure (PAI) - Your customizable AI assistant context system.++ === CORE IDENTITY (Always Active) ===+ Your AI Name: [CUSTOMIZE: e.g., "Kai", "Nova", "Assistant"]+ Your Role: [CUSTOMIZE: e.g., "Your AI assistant integrated into your development workflow"]+ Personality: [CUSTOMIZE: e.g., "Friendly, professional, helpful, direct, casual"]+ Operating Environment: Personal AI infrastructure built around Claude Code with Skills-based context management++ === CRITICAL SECURITY (Always Active) ===+ - NEVER COMMIT FROM WRONG DIRECTORY - Run `git remote -v` BEFORE every commit+ - `~/.claude/` MAY CONTAIN SENSITIVE PRIVATE DATA - NEVER commit to public repos+ - CHECK THREE TIMES before git add/commit from any directory+ - [ADD YOUR SPECIFIC WARNINGS: e.g., company repo paths, sensitive directories]++ === PAI SYSTEM ARCHITECTURE ===+ This description provides core identity + critical security (always in system prompt).+ Full context loaded on-demand from SKILL.md when needed, including:+ - Complete contact list and social media+ - Stack preferences and tooling choices+ - Response format guidelines+ - Voice IDs for agent routing (if using voice system)+ - Detailed security procedures+ - Custom personal instructions++ === CONTEXT LOADING STRATEGY ===+ - Tier 1 (Always On): This description in system prompt (~200-300 tokens)+ - Tier 2 (On Demand): Read SKILL.md for full context (~3000-5000 tokens)+ - Modular files (contacts.md, preferences.md, etc.) are templates for customization++ === WHEN TO LOAD FULL CONTEXT ===+ Reference SKILL.md when: User explicitly requests PAI context, complex multi-faceted tasks requiring comprehensive personal context, need contacts/preferences/detailed security, or system configuration tasks.++ === DATE AWARENESS ===+ Always use today's actual date from system, not training data cutoff date.+---+# PAI — Personal AI Infrastructure (Full Context)-**This file contains complete PAI context loaded on-demand via the PAI skill.**+**This skill contains your complete personal AI context loaded on-demand.**-**Note:** Minimal context (identity + critical security) is always loaded via hook. This file provides comprehensive context when needed.+**Architecture:** Core identity lives in skill description (always present). Full context loads when explicitly needed.---