I recently returned to Emacs, motivated by CLI-type AI tools like GitHub Copilot CLI.
Copilot CLI supports ACP (Agentic Communication Protocol), which enables communication between AI agents and editors (GitHub official documentation). And agent-shell is an ACP client that runs on Emacs.
agent-shell can be started with M-x agent-shell.
By default, starting agent-shell creates a new session. However, with the following configuration change, you can choose to create a new session or select from past sessions when starting. I’ll introduce this configuration.
Prerequisites
$ emacs --version
GNU Emacs 30.2
Development version 636f166cfc86 on HEAD branch; build date 2025-12-14.
Copyright (C) 2025 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
This article assumes the use of Copilot CLI.
$ copilot --version
GitHub Copilot CLI 0.0.420.
Run 'copilot update' to check for updates.
After starting Emacs, the result of running M-x agent-shell-version is as follows:
agent-shell v0.43.1
Method
Set the value of agent-shell-session-strategy to prompt.
Here is an example configuration in init.el:
(use-package agent-shell
:custom
(agent-shell-session-strategy 'prompt)
:ensure t)
With this configuration, you can create a new session or select from history in the minibuffer. Selecting a new session behaves the same as the default behavior, but selecting a past session allows you to resume work in that session’s context. This enables you to efficiently manage multiple different projects and tasks.
Note: The review and translation were assisted by an AI generative model. The author is responsible for the final content.