Skip to content
Pi Coding Agent Guide

What a Pi package installs

Pin Pi coding agent extensions in an open-source runtime

The open-source CompanyOS

Pi coding agent extensions are TypeScript modules that run inside the Pi process, with the permissions of the account that started it. So the machine they land on matters more than the package you pick. Kortix is open source, and it runs pi with a declared extension list, which I think is the safer place to load one; I work on Kortix's marketing, so weigh that accordingly.

Its own isolated machine per session · Connector credentials never enter the machine · Any model, your keys

pi.dev · extensions
An extension runs inside the Pi process with the same operating-system permissions.It can inspect prompts, tool calls, files, credentials, and session history, so load extensions only from sources you trust.

Open source. Read it, fork it, audit it.

Where Pi puts an extension

Pi packages bundle extensions, skills, prompt templates and themes. They install from npm or git: pi install npm:@foo/pi-tools, or pi install git:github.com/badlogic/pi-doom (pi.dev/packages). Pi looks in ~/.pi/agent/extensions/ for every project and in .pi/extensions/ for one. Project-local entries load once the project is trusted. pi -e ./path.ts runs a single file for a quick test, and /reload picks up auto-discovered ones without a restart (Pi's extension docs).

An extension registers tools the model can call and adds commands. It intercepts tool calls and can block them, injects context, draws custom interface components, and keeps state across restarts. It can also register model providers or MCP servers. Pi enables four built-in tools by default: read, bash, edit and write, next to grep, find, ls and powershell that ship built in and off (Pi's settings reference). A permission gate is an extension deciding whether a tool may fire.

What "same operating-system permissions" means

Pi's documentation states the trade in two sentences: "An extension runs inside the Pi process with the same operating-system permissions. It can inspect prompts, tool calls, files, credentials, and session history, so load extensions only from sources you trust." The same page puts it again as "Extensions run with your full system permissions and can execute arbitrary code."

In practice that covers the project files, the session transcript, and whatever credentials the process inherited. On a machine you run Pi on yourself, Pi reads provider keys from the environment, and a module loaded into the same process can read them. In Kortix a provider key belongs to the whole project, and a secret delivered as an environment variable is a real value inside the session, so what an extension can read in a session is that session's files, its context and whatever that session was given (Kortix models docs, security docs). Pi's README adds that the harness "does not include a built-in permission system for restricting filesystem, process, network, or credential access. By default, it runs with the permissions of the user and process that launched it." (earendil-works/pi)

The permission layer is a package

Pi's docs name permission gates (confirm before rm -rf, sudo), path protection (block writes to .env, node_modules/) and git checkpointing as example uses. Community walkthroughs install extensions called pi-permission-system, pi-undo-redo and pi-web-access. In those setups the permission layer arrives as a community package, loaded into the same process it is meant to police.

A gate you install still does useful work. It is code you can read and test before it loads. That is the check Pi's docs ask for when they say to load extensions only from sources you trust.

What the runtime around the list changes

In Kortix every new session runs pi. An extension is registered under extensions: in kortix.yaml and enabled per agent with agents.<name>.extensions. Each pi entry is an exact npm pin, such as npm:pi-web-access@0.30.0, or a repository path such as extensions/audit.ts with no leading ./; a version range is an error, and an extension with no pi entry loads in no new session. (Read the docs) A pin fixes the version and says nothing about the code inside it.

A session loads its extensions when its runtime starts, so a change reaches a running session at its next start. At merge, the change request builds npm packages, and a session never installs them. Tool calls then pass the agent's permission rules. Each tool is allow, ask or deny, bash globs can be named one by one, and the most specific matching rule wins. Those rules govern the calls the model makes. A package that runs its own code is limited by the machine instead. Each session has its own isolated machine and branch, so an extension reaches that session's files rather than your laptop's. Connector credentials are brokered server-side and never enter the machine. A secret delivered as an environment variable is a real value inside the session, so the values a module can read are the ones the session was given.

One file decides the exposure: kortix.yaml carries the extensions block and each agent's permission block. It lives in the repository, which makes it the part of a Pi setup a reviewer can read before the first session starts. Where the session itself runs is the other half, covered in running Pi in the cloud. How the harness itself compares is a separate question, and Pi vs Claude Code works through it from the model down to the merge.

What a gate looks like, and where Kortix declares one

A tool-call gate from Pi's docs, and the block a manifest registers it in.

~/.pi/agent/extensions/my-extension.ts
import { type ExtensionAPI, isToolCallEventType } from "@earendil-works/pi-coding-agent"; export default function (pi: ExtensionAPI) {  pi.on("tool_call", async (event, ctx) => {    if (isToolCallEventType("bash", event) && event.input.command.includes("rm -rf")) {      const ok = await ctx.ui.confirm("Dangerous!", "Allow rm -rf?");      if (!ok) return { block: true, reason: "Blocked by user" };    }  });}

Read Pi's extension docs ↗

kortix.yaml
extensions:  web-access:    pi: npm:pi-web-access@0.30.0

Read the docs ↗

What readers ask about Pi extensions

The answer depends on the workflow, and no measured ranking exists. pi.dev/packages lists an extension that brings Claude Code-like sub-agents and workflow orchestration to pi, and community walkthroughs use pi-permission-system for permission gates, pi-undo-redo for reverting edits and pi-web-access for web access.

No VS Code extension is documented. Pi runs in the terminal and speaks print/JSON, RPC and SDK, and an editor integration would be built on one of those modes.

Only from a source you would run as your own shell account. An extension runs with the same operating-system permissions as the Pi process and can read prompts, files, credentials and session history, so Pi's docs say to load only from sources you trust. Read the code and pin the version.

Write the extension list down before the first session

Every new session in Kortix runs pi, and the extensions it loads come from one file in the repository.