Installation
npm (recommended)
Install Patchwork globally from npm:
npm install -g patchwork-auditVerify the installation:
patchwork --versionFrom Source
Clone the repository and build:
git clone https://github.com/JonoGitty/patchwork-audit.git
cd patchwork-audit
pnpm install && pnpm build
# Link the CLI globally
cd packages/cli && npm link && cd ../..System Requirements
- Node.js 20 or later
- Operating system: macOS, Linux, or Windows
- AI agent: Claude Code (more agents coming soon)
System-Level Install (Tamper-Evident)
For managed machines where non-admin users should not be able to disable auditing:
sudo bash scripts/system-install.shsudo bash scripts/system-install.sh --all-userssudo bash scripts/system-install.sh --users alice,bob,charliepowershell -ExecutionPolicy Bypass -File scripts/system-install.ps1The system install deploys:
- A root-owned relay daemon that receives audit events via Unix socket
- A watchdog that ensures hooks can't be silently removed
- Immutable policy files that non-admin users cannot modify
See Tamper-Evident Layers for details on what each layer protects.
Editing a system-level policy later
The system install flags /Library/Patchwork/policy.yml immutable (chflags schg on macOS, chattr +i on Linux, attrib +R on Windows). That is deliberate, but it means even root cannot edit the policy until the flag is cleared, and a write attempt fails with Operation not permitted rather than a permissions message. Clear the flag, edit, then set it again — and verify with ls -lO that it is back, because leaving it cleared silently downgrades the install.
Next Steps
Once installed, follow the Quickstart to set up your first audited session.