# Run Claude Code (or any AI agent) inside your terminal editor

> Run Claude Code, Gemini CLI, Codex or opencode next to your code in the terminal - with tmux, Neovim's :terminal, or an editor that speaks ACP like Skink.

Source: https://skink.cc/articles/run-claude-code-next-to-your-editor/

There are two ways to run Claude Code (or Gemini CLI, Codex, opencode and others) next to your editor in the terminal. The simple way is to run the agent's CLI in a split beside the editor: a tmux pane, a Neovim `:terminal`, or a terminal tab.

The integrated way is an editor that talks to the agent over the Agent Client Protocol (ACP). Then you can send it the selection or the errors, and review its edits as diffs before they are saved. Skink does both.

## Option 1: a tmux split

```sh
tmux new -s work
# left pane: your editor
nvim .
# split: Ctrl-b %   then in the right pane:
claude
```

This works with any editor and any agent.

The downside: the agent edits files on disk behind your editor's back. Most editors notice and reload, but you review changes with `git diff`, not in the editor, and you copy errors or code into the agent by hand.

## Option 2: a Neovim or Vim terminal

```vim
:vsplit | terminal claude
```

In Neovim, press Ctrl+\\ Ctrl+N to leave terminal mode and move between windows. Set `autoread` (on by default in Neovim) and run `:checktime` so buffers pick up the agent's changes.

Plugins exist that wire agents into Neovim more deeply, including over ACP. They vary in what they support.

## Option 3: an editor with an ACP client

The Agent Client Protocol is an open protocol, introduced by Zed, for editors to talk to coding agents. With it, the editor:

- starts the agent as a background process,
- sends it prompts with context,
- shows its tool calls and asks you about its permission requests,
- receives its file edits as proposals.

Skink is an ACP client. It supports Claude Code (through claude-code-acp, or your installed `claude` via npx, which reuses its login), Gemini CLI, opencode, Goose, Antigravity and Codex. By default (`"ai.agent": "auto"`) it picks Claude Code first, then the others in that order.

### Run the CLI in a Skink terminal tab

The quickest start, with no config:

1. Open your project:

   ```sh
   skink .
   ```

2. Press Ctrl+E and type `term claude` (or `term gemini`, `term codex`), then Enter.

3. The agent runs in a real terminal emulator in a tab, so its UI works unchanged.

From there:

- F12 flips between your file and the terminal.
- Alt+T shows a shell docked along the bottom.
- Ctrl+click on a `file:line` in the agent's output opens that spot.

With `EDITOR=skink` set, Ctrl+G in Claude Code opens your prompt as a tab of the same Skink. See [Use Skink as your $EDITOR](https://skink.cc/tools/skink-as-editor/).

### Use the agent panel

Alt+Shift+A opens the agent panel, or run `:agent your message`. It shows the chat, tool calls and the agent's plan.

Ctrl+G in the panel types a message, with context chips:

- `@file` (fuzzy, Tab completes), `@selection`, `@diagnostics`, `@terminal` (the screen of the last terminal tab)
- `#rule` from `AGENTS.md` / `AGENT.md` (found walking up from the file) and `.skink/rules/*.md`

Files the agent writes are **staged, not written**. When its turn ends they open in the refactor preview, with a checkbox per file and hunk and a side-by-side diff. Space toggles, Enter applies. Permission requests show as a dialog.

### Ask for an edit inline

Select some code and press Ctrl+G (or type `:ask`). Type what you want; Enter sends. Shift+Tab switches mode: rewrite, implement, ask or search.

For rewrite and implement, the answer shows as a diff in the file itself:

| Key | Does |
|---|---|
| y | Accept the change |
| n | Reject the change |
| Enter | Apply |
| Esc | Discard |

Applying is one undo step.

### Send it your errors

Alt+Shift+E (or `:senderrors`) sends errors to the agent. In a terminal tab that is the last command and its output; elsewhere, the errors and warnings of your open files.

If Alt chords do not reach Skink in your terminal, every key also has a typed command: see [typed commands](https://skink.cc/editing/typed-commands/).

## Configure the agent, model and effort

In `~/.config/skink/settings.json` (open it with `:settings`):

```json
{
  "ai.agent": "claude",
  "ai.model": "default",
  "ai.effort": "medium",
  "ai.model.rewrite": "default"
}
```

`ai.agent` also takes `"gemini"`, `"opencode"`, `"goose"`, `"antigravity"`, `"codex"`, or a custom command such as `["my-agent", "--acp"]`.

Saving a change runs a one-line test chat in a throwaway folder and reports whether the agent works. `:agents` lists supported agents and which are installed; `:agents check` runs the test again.

**Note:**
Skink does not include an agent or a model. You need the agent installed and logged in (for Claude Code, run `claude` once). Missing ACP adapters are run through `npx` when possible, which needs Node.js.

## Over SSH

All of this runs on the machine where Skink runs. SSH into your server, start Skink there, and the agent works on the server's files with the server's tools.

Copying in Skink, and OSC 52 copy requests from programs in its terminal tabs, reach your local clipboard.

## Try it

```sh
curl -fsSL https://skink.cc/install.sh | sh
skink .
```

Full setup: [AI agents guide](https://skink.cc/tools/ai-agents/) and [terminal tabs](https://skink.cc/tools/terminal-tabs/). Compared with Zed's agent support: [Skink vs Zed](https://skink.cc/compare/zed/).
