PAI v4.0.0 — Lean and Mean #818
Replies: 5 comments 1 reply
-
|
You build amazing project, Daniel. Thank you for sharing |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very, very much, Daniel! Can you tell us which of the issues are addressed with this update? I see some I would guess to be fixed, but I am not sure how your process works regarding what goes into a release and how. Some advice would be great! Cheers, |
Beta Was this translation helpful? Give feedback.
-
Upgrade Experience: v3.0 → v4.0 (Customized Install)TL;DR: Upgraded a heavily customized v3.0 (15 patches, custom hooks, Kokoro voice) to v4.0. Took ~4 hours for a careful, customized upgrade. The new architecture is a clear improvement — Algorithm v3.5.0, BuildCLAUDE.ts, and context routing are excellent. But Upgraded a heavily customized PAI v3.0 installation (15 active local patches, custom hooks, Kokoro voice server, custom skills) to v4.0. Here's what worked and what to watch out for. What I did differently from the suggested
|
Beta Was this translation helpful? Give feedback.
-
|
Excellent upgrade, thank you for this Daniel. |
Beta Was this translation helpful? Give feedback.
-
|
Closing this out as part of a cleanup of the discussion board. We're on the 7.x releases now and a lot has changed since this thread was active. Thanks to everyone who jumped in. If this is still relevant on 7.x, please open a fresh discussion or issue and we'll pick it up there. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PAI v4.0.0 — Lean and Mean
63 skills, 180 workflows, 21 hooks — and 81% of the context window is free for your actual work.
Context Efficiency: The Whole Point of v4.0
Every AI agent system has the same fundamental constraint: context window size. Every token your system spends on scaffolding — skill descriptions, routing tables, hook definitions, identity configuration — is a token not available for actual work.
This matters more than people realize:
v3.0 was powerful but heavy. 38 flat skill directories, each loading its own
SKILL.mddescription into context every single turn. Dead systems taking up space. A staticCLAUDE.mdthat had to be comprehensive because it couldn't adapt.v4.0 re-architects PAI as a dynamic loading system. Super lean at startup, expanding only as needed.
The screenshot above is a live PAI v4.0 session at startup — 19% context usage with the full system loaded. That's down from ~38% in v3.0. Half the context footprint, same capabilities.
What This Means In Practice
How We Got There
The context reduction came from three architectural changes:
Skill hierarchy — 38 flat directories compressed into 12 hierarchical categories. Each category loads ONE
SKILL.mdthat routes to sub-skills. Instead of 38 competing descriptions in context, there are 12.Dead system removal — Three entire systems (
Components/,DocRebuild.hook.ts,RebuildSkill.ts) were silently failing for months and still consuming context. Removed entirely. Zero functionality lost.Dynamic CLAUDE.md — Generated from a template at session start instead of being a static file. Only loads what's needed, with variables resolved automatically from
settings.json.Everything Else That Changed
Beyond context efficiency, v4.0 includes:
Algorithm v3.5.0
Jumped from v1.4.0 (shipped with v3.0) to v3.5.0. Now lives at
PAI/Algorithm/v3.5.0.mdwith aLATESTfile pointing to the current version.CLAUDE.md Template System
CLAUDE.md is no longer a static file:
SessionStart hook runs
BuildCLAUDE.tsautomatically — keeps CLAUDE.md fresh without manual intervention.Installer Updates
Every version reference across the entire installer was audited and updated. Electron fix: pre-built
node_modulesremoved from release — Electron installs fresh on the target machine, avoiding the macOS quarantine crash that plagued v3.0.Security & Sanitization
Comprehensive audit with multiple agent sweeps:
By The Numbers
Installation
The installer handles prerequisites, configuration, and setup. Run
source ~/.zshrc && paiafter installation.Upgrading from v3.0
If you're running v3.0:
~/.claude/directorycp -r .claude ~/bun ~/.claude/PAI/Tools/BuildCLAUDE.tssettings.jsonmerged correctly — your identity, voice, and preferences should persistFull release notes →
Beta Was this translation helpful? Give feedback.
All reactions