mode

A project setting that controls when the pi coding agent may handle edits: never, with prompts, or only through delegated work.

In plain words
What is it for?
Use it to view or change a project's pi dispatch mode between off, soft, and strict.
Why use it?
It lets a project define how strictly coding work is routed to pi. The setting follows the project folder, even when work starts elsewhere.

Skill for Claude CodeCodex

Part of the pi-delegate plugin — 9 skills, 3 hooks, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/larrystanley/pi-delegate/mode
Any agent
npx skills add LarryStanley/pi-delegate --skill mode
Clone the repo
git clone --depth 1 https://github.com/LarryStanley/pi-delegate

Made for: Claude Code, Codex.

Or install pi-delegate, the plugin that ships this one along with the rest of its 9 skills, 3 hooks, 1 MCP server.

Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,486 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.01486
Opus 5 $0.00006 $0.00743
Sonnet 5 $0.00003 $0.00297
Haiku 4.5 $0.00001 $0.00149

Measured 2d ago against content hash 7027b1870d76, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mode/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

The user wants to set the pi-delegate mode to: $ARGUMENTS

If $ARGUMENTS is empty, just show the current mode and policy — do nothing else:

node "${CLAUDE_PLUGIN_ROOT}/bin/pi-mode"

For off and soft, set it directly and report the result:

node "${CLAUDE_PLUGIN_ROOT}/bin/pi-mode" <mode>

What the three modes do:

  • off — no intervention at all. Suitable for a project pi should never touch.
  • soft — nudges when existing product code is touched (default).
  • strictblocks edits to existing product code, requiring pi_dispatch instead.

The mode is recorded against the project root and applied by the project root of the file being edited — not by wherever the session happens to be sitting. A strict project therefore stays strict when edited from another project's session, or from one of its own subdirectories. Report the path the command prints, so the user can see which project the mode actually landed on.

Setting strict: survey the project first

strict is the mode with teeth, so it needs to know what to protect. Without a policy it falls back to a built-in heuristic that only fits one shape — a src/ directory holding .ts/.tsx/.js/.jsx/.mjs/.svelte/.py. On a Go, Rust, Elixir, or <pkg>/-layout Python tree that heuristic protects nothing, and says nothing about it: strict looks switched on and is not. So work out this project's real answer.

1. Look at the project. Read the manifest (go.mod, Cargo.toml, pyproject.toml, package.json, mix.exs, …) and list the top-level directories. You are answering one question: which paths hold product source that should be written by pi rather than by hand?

Typical answers, as a starting point and not a lookup table — the repo in front of you wins over any of them:

Layout Usually protect
Node / TS src/**
Go internal/**, cmd/**, pkg/**
Rust src/**/*.rs
Python (<pkg>/) <pkg>/**/*.py
Elixir lib/**

Test files are NOT an exception. Do not put them in allow. They are the single biggest block of characters in most repos, and dispatching them is the plugin's whole premise — the skill's rule is structural, not about judgment: is this a character that gets committed? then pi writes it, implementation and tests alike. Exempting tests looks reasonable ("the test is the spec, so I should write it") and quietly hands the largest share of the work straight back to hand-typing. That is the exact leak strict exists to close: with a written rule in place and no enforcement, roughly 80% of committed characters were still typed by the main model.

If you want to fix the contract before pi implements it, the contract belongs in the task book — prose you write, not a file that gets committed. And an acceptance test you run yourself to judge the result is fine too, because it is a throwaway you never commit. What must not happen is src/**/*.test.ts landing in the repo from your own keyboard.

allow is for things that are not hand-written source at all: generated code (*.pb.go, *_pb2.py, src/generated/**, snapshots) and framework shells that are config in disguise (src/app.d.ts, src/app.html, a vitest setup file). Getting these wrong is what makes someone switch strict off entirely rather than live with it.

Paths that are simply outside the protected globs — docs, config, migrations you hand-write by policy, fixtures, scripts — need no allow entry at all; they were never protected.

2. Show the user what you propose, and why. List the protect globs and the allow globs, each with a one-line reason, and name anything you were unsure about. Patterns are relative to the project root; ** crosses directories, * stays inside one segment, and a trailing / means "everything under here".

3. Wait for their answer. Do not write the policy until they approve it. They may edit the lists — use what they say, not what you proposed. This confirmation step is the whole reason this is safe: otherwise the model editing the files is also the model deciding which files it may edit.

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 125 lines · 13 tokens per session scan A 7027b1870d76

Subscribe to this mod's changes

mode is a skill published in the GitHub repository LarryStanley/pi-delegate (2 stars, last pushed 9d ago), licensed MIT. It adds 13 tokens to every session and 1,486 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

reduce-foreground-guard-prompts

Explain why foreground-guard is prompting on Bash commands and how to stop the avoidable prompts. Use when the user asks "why am I getting so many foreground-guard prompts", "reduce foreground-guard prompts", "stop the watch/sleep/gh run watch permission prompts", or otherwise wants fewer confirmation prompts from…

karlkfi/claude-bouncer · 74 tokens

reduce-workspace-guard-prompts

Explain why workspace-guard is prompting on Bash file commands and how to stop the avoidable prompts. Use when the user asks "why am I getting so many permission prompts", "reduce workspace-guard prompts", "stop the grep/cat permission prompts", or otherwise wants fewer confirmation prompts from this hook.

karlkfi/claude-bouncer · 69 tokens

hs

ACTIVATE THIS SKILL FOR ANY SHELL COMMAND OR FILE READ. Check curl, wget, rm, sudo, apt, dpkg, chmod, dd, format, powershell, bash, sh. Check pipe patterns like | sh or | bash. Check shell wrappers like bash -c, xargs, find -exec. Check cloud CLI (aws, gcloud, kubectl, terraform). Check when user says sysadmin told…

frmoretto/hardstop · 144 tokens

babysit

Same-session monitoring loop for PRs, CI runs, tickets, and deployments using the monitorstart / monitorupdate / autonudgestop MCP tools. The loop re-injects your check instructions into THIS session on an idle interval — same context, same tools — and works from dashboard chat, Slack threads, and Discord DMs. Use…

kirodotdev/KiroCrew · 137 tokens

agile-product-owner

../../../product-team/agile-product-owner/skills/agile-product-owner/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

mochi-remind

Handle due reminders — notify the user with natural language and mark them done.

kirodotdev/KiroCrew · 20 tokens