К основному содержанию
плагин CX Codex

kernel — плагин для Claude Code и Codex: хуки, память, установка

Плагин kernel ставит хуки-ограждения в Claude и Codex: блокирует разрушительные команды, закрывает необратимые операции одноразовым токеном и ведёт память агента в SQLite.

MIT ★ 1 596 обновлён 2026-10-29

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install kernel@awesome-codex-plugins
Открыть на GitHub

Что делает kernel

Хуки делят команды и записи в файлы по тому, насколько трудно их откатить. Исправимую ошибку модель получает назад предупреждением, а разрушительная команда жёстко блокируется и всплывает у вас. Снять блокировку может только одноразовый токен, который не подделает инструкция, внедрённая в контекст. Результат проверяют отдельные агенты-верификаторы, они не видели рассуждений того, кто писал код.

Память — база agentdb в SQLite в каталоге Vaults. Сессия читает из неё перед работой и дописывает выводы в конце. Поиск по умолчанию полнотекстовый, на FTS5; локальный семантический включается отдельно и запросы никуда не отправляет. Состояние между сессиями передаётся валидированными JSON-манифестами, у CLI есть команды validate, latest, divergence, preflight, compile, resume, activate и deactivate. Фоновые накладные расходы около 4,600 токенов на сессию.

Нужны git, sqlite3, jq, python3 и bash. Setup пишет тестовую запись в память и читает её обратно; если запись или чтение не удались, он выходит с ненулевым кодом и говорит, какая половина сломалась. В Codex пакет грузится через загрузчик совместимости с маркетплейсом, но события PostToolUseFailure там нет, поэтому capture-error.sh не подключается и запись ошибок тихо урезается до того, что видит PostToolUse. Удалённые сессии Claude плагины не поддерживают.

Какие задачи решает

  • Заблокировать разрушительную команду до запуска
  • Открыть необратимую операцию одноразовым токеном
  • Поднять вчерашние выводы из памяти в начале сессии
  • Передать состояние между сессиями через JSON-манифест
  • Проверить правку агентом, который не видел рассуждений автора

Примеры запросов агенту

  • Покажи все скиллы и проверь установку: /kernel:help
  • В Codex начни с $kernel:help, потом заведи память проекта через $kernel:init
  • Собери манифест текущей сессии и продолжи с него в новом окне: compile, затем resume

Как установить kernel

Через маркетплейс плагинов

/plugin marketplace add hashgraph-online/awesome-codex-plugins
/plugin install kernel@awesome-codex-plugins

По шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой

Вопросы о kernel

Как установить kernel в Claude Code?

В сессии выполните /plugin marketplace add hashgraph-online/awesome-codex-plugins, затем /plugin install kernel@awesome-codex-plugins. После перезапуска хоста наберите /kernel:help, чтобы увидеть список скиллов.

Что делает kernel?

Вешает хуки, которые блокируют разрушительные команды и требуют одноразовый токен для необратимых операций. Плюс держит память агента в SQLite и передаёт состояние между сессиями через JSON-манифесты.

Чем Codex отличается от Claude в работе с kernel?

Пакет тот же, но скиллы вызываются как $kernel:<name>. Событие PostToolUseFailure в Codex не реализовано, поэтому capture-error.sh там не подключается и ошибки инструментов фиксируются только тем, что видит PostToolUse.

Исходный текст

kernel-claude · MIT
# KERNEL

## For agents

If you are an agent deciding whether to install this, the machine-readable summary is
[llms.txt](llms.txt): what it is, what it adds, and when not to use it.

Claude Code (in a session, `/plugin marketplace add ariaxhan/kernel-claude` then
`/plugin install kernel@kernel-marketplace`):

```bash
claude plugin marketplace add ariaxhan/kernel-claude
claude plugin install kernel@kernel-marketplace
~/.claude/plugins/marketplaces/kernel-marketplace/scripts/kernel-setup.sh
```

Codex:

```bash
codex plugin marketplace add ariaxhan/kernel-claude
codex plugin add kernel@kernel-marketplace
```

Gemini CLI (methodology only: the 29 skills and `llms.txt` as ambient context; the hooks, the
approval token, and agentdb do not run on this host):

```bash
gemini extensions install https://github.com/ariaxhan/kernel-claude
```

Restart the host, then run `/kernel:help` on Claude Code or `$kernel:help` on Codex to confirm the
install and list every skill. Requires `git`, `sqlite3`, `jq`, `python3`, `bash`.

---

**Stop approving everything your AI does. It's making you less safe.**

Auto mode is the default now, and the data behind that decision is brutal: humans reviewing
per-action permission prompts caught dangerous commands 13.6% of the time; automated checks
caught 89%. People approve 97% of prompts. Attention decays to ~5% blocking after fifty
prompts. Per-action approval is a leash held by someone who stopped looking.
([Anthropic's numbers](https://claude.com/blog/auto-mode-default-in-claude-code); the
[academic result](https://arxiv.org/abs/2606.05647) is worse — 94% of developers miss
deliberate agent sabotage, and 56% accept it even after a warning.)

KERNEL is the other model: fences. The agent runs free inside enforced boundaries — hooks
that block destructive commands outright rather than warning about them, irreversible
operations gated behind a one-time token only a human can open, independent verifier agents
that never saw the builder's reasoning, and receipts for every claim. You review outcomes,
not keystrokes.

And the fences learn: every mistake a session survives is written to a memory that outlives
it, so yesterday's near-miss is tomorrow's blocked command.

For people running Claude Code in auto mode on real repositories. Not for you if you want
an autonomous agent with no boundaries, or a replacement for tests, review, and reading
the diff.

## Install

```bash
claude plugin marketplace add ariaxhan/kernel-claude
claude plugin install kernel@kernel-marketplace
~/.claude/plugins/marketplaces/kernel-marketplace/scripts/kernel-setup.sh
```

Needs `git`, `sqlite3`, `jq`, `python3`, `bash`. Takes about ten seconds. Setup asks once
before it writes, and never touches your shell config.

## What you should see

Setup finishes by writing a real memory and reading it back by keyword:

```text
## Recall: KERNEL installed machine

- [pattern] KERNEL 8.7.2 installed on this machine  ↳ kernel-setup.sh completed at 2026-08-04T23:51:39Z

KERNEL is set up.
  memory:  /Users/you/Documents/Vaults/_meta/agentdb/agent.db
  agentdb: /Users/you/Documents/Vaults/.local/bin/agentdb
```

That round trip is the proof, not a status message. There is now a SQLite database on your
machine that every Claude Code session reads on start and writes on end. If setup could not
write to it or could not read it back, it exits non-zero and tells you which half failed.

Now run `claude` and type `/kernel:help`.

---

## Where things are

**[Full documentation](docs/)** covers install paths and verification, the daily loop, what
KERNEL writes to disk, the safety model, troubleshooting, upgrading, and contributing.

Go to [docs/install.md](docs/install.md) if the three commands above did not work, and
[docs/daily-use.md](docs/daily-use.md) once they did.

## What it actually does

Three things, in the order you notice them.

**Memory.** `agentdb` is a SQLite database in your Vaults directory. Sessions recall from it
before acting and write learnings at the end, so a failure you hit last week does not cost
you the same afternoon twice. Recall is FTS5 keyword search by default; local semantic search
is opt-in and adds nothing to your network. See
[docs/data-and-memory.md](docs/data-and-memory.md).

**Bounded resume.** Handoffs, checkpoints, and retrospectives are validated JSON manifests,
not prose summaries. A new session reconstructs exactly the state the manifest pins rather
than inheriting a whole conversation. The manifest CLI is
`validate | latest | divergence | preflight | compile | resume | activate | deactivate`.

**Reversibility guards.** Hooks classify commands and writes by how hard they are to undo.
Recoverable mistakes get a warning the model can correct; genuinely destructive ones
hard-block and surface to you, with a one-time approval token that a prompt-injected command
cannot forge. These are a tripwire, not a sandbox, and [docs/safety.md](docs/safety.md) is
explicit about where they stop working.

Underneath, KERNEL classifies each task by domain, work shape, and safety level, then loads
one domain pack for the announced route. Ordinary work runs with no ceremony.

One honest limit on that, current as of 9.0.0: the model-routing and
separate-builder-from-verifier rules are checked when receipt validation is run. They are not
yet enforced on every request, and a request with no receipt at all proceeds normally. Treat
them as a convention the tooling helps you keep, not as a sandbox.

On context cost, the number you will see quoted elsewhere is wrong and this is the corrected
one. KERNEL's ambient cost to a plugin user is roughly **4,600 tokens**: about 1,900 from the
SessionStart hook and about 2,700 from skill frontmatter the host keeps visible so routing can
happen. This repo's `CLAUDE.md` is **not** part of that; your host loads your own instruction
file, not ours. An earlier target of "under 500 tokens" came from a measurement that charged our
`CLAUDE.md` to everyone, and it is withdrawn. Detail and the ratchets that now enforce it:
[docs/kernel-9/INVENTORY.md](docs/kernel-9/INVENTORY.md).

## Surfaces, and how Codex differs

Claude Code terminal, Desktop (local and SSH), and VS Code. Remote Claude Code sessions do
not support plugins.

Codex CLI and the Codex app load the same package through their Claude-marketplace
compatibility loader:

```bash
codex plugin marketplace add ariaxhan/kernel-claude
codex plugin add kernel@kernel-marketplace
```

Restart Codex afterwards, then invoke `$kernel:init`. Skills are namespaced on both hosts:
Claude Code invokes `/kernel:help`, Codex invokes `$kernel:help`. Two real differences.
Codex runs the supported synchronous hook events, including `SessionEnd`, but does not
implement `PostToolUseFailure`. KERNEL's `capture-error.sh` is therefore not bound on that
host, and tool-error recording degrades to what `PostToolUse` can observe. That degradation is
silent at runtime, so the per-host matrix is worth reading before you rely on error history:
[docs/kernel-9/HOST-CAPABILITIES.md](docs/kernel-9/HOST-CAPABILITIES.md), generated from
`governance/hosts.json`. And Codex does
not register KERNEL's Claude Code agent definitions as native subagents; it maps the same
roles onto its own during orchestration. Reasoning and detail:
[docs/install.md](docs/install.md).

## Updating

Claude Code:

```text
/plugin marketplace update kernel-marketplace
/plugin update kernel@kernel-marketplace
/reload-plugins
```

Codex, where the marketplace upgrade also refreshes the installed cache:

```bash
codex plugin marketplace upgrade kernel-marketplace
```

Upgrading from 7.23, the breaking changes, and rolling back without losing data:
[docs/upgrading.md](docs/upgrading.md).

If update and reload both fail, reinstall. Claude Code takes
`/plugin uninstall kernel@kernel-marketplace --keep-data` followed by a fresh install; Codex
takes `codex plugin remove kernel@kernel-marketplace` then
`codex plugin add kernel@kernel-marketplace`. Removing the marketplace or clearing the plugin
cache is not routine maintenance.

## Rolling back

Check out the verified 7.23 release commit and point the installed selector at it:

```bash
git clone https://github.com/ariaxhan/kernel-claude.git "$HOME/kernel-claude-7.23"
git -C "$HOME/kernel-claude-7.23" checkout 54a0053
V8_SELECTOR="$HOME/.claude/plugins/cache/kernel-marketplace/kernel/current/scripts/select-runtime.sh"
"$V8_SELECTOR" "$HOME/kernel-claude-7.23"
claude --plugin-dir "$HOME/kernel-claude-7.23"
```

To select a validated runtime explicitly, call a numbered selector directly, for example
`"$HOME/.claude/plugins/cache/kernel-marketplace/kernel/8.0.2/scripts/select-runtime.sh" /path/to/runtime`.
That moves `current` backward on purpose; ordinary old sessions cannot. It selects code only
and does not convert state formats.

## Where your data lives

Everything durable goes in the selected Vaults directory: `_meta/agentdb/agent.db` for
memory, `_meta/handoffs/` and `_meta/checkpoints/` for JSON state, `_meta/logs/` for runtime
records. Detection order and the full list: [docs/data-and-memory.md](docs/data-and-memory.md).

When the active project root exactly matches the Vaults root and a shared continuity engine
with an executable host adapter is present, that service owns compaction checkpoints and
restore injection, and KERNEL's compaction paths cleanly no-op rather than adding a second
restore. Nested repositories retain KERNEL's deterministic generic fallback.

## Contributing

```bash
git clone https://github.com/ariaxhan/kernel-claude.git
cd kernel-claude
./scripts/kernel-setup.sh
claude --plugin-dir ./
./tests/run-tests.sh
```

See [docs/contributing.md](docs/contributing.md). Fix defects here and release; do not edit
an installed cache directory.

MIT licensed.

© Aria Han · MIT · hashgraph-online/awesome-codex-plugins

Похожие плагины

Все плагины по теме «Настройка агента: память, контекст, субагенты» →
how-it-works thedotmack Скилл how-it-works для Claude Code и Codex объясняет архитектуру claude-mem, механизмы сохранения наблюдений и локальное размещение данных. Отвечает на вопросы о фоновых процессах памяти между сессиями. CX Codex +1 5 600установок ontology sundial-org Скилл ontology для Claude Code хранит память агента как типизированный граф: сущности, связи и проверка ограничений перед записью. Несколько скиллов видят общее состояние через единое хранилище. CX Codex +1 3 700установок agent-recall mnardit Плагин agent-recall сохраняет факты о людях, решениях и проектах в локальной базе SQLite и передаёт агенту краткую сводку при старте сессии. ★ 15звёзд репо Mnemosyne 28naem-del Локальный MCP-сервер Mnemosyne сохраняет знания агента вместе с источниками в SQLite. Исправление факта снимает с использования связанные с ним записи. CX Codex +1 ★ 162звёзд репо lore jordanhindo MCP-сервер lore для Claude Code и других агентов: собирает историю сессий в локальную базу и даёт искать по ней из любого MCP-клиента. Восстанавливает разбор задачи после сжатия контекста. CX Codex +1 ★ 16звёзд репо kernel-auth kernel Скилл kernel-auth подключает управляемую авторизацию KERNEL или хранилище паролей для браузерных задач агента. Скилл пригодится, когда сервису нужен веб-интерфейс, а прямого API нет. CX Codex +1 400установок

Из того же набора391

Весь набор →
magents Плагин magents связывает сессии Codex, Claude и Cursor через общую шину MCP. Помогает передавать контекст и запускать задачи без ручного копирования. CX Codex ★ 1 596звёзд репо maestro Плагин maestro для Claude Code отправляет один запрос нескольким локальным CLI-моделям, поручает выбранной модели-судье сравнить ответы, а синтезатору — собрать общий итог. CX Codex ★ 1 596звёзд репо lvtd-skills Плагин lvtd-skills для Claude Code и Codex собирает готовые скиллы по Django, htmx, Rust, документации, SEO, тракшену и книгам — по одному файлу SKILL.md на тему. CX Codex ★ 1 596звёзд репо krypton Плагин krypton для Claude Code и Codex превращает запрос на разработку в план с ответственными, решением о переходе и критериями приёмки. Подключайте его для новой функции, исправления, рефакторинга, миграции или архитектурной задачи. CX Codex ★ 1 596звёзд репо jev-use Плагин jev-use делегирует быстрые бинарные решения и проверку шелл-команд модели суждений Jev без генерации лишнего текста. CX Codex ★ 1 596звёзд репо sirv-media-skills Плагин sirv-media-skills для Claude Code объединяет восемь скиллов для аудита изображений и видео, работы с Sirv API, галереями и 360-вью. Скиллы охватывают веб-производительность и товарный контент. CX Codex ★ 1 596звёзд репо hotl Плагин hotl ведёт задачу через восемь фаз: брейншторм, письменный план, исполнение, ревью и проверка тестами. Для фич, рефакторингов и правок, которые страшно пускать наугад. CX Codex ★ 1 596звёзд репо codex-honcho Плагин codex-honcho сохраняет контекст и решения между перезапусками сессий с помощью сервиса памяти Honcho, избавляя от повторения инструкций. CX Codex ★ 1 596звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой