Claude Code
$ pdep init --claude- MCP server
.mcp.json- Guard hook
.claude/settings.local.json- Then
- Restart Claude Code and allow the pdep server once.
Docs
Install the CLI, set up your repository and your agent, and approve the work where it matters. Below are the steps, then every command and tool.
Four steps, a few minutes. The repository needs Git and at least one commit.
The installer checks the release's SHA-256 checksum and puts pdep in ~/.pdep/bin. Run it again to update.
Windows (PowerShell)
> irm https://pdep.dev/install.ps1 | iexmacOS and Linux
$ curl -fsSL https://pdep.dev/install.sh | shApprove this machine on pdep.dev. Community is free; pdep never sees a password or a passkey.
$ pdep loginCreates .pdep/ and sets up your agent: its MCP server and the guard hook. In a folder of repositories, it sets up each one.
$ pdep initOpen the repository in your agent and ask for a change as usual. The agent starts a pdep task and asks for your approval when it needs it.
pdep init writes the PDEP MCP server and the guard hook into each agent’s own project files. Your other settings stay as they are; run it again any time.
$ pdep init --claude --codexAny number of agents at once. Without a flag: Claude Code. Already set up? pdep hook install adds an agent later.
$ pdep init --claude.mcp.json.claude/settings.local.json$ pdep init --codex.codex/config.toml.codex/hooks.json$ pdep init --cursor.cursor/mcp.json.cursor/hooks.json$ pdep init --copilot.vscode/mcp.json.github/hooks/pdep.json$ pdep init --gemini.gemini/settings.json.gemini/settings.json$ pdep init --windsurf.devin/hooks.jsonExperimental: the agent’s hook input is not fully documented yet. An edit pdep cannot read is allowed and logged, never silently blocked; CI still checks every pull request.
The agent does the work through pdep's MCP tools; you decide at the points that matter.
It starts a task, describes the problem and writes the analysis: what it found in the code and what it will change.
pdep opens an approval window. Type the 6-digit code from your authenticator app or your e-mail, or send it back with a reason.
The plan names the files and the steps. Only after you approve it can the agent edit code, and only inside the plan's scope: the guard hook blocks the rest.
At each checkpoint you continue or send the step back.
The agent verifies the change and reviews it against your conventions; you approve the review and accept the delivery. In CI, pdep ci verify checks the records on the pull request.
pdep --help and pdep <command> --help list every option. In a folder of repositories, -C <repository> runs a command for one of them.
Your agent usually starts tasks itself; these are for you.
| Command | What it does |
|---|---|
pdep init | Set up pdep in this repository, or in each repository of a folder, with Claude Code. Signs in to pdep.dev the first time. |
pdep init --codex --cursor | Other agents, any number of them: --claude, --codex, --cursor, --copilot, --gemini, --windsurf. --no-hook skips the agents. |
pdep start --title <title> --type <type> [--risk <level>] | Start a task yourself. Types: bug, feature, refactor, dependency, docs, chore, security. Risk: low, medium (the default), high, critical. |
pdep status [TASK-0001] | List the tasks, or show one: its stage, plan, scope and steps. |
The approval window does these for you. In a terminal without a desktop (SSH, containers) use the commands.
| Command | What it does |
|---|---|
pdep approve TASK-0001 | Approve what the task waits for (the analysis, the plan or the conformance review) with your code; a step checkpoint at once. |
pdep reject TASK-0001 -r "<reason>" | Send the analysis or the plan back, with the reason the agent reads. |
pdep reject TASK-0001 --step S1 -r "<reason>" | Send a completed step back. |
pdep accept TASK-0001 | Accept the delivery with your code and close the task. |
pdep cancel TASK-0001 -r "<reason>" | Abandon an open task, confirmed with your code. Its records stay for audit. |
What the agent reads before it designs a change.
| Command | What it does |
|---|---|
pdep profile | The project map pdep computes from the code: projects and layers, packages, type and naming families. |
pdep conventions | How the repository already does things (.pdep/conventions.yaml). Every change is checked against them. |
pdep code-rules | The code rules the agent follows here: your organisation's, from the console, and .pdep/code-rules.md. |
pdep init does this once; the hooks are run by the agent, not by you.
| Command | What it does |
|---|---|
pdep hook install [--codex …] | Set up the agents again: the MCP server and the guard hook, with the same flags as pdep init. |
pdep mcp | The MCP server, over stdio. The agent starts it from its MCP settings. |
pdep hook check --agent <agent> | The before-edit hook: blocks edits pdep has not authorized. |
pdep hook prompt --agent <agent> | The before-prompt hook: stops prompts that break your prompt rules. |
Anywhere, no repository needed.
| Command | What it does |
|---|---|
pdep login | Sign in: pdep shows a code, and you approve this machine on pdep.dev. |
pdep whoami | The account this machine is signed in to. |
pdep logout | Revoke this machine's sign-in on pdep.dev and forget it here. |
PostgreSQL and SQL Server, read only. The connection string is never an argument.
| Command | What it does |
|---|---|
pdep db add <name> --provider postgres --agent | Add a connection (postgres or sqlserver). pdep asks for the connection string and keeps it in the OS credential store. --agent lets agents query it. |
pdep db list | Your connections: name, provider, whether agents may query it. Never the connection string. |
pdep db test <name> | Connect and run SELECT 1. |
pdep db remove <name> | Remove a connection and its connection string. |
pdep rules sync --rule "<rule>" --db <name> --query "SELECT …" | Fill a prompt rule with values from a query. Only hashes of the values leave the machine. --days 30 lets them count for 30 days. |
pdep rules sync --rule "<rule>" --file values.txt | The same from a file, one value per line. |
pdep rules sync | Run every saved source again, for example from a scheduled task. |
pdep rules sources | The saved sources and their queries. --remove "<rule>" forgets a rule's sources. |
The enforcement point: a required check on the protected branch.
| Command | What it does |
|---|---|
pdep ci verify --base origin/main | Check that every code change in the pull request is covered by an approved, accepted plan. |
pdep trust | Write pdep.dev's signing keys into .pdep/trust/cloud-keys.json, to review and commit. |
| Command | What it does |
|---|---|
--json | One JSON object, {"pdepCli":1,"ok":…}, for scripts and integrations. |
-C <repository> | Run the command for one repository of a folder, for example pdep -C api approve TASK-0001. |
--help | The command's options. |
The agent goes through the stages with these tools; each stage has a gate it must pass. You don't call them yourself.
pdep_start_taskpdep_get_taskpdep_list_repositoriespdep_submit_problempdep_submit_analysispdep_submit_diagnosispdep_submit_solution_designpdep_submit_impact_analysispdep_submit_project_baselinepdep_create_planpdep_request_approvalpdep_wait_for_approvalpdep_submit_approval_codepdep_get_implementation_authorizationpdep_start_steppdep_complete_steppdep_approve_steppdep_reopen_steppdep_submit_verificationpdep_submit_security_reviewpdep_get_structural_changespdep_submit_conformance_reviewpdep_submit_deliverypdep_get_project_profilepdep_get_conventionspdep_code_rulespdep_db_queryCommit .pdep/ with your code, except the local state. The agent can't edit policies, conventions, code rules or pdep's state.
.pdep/tasks/<TASK-ID>/ | The task's documents, plan and approval records. Commit them in the same pull request as the code they cover. |
.pdep/policies/default.yaml | How strict each stage is: which approvals, step checkpoints, the minimum assurance. |
.pdep/conventions.yaml | How the repository already does things, with evidence. Reviews and CI check changes against it. |
.pdep/code-rules.md | Your team's code rules: each ## heading starts a rule the agent follows. |
.pdep/trust/cloud-keys.json | The signing keys CI trusts, written by pdep trust. |
.pdep/state.db | Local state, ignored by Git. Don't commit it. |
~/.pdep/bin | The pdep program. The installer updates it. |
~/.pdep/databases.json | Your database connections, without their connection strings. |
~/.pdep/prompts/ | Your prompts for the approval window, masked, kept for 30 days. |
Make pdep ci verify a required check on the protected branch. It reads committed files only and runs nothing from the pull request. Pin the version so a new release doesn't change the check.
Azure Pipelines
steps:
- checkout: self
fetchDepth: 0
- script: |
curl -fsSL https://pdep.dev/install.sh | PDEP_VERSION=0.17.0 sh
echo "##vso[task.prependpath]$HOME/.pdep/bin"
displayName: Install pdep
- script: pdep ci verify --base origin/$(System.PullRequest.TargetBranchName) --allow-unsigned
displayName: PDEP ci verify
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))GitHub Actions
on:
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
curl -fsSL https://pdep.dev/install.sh | PDEP_VERSION=0.17.0 sh
echo "$HOME/.pdep/bin" >> "$GITHUB_PATH"
- run: pdep ci verify --base origin/${{ github.base_ref }} --allow-unsigned--allow-unsigned is for repositories on L0 approvals. Once approvals are signed by pdep.dev, set minApprovalAssurance in the policy and remove the flag.
PDEP_VERSION | Install this version instead of the latest, for example in CI. |
PDEP_APPROVAL_WINDOW=off | No approval window (SSH, containers): type the code in the agent's chat instead. |
PDEP_API_URL | Another pdep server, for example your own. https only. |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 | Linux without ICU: pdep runs without SQL Server support. |