15 minutes from clone to working PACT setup in your project.
PACT is a governance methodology for AI-assisted software work. It's a set of shell hooks + structured YAML knowledge files that compound your project's self-understanding across sessions, so the agent gets smarter about your codebase the longer you use it.
It is not a workflow you follow rigidly. It is invisible infrastructure that keeps the agent honest while you work.
- A git repository for your project (PACT can
git initone if you don't have one yet) - Claude Code (or Gemini CLI — PACT supports both) installed
- Bash shell (Git Bash on Windows, default shell on Linux/macOS)
- Python 3.10+ in your PATH (one PACT script uses it for templating)
Pick one. Both work; they install PACT to different places.
Option A — Clone PACT to a sibling directory:
cd ~/code # or wherever you keep projects
git clone https://github.com/jonathanmr22/pact.gitOption B — Install PACT as a Claude Code plugin:
# Inside Claude Code:
/install-plugin jonathanmr22/pactEither way, you now have PACT files on your machine. Note the path — you'll point pact_init.sh at them in step 2.
cd ~/code/your-project # the project you want to put PACT into
bash ~/code/pact/templates/scripts/pact_init.shThe script asks ~5 questions (project name, primary languages, backend type, mobile/no, worktree isolation), then:
- Generates a customized
CLAUDE.mdfrom PACT's template — your project name and stack baked in - Scaffolds the directory structure (
knowledge/,bugs/,feature_flows/,skills/,plans/,.claude/) - Copies starter index files (
HANDOFF.yaml,KNOWLEDGE_DIRECTORY.yaml,_SKILL_INDEX.yaml, etc.) - Copies the default hooks into
.claude/hooks/ - Writes a working
.claude/settings.jsonwith sensible default hook wiring
The script is idempotent — re-running skips files that already exist, so if you change your mind about an answer you can safely re-run.
cd ~/code/your-project
claudeOn the first session, the PACT orientation hook fires automatically. The agent sees a SessionStart context block teaching it:
- What PACT is in two sentences
- Where the key files live in your project
- The core cognitive redirections that always apply
- The session-start protocol
The orientation hook fires for the first 5 sessions, then goes silent (or earlier if your project accumulates real PACT artifacts before then). After that, PACT is invisible infrastructure running in the background.
Verify it worked:
- The agent should state "I have read and will follow all rules" on its first response
- It should reference reading
HANDOFF.yamlat session start - It should be using the cognitive redirections from
CLAUDE.md(verify-before-agreeing, fresh-read-before-edit, etc.)
After pact_init.sh, your project root has these new files and directories:
| Path | What goes here |
|---|---|
CLAUDE.md |
Always-loaded project rules + cognitive redirections. Customize the Project Philosophy section. |
HANDOFF.yaml |
Entry pointer — top priorities + last-session summary. Updated as you work. |
knowledge/packages/*.yaml |
One YAML per library you use, with verified API + gotchas. Read before writing package code. |
knowledge/research/*.md |
Synthesis of non-trivial investigations. Save findings here so future sessions don't re-research. |
knowledge/KNOWLEDGE_DIRECTORY.yaml |
Tag-based index across all knowledge systems. Scan before researching. |
bugs/{system}/{system}-NNN.yaml |
Bug investigations + resolutions. Create the file BEFORE starting fixes. |
bugs/_SOLUTIONS.yaml |
Reusable solutions across bugs. Check tags here when something breaks. |
feature_flows/*.yaml |
Lifecycle docs for critical systems — participating_files, invariants, declared_dependencies. |
skills/*.yaml |
Proven multi-step workflows with prerequisites, procedures, quality gates, gotchas. |
plans/dashboard/trees/{tree}/streams/*.yaml |
Active task ledger. Single source of truth for current and historical work. |
scripts/SCRIPT_CATALOG.yaml |
Every script in your project, with deps, tags, lessons, reusable patterns. |
.claude/hooks/*.sh |
Mechanical enforcement. PreToolUse / PostToolUse / SessionStart. |
.claude/settings.json |
Wires hooks into Claude Code. |
PACT is at its best when you treat it as a forcing function, not a checklist. Here's the most common high-value first session:
-
Customize
CLAUDE.md— fill in the Project Philosophy section (core beliefs, decision filters, what this project is NOT). These are the values that govern every product decision. Five minutes of thought here saves hours of misaligned output later. -
Add your first feature flow — pick the most important critical system in your project (auth, payments, sync, encryption — whatever's load-bearing). Run the
feature_flow_authoringskill. Result: afeature_flows/{system}_flow.yamlwithparticipating_files,invariants,declared_dependencies. The next time anyone touches that system, the agent knows what depends on it. -
Document one package you actually use — pick the one that bites the most when its API surprises you. Add
knowledge/packages/{name}.yamlwith verified API + gotchas. Now every code-write that touches that package is correct first try.
That's it. Three things. The rest accumulates organically — every bug you fix becomes bugs/{system}/{system}-NNN.yaml. Every workflow you iterate on becomes a skill. Every research session leaves knowledge/research/{topic}.md behind. The system gets smarter with use.
"I ran pact_init.sh but the agent isn't doing anything PACT-y." — Most likely the orientation hook didn't fire, or the agent ignored CLAUDE.md. Verify: (a) .claude/settings.json was created, (b) CLAUDE.md exists at project root, (c) the agent's first response mentions reading CLAUDE.md. If the hook didn't fire, your .claude/settings.json may not be active — Claude Code's settings watcher needs to see the file at session start. Restart Claude Code or run /hooks to reload.
"The CLAUDE.md is too long; I want to trim it." — Don't trim aggressively. Each cognitive redirection prevents a specific failure mode that downstream projects have hit. If you trim the "verify before agreeing" redirect because it seems redundant, the next session will agree with a wrong correction. Trim only sections clearly inapplicable to your project (e.g. the Flutter-specific subsections if you don't have a mobile app).
"I have an existing .claude/ setup that already does what PACT does." — pact_init.sh is idempotent and skips existing files. PACT plays well with other tools (memory plugins, task managers, workflow orchestrators). See COMPARISON.md for how it composes.
"I'm getting hook errors on every command." — Open .claude/settings.json, find the failing hook in the spinner output, and either fix the script (if it's missing a dependency) or remove that one hook entry. PACT hooks are designed to fail gracefully (exit 0 on error) but the underlying scripts may need Python or specific Bash features.
README.md— broader feature overview, comparisons to other toolsCOMPARISON.md— how PACT composes with Superpowers, Taskmaster, memory plugins, etc.docs/dashboard.md— the multi-tree status dashboard + Repo Map viewdocs/handoff_architecture.md— the HANDOFF.yaml + dashboard streams architecture (replaces the legacy PENDING_WORK.yaml pattern)templates/CLAUDE.md.template— the source of your project's CLAUDE.md, before customization
If you hit a wall, open an issue at https://github.com/jonathanmr22/pact/issues with the version (cat VERSION in your PACT install) and what you tried.
PACT uses Semantic Versioning. Same-day changes share major.minor and increment the patch (so today's three releases would be v0.12.0, v0.12.1, v0.12.2 — not three minor bumps). The CHANGELOG explains what's in each release; the version in VERSION matches the latest published release.