Skip to content

Commit e28a7d9

Browse files
author
Snir Turgeman
committed
docs: add fork features section and recommended configuration
- Add "Fork Features" section highlighting multi-session support and visual tab bar features unique to this fork - Add "Recommended Configuration" with practical floating window setup - Update all repo references from coder/claudecode.nvim to snirt/claudecode.nvim - Add multi-session keymaps to installation example - Update CHANGELOG with new features and bug fixes
1 parent 9c74f95 commit e28a7d9

2 files changed

Lines changed: 177 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Features
66

7+
- Multi-session terminal support with `:ClaudeCodeNew`, `:ClaudeCodeSessions`, `:ClaudeCodeSwitch`, `:ClaudeCodeCloseSession` commands
8+
- Tab bar UI with mouse support for session management (`terminal.tabs.*` configuration)
9+
- Smart ESC handling - double-tap ESC to exit terminal mode (`esc_timeout`, `keymaps.exit_terminal`)
710
- External terminal provider to run Claude in a separate terminal ([#102](https://github.com/coder/claudecode.nvim/pull/102))
811
- Terminal provider APIs: implement `ensure_visible` for reliability ([#103](https://github.com/coder/claudecode.nvim/pull/103))
912
- Working directory control for Claude terminal ([#117](https://github.com/coder/claudecode.nvim/pull/117))
@@ -32,6 +35,10 @@
3235

3336
### Bug Fixes
3437

38+
- Preserve terminal window size across session operations
39+
- Keep terminal window open when session exits with other sessions available
40+
- Fix cursor position when switching terminal sessions
41+
- Send selection updates on BufEnter event
3542
- Wrap ERROR/WARN logging in `vim.schedule` to avoid fast-event context errors ([#54](https://github.com/coder/claudecode.nvim/pull/54))
3643
- Native terminal: do not wipe Claude buffer on window close ([#60](https://github.com/coder/claudecode.nvim/pull/60))
3744
- Native terminal: respect `auto_close` behavior ([#63](https://github.com/coder/claudecode.nvim/pull/63))

README.md

Lines changed: 170 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# claudecode.nvim
22

3-
[![Tests](https://github.com/coder/claudecode.nvim/actions/workflows/test.yml/badge.svg)](https://github.com/coder/claudecode.nvim/actions/workflows/test.yml)
3+
[![Tests](https://github.com/snirt/claudecode.nvim/actions/workflows/test.yml/badge.svg)](https://github.com/snirt/claudecode.nvim/actions/workflows/test.yml)
44
![Neovim version](https://img.shields.io/badge/Neovim-0.8%2B-green)
55
![Status](https://img.shields.io/badge/Status-beta-blue)
66

@@ -20,11 +20,54 @@ When Anthropic released Claude Code, they only supported VS Code and JetBrains.
2020
-**First to Market** — Beat Anthropic to releasing Neovim support
2121
- 🛠️ **Built with AI** — Used Claude to reverse-engineer Claude's own protocol
2222

23+
## Fork Features
24+
25+
This fork adds features not available in the original [coder/claudecode.nvim](https://github.com/coder/claudecode.nvim):
26+
27+
### Multi-Session Support
28+
29+
Run multiple Claude Code sessions simultaneously, each with isolated state:
30+
31+
- **Independent sessions** — Each session has its own terminal, WebSocket connection, and context
32+
- **Easy switching** — Use `:ClaudeCodeSessions` for a picker or `:ClaudeCodeSwitch 2` to switch directly
33+
- **Session lifecycle** — Create with `:ClaudeCodeNew`, close with `:ClaudeCodeCloseSession`
34+
35+
Perfect for working on multiple features, comparing approaches, or keeping separate contexts for different parts of a project.
36+
37+
### Visual Tab Bar
38+
39+
A clickable tab bar for managing sessions visually:
40+
41+
```
42+
┌─────────────────────────────────────────────────────┐
43+
│ [1*] ✕ | [2] ✕ | [3] ✕ | [+] │
44+
├─────────────────────────────────────────────────────┤
45+
│ │
46+
│ Claude Code Terminal │
47+
│ │
48+
└─────────────────────────────────────────────────────┘
49+
```
50+
51+
- **Mouse support** — Click tabs to switch, click ✕ to close, click + for new session
52+
- **Keyboard navigation**`Alt+Tab` / `Alt+Shift+Tab` to cycle sessions
53+
- **Active indicator** — Current session marked with `*`
54+
55+
Enable with:
56+
57+
```lua
58+
terminal = {
59+
tabs = {
60+
enabled = true,
61+
mouse_enabled = true,
62+
},
63+
}
64+
```
65+
2366
## Installation
2467

2568
```lua
2669
{
27-
"coder/claudecode.nvim",
70+
"snirt/claudecode.nvim",
2871
dependencies = { "folke/snacks.nvim" },
2972
config = true,
3073
keys = {
@@ -45,6 +88,9 @@ When Anthropic released Claude Code, they only supported VS Code and JetBrains.
4588
-- Diff management
4689
{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
4790
{ "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
91+
-- Multi-session management
92+
{ "<leader>an", "<cmd>ClaudeCodeNew<cr>", desc = "New Claude session" },
93+
{ "<leader>al", "<cmd>ClaudeCodeSessions<cr>", desc = "List Claude sessions" },
4894
},
4995
}
5096
```
@@ -90,7 +136,7 @@ If you have a local installation, configure the plugin with the direct path:
90136

91137
```lua
92138
{
93-
"coder/claudecode.nvim",
139+
"snirt/claudecode.nvim",
94140
dependencies = { "folke/snacks.nvim" },
95141
opts = {
96142
terminal_cmd = "~/.claude/local/claude", -- Point to local installation
@@ -147,7 +193,7 @@ Configure the plugin with the detected path:
147193

148194
```lua
149195
{
150-
"coder/claudecode.nvim",
196+
"snirt/claudecode.nvim",
151197
dependencies = { "folke/snacks.nvim" },
152198
opts = {
153199
terminal_cmd = "/path/to/your/claude", -- Use output from 'which claude'
@@ -163,6 +209,52 @@ Configure the plugin with the detected path:
163209

164210
> **Note**: If Claude Code was installed globally via npm, you can use the default configuration without specifying `terminal_cmd`.
165211
212+
## Recommended Configuration
213+
214+
A practical configuration with the most useful options:
215+
216+
```lua
217+
{
218+
"snirt/claudecode.nvim",
219+
dependencies = { "folke/snacks.nvim" },
220+
opts = {
221+
-- Terminal as floating window (recommended)
222+
terminal = {
223+
provider = "snacks",
224+
split_side = "right",
225+
split_width_percentage = 0.30,
226+
snacks_win_opts = {
227+
style = "float",
228+
width = 0.8,
229+
height = 0.8,
230+
border = "rounded",
231+
},
232+
-- Tab bar for multiple sessions
233+
tabs = {
234+
enabled = true,
235+
mouse_enabled = true,
236+
},
237+
},
238+
-- Diff behavior
239+
diff_opts = {
240+
auto_close_on_accept = true,
241+
},
242+
},
243+
keys = {
244+
{ "<leader>a", group = "Claude" },
245+
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
246+
{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
247+
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send selection" },
248+
{ "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>", desc = "Add file", ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" } },
249+
{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
250+
{ "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
251+
-- Multi-session
252+
{ "<leader>an", "<cmd>ClaudeCodeNew<cr>", desc = "New session" },
253+
{ "<leader>al", "<cmd>ClaudeCodeSessions<cr>", desc = "List sessions" },
254+
},
255+
}
256+
```
257+
166258
## Quick Demo
167259

168260
```vim
@@ -199,6 +291,13 @@ Configure the plugin with the detected path:
199291
- `:ClaudeCodeDiffAccept` - Accept diff changes
200292
- `:ClaudeCodeDiffDeny` - Reject diff changes
201293

294+
**Multi-Session Commands:**
295+
296+
- `:ClaudeCodeNew` - Create a new Claude terminal session
297+
- `:ClaudeCodeSessions` - Show session picker (fzf-lua if available)
298+
- `:ClaudeCodeSwitch <number>` - Switch to session by number
299+
- `:ClaudeCodeCloseSession [number]` - Close a session (active session if no number)
300+
202301
## Working with Diffs
203302

204303
When Claude proposes changes, the plugin opens a native Neovim diff view:
@@ -208,6 +307,41 @@ When Claude proposes changes, the plugin opens a native Neovim diff view:
208307

209308
You can edit Claude's suggestions before accepting them.
210309

310+
## Multi-Session Support
311+
312+
Run multiple Claude Code sessions simultaneously:
313+
314+
- **Create sessions**: `:ClaudeCodeNew` opens a new terminal session
315+
- **Switch sessions**: Use `:ClaudeCodeSessions` to pick from a list, or `:ClaudeCodeSwitch 2` to switch directly
316+
- **Close sessions**: `:ClaudeCodeCloseSession` closes the active session, or `:ClaudeCodeCloseSession 2` to close a specific one
317+
318+
Each session has isolated:
319+
320+
- Terminal buffer and process
321+
- WebSocket client connection
322+
- Selection tracking context
323+
- @ mention queue
324+
325+
### Tab Bar for Sessions
326+
327+
Enable a visual tab bar for managing multiple sessions:
328+
329+
```lua
330+
terminal = {
331+
tabs = {
332+
enabled = true,
333+
mouse_enabled = true, -- Click tabs to switch, middle-click to close
334+
},
335+
}
336+
```
337+
338+
The tab bar shows:
339+
340+
- Numbered tabs for each session (active marked with `*`)
341+
- Close button (x) on each tab
342+
- New session button (+)
343+
- Supports keyboard navigation (Alt+Tab, Alt+Shift+Tab) and mouse interactions
344+
211345
## How It Works
212346

213347
This plugin creates a WebSocket server that Claude Code CLI connects to, implementing the same protocol as the official VS Code extension. When you launch Claude, it automatically detects Neovim and gains full access to your editor.
@@ -238,7 +372,7 @@ For deep technical details, see [ARCHITECTURE.md](./ARCHITECTURE.md).
238372

239373
```lua
240374
{
241-
"coder/claudecode.nvim",
375+
"snirt/claudecode.nvim",
242376
dependencies = { "folke/snacks.nvim" },
243377
opts = {
244378
-- Server Configuration
@@ -265,6 +399,31 @@ For deep technical details, see [ARCHITECTURE.md](./ARCHITECTURE.md).
265399
auto_close = true,
266400
snacks_win_opts = {}, -- Opts to pass to `Snacks.terminal.open()` - see Floating Window section below
267401

402+
-- Smart ESC handling: double-tap ESC to exit terminal mode
403+
esc_timeout = 200, -- Timeout in ms (0 or nil to disable smart ESC)
404+
405+
-- Terminal keymaps
406+
keymaps = {
407+
exit_terminal = "<Esc><Esc>", -- Key to exit terminal mode (set to false to disable)
408+
},
409+
410+
-- Tab bar for multi-session management
411+
tabs = {
412+
enabled = false, -- Enable tab bar (default: false)
413+
height = 1, -- Height in lines
414+
show_close_button = true, -- Show [x] close button on tabs
415+
show_new_button = true, -- Show [+] button for new session
416+
separator = " | ", -- Separator between tabs
417+
active_indicator = "*", -- Indicator for active tab
418+
mouse_enabled = false, -- Enable mouse clicks on tabs
419+
keymaps = {
420+
next_tab = "<A-Tab>", -- Switch to next session
421+
prev_tab = "<A-S-Tab>", -- Switch to previous session
422+
close_tab = "<A-w>", -- Close current session
423+
new_tab = "<A-+>", -- Create new session
424+
},
425+
},
426+
268427
-- Provider-specific options
269428
provider_opts = {
270429
-- Command for external terminal provider. Can be:
@@ -332,7 +491,7 @@ The `snacks_win_opts` configuration allows you to create floating Claude Code te
332491
local toggle_key = "<C-,>"
333492
return {
334493
{
335-
"coder/claudecode.nvim",
494+
"snirt/claudecode.nvim",
336495
dependencies = { "folke/snacks.nvim" },
337496
keys = {
338497
{ toggle_key, "<cmd>ClaudeCodeFocus<cr>", desc = "Claude Code", mode = { "n", "x" } },
@@ -369,7 +528,7 @@ return {
369528
local toggle_key = "<M-,>" -- Alt/Meta + comma
370529
return {
371530
{
372-
"coder/claudecode.nvim",
531+
"snirt/claudecode.nvim",
373532
dependencies = { "folke/snacks.nvim" },
374533
keys = {
375534
{ toggle_key, "<cmd>ClaudeCodeFocus<cr>", desc = "Claude Code", mode = { "n", "x" } },
@@ -421,7 +580,7 @@ require("claudecode").setup({
421580

422581
```lua
423582
{
424-
"coder/claudecode.nvim",
583+
"snirt/claudecode.nvim",
425584
dependencies = { "folke/snacks.nvim" },
426585
keys = {
427586
{ "<C-,>", "<cmd>ClaudeCodeFocus<cr>", desc = "Claude Code (Ctrl+,)", mode = { "n", "x" } },
@@ -496,7 +655,7 @@ You have to take care of launching CC and connecting it to the IDE yourself. (e.
496655

497656
```lua
498657
{
499-
"coder/claudecode.nvim",
658+
"snirt/claudecode.nvim",
500659
opts = {
501660
terminal = {
502661
provider = "none", -- no UI actions; server + tools remain available
@@ -517,7 +676,7 @@ Run Claude Code in a separate terminal application outside of Neovim:
517676
```lua
518677
-- Using a string template (simple)
519678
{
520-
"coder/claudecode.nvim",
679+
"snirt/claudecode.nvim",
521680
opts = {
522681
terminal = {
523682
provider = "external",
@@ -531,7 +690,7 @@ Run Claude Code in a separate terminal application outside of Neovim:
531690

532691
-- Using a function for dynamic command generation (advanced)
533692
{
534-
"coder/claudecode.nvim",
693+
"snirt/claudecode.nvim",
535694
opts = {
536695
terminal = {
537696
provider = "external",

0 commit comments

Comments
 (0)