Chapter 1 of 8
What LifeOS is, and the whole setup in one pass
Start with why. LifeOS is a Life Operating System: it holds who you are, what you care about, and where you are trying to go, and it points AI that actually knows you at getting you there. Let me define it by contrast, because that is the fastest way to see it. LifeOS is not a dashboard. It is not a chatbot. It is not a pile of prompts you paste. It is the operating system your life runs on, and the pieces sit in clear places. Claude Code is the engine. LifeOS is everything else that makes it your car. Three names you will use constantly: LifeOS is the OS itself (formerly PAI, Personal AI Infrastructure, same system, renamed); the DA is your Digital Assistant, the named voice and personality you actually talk to; and Pulse is your dashboard, a local daemon at localhost:31337 where your state and work show up.
Now the core loop, and it is the whole thing: understand your current state, understand your ideal state, and hill-climb from one to the other. Everything else is mechanics. That single sentence is the engine under every chapter that follows.
Installing is AI-first, so you hand the work to the machine. You need three things present: bun, git, and a coding harness that can both read and write files and run shell (Claude Code is the recommended one). Then you tell Claude Code: "Read https://ourlifeos.ai/install and install LifeOS for me." Or run
And upgrading is the same idea turned on the system itself: use your AI to upgrade it. Back up first (
Now the core loop, and it is the whole thing: understand your current state, understand your ideal state, and hill-climb from one to the other. Everything else is mechanics. That single sentence is the engine under every chapter that follows.
Installing is AI-first, so you hand the work to the machine. You need three things present: bun, git, and a coding harness that can both read and write files and run shell (Claude Code is the recommended one). Then you tell Claude Code: "Read https://ourlifeos.ai/install and install LifeOS for me." Or run
curl -fsSL https://ourlifeos.ai/install.sh | bash. Either way a nine-step agentic workflow runs: it detects your environment, scans for conflicts read-only, deploys the core, scaffolds and links your personal USER directory, then asks permission before it wires any hook, edits settings.json, or adds the lifeos alias, offers a component picker, runs the Doctor capability check (bun LIFEOS/TOOLS/Doctor.ts), and finishes with Setup and the Interview. Three laws hold throughout: additive never clobbering, permission precedes every mutation, and it backs up before it edits. Your first config lands in USER/Config/PAI_CONFIG.yaml: your name and timezone, your DA's name and voice, the environment variable names (not the raw keys) for your services, and the Pulse port.And upgrading is the same idea turned on the system itself: use your AI to upgrade it. Back up first (
cp -r ~/.claude ~/.claude-backup-$(date +%Y%m%d)), then rerun the installer. It detects the existing install and merges intelligently and additively, your USER directory is never touched, and settings merge rather than overwrite. A major version jump is a new system, not a patch, so you read the migration guide and tell your DA: help me migrate my context across. That is the entire arc, install to upgrade, in one pass. The rest of the course makes it yours.The lab: read it, then run it
#!/usr/bin/env python3
"""
LAB LM1: Install preflight. The agentic installer that asks before it touches.
LifeOS installs itself by handing the work to your AI. You tell Claude Code
"read the install page and install LifeOS for me", and a nine-step agentic
workflow runs: detect the environment, scan for conflicts read-only, deploy the
core, scaffold your personal USER dir, then ASK PERMISSION before it wires any
hook, edits settings.json, or adds the shell alias. Three laws hold the whole
thing together: additive never clobbering, permission precedes every mutation,
and a backup is taken before any edit. In this lab you run that flow on a
fictional sample environment and prove all three laws held. No real machine is
touched; every value here is invented for the lesson.
Run: python3 modules/academy-content/labs/lifeos-mastery/lm1-install-preflight.py
"""
import sys
# STEP 1: detect the environment. The installer needs a coding harness that can
# BOTH read/write files AND run shell. Bun and Git are the hard prerequisites.
sample_env = {"bun": "1.1.0", "git": "2.44", "harness": "claude-code", "harness_can_shell": True, "harness_can_files": True}
required = ["bun", "git", "harness"]
missing = [t for t in required if t not in sample_env]
harness_capable = sample_env.get("harness_can_shell") and sample_env.get("harness_can_files")
print("STEP 1: detect env, verify prerequisites")
for t in required:
print(f" {t:8} -> {sample_env.get(t, 'MISSING')}")
print(f" harness reads+writes files AND runs shell: {harness_capable}")
preflight_ok = (missing == []) and harness_capable
# STEP 2: run the nine-step workflow as an audit log. Every step that MUTATES the
# machine must be immediately preceded by a permission grant, and any write to an
# existing file must be preceded by a backup of that file. Read-only steps are free.
disk = {"settings.json": "user-original"} # a pre-existing file we must not clobber
log = [] # ordered audit trail, the invariant surface
granted = set()
def step(name, kind, target=None):
# kind: "read" (free), "mutate" (needs a prior grant), "write" (grant + backup)
if kind in ("mutate", "write"):
log.append(("PERMISSION", name)); granted.add(name) # ASK precedes the act
if kind == "write" and target in disk:
log.append(("BACKUP", target)) # backup precedes the edit
log.append(("DO", name, kind))
step("detect-env", "read")
step("conflict-scan", "read")
step("deploy-core", "mutate")
step("scaffold-user-dir", "mutate")
step("wire-hooks", "write", "settings.json")
step("edit-settings", "write", "settings.json")
step("add-lifeos-alias", "mutate")
step("doctor-capability-check", "read")
step("setup-and-interview", "mutate")
print("")
print("STEP 2: nine-step agentic workflow audit log")
for e in log:
print(" " + " ".join(str(x) for x in e))
# STEP 3: prove the three laws. (a) Every mutating/writing step was granted first.
# (b) Every write to an existing file was backed up first. (c) Additive: the
# original file's bytes are still recoverable (we never overwrote without backup).
mutations = [e[1] for e in log if e[0] == "DO" and e[2] in ("mutate", "write")]
permission_precedes = all(m in granted for m in mutations)
# check ordering: for settings.json, BACKUP appears before the DO write
seq = [e for e in log if (len(e) > 1 and e[1] in ("settings.json", "wire-hooks", "edit-settings")) or e[0] == "BACKUP"]
backup_before_write = log.index(("BACKUP", "settings.json")) < log.index(("DO", "edit-settings", "write"))
additive = "settings.json" in disk # the key still exists; nothing was deleted
print("")
print(f"STEP 3: permission precedes every mutation : {permission_precedes}")
print(f" backup precedes the settings write : {backup_before_write}")
print(f" additive, original file preserved : {additive}")
ok = preflight_ok and permission_precedes and backup_before_write and additive
print("")
print(f"AGENTIC INSTALL SAFE (preflight ok, permission precedes mutation, backup before write, additive): {'YES' if ok else 'NO'}")
if not ok:
sys.exit(1)
print("The installer asked before it touched anything. Next: name your DA.")
Runnable lab
lm1-install-preflight.pyRun the agentic install flow on a sample environment and prove the three safety laws held.
Proves: AGENTIC INSTALL SAFE (preflight ok, permission precedes mutation, backup before write, additive): YES
Runs in your browser via Pyodide. First run loads the runtime once; no install, no server.
That flow is the mindset of the whole system: the machine does the work, but it asks before it touches anything, and it never destroys what you already have. You now have LifeOS on disk with a first config. But right now your assistant answers to a placeholder. The next step is the most human one in the entire setup, and it is where it starts becoming yours: you give it a name.
Check your understanding
1. What is the core loop of LifeOS?
2. How do you install LifeOS?
3. What happens to your USER directory when you upgrade?