# Plugins

What a plugin is in Loam, where it lives in your vault, how Loam loads it, and how to turn it on or off.

In Loam, every feature is a plugin, built in or written by you. A plugin adds commands, offers services to other plugins, and can add pages and panels to the window. This page explains what a plugin is, where a vault plugin lives, and how you turn plugins on and off.

## What a plugin adds

- **Commands**: actions you run from the palette, from the `loam` command line, or from an AI agent.
- **Services**: features other plugins can use, such as the note graph or tasks.
- **Events**: messages sent when something changes, such as a file on disk.
- **Interface**: pages, panels, slash menu items and overlays, for plugins with a UI part.

## Built-in and vault plugins

Built-in plugins come with the app. Settings > Plugins lists them in two groups, Features and Services. A **vault plugin** is one you add to your vault. Its source lives in the vault, so it travels with your notes, and Loam compiles it on each Mac.

## Where a vault plugin lives

```text
.loam/plugins/<id>/            the plugin's source: plugin.json and a Swift package
.loam/cache/plugins/<id>/      the compiled library, rebuilt from the source
```

The folder under `.loam/plugins/` is the part you share. The cache is disposable: `loam plugin build` recreates it. Never edit `.loam/cache/` by hand.

## How a vault plugin loads

Loam reads each `plugin.json` first and loads no code at that point. It opens the compiled library only for plugins you turned on. Safe mode never loads vault plugins.

## Turn a plugin on or off

A vault plugin stays off until you enable it. Enabling is a deliberate step, because a plugin runs with the same access as the app. Read [Permissions](/docs/permissions) first.

- In the app: open Settings > Plugins and use the switch on the plugin row.
- In a terminal: `loam plugin enable <id>` turns a plugin on, and `loam plugin disable <id>` turns it off.

Turning a plugin off stops it, but its code stays in memory until Loam quits. The commands of a plugin that is off are not listed by `loam list`.

> **Tip:** For AI agents: `loam guide plugins` explains how to build a plugin, step by step. `loam plugin list` shows every plugin, its source, and whether it is enabled.

Next, read [Build your first plugin](/docs/plugins/quickstart).
