# The Complete Guide to Building Pi Extensions

> Split into individual files for easier consumption.

## Table of Contents

- [01. What Are Extensions?](./01-what-are-extensions.md)
- [02. Architecture & Mental Model](./02-architecture-mental-model.md)
- [03. Getting Started](./03-getting-started.md)
- [04. Extension Locations & Discovery](./04-extension-locations-discovery.md)
- [05. Extension Structure & Styles](./05-extension-structure-styles.md)
- [06. The Extension Lifecycle](./06-the-extension-lifecycle.md)
- [07. Events — The Nervous System](./07-events-the-nervous-system.md)
- [08. ExtensionContext — What You Can Access](./08-extensioncontext-what-you-can-access.md)
- [09. ExtensionAPI — What You Can Do](./09-extensionapi-what-you-can-do.md)
- [10. Custom Tools — Giving the LLM New Abilities](./10-custom-tools-giving-the-llm-new-abilities.md)
- [11. Custom Commands — User-Facing Actions](./11-custom-commands-user-facing-actions.md)
- [12. Custom UI — Visual Components](./12-custom-ui-visual-components.md)
- [13. State Management & Persistence](./13-state-management-persistence.md)
- [14. Custom Rendering — Controlling What the User Sees](./14-custom-rendering-controlling-what-the-user-sees.md)
- [15. System Prompt Modification](./15-system-prompt-modification.md)
- [16. Compaction & Session Control](./16-compaction-session-control.md)
- [17. Model & Provider Management](./17-model-provider-management.md)
- [18. Remote Execution & Tool Overrides](./18-remote-execution-tool-overrides.md)
- [19. Packaging & Distribution](./19-packaging-distribution.md)
- [20. Mode Behavior](./20-mode-behavior.md)
- [21. Error Handling](./21-error-handling.md)
- [22. Key Rules & Gotchas](./22-key-rules-gotchas.md)
- [23. File Reference — Documentation](./23-file-reference-documentation.md)
- [24. File Reference — Example Extensions](./24-file-reference-example-extensions.md)
- [25. Slash Command Subcommand Patterns](./25-slash-command-subcommand-patterns.md)
- [26. Extension Development Template](./26-extension-template.md)

---

*Split into per-section files for surgical context loading.*
