# Extensions: MCP, skills, hooks

> Your own MCP servers, skills, commands, subagents, AGENTS.md memory and hooks — from the window and console settings. Trust in project hooks and commands.

Everything you can add to the agent is gathered in **“Settings → Extensions”** — for you personally (for all
projects) and in the **project settings** (for this repository). You do not need to edit configuration files
by hand: the forms write them and leave the rest of the file’s contents alone.

Tabs: **MCP**, **Plugins**, **Skills**, **Commands**, **Subagents**, **Hooks**, **Memory**.

| Tab | What it is |
| --- | --- |
| **MCP** | your own MCP servers: tools the agent can call |
| **Skills** | instructions for the agent for routine work, `SKILL.md` files |
| **Commands** | your own `/…` commands — a prepared request text |
| **Subagents** | agents for separate assignments: their own mode, model and instruction |
| **Memory** | `AGENTS.md` files: what the agent knows about the project from the first message |
| **Hooks** | a shell command on an event: before a tool, after it, before sending a prompt |

## Where it is stored: with me or in the project

Every entry has a **scope**:

- **with me** — in the user’s configuration directory; it applies in all projects and does not go into
  the repository;
- **in the project** — in the project’s files (`buffcode.json`, `.buffcode/`; if the project already has
  the older `opencode.json` and `.opencode/`, the entry goes there), it travels into the repository along
  with the code and applies to everyone who opens it. The form warns about this.

## MCP servers

_Illustration: Buff Code servers are what the organisation provides; below are your own servers with their status._

- **Buff Code servers** — `buff` (the company’s integrations and the administrator’s MCP servers through
  the connector), `knowledge` (the organisation’s knowledge base), `repos` (the project’s repositories, read-only).
  They connect by themselves after sign-in; you can turn them off but not change them. In detail — [Connection
  tools](/en/docs/buff-code/tools), [Knowledge base](/en/docs/buff-code/knowledge),
  [Project repositories](/en/docs/buff-code/repositories).
- **Your own servers** — “Add server”: local (a command) or remote (an address). The form has the tabs
  “Fields” and “JSON”; into the JSON tab you can paste an entry from another agent’s settings, including
  a whole `mcpServers` block.
- A server has a **status in words**: “Connected”, “Connecting…”, “Disabled”, “Sign-in needed”, “Did not
  start — reason” (“Command not found…”, “The server at this address does not respond…”).
  The toggle is written to the file and survives a restart.
_Illustration: The server form: a command on this machine or an address on the network; in the JSON tab — an entry from another agent._

- Substitutions like `{env:TOKEN}` are saved as written — a secret from the environment does not end up
  in the file.

## Skills

A skill is a `SKILL.md` file with an instruction for routine work: “how to prepare release notes”, “how
to check migrations”. The agent decides by itself when a skill is needed, or you name it in a message
(`@skill`).

- A list with search by name and description, grouped by origin: **project**, **mine**,
  **attached**. Each has a description and a toggle.
- **“Create skill”** — name, description, text. **“Attach a directory”** — a folder or address with
  the team’s ready-made skills.
- A disabled skill stays on disk, but the agent does not see it and it is not in the `@` suggestions.

## Commands and subagents

- **A command** is a prepared request under its own name: `/release-notes`, `/git/sync`. You set
  the description, the text, the agent, the model and where to run it — in the current session or as a separate subagent.
- **A subagent** is an agent for assignments: “when to call”, mode, model, instruction. The main agent
  hands work to it and gets the result.
- Built-in commands and agents are visible in the same lists; they can be turned off but not edited.
  The last main agent cannot be turned off.

## Memory

**Memory** is the `AGENTS.md` files: your shared one and the project’s files — from the repository root to the open
folder. The agent reads them at the start of every session.

- The text is edited in place; you can see when a file was changed.
- Each file has a toggle, and there is a general memory toggle.

## Hooks

**A hook** is a shell command that runs on an event:

| Event | What the command does |
| --- | --- |
| **before a tool** | a non-zero exit code forbids the call, and its output goes to the agent as the reason |
| **after a tool** | gets the event and can record or check something |
| **before sending a prompt** | its output is appended to your message |

The event comes to the command as JSON — on standard input and in the `BUFF_HOOK_EVENT` variable.

## Trust in project hooks and commands

Project hooks and commands come with the repository — you did not write them. So they **do not
run until you have looked at their text and confirmed them**.

- A bar appears above the input field about project hooks and commands awaiting a check; in
  the settings such entries are marked and have “Check”.
- The confirmation is tied to the content: if the entry changes, Buff Code asks again.
- The “Check project hooks and commands” toggle is on the “Hooks” tab and in the third step of the introduction.
  Turn it off only for your own projects.

## In the console

| What | Commands |
| --- | --- |
| MCP | `/mcps` — list and status; `/mcp-add`, `/mcp-edit`, `/mcp-remove` |
| skills | `/skills` — list, `ctrl+s` — turn on or off; `/skill-attach`, `/skill-detach` |
| commands | `/command-add`, `/command-edit`, `/command-remove`, `/command-toggle` |
| subagents | `/agent-add`, `/agent-edit`, `/agent-remove`, `/agent-toggle` |
| memory | `/memory` — toggles and a note at the end of the file |
| hooks | `/hook-add`, `/hook-remove`, `/hook-toggle` |
| trust | `/trust` — what awaits a check, viewing and confirming |
