claude-code-tools 0.1.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of claude-code-tools might be problematic. Click here for more details.

@@ -0,0 +1,313 @@
1
+ Metadata-Version: 2.4
2
+ Name: claude-code-tools
3
+ Version: 0.1.8
4
+ Summary: Collection of tools for working with Claude Code
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: click>=8.0.0
7
+ Requires-Dist: fire>=0.5.0
8
+ Requires-Dist: rich>=13.0.0
9
+ Provides-Extra: dev
10
+ Requires-Dist: commitizen>=3.0.0; extra == 'dev'
11
+ Description-Content-Type: text/markdown
12
+
13
+ # claude-code-tools
14
+
15
+ A collection of practical tools, hooks, and utilities for enhancing Claude Code.
16
+
17
+ ## 🎮 tmux-cli: Bridging Claude Code and Interactive CLIs
18
+
19
+ ![tmux-cli demo](demos/tmux-cli-demo-short.gif)
20
+
21
+ Consider these scenarios:
22
+
23
+ You're using Claude Code (CC) to build an interactive script. The script prompts
24
+ for user input, but CC can't respond to prompts.
25
+
26
+ You want Claude Code to debug using pdb, stepping through code line by line.
27
+
28
+ You need CC to launch another Claude Code instance for code review - not as a
29
+ hidden sub-agent, but as a visible session you can monitor (as shown in gif above).
30
+
31
+ **tmux-cli enables these workflows** by giving Claude Code programmatic control
32
+ over terminal applications.
33
+
34
+ For those new to [tmux](https://github.com/tmux/tmux/wiki), it's a terminal
35
+ multiplexer that lets you create and manage multiple terminal sessions. The key
36
+ benefit for our purposes is that tmux is scriptable and allows sending keystrokes
37
+ to specific panes or sessions programmatically.
38
+
39
+ **Important**: You don't need to learn tmux-cli commands. Claude Code will handle
40
+ all the interactions automatically. Just tell CC what you want to do, and it will
41
+ use tmux-cli behind the scenes.
42
+
43
+ **Think Playwright for terminals** - Terminal automation for AI agents.
44
+
45
+ **Works anywhere**: Automatically handles both local tmux panes and remote sessions.
46
+
47
+ ## 🚀 Quick Start
48
+
49
+ ```bash
50
+ # Install all the command-line tools
51
+ uv tool install git+https://github.com/pchalasani/claude-code-tools
52
+ ```
53
+
54
+ This gives you:
55
+ - `tmux-cli` - The interactive CLI controller we just covered
56
+ - `find-claude-session` - Search and resume Claude Code sessions by keywords
57
+ - `vault` - Encrypted backup for your .env files
58
+
59
+ ## 🎮 tmux-cli Deep Dive
60
+
61
+ ### What Claude Code Can Do With tmux-cli
62
+
63
+ 1. **Test Interactive Scripts** - CC can run and interact with scripts that
64
+ require user input, answering prompts automatically based on your instructions.
65
+
66
+ 2. **UI Development & Testing** - CC can launch web servers and coordinate with
67
+ browser automation tools to test your applications.
68
+
69
+ 3. **Interactive Debugging** - CC can use debuggers (pdb, node inspect, gdb) to
70
+ step through code, examine variables, and help you understand program flow.
71
+
72
+ 4. **Claude-to-Claude Communication** - CC can launch another Claude Code instance
73
+ to get specialized help or code reviews.
74
+
75
+ Claude Code knows how to use tmux-cli through its built-in help. You just describe
76
+ what you want, and CC handles the technical details.
77
+
78
+ For complete command reference, see [docs/tmux-cli-instructions.md](docs/tmux-cli-instructions.md).
79
+
80
+ ### Setting up tmux-cli for Claude Code
81
+
82
+ To enable CC to use tmux-cli, add this snippet to your global
83
+ `~/.claude/CLAUDE.md` file:
84
+
85
+ ```markdown
86
+ # tmux-cli Command to interact with CLI applications
87
+
88
+ `tmux-cli` is a bash command that enables Claude Code to control CLI applications
89
+ running in separate tmux panes - launch programs, send input, capture output,
90
+ and manage interactive sessions. Run `tmux-cli --help` for detailed usage
91
+ instructions.
92
+
93
+ Example uses:
94
+ - Interact with a script that waits for user input
95
+ - Launch another Claude Code instance to have it perform some analysis or review or
96
+ debugging etc
97
+ - Run a Python script with the Pdb debugger to step thru its execution, for
98
+ code-understanding and debugging
99
+ - Launch web apps and test them with browser automation MCP tools like Puppeteer
100
+ ```
101
+
102
+ For detailed instructions, see [docs/tmux-cli-instructions.md](docs/tmux-cli-instructions.md).
103
+
104
+ ## 🔍 find-claude-session
105
+
106
+ Search and resume Claude Code sessions by keywords with an interactive UI.
107
+
108
+ ### Setup (Recommended)
109
+
110
+ Add this function to your shell config (.bashrc/.zshrc) for persistent directory
111
+ changes:
112
+
113
+ ```bash
114
+ fcs() { eval "$(find-claude-session --shell "$@" | sed '/^$/d')"; }
115
+ ```
116
+
117
+ Or source the provided function:
118
+ ```bash
119
+ source /path/to/claude-code-tools/scripts/fcs-function.sh
120
+ ```
121
+
122
+ ### Usage
123
+
124
+ ```bash
125
+ # Search in current project
126
+ fcs "keyword1,keyword2,keyword3"
127
+
128
+ # Search across all Claude projects
129
+ fcs "keywords" --global
130
+ fcs "keywords" -g
131
+ ```
132
+
133
+ ### Features
134
+
135
+ - Interactive session selection with previews
136
+ - Cross-project search capabilities
137
+ - Automatic session resumption with `claude -r`
138
+ - Persistent directory changes when resuming cross-project sessions
139
+
140
+ Note: You can also use `find-claude-session` directly, but directory changes
141
+ won't persist after exiting Claude Code.
142
+
143
+ For detailed documentation, see [docs/find-claude-session.md](docs/find-claude-session.md).
144
+
145
+ ## 🔐 vault
146
+
147
+ Centralized encrypted backup for .env files across all your projects using SOPS.
148
+
149
+ ```bash
150
+ vault sync # Smart sync (auto-detect direction)
151
+ vault encrypt # Backup .env to ~/Git/dotenvs/
152
+ vault decrypt # Restore .env from centralized vault
153
+ vault list # Show all project backups
154
+ vault status # Check sync status for current project
155
+ ```
156
+
157
+ ### Key Features
158
+
159
+ - Stores all encrypted .env files in `~/Git/dotenvs/`
160
+ - Automatic sync direction detection
161
+ - GPG encryption via SOPS
162
+ - Timestamped backups for safety
163
+
164
+ For detailed documentation, see [docs/vault-documentation.md](docs/vault-documentation.md).
165
+
166
+ ## 🛡️ Claude Code Safety Hooks
167
+
168
+ This repository includes a comprehensive set of safety hooks that enhance Claude
169
+ Code's behavior and prevent dangerous operations.
170
+
171
+ ### Key Safety Features
172
+
173
+ - **File Deletion Protection** - Blocks `rm` commands, enforces TRASH directory
174
+ pattern
175
+ - **Git Safety** - Prevents dangerous `git add -A`, unsafe checkouts, and
176
+ accidental data loss
177
+ - **Context Management** - Blocks reading files >500 lines to prevent context
178
+ bloat
179
+ - **Command Enhancement** - Enforces ripgrep (`rg`) over grep for better
180
+ performance
181
+
182
+ ### Quick Setup
183
+
184
+ 1. Copy the sample hooks configuration:
185
+ ```bash
186
+ cp hooks/settings.sample.json hooks/settings.json
187
+ export CLAUDE_CODE_TOOLS_PATH=/path/to/claude-code-tools
188
+ ```
189
+
190
+ 2. Reference in your Claude Code settings or use `--hooks` flag:
191
+ ```bash
192
+ claude --hooks /path/to/hooks/settings.json
193
+ ```
194
+
195
+ ### Available Hooks
196
+
197
+ - `bash_hook.py` - Comprehensive bash command safety checks
198
+ - `file_size_conditional_hook.py` - Prevents reading huge files
199
+ - `grep_block_hook.py` - Enforces ripgrep usage
200
+ - `notification_hook.sh` - Sends ntfy.sh notifications
201
+ - `pretask/posttask_subtask_flag.py` - Manages sub-agent state
202
+
203
+ For complete documentation, see [hooks/README.md](hooks/README.md).
204
+
205
+ ## 🤖 Using Claude Code with Open-weight Anthropic API-compatible LLM Providers
206
+
207
+ You can use Claude Code with alternative LLMs served via Anthropic-compatible
208
+ APIs. Add these functions to your shell config (.bashrc/.zshrc):
209
+
210
+ ```bash
211
+ kimi() {
212
+ (
213
+ export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic
214
+ export ANTHROPIC_AUTH_TOKEN=$KIMI_API_KEY
215
+ claude "$@"
216
+ )
217
+ }
218
+
219
+ zai() {
220
+ (
221
+ export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
222
+ export ANTHROPIC_AUTH_TOKEN=$Z_API_KEY
223
+ claude "$@"
224
+ )
225
+ }
226
+ ```
227
+
228
+ After adding these functions:
229
+ - Set your API keys: `export KIMI_API_KEY=your-kimi-key` and
230
+ `export Z_API_KEY=your-z-key`
231
+ - Run `kimi` to use Claude Code with the Kimi K2 LLM
232
+ - Run `zai` to use Claude Code with the GLM-4.5 model
233
+
234
+ The functions use subshells to ensure the environment variables don't affect
235
+ your main shell session, so you could be running multiple instances of Claude Code,
236
+ each using a different LLM.
237
+
238
+ ## 📚 Documentation
239
+
240
+ - [tmux-cli detailed instructions](docs/tmux-cli-instructions.md) -
241
+ Comprehensive guide for using tmux-cli
242
+ - [Claude Code tmux tutorials](docs/claude-code-tmux-tutorials.md) -
243
+ Additional tutorials and examples
244
+ - [Vault documentation](docs/vault-documentation.md) -
245
+ Complete guide for the .env backup system
246
+ - [Hook configuration](hooks/README.md) - Setting up Claude Code hooks
247
+
248
+ ## 📋 Requirements
249
+
250
+ - Python 3.11+
251
+ - uv (for installation)
252
+ - tmux (for tmux-cli functionality)
253
+ - SOPS (for vault functionality)
254
+
255
+ ## 🛠️ Development
256
+
257
+ ### Setup
258
+
259
+ 1. Clone the repository:
260
+ ```bash
261
+ git clone https://github.com/username/claude-code-tools
262
+ cd claude-code-tools
263
+ ```
264
+
265
+ 2. Create and activate a virtual environment with uv:
266
+ ```bash
267
+ uv venv
268
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
269
+ ```
270
+
271
+ 3. Install in development mode:
272
+ ```bash
273
+ make install # Install tools in editable mode
274
+ make dev-install # Install with dev dependencies (includes commitizen)
275
+ ```
276
+
277
+ ### Making Changes
278
+
279
+ - The tools are installed in editable mode, so changes take effect immediately
280
+ - Test your changes by running the commands directly
281
+ - Follow the existing code style and conventions
282
+
283
+ ### Version Management
284
+
285
+ The project uses commitizen for version management:
286
+
287
+ ```bash
288
+ make patch # Bump patch version (0.0.X)
289
+ make minor # Bump minor version (0.X.0)
290
+ make major # Bump major version (X.0.0)
291
+ ```
292
+
293
+ ### Contributing
294
+
295
+ 1. Fork the repository
296
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
297
+ 3. Make your changes
298
+ 4. Test thoroughly
299
+ 5. Commit your changes (commitizen will format the commit message)
300
+ 6. Push to your fork
301
+ 7. Open a Pull Request
302
+
303
+ ### Available Make Commands
304
+
305
+ Run `make help` to see all available commands:
306
+ - `make install` - Install in editable mode for development
307
+ - `make dev-install` - Install with development dependencies
308
+ - `make release` - Bump patch version and install globally
309
+ - `make patch/minor/major` - Version bump commands
310
+
311
+ ## 📄 License
312
+
313
+ MIT
@@ -0,0 +1,8 @@
1
+ claude_code_tools/__init__.py,sha256=6FaZc8_62nPmtB96GLk7xFM5H-gESGyEmc6bh5Ju0Ps,89
2
+ claude_code_tools/dotenv_vault.py,sha256=KPI9NDFu5HE6FfhQUYw6RhdR-miN0ScJHsBg0OVG61k,9617
3
+ claude_code_tools/find_claude_session.py,sha256=k7K-lwHY2aEWEgUw92T_NT3ds6cGql9eq1CKQikig68,21295
4
+ claude_code_tools/tmux_cli_controller.py,sha256=lemoz1UljbXMHQRdP3475K8MEqBS67TiiVqoEJ-dadc,25272
5
+ claude_code_tools-0.1.8.dist-info/METADATA,sha256=_0fiyCKD2E0vOlKKiuDsrzBpXm-V9hbQlWeksU4z6wA,9766
6
+ claude_code_tools-0.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ claude_code_tools-0.1.8.dist-info/entry_points.txt,sha256=yUTZlZ2jteoUZ9bGPvZKI9tjmohPDhRk1fovu5pZACM,181
8
+ claude_code_tools-0.1.8.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ find-claude-session = claude_code_tools.find_claude_session:main
3
+ tmux-cli = claude_code_tools.tmux_cli_controller:main
4
+ vault = claude_code_tools.dotenv_vault:main