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.
| Layer | What | Where |
|---|---|---|
| You | The decision maker | wherever you are |
| Host | The AI runtime that reads the brain and acts on it | Claude Code or Codex in your terminal |
| Plugin | Skill bodies, the MCP server, hooks, mods | one repo, many homes |
| Brain | Personality, knowledge, projects: everything that makes the agent yours | <HOME>/, portable markdown |
| Obsidian | Human-facing browser for the brain | <HOME>/ opened as a vault |
| Terminal | Bypass route for scripted task ops and headless compile prep | bun "<plugin root>/src/cli.ts". See CLI |
| External services | Optional tools the MCP server calls with your keys | GSC, 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.0Two 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.
| Host | How it gets the hooks and the MCP server |
|---|---|
| Claude Code | Bundled, from the plugin manifest |
| Codex | The 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.