start codecompanion chats and CLI agents in auto mode

Claude Code and Antigravity chats open in the agent's own auto mode,
with CodeCompanion's approval mode on auto too. The CLI terminals run
`claude --permission-mode auto` and `agy --mode auto`. Inline stays as
is: it never prompts, and the agent's permission requests are what keep
it editing only the buffer copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jannikdonkerandClaude Opus 5.5 committed 2026-11-17 17:26:13 +01:00
1 parent e4e7b6621e
commit fb8cdc0e1c
1 file changed
+23 -5
+23 -5
View File
@@ -97,16 +97,25 @@ require("codecompanion").setup({
-- List only the two agents below in the adapter picker.
opts = { show_presets = false },
-- Chat agents start in their own auto mode: the agent approves
-- routine actions itself and only asks about risky ones.
-- (Claude falls back to its default if a model lacks auto.)
claude_code = function()
return acp.extend("claude_code", {})
return acp.extend("claude_code", {
defaults = { session_config_options = { mode = "auto" } },
})
end,
antigravity = function() return antigravity("antigravity") end,
antigravity = function() return antigravity("antigravity", { mode = "auto" }) end,
-- Inline edits: Gemini 4 Hydrogen at high effort. A separate
-- adapter because inline can only pin a model, not effort, and
-- setting effort on `antigravity` would change chats too. Hidden
-- from the `ga` picker below.
-- from the `ga` picker below. No auto mode here on purpose:
-- inline never prompts you anyway (CodeCompanion answers the
-- agent's permission requests itself), and those requests are
-- how it keeps the agent to editing only the buffer copy. An
-- agent in auto mode would skip them.
antigravity_inline = function()
return antigravity("antigravity_inline", {
model = "gemini-4-hydrogen",
@@ -122,6 +131,11 @@ require("codecompanion").setup({
interactions = {
chat = {
adapter = "claude_code",
-- CodeCompanion's own approval layer (`gty` to change per chat).
-- Auto: the agent's reads, searches, edits and fetches go through;
-- shell commands outside tools.run_command.opts.safe_commands
-- (git status, ls, pwd) and anything else (e.g. deletes) still ask.
tools = { opts = { approval_mode = "auto" } },
keymaps = {
-- `ga` already switches agent + model; `ge` (normally "end of
-- previous word", only overridden in the chat buffer) switches
@@ -149,8 +163,12 @@ require("codecompanion").setup({
cli = {
agent = "claude_code",
agents = {
claude_code = { cmd = "claude", args = {}, description = "Claude Code CLI" },
antigravity = { cmd = "agy", args = {}, description = "Antigravity CLI" },
claude_code = {
cmd = "claude", -- must stay "claude" for :CodeCompanionCLI Install hooks
args = { "--permission-mode", "auto" },
description = "Claude Code CLI",
},
antigravity = { cmd = "agy", args = { "--mode", "auto" }, description = "Antigravity CLI" },
},
},
},