# Pi Extensions and Workflow Automation

Pi uses extension events rather than another harness's hook names or `allowedTools` configuration. In a plugin-free session, run checks directly with built-in file and shell tools; do not claim that lifecycle automation or interception occurred. If the user explicitly requests persistent tool interception or lifecycle automation, explain that Pi core requires an extension for that capability and obtain approval before creating or installing one.

## Relevant Extension Events

- `tool_call`: validate, block, or modify a tool call before execution.
- `tool_result`: inspect or modify a completed tool result.
- `agent_settled`: run checks after Pi has no automatic continuation left.
- `session_shutdown`: clean up resources when a session ends or reloads.
- `project_trust`: participate in project trust decisions from a global or CLI extension.

Place trusted extensions in `~/.pi/agent/extensions/` for global use or `.pi/extensions/` for a trusted project. Configure additional extension paths in `~/.pi/agent/settings.json` or `.pi/settings.json`. Use `/reload` after changing an auto-discovered extension.

Extensions run with the user's full system permissions. Review third-party extension source before loading it, and keep project trust enabled for repository-controlled resources.

## Tool Access

Use Pi's `--tools` allowlist and `--exclude-tools` denylist when starting a session that needs a narrower tool set. Without extensions, use those startup controls, a container, or direct manual review for isolation; do not claim that a confirmation gate or path-protection hook exists. Create or install a trusted extension only when the user explicitly requires an in-session gate and approves the added code. Pi core intentionally has no permission popups.

Never assume an extension is installed. Follow the tools exposed in the current session.

## Task Tracking

Pi core has no built-in task list. For multi-step work:

- use an extension-provided task tool when one is exposed;
- otherwise maintain a concise `TODO.md` only when persistent tracking is useful;
- keep trivial work in the conversation rather than creating process overhead.

Keep task state accurate, mark only verified work complete, and disclose blockers.
