by code-yeongyu
pi had nothing (nothing), so I made something (something) — sorry mariozechner-senpai, I went ahead and lovingly soiled your pure pi for you. opinionated fork of badlogic/pi-mono with extension-first additions. ganbare ganbare senpi 頑張れ頑張れ先輩
# Add to your Claude Code skills
git clone https://github.com/code-yeongyu/senpi⚠️ Experimental. senpi is an opinionated, in-flight fork of badlogic/pi-mono. It powers Dori under the hood and reflects what one specific AI assistant needs from a coding-agent runtime. Use it; don't bet a production pipeline on it.
senpi is a senpai-name pun and a more sane pi with extra batteries included — a TypeScript monorepo that rebrands pi-mono's coding agent as senpi and ships a curated set of builtin extensions and core tweaks on top of upstream.
Upstream: pi-mono by @mariozechner — tools for building AI agents and managing LLM deployments.
senpi was born from two influences:
No comments yet. Be the first to share your thoughts!
Core source modifications are minimised and tracked in changes.md files alongside every modified subdirectory so upstream rebases stay clean.
senpi ships a fixed set of builtin extensions and stops there. The sibling ../pi-extensions checkout contains the full extension ecosystem: some packages are vendored into senpi as builtins, while the rest can be installed on top when you want extra capabilities like LSP, AST-grep, sandboxing, goal tracking, web search/fetch, or rule loading.
These ../pi-extensions/* packages are intended to be installed as standalone senpi/pi extensions:
| Extension | What it adds |
|---|---|
| ../pi-extensions/pi-agent-system | Agent profiles via SANEPI_AGENT_TYPE / PI_AGENT_TYPE, with profile markdown, tool filtering, and prompt fragments. |
| ../pi-extensions/pi-ast-grep | AST-aware code search/replace across 25 languages. Auto-downloads sg on first use. |
| ../pi-extensions/pi-goal | Persistent goal tracking with Codex-style goal tools, TUI footer, and continuation prompts. |
| ../pi-extensions/pi-lsp-client | LSP integration: lsp_rename, lsp_goto_definition, lsp_find_references, lsp_diagnostics, plus a /lsp inspector. |
| ../pi-extensions/pi-nested-agents-md | Auto-injects nearby AGENTS.md files when the agent reads from a nested directory. |
| ../pi-extensions/pi-rules | Auto-discovers rule files from .sisyphus/rules/, .claude/rules/, .cursor/rules/, .github/instructions/, AGENTS.md, and CLAUDE.md. |
| ../pi-extensions/pi-sandbox | OS-level sandbox policy with native, Docker, justbash, and QEMU backends plus SSH transport facets. |
| ../pi-extensions/pi-webfetch | web_fetch tool: URL content as markdown, plain text, or HTML with bounded time and size. |
| ../pi-extensions/pi-websearch | Provider-backed web search with config-gated activation, TUI status, and source-aware results. |
Install any of them with:
senpi install ../pi-extensions/pi-ast-grep
senpi install ../pi-extensions/pi-lsp-client
# ...or use the matching git:github.com/code-yeongyu/<package> URL.
See Senpi Packages for the install / update / remove flow.
../pi-extensions packages already shipped as senpi builtinsYou do not need to install these sibling packages for normal senpi use; their functionality is already included in the binary:
| Sibling package | Builtin capability |
|---|---|
| ../pi-extensions/pi-anthropic-bash | Anthropic-native bash tool policy and prompt guidance. |
| ../pi-extensions/pi-anthropic-code-execution | Anthropic-native code execution sandbox. |
| ../pi-extensions/pi-anthropic-computer-use | Anthropic computer-use bindings. |
| ../pi-extensions/pi-anthropic-text-editor | Anthropic-native text editor tool. |
| ../pi-extensions/pi-anthropic-tool-search | Anthropic-native tool search. |
| ../pi-extensions/pi-anthropic-web-fetch | Anthropic-native web fetch support. |
| ../pi-extensions/pi-anthropic-web-search | Anthropic-native web search support. |
| ../pi-extensions/pi-apply-patch | Codex-style apply_patch tool. |
| ../pi-extensions/pi-bash-timeout | Bash timeout handling and related tool handlers. |
| ../pi-extensions/pi-google-code-execution | Google native code execution. |
| ../pi-extensions/pi-google-google-search | Google Search grounding. |
| ../pi-extensions/pi-google-url-context | Google URL grounding. |
| ../pi-extensions/pi-openai-api-parallel-tool-calls | OpenAI parallel_tool_calls payload support. |
| ../pi-extensions/pi-openai-code-interpreter | OpenAI Code Interpreter. |
| ../pi-extensions/pi-openai-web-search | OpenAI-native web search. |
| ../pi-extensions/pi-todotools | todowrite / todoread, todo sidebar state, workflow prompt guidance, and continuation follow-ups. |
senpi is a small joke on senpai, but it is also literal project positioning: this fork aims to be a more sane pi with practical additions that make everyday agent work smoother without abandoning upstream's core design.
All additions follow pi's extension-first philosophy. Core source modifications are minimized and documented in changes.md files to keep upstream rebases clean.
senpi inherits pi's extension-first design — the core stays minimal, every feature lands as a builtin extension. The bet is that an opinionated set of features is wanted often enough to be in the binary; anything you don't want is still one settings flag away from being off (disabledBuiltinExtensions in settings.json).
Verified against git diff upstream/main..HEAD and every changes.md file in the repo.
| Subsystem | What it does | Docs |
|-----------|--------------|------|
| Dynamic system prompt | Replaces upstream's static prompt with an adaptive builder: senpi identity → forced intent gate → exploration discipline → parallel-tool guidance → verification tiers → categorized tool reference → policies → style → optional per-model tuning. | dynamic-prompt/ · changes.md |
| Compaction pipeline | Plugsuit-style adaptive thresholds, empty-summarization guard, branch summarization hooks. Speculative + emergency compaction with restoration tracker lives as the compaction builtin extension. | core/compaction/ · changes.md |
| Tool-call middleware rewrite | XML / Hermes / YAML+XML / Gemma4 text-tool protocols for models without native function calling. Strict parsing, stream-error preservation. | tool-call-middleware/ · changes.md |
In-tree, tightly coupled to senpi internals. Loaded in this exact registration order:
| # | Extension | Role | Docs |
|---|-----------|------|------|
| 1 | background-task | task / background_output / background_cancel tools, sub-agent spawning into detached subprocesses, custom session entries, desktop notifications | AGENTS.md |
| 2 | [permission-system](packages/coding-ag