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
refactor: extract broadcast functions and add ClaudeCodeAdd command
- Extract broadcast_at_mention() for single file broadcasts
- Extract add_paths_to_claude() for batch operations with optional delays
- Refactor all existing handlers to use centralized functions
- Add ClaudeCodeAdd <file-path> command for direct file addition
- Remove verbose comments that describe "what" instead of "why"
- Add comprehensive documentation to README with examples
- Add 13 test cases covering command registration, validation, and functionality
- Maintain all existing functionality and test compatibility (164 tests passing)
Change-Id: I171dbc0bcc82d72c5c9a4f3d891a71fc3c814dbc
Signed-off-by: Thomas Kosiewski <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,7 @@ That's it! For more configuration options, see [Advanced Setup](#advanced-setup)
81
81
-`:ClaudeCode` - Toggle the Claude Code terminal window
82
82
-`:ClaudeCodeSend` - Send current visual selection to Claude, or add files from tree explorer
83
83
-`:ClaudeCodeTreeAdd` - Add selected file(s) from tree explorer to Claude context (also available via ClaudeCodeSend)
84
+
-`:ClaudeCodeAdd <file-path>` - Add a specific file or directory to Claude context by path
84
85
85
86
### Tree Integration
86
87
@@ -98,6 +99,39 @@ This allows you to quickly add entire files to Claude's context for review, refa
98
99
-**Smart detection**: Automatically detects whether you're in nvim-tree or neo-tree
99
100
-**Error handling**: Clear feedback if no files are selected or if tree plugins aren't available
100
101
102
+
### Direct File Addition
103
+
104
+
The `:ClaudeCodeAdd` command allows you to add files or directories directly by path:
105
+
106
+
```vim
107
+
:ClaudeCodeAdd src/main.lua
108
+
:ClaudeCodeAdd ~/projects/myproject/
109
+
:ClaudeCodeAdd ./README.md
110
+
```
111
+
112
+
#### Features
113
+
114
+
-**Path completion**: Tab completion for file and directory paths
115
+
-**Path expansion**: Supports `~` for home directory and relative paths
116
+
-**Validation**: Checks that files and directories exist before adding
117
+
-**Flexible**: Works with both individual files and entire directories
118
+
119
+
#### Examples
120
+
121
+
```vim
122
+
" Add a specific file
123
+
:ClaudeCodeAdd src/components/Header.tsx
124
+
125
+
" Add an entire directory
126
+
:ClaudeCodeAdd tests/
127
+
128
+
" Add file in home directory
129
+
:ClaudeCodeAdd ~/.config/nvim/init.lua
130
+
131
+
" Add relative path
132
+
:ClaudeCodeAdd ../other-project/package.json
133
+
```
134
+
101
135
## How It Works
102
136
103
137
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