pi-code

Claude Code experience for the pi coding agent: reads your .claude config (rules, commands, skills, hooks, output styles, MCP servers, agents) and adds todo, checkpoints, memory, web, and subagents

Packages

Package details

extension

Install pi-code from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-code
Package
pi-code
Version
0.4.0
Published
Jul 23, 2026
Downloads
918/mo · 918/wk
Author
ilovepixelart
License
MIT
Types
extension
Size
223.3 KB
Dependencies
2 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-code

npm npm GitHub
Coverage Quality Gate Status
Reliability Rating Maintainability Rating Security Rating

Claude Code experience for the pi coding agent, in one package. Point pi at a project that already has a .claude/ directory and it reads your existing config: rules, commands, skills, hooks, output styles, MCP servers, and agents. It also adds the Claude Code features pi lacks: a todo overlay, checkpoints, memory, web search, and subagents.

pi-code demo

Install

pi install npm:pi-code       # from npm
pi install -l npm:pi-code    # project-local instead, writes .pi/settings.json

Other sources:

pi install git:github.com/ilovepixelart/pi-code
pi install ./pi-code         # local checkout, then /reload after edits

One pi install and everything below loads on the next start. pi list shows what is installed, pi config toggles individual resources, and pi update pi-code upgrades it. Each feature is an extension under extensions/.

What it does

Feature Reads / provides Extension
Global + project rules ~/.claude/rules, .claude/rules (+ paths: frontmatter scoping) claude-rules.ts
Custom slash commands .claude/commands/*.md → pi prompt templates commands.ts
Skills .claude/skills → pi skill discovery (pi reads name, description, disable-model-invocation; allowed-tools is inert in pi's loader) skills.ts
Hooks .claude/settings.json hooks: PreToolUse, PostToolUse, SessionStart, UserPromptSubmit (blocks and injects context), Stop, PreCompact, SessionEnd hooks.ts
Output styles .claude/output-styles + active outputStyle, /output-style switcher output-styles.ts
CLAUDE.md @imports resolves @path imports pi's native loader skips; loads CLAUDE.local.md (approval-gated) context-imports.ts
MCP servers user ~/.claude.json (incl. per-project projects[cwd] local scope), ~/.pi/agent/mcp.json; project .mcp.json, .pi/mcp.json (once approved); stdio/HTTP/SSE by type; ${VAR:-default} expansion; MCP_TIMEOUT/MCP_TOOL_TIMEOUT mcp.ts
Project trust prompts before loading project config (MCP servers, hooks, agents, rules, output styles) that pi would otherwise trust silently internal/project-approval.ts
Subagents / Task ~/.claude/agents and ~/.pi/agent/agents, plus project .claude/agents and .pi/agents; background runs subagent/
Plan mode plan_mode_complete tool, exact tool snapshot/restore plan-mode/
Todo list persistent overlay, status machine, compaction-safe todo.ts
Checkpoints / rewind shadow-repo snapshots; restore overwrites checkpointed files, keeps files created later git-checkpoint.ts
Persistent memory per-project memories, index injected each session memory.ts
WebSearch / WebFetch key-free DuckDuckGo search, SSRF-guarded fetch web.ts
AskUserQuestion one question with header, single- or multiSelect options, plus free-text; no multi-question batching question.ts
Statusline turn state + session cost status-line.ts
Notifications vendored example notify.ts

CLAUDE.md itself needs no extension: pi loads CLAUDE.md / AGENTS.md context files natively (global + walking cwd to root). context-imports.ts only adds the @import resolution pi's loader lacks, appending the imported files without re-injecting the base.

extensions/internal/ holds shared modules pi's loader must not treat as extensions: output-guard.ts (context-budget truncation), web-transport.ts (DNS-pinned fetch), and project-approval.ts (the trust decision above). The extensions use them; only internal/ keeps them out of pi's extension scan.

Vendored bases (question, notify, status-line) come from pi's MIT example extensions (see LICENSE).

Development

npm install
npm run check           # biome + strict tsc + vitest, the whole gate
scripts/e2e.sh          # quick smoke of the real pi TUI via tmux (needs a working model)
scripts/e2e-full.sh     # every README feature end to end, model turns included (5-15 min)
scripts/record-demos.sh # re-records demos/*.tape with vhs at low thinking

Extensions live in extensions/, tests in tests/. Install a local checkout with pi install ./pi-code, then /reload after edits.