You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add ClaudeCodeTreeAdd command for tree integration
- Add integrations.lua module to handle nvim-tree and neo-tree file selection
- Add ClaudeCodeTreeAdd command to send file at_mentions from tree explorers
- Support both single file selection and multi-file selection
- Update README with tree integration documentation and lazy.nvim keybinding setup
- Implement context-aware <leader>as keybinding behavior
Co-authored-by: ThomasK33 <[email protected]>
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode="v", desc="Send to Claude" },
54
+
-- Add file from nvim-tree or neo-tree
55
+
{ "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>", desc="Add file to Claude context", ft= { "NvimTree", "neo-tree" } },
54
56
},
55
57
}
56
58
```
@@ -60,13 +62,35 @@ That's it! For more configuration options, see [Advanced Setup](#advanced-setup)
60
62
## Usage
61
63
62
64
1.**Launch Claude**: Run `:ClaudeCode` to open Claude in a split terminal
63
-
2.**Send context**: Select text and run `:'<,'>ClaudeCodeSend` to send it to Claude
65
+
2.**Send context**:
66
+
- Select text in visual mode and use `<leader>as` to send it to Claude
67
+
- In `nvim-tree` or `neo-tree`, press `<leader>as` on a file to add it to Claude's context
64
68
3.**Let Claude work**: Claude can now:
65
69
- See your current file and selections in real-time
66
70
- Open files in your editor
67
71
- Show diffs with proposed changes
68
72
- Access diagnostics and workspace info
69
73
74
+
## Commands
75
+
76
+
-`:ClaudeCode` - Toggle the Claude Code terminal window
77
+
-`:ClaudeCodeSend` - Send current visual selection to Claude
78
+
-`:ClaudeCodeTreeAdd` - Add selected file(s) from tree explorer to Claude context
79
+
80
+
### Tree Integration
81
+
82
+
The `<leader>as` keybinding has context-aware behavior:
83
+
-**In normal buffers (visual mode)**: Sends selected text to Claude
84
+
-**In nvim-tree/neo-tree buffers**: Adds the file under cursor (or selected files) to Claude's context
85
+
86
+
This allows you to quickly add entire files to Claude's context for review, refactoring, or discussion.
87
+
88
+
#### Features:
89
+
-**Single file**: Place cursor on any file and press `<leader>as`
90
+
-**Multiple files**: Select multiple files (using tree plugin's selection features) and press `<leader>as`
91
+
-**Smart detection**: Automatically detects whether you're in nvim-tree or neo-tree
92
+
-**Error handling**: Clear feedback if no files are selected or if tree plugins aren't available
93
+
70
94
## How It Works
71
95
72
96
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.
0 commit comments