> ## Documentation Index
> Fetch the complete documentation index at: https://docs.symbioticsec.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugins

> Add plugins to Symbiotic Code

Plugins allow you to extend Symbiotic Code by hooking into various events and customizing behavior. You can create plugins to **add new features, integrate with external services, or modify Symbiotic Code's default behavior.**

***

## Use plugins

There are two ways to load plugins:

### 1. From local files

Place JavaScript or TypeScript files in the plugin directory.

* `.symbiotic/plugins/` - Project-level plugins
* `~/.config/symbiotic/plugins/` - Global plugins

Files in these directories are automatically loaded at startup.

***

### 2. From npm

Specify npm packages in your config file.

```json title="symbiotic.json" theme={null}
{
  "$schema": "https://config.symbioticsec.ai/config.json",
  "plugin": ["@my-org/custom-plugin"]
}
```

Both regular and scoped npm packages are supported.

***

### How plugins are installed

* **npm plugins** are installed automatically using Bun at startup. Packages and their dependencies are cached in `~/.cache/symbioticnode_modules/`.

* **Local plugins** are loaded directly from the plugin directory. To use external packages, you must create a `package.json` within your config directory, or publish the plugin to npm and [add it to your config](/code/basics/configuration_file#plugins).

***

### Load order

Plugins are loaded from all sources and all hooks run in sequence. The load order is:

1. Global config (`~/.config/symbiotic.json`)
2. Project config (`symbiotic.json`)
3. Global plugin directory (`~/.config/symbiotic/plugins/`)
4. Project plugin directory (`.symbiotic/plugins/`)

Duplicate npm packages with the same name and version are loaded once. However, a local plugin and an npm plugin with similar names are both loaded separately.
