https://github.com/edo1z/claude-cli.nvim
Neovim plugin for seamless Claude Code CLI integration - AI-powered coding assistant in your editor
https://github.com/edo1z/claude-cli.nvim
claude-code nvim nvim-plugin
Last synced: 2 months ago
JSON representation
Neovim plugin for seamless Claude Code CLI integration - AI-powered coding assistant in your editor
- Host: GitHub
- URL: https://github.com/edo1z/claude-cli.nvim
- Owner: edo1z
- License: mit
- Created: 2025-06-24T17:16:08.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-06T05:38:08.000Z (3 months ago)
- Last Synced: 2025-07-06T06:37:25.642Z (3 months ago)
- Topics: claude-code, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 69.3 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# claude-cli.nvim
Seamlessly integrate Claude Code CLI into your Neovim workflow with multi-instance management.
*Read this in other languages: [ๆฅๆฌ่ช](README.ja.md)*
https://github.com/user-attachments/assets/7a96fad4-ade7-4a7a-88b4-d7cb8a96f84a
## Features
- ๐ค **Embedded Claude Code Terminal** - Run Claude Code directly in Neovim
- ๐ **Smart Prompt Builder** - Compose prompts with snippets and history
- ๐ **Context Awareness** - Send file paths, errors, and code selections
- โก **Quick Actions** - Fast keybindings for common tasks
- ๐พ **Persistent Storage** - Save snippets and command history
- ๐ **Auto-reload Files** - Automatically updates files modified by Claude Code
- ๐ **Session Continuation** - Continue from the last Claude Code session
- ๐ฏ **Multi-Instance Manager** - Manage up to 30 Claude Code instances simultaneously## Requirements
- Neovim >= 0.8.0
- [Claude Code CLI](https://claude.ai/code) installed and configured
- tmux (for multi-instance manager)## Installation
### Using [lazy.nvim](https://github.com/folke/lazy.nvim) (Recommended)
```lua
{
'edo1z/claude-cli.nvim',
config = function()
require('claude-cli').setup()
end,
}
```### Using [vim-plug](https://github.com/junegunn/vim-plug)
```vim
Plug 'edo1z/claude-cli.nvim'
```### Using [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
use 'edo1z/claude-cli.nvim'
```## Quick Start
### Basic Usage
1. Start new Claude Code session: `cc` (or `cd` for dangerous mode)
2. Continue from last session: `cC` (or `cD` for dangerous mode)
3. Open instance manager: `cm`### Multi-Instance Manager
1. Open instance manager: `cm`
2. Add new instance: press `a` in the list view
3. Open specific instance: press `o` on any instance
4. Delete instance: press `d` on selected instance### Send Context to Claude
- Open prompt builder: `ca`
- Send current error: `ce`
- Send file path: `cp`
- Send selection: `cs` (visual mode)## Multi-Instance Manager
The multi-instance manager allows you to run multiple Claude Code sessions simultaneously:
### Key Features
- **Dynamic Management**: Start with 0 instances, add up to 30 as needed
- **tmux Integration**: Each instance runs in a separate tmux session
- **Process Isolation**: Instances are namespaced by Neovim process ID
- **Launch Options**: Choose from normal, continue (-c), and dangerous modes### List View Keybindings
| Key | Action |
|-----|--------|
| `a` | Add new instance with options |
| `d` | Delete current instance (with confirmation) |
| `o` | Open instance in individual window |
| `r` | Restart instance |
| `q` | Close list view |
| `?` | Show help |
| `` | Exit terminal mode |### Commands
- `:ClaudeManagerToggle` - Toggle instance list view
- `:ClaudeManagerShow` - Show instance list
- `:ClaudeManagerHide` - Hide instance list
- `:ClaudeManagerOpen [name]` - Open specific instance## Prompt Builder
The prompt builder (`ca`) provides powerful prompt composition:
| Key | Action |
|-----|--------|
| `Ctrl+s` | Send to active Claude instance |
| `Ctrl+l` | Show snippets |
| `Ctrl+h` | Show history |
| `Ctrl+c` | Create snippet |
| `Esc` | Close prompt |## Configuration
```lua
require('claude-cli').setup({
keymaps = {
-- Basic keymaps
toggle = "cc",
toggle_dangerous = "cd",
continue_session = "cC",
continue_session_dangerous = "cD",
-- Context actions
send_path = "cp",
send_error = "ce",
send_selection = "cs",
open_prompt = "ca",
-- Multi-instance manager
manager_toggle = "cm",
},
window = {
position = "right", -- right, left, bottom, top
size = 0.4, -- 40% of screen
},
snippets = {
-- Default snippets
Refactor = "ใใฎใณใผใใใชใใกใฏใฟใชใณใฐใใฆใใใ่ชญใฟใใใใใฆใใ ใใ:\n",
Explain = "ใใฎใณใผใใฎๅไฝใๆฅๆฌ่ชใง่ชฌๆใใฆใใ ใใ:\n",
FixError = "ไปฅไธใฎใจใฉใผใไฟฎๆญฃใใฆใใ ใใ:\n",
AddTests = "ใใฎใณใผใใซๅฏพใใใในใใไฝๆใใฆใใ ใใ:\n",
Optimize = "ใใฎใณใผใใฎใใใฉใผใใณในใๆ้ฉๅใใฆใใ ใใ:\n",
}
})
```## Commands
### Basic Commands
- `:ClaudeCode` - Start new Claude Code session
- `:ClaudeCodeDangerous` - Start with dangerous mode
- `:ClaudeCodeContinue` - Continue last session
- `:ClaudePrompt` - Open prompt builder### Multi-Instance Manager
- `:ClaudeManagerToggle` - Toggle instance list
- `:ClaudeManagerShow` - Show instance list
- `:ClaudeManagerHide` - Hide instance list
- `:ClaudeManagerOpen` - Open specific instance## Tips
1. **Active Instance**: When using multi-instance manager, `ca` sends to the active instance
2. **Quick Switch**: Use `cm` to quickly switch between instances
3. **Terminal Navigation**: Use `Ctrl+q` to exit terminal mode in instance list
4. **Auto-reload**: Files modified by Claude are automatically reloaded
5. **Process Isolation**: Each Neovim process has its own set of Claude instances## License
MIT License - see [LICENSE](LICENSE) file for details.
## Contributing
Issues and PRs are welcome!
## Acknowledgments
Built for use with [Claude Code](https://claude.ai/code) by Anthropic.