repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/mode/README.md

Raw

mode

Session-local Pi modes from Markdown files.

Install / load

Loaded through the root pi-ext package. See ../../README.md.

Commands / tools / settings

Commands:

Tools: none.

Settings: none.

Mode files

V1 loads only global mode files:

~/.pi/agent/modes/*.md

Mode id is the file stem. Valid ids match ^[a-zA-Z0-9_-]+$.

Example:

---
description: Read-only planning
model: openai/gpt-5.2-codex
thinking: high
tools: [read, grep, find, ls]
reminder: You are planning only. Do not implement.
---

# Planning mode

Plan only.
Do not implement.

Behavior

Active mode appends its Markdown body and a generated mode kernel to the system prompt for each agent turn. Mode prompts are not stored as chat messages.

A mode may change active tools, model, and thinking level. Turning mode off does not restore prior tools, model, or thinking in V1.

Mode state persists in session custom entries. Restore uses the current branch only. Compaction adds a mode checkpoint.

V1 limits

Project-local .pi/modes/*.md is deferred until Pi exposes a public project-trust API to extensions. Shortcuts, extension scoping, permission policy, tool globs, and baseline restore are not in V1.

Markdown source
File outline
# mode

Session-local Pi modes from Markdown files.

## Install / load

Loaded through the root pi-ext package.
See [../../README.md](../../README.md).

## Commands / tools / settings

Commands:

- `/mode` — show active mode and available modes.
- `/mode status` — same as `/mode`.
- `/mode list` — list available modes.
- `/mode <id>` — switch to a mode.
- `/mode off` — turn mode off.
- `/mode normal` — alias for `/mode off`.
- `/mode none` — alias for `/mode off`.
- `/mode reload-config` — reload mode files and report count/warnings.

Tools: none.

Settings: none.

## Mode files

V1 loads only global mode files:

```text
~/.pi/agent/modes/*.md
```

Mode id is the file stem.
Valid ids match `^[a-zA-Z0-9_-]+$`.

Example:

```md
---
description: Read-only planning
model: openai/gpt-5.2-codex
thinking: high
tools: [read, grep, find, ls]
reminder: You are planning only. Do not implement.
---

# Planning mode

Plan only.
Do not implement.
```

## Behavior

Active mode appends its Markdown body and a generated mode kernel to the system prompt for each agent turn.
Mode prompts are not stored as chat messages.

A mode may change active tools, model, and thinking level.
Turning mode off does not restore prior tools, model, or thinking in V1.

Mode state persists in session custom entries.
Restore uses the current branch only.
Compaction adds a mode checkpoint.

## V1 limits

Project-local `.pi/modes/*.md` is deferred until Pi exposes a public project-trust API to extensions.
Shortcuts, extension scoping, permission policy, tool globs, and baseline restore are not in V1.