Docs · Library
Library
magpie’s Library keeps instructions, MCP servers, skills, hooks and subagents in one place, and writes each of them into every agent you tick for it, in that agent’s own files and format. The agents read those files as they always do. magpie adds no layer between an agent and what it is given: the agent itself decides when to use a skill, an MCP tool or a subagent.
The page has six tabs: Instructions, MCP servers, Skills, Hooks, Subagents and RTK. Each item has a row of agents; tick an agent to give it the item, untick it to take it away. An agent reads the change when it starts again.
Where it is kept
- The library is
library.jsonin magpie’s config folder (~/.config/magpie, or$XDG_CONFIG_HOME/magpiewhen that is set). Instruction texts and skill folders are inlibrary/next to it. - Every change saves the library and writes it into every agent at once. magpie records what it wrote, so it only ever takes away its own entries and leaves yours alone.
- Backups. Before a change, the files it replaces are copied to
backups/in the same folder. The last 30 are kept. The Backups button at the top of each tab opens them. - Write it again. After you install an agent, or edit its files by hand,
magpie library syncwrites the library into every agent again.
magpie library # what the library gives each agent magpie library sync # write it into the agents again
Instructions
Instructions are text every session of an agent starts with, such as house rules or a coding style. magpie writes its part between two marker lines in the agent’s instructions file:
<!-- magpie:begin · written by magpie from its Library --> …the Library's instructions… <!-- magpie:end -->
Everything outside the markers is yours and is never changed. You can keep several named sets and give each set to different agents, and a set can live in a file of your own.
| Agent | File |
|---|---|
| Claude Code | ~/.claude/CLAUDE.md |
| Codex | ~/.codex/AGENTS.md (or AGENTS.override.md when you use one) |
| Gemini CLI | ~/.gemini/GEMINI.md |
| Antigravity | ~/.gemini/config/GEMINI.md |
| OpenCode | AGENTS.md in its config folder |
| Copilot CLI | ~/.copilot/copilot-instructions.md |
| Goose, Crush, Qwen Code, CodeBuddy | .goosehints, CRUSH.md, QWEN.md, CODEBUDDY.md |
| Droid, Grok, dsh, omp | AGENTS.md in the agent’s own folder |
| Pi, OmO | the first one there of AGENTS.md and CLAUDE.md |
Folders follow the agent’s own setting: a custom CLAUDE_CONFIG_DIR or CODEX_HOME is used in place of the default.
MCP servers
An MCP server is either a command (a program the agent starts, such as npx …) or a URL (HTTP or SSE). magpie writes one entry per server into each ticked agent’s MCP config, in that agent’s format, and keeps any fields you added to the entry yourself.
| Agent | File |
|---|---|
| Claude Code | ~/.claude.json |
| Codex | ~/.codex/config.toml |
| Gemini CLI | ~/.gemini/settings.json |
| Antigravity | ~/.gemini/config/mcp_config.json |
| OpenCode | opencode.json |
| Cursor | ~/.cursor/mcp.json |
| Copilot CLI | ~/.copilot/mcp-config.json |
| Zed | context_servers in its settings.json |
- Variables.
${NAME}in a header or an env value is written in each agent’s own syntax. An agent that has no such syntax is not given that server, and the page says why. - SSE. Codex, Goose, dsh, Grok, Command Code and Zed can’t use an SSE server. Claude Desktop takes no remote servers at all.
- Single tools off. You can turn off tools one by one for Codex, Gemini CLI, Crush, Hermes Agent, Claude Code and OpenCode, each in its own setting. Every other agent gets the whole server.
- Sign-in. A server that needs OAuth is signed in to once, in magpie. Agents then reach it through magpie’s gateway at
/mcp/<name>. - This computer only. Turn off Sync to your other computers for a server that should stay here (
magpie library mcp local <name> on).
With the MCP router on, each agent gets one server named magpie in place of these entries, and magpie runs each command server once for all of them. It is off by default.
Skills
A skill is a folder with a SKILL.md in it. The agent reads each skill’s name and description and loads the rest when a task needs it. Add one from GitHub, any git repository, a folder on this computer, or the market on the Skills tab.
| Agent | Folder |
|---|---|
| Claude Code | ~/.claude/skills |
| Codex | ~/.codex/skills |
| Gemini CLI | ~/.gemini/skills |
| OpenCode | skills in its config folder |
| Cursor | ~/.cursor/skills |
| Copilot CLI | ~/.copilot/skills |
| Goose | ~/.agents/skills |
Links or copies
Give skills as sets how a skill reaches an agent, for every agent or, under By agent, for one:
- Links (the default). The agent’s folder links to the library’s copy, so an update reaches every agent at once. On Windows without the right to make links, a junction is used.
- Copies. Each agent gets a folder of its own, for tools that don’t follow links. A copy is made again when the library’s skill changes. If the agent, or you, edit a copy, the next sync takes the newest edit into the library and gives it to the other agents. An edit that loses to a newer one is kept with the backups.
A skill folder of your own with the same name is never written over: the page asks whether to use the library’s or keep yours.
Editing and updates
- Edit opens a skill’s files on the page; Save (or ⌘S) writes them. The command line has no editor.
- Updates. When you open the Skills tab, skills from GitHub are checked for updates if 12 hours have passed since the last check (
magpie library skill updatechecks now). A skill you changed is never replaced without asking. - Put skills in. Skills go to each ticked agent’s own folder (the default), or also into
~/.agents/skills, which Codex, Gemini CLI, OpenCode, Crush, Droid, Kimi Code and other tools read. - Off here. A skill can be turned off on this computer only; a sync from another computer doesn’t turn it back on.
Subagents
A subagent is a helper the main agent can hand a task to. It has a name, a description and a prompt. magpie writes it as a file in each ticked agent’s subagent folder. The main agent reads every subagent’s description and decides itself when to call one, so the description should say plainly what it is for and when to use it.
- Name: 2 to 50 lowercase letters, digits and
-. A few names are reserved, such asdefaultandmain. - Description: required, up to 1,000 characters.
- Prompt: required. It becomes the subagent’s instructions.
- Model: optional. See Subagent models.
| Agent | File | Skills, MCP servers |
|---|---|---|
| Claude Code | ~/.claude/agents/<name>.md | the ones you pick |
| Codex | ~/.codex/agents/<name>.toml | all the agent has |
| OpenCode | agents/<name>.md in its config folder | all the agent has |
| Gemini CLI | ~/.gemini/agents/<name>.md | all the agent has |
| Qwen Code | agents/<name>.md in its folder | all the agent has |
| Droid | ~/.factory/droids/<name>.md | MCP servers you pick; all skills |
| Grok | agents/<name>.md in its folder | all the agent has |
| Cursor | ~/.cursor/agents/<name>.md | all the agent has |
| Copilot CLI | ~/.copilot/agents/<name>.agent.md | all the agent has |
- Only Claude Code limits a subagent to the skills you pick, and only Claude Code and Droid to the MCP servers you pick. Elsewhere a subagent has everything its agent has.
- Cursor: only the Cursor app reads
~/.cursor/agents.cursor-agentreads only a project’s.cursor/agents. - Kimi Code, Goose, Crush, Qoder, CodeBuddy, iFlow and Kiro have no user-wide subagent folder, so they get none. Agents in WSL get none either.
- If you edit a file magpie wrote, it becomes yours and magpie stops changing it. A file of your own with the same name is never written over; the page shows a problem instead.
Subagent models
A subagent’s Model field is written only for Codex. Every other agent runs its subagents on the model it picks itself, and the page says so. Left empty, the field reads Picked by the agent.
For Codex, the model goes into the subagent’s .toml file. Codex lays that file over the spawn, so requests carry that model and magpie’s gateway routes them like any other request. You can pick any model in Codex’s list, a magpie provider/model, or a routing group (group/<id>).
Codex’s subagent model on the Agents page
Codex’s row on the Agents page has a subagent model of its own, for every subagent Codex starts:
- Lead’s pick (the default). The main agent picks each subagent’s model, one of Codex’s own too. A subagent it names no model for runs on the main agent’s model. A resumed subagent stays on the model it started on.
- Same as the lead. Every subagent runs on the main agent’s model.
- A model or a group. Every subagent runs on it, even when the main agent names another.
default_subagent_model from Codex’s config.Codex’s own [agents] default_subagent_model in config.toml is a different thing: only the model a subagent starts on when the main agent names none. One exception to all of the above: a task the ChatGPT backend has sealed stays on the model it asked for, unless the setting is a ChatGPT account’s model.
Claude Code has its own order: the model the main agent names in its call, then the subagent file’s model:, then CLAUDE_CODE_SUBAGENT_MODEL (which Claude Code’s row on the Agents page can set), then the session’s model.
Hooks
A hook is a command an agent runs at a point in its turn: a notification when it finishes, a formatter after it edits a file. Pick a portable event (turn end, after a tool, before a tool, on a prompt, at session start) and magpie writes it under each agent’s own name for that event. Only Claude Code, Codex, Gemini CLI, Cursor, Grok Build and Grok App take hooks. A hook entry you change becomes yours.
RTK
The RTK tab turns on RTK per agent: the agent’s shell commands run through RTK, which shortens their output to save tokens. magpie can install RTK for you; turning it off works with RTK gone.
What magpie touches
- Only what it wrote: the text between its markers, entries it recorded, files it marked as its own.
- Never a file, entry or skill of yours with the same name. The page shows the clash and lets you choose.
- Anything it replaces goes to the backups first.
Projects can get skills and MCP servers too, in the project’s own folders (such as .claude/skills, .agents/skills, .mcp.json or .codex/config.toml).