agent collects the Emacs integration layer for AI coding command-line tools. It provides a shared session switcher, notifications, theme synchronization, terminal fixes, skill execution, and backend modules for Claude Code and Codex.
The package is for Emacs users who run AI coding agents inside terminal buffers and want one coherent interface instead of separate menus and keybindings per CLI. The core package (agent.el) owns backend registration, session identity and state, and the unified commands (handoff, restart, exit, skills); agent-account handles multi-account selection and config homes for all backends; agent-project routes Slack messages, emails, and Org TODOs through project lists scoped to the backend account selected for that invocation; agent-capture and agent-snippet add Org prompt capture and yasnippet expansion in session buffers; agent-claude (with agent-claude-cli quarantining undocumented Claude CLI conventions) adds status and usage polling, branch navigation, batch TODO execution, and hook setup; agent-codex adds theme sync, codex exec execution, and modeline helpers.
Each backend ships a global minor mode (agent-claude-mode, agent-codex-mode) that owns every hook, advice, and timer the backend installs. Loading the modules installs nothing; you must enable the modes explicitly.
With package-vc:
(use-package agent
:vc (:url "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/benthamite/agent"))With Elpaca:
(use-package agent
:ensure (:host github :repo "benthamite/agent"))With straight.el:
(use-package agent
:straight (:host github :repo "benthamite/agent"))Dependencies: Emacs 30 or later, transient, and consult for the core package. The Claude backend expects claude-code; the Codex backend expects codex. Optional integrations use yasnippet, doom-modeline, gptel, agent-log, and monet when available.
(use-package agent
:ensure (:host github :repo "benthamite/agent")
:after (claude-code codex)
:demand t
:config
(require 'agent-claude)
(require 'agent-codex)
(agent-claude-mode 1)
(agent-codex-mode 1))Run M-x agent-menu for the unified command menu, or bind it directly:
(keymap-global-set "H-e" #'agent-menu)Handoffs keep the source directory by default, but can carry an existing target directory in YAML front matter or through the Lisp and emacsclient APIs. Before-exit skill entries can also require a JSON closeout receipt: only explicit success and no-op results let the chain continue, while failures, missing receipts, and invalid receipts keep the session open. A repeated exit request cannot bypass an active chain.
For a comprehensive description of all user options, commands, and functions, see the manual.