Skip to content

⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.

fix: Update system principles slide with all 15 principles

Daniel Miessler1c23a00e5aa6
diff --git a/Bundles/Kai/install.ts b/Bundles/Kai/install.ts
index f645978a..99c83451 100644
--- a/Bundles/Kai/install.ts
+++ b/Bundles/Kai/install.ts
@@ -185,7 +185,24 @@ async function gatherConfig(): Promise<WizardConfig> {
printHeader("KAI BUNDLE SETUP");
console.log("This wizard will configure your AI assistant.\n");
- console.log("Installation directory: ~/.claude (standard Claude Code location)\n");
+
+ // Check for existing PAI_DIR environment variable
+ const existingPaiDir = process.env.PAI_DIR;
+ if (existingPaiDir) {
+ console.log(`📍 Existing PAI_DIR detected: ${existingPaiDir}\n`);
+ const useExisting = await askYesNo(
+ `Use existing PAI_DIR (${existingPaiDir}) for installation?`,
+ true
+ );
+ if (useExisting) {
+ console.log(`\nUsing existing PAI_DIR: ${existingPaiDir}\n`);
+ } else {
+ console.log("\n⚠️ Installation will use ~/.claude (standard Claude Code location)");
+ console.log(" You may need to update your PAI_DIR environment variable after installation.\n");
+ }
+ } else {
+ console.log("Installation directory: ~/.claude (standard Claude Code location)\n");
+ }
// Essential questions only
const userName = await ask("What is your name? ");
diff --git a/Packs/kai-core-install.md b/Packs/kai-core-install.md
index abd50958..e804e636 100644
--- a/Packs/kai-core-install.md
+++ b/Packs/kai-core-install.md
@@ -617,8 +617,8 @@ import { readFile } from 'fs/promises';
import { join } from 'path';
import { existsSync } from 'fs';
-const PAI_HOME = process.env.PAI_HOME || join(process.env.HOME || '', '.claude');
-const INDEX_FILE = join(PAI_HOME, 'Skills', 'skill-index.json');
+const PAI_DIR = process.env.PAI_DIR || process.env.PAI_HOME || join(process.env.HOME || '', '.claude');
+const INDEX_FILE = join(PAI_DIR, 'Skills', 'skill-index.json');
interface SkillEntry {
name: string;
@@ -710,8 +710,8 @@ import { readdir, readFile, writeFile } from 'fs/promises';
import { join } from 'path';
import { existsSync } from 'fs';
-const PAI_HOME = process.env.PAI_HOME || join(process.env.HOME || '', '.claude');
-const SKILLS_DIR = join(PAI_HOME, 'Skills');
+const PAI_DIR = process.env.PAI_DIR || process.env.PAI_HOME || join(process.env.HOME || '', '.claude');
+const SKILLS_DIR = join(PAI_DIR, 'Skills');
const OUTPUT_FILE = join(SKILLS_DIR, 'skill-index.json');
const ALWAYS_LOADED_SKILLS = ['CORE', 'Development', 'Research'];
diff --git a/Packs/kai-hook-system.md b/Packs/kai-hook-system.md
index 9b90e9e8..51846b9f 100644
--- a/Packs/kai-hook-system.md
+++ b/Packs/kai-hook-system.md
@@ -835,9 +835,9 @@ async function main() {
// 2. Ensure required directories exist
const requiredDirs = [
join(paiDir, 'hooks', 'lib'),
- join(paiDir, 'history', 'sessions'),
- join(paiDir, 'history', 'learnings'),
- join(paiDir, 'history', 'research'),
+ join(paiDir, 'History', 'Sessions'),
+ join(paiDir, 'History', 'Learnings'),
+ join(paiDir, 'History', 'Research'),
];
for (const dir of requiredDirs) {
diff --git a/README.md b/README.md
index 22634c55..4fa71ef7 100644
--- a/README.md
+++ b/README.md
@@ -341,6 +341,58 @@ Packs are self-contained markdown files. You can:
---
+## 📂 Understanding PAI_DIR
+
+The `PAI_DIR` environment variable is the **single source of truth** for where your PAI installation lives.
+
+### What is PAI_DIR?
+
+`PAI_DIR` points to the directory where your personal AI infrastructure is installed - this is where skills, hooks, history, and configuration files live.
+
+### Two Different Things
+
+| Concept | Path | Purpose |
+|---------|------|---------|
+| **PAI Repository** | Where you cloned `git clone https://github.com/danielmiessler/PAI.git` | Source code, packs, templates - read-only reference |
+| **PAI Installation** (`PAI_DIR`) | `~/.claude` (default) or your custom location | Your active installation - skills, hooks, history, config |
+
+The repository is like a cookbook. Your installation is your actual kitchen.
+
+### Default Behavior
+
+If `PAI_DIR` is not set, PAI tools and packs default to `~/.claude`:
+- This is the standard Claude Code configuration directory
+- Works seamlessly with Claude Code out of the box
+- Recommended for most users
+
+### When to Use a Custom PAI_DIR
+
+Set a custom `PAI_DIR` if you:
+- Use a different AI coding assistant (Cursor, Windsurf, OpenCode)
+- Want to keep PAI separate from Claude Code's config
+- Are testing or developing packs
+- Have multiple PAI installations
+
+### Setting PAI_DIR
+
+**In your shell profile** (`~/.zshrc` or `~/.bashrc`):
+```bash
+export PAI_DIR="$HOME/.claude" # Default - Claude Code location
+# OR
+export PAI_DIR="$HOME/.config/pai" # Custom location
+```
+
+### How Tools Resolve PAI_DIR
+
+PAI tools use this resolution order:
+1. `process.env.PAI_DIR` - Explicit setting (highest priority)
+2. `process.env.PAI_HOME` - Legacy/alternate variable
+3. `~/.claude` - Default fallback
+
+This means: if you set `PAI_DIR`, it takes precedence. If not, it defaults to Claude Code's standard location.
+
+---
+
## 🔐 Authentication Setup
**All API keys live in ONE place: `$PAI_DIR/.env`**
diff --git a/pai-system-principles.png b/pai-system-principles.png
index e04d155d..7d9f3110 100644
Binary files a/pai-system-principles.png and b/pai-system-principles.png differ