AgentLayer▸docs
Reference

Architecture

The brain is portable markdown. The host is the runtime. The plugin is the glue.

The parts and what talks to what. Your host does the thinking, the plugin does the I/O, and the home holds everything as files.

LayerWhatWhere
YouThe decision makerwherever you are
HostThe AI runtime that reads the brain and acts on itClaude Code or Codex in your terminal
PluginSkill bodies, the MCP server, hooks, modsone repo, many homes
BrainPersonality, knowledge, projects: everything that makes the agent yours<HOME>/, portable markdown
ObsidianHuman-facing browser for the brain<HOME>/ opened as a vault
TerminalBypass route for scripted task ops and headless compile prepbun "<plugin root>/src/cli.ts". See CLI
External servicesOptional tools the MCP server calls with your keysGSC, PageSpeed, SerpAPI, OpenPageRank, Perplexity, bundled Chromium

Why the model never runs inside the plugin

Other personal-AI setups call the model from their own code, which bills a metered API key. This plugin does not. Its tools do I/O and return prompts, and your own session does the thinking on your host's plan. See The host does the thinking.

That one choice shapes the rest:

  • Compile is a loop your session drives.
  • Briefings are skills you invoke.
  • There is no daemon waking up at 7am, so the agent acts when you ask and never on its own.

How it came to be built this way: Before the plugin.

The plugin repo

agentlayer-agent/
├── .claude-plugin/
│   ├── plugin.json          # Claude Code manifest: hooks/claude.json, the agent MCP server
│   └── marketplace.json     # developer marketplace (agentlayer-dev) so a clone installs
├── .codex-plugin/plugin.json      # Codex manifest: the same skills/ (hooks + server register per home)
├── .agents/plugins/marketplace.json  # the same developer marketplace for Codex
├── package.json             # one Bun package for the whole plugin; bun install here
├── src/
│   ├── server.ts            # the agent MCP server
│   ├── cli.ts               # the CLI the hooks, the status line and your terminal run
│   ├── tools.ts             # the tool registry: one import per domain
│   └── <domain>/            # one folder per domain or pack, each with its tool.ts
├── hooks/claude.json        # SessionStart · SessionEnd · PreCompact · PreToolUse guard, plus the mods module
├── mods/                    # Claude Code mods: instant commands, repo manuals, sync progress, notices
├── skills/                  # 34 skills
├── templates/               # init copies these into <HOME>
├── CHANGELOG.md             # release contract: Upgrade blocks drive the upgrade skill
└── LICENSE · NOTICE         # Apache 2.0

Two hosts, one home

The home does not care which CLI opened it, and a session ended in one host is in the other's context next time.

HostHow it gets the hooks and the MCP server
Claude CodeBundled, from the plugin manifest
CodexThe same entry points, wired per home into .codex/, because a Codex plugin cannot yet carry hooks or a server that knows its home

What every host provides, and what a new one needs: Hosts.

On this page