@unitsvc/cc-helper 1.0.15 → 1.0.17

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.
Files changed (3) hide show
  1. package/README-zh.md +141 -36
  2. package/README.md +141 -24
  3. package/package.json +2 -4
package/README-zh.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [**English**](./README.md) | **简体中文**
8
8
 
9
- > ⚡ 一键启用 Claude Code CLI 的隐藏功能:`/loop` 和 `/btw`
9
+ > ⚡ 一键启用 Claude Code CLI 的隐藏功能:`/loop`、`/btw`、`/keybindings`、`/context1m` 和 `MCPSearch`
10
10
 
11
11
  ## 环境要求
12
12
 
@@ -14,15 +14,22 @@
14
14
  - Claude Code v2.1.71+
15
15
 
16
16
  ```bash
17
- npm install -g @anthropic-ai/claude-code@v2.1.71
17
+ npm install -g @anthropic-ai/claude-code@v2.1.76
18
18
  ```
19
19
 
20
20
  ## 使用方法
21
21
 
22
22
  ```bash
23
- # 启用所有功能(默认)
23
+ # 启用默认功能(/loop, /btw, /keybindings)
24
24
  npx @unitsvc/cc-helper enable
25
25
 
26
+ # 启用特定功能
27
+ npx @unitsvc/cc-helper enable loop
28
+ npx @unitsvc/cc-helper enable btw
29
+ npx @unitsvc/cc-helper enable keybindings
30
+ npx @unitsvc/cc-helper enable toolsearch
31
+ npx @unitsvc/cc-helper enable context1m # 别名: 1m, 1M
32
+
26
33
  # 查看状态
27
34
  npx @unitsvc/cc-helper status
28
35
 
@@ -30,40 +37,18 @@ npx @unitsvc/cc-helper status
30
37
  npx @unitsvc/cc-helper disable
31
38
  ```
32
39
 
33
- ### 代理支持
34
-
35
- 如果下载失败,使用 `--proxy` 参数:
36
-
37
- ```bash
38
- # 使用默认代理 (https://edgeone.gh-proxy.org)
39
- npx @unitsvc/cc-helper --proxy enable
40
-
41
- # 使用自定义代理
42
- npx @unitsvc/cc-helper --proxy https://your-proxy.com enable
43
- ```
44
-
45
40
  ### 命令说明
46
41
 
47
- | 命令 | 说明 |
48
- | --------- | ----------------------- |
49
- | `enable` | 启用 `/loop` 和 `/btw` 功能 |
50
- | `disable` | 恢复原始状态 |
51
- | `status` | 查看当前状态 |
52
-
53
- ## 赞助
54
-
55
- <table>
56
- <tr>
57
- <td width="60" valign="middle">
58
- <img src="https://img.shields.io/badge/🚀-GLM-blue?style=for-the-badge" alt="GLM"/>
59
- </td>
60
- <td valign="middle">
61
- <b>GLM Coding Plan</b><br/>
62
- <sub>Full support for <b>Claude Code</b>, <b>Cline</b>, and <b>20+ top coding tools</b> — starting at just <b>$10/month</b></sub><br/>
63
- <a href="https://z.ai/subscribe?ic=1YVKN4IRCQ"><b>👉 Subscribe now — limited-time deal!</b></a>
64
- </td>
65
- </tr>
66
- </table>
42
+ | 命令 | 说明 |
43
+ | -------------------- | -------------------------------------------------------------- |
44
+ | `enable` | 启用 `/loop`、`/btw` 和 `/keybindings` 功能(默认) |
45
+ | `enable loop` | 仅启用 `/loop` 功能 |
46
+ | `enable btw` | 仅启用 `/btw` 功能 |
47
+ | `enable keybindings` | 仅启用 `/keybindings` 功能 |
48
+ | `enable toolsearch` | 启用 toolsearch 功能(需要显式激活) |
49
+ | `enable context1m` | 启用 1M 上下文窗口,用于 Claude Opus(v2.1.76+,需要显式激活) |
50
+ | `disable` | 恢复原始状态 |
51
+ | `status` | 查看当前状态及版本要求 |
67
52
 
68
53
  ---
69
54
 
@@ -132,13 +117,133 @@ cancel the deploy check job # 按描述或 ID 取消
132
117
  /btw 为什么这里要用 async/await?
133
118
  ```
134
119
 
120
+ ## 什么是工具搜索?
121
+
122
+ 工具搜索(Tool Search)是一项允许 Claude 在运行时动态搜索和加载工具的功能,而不是一次性发送所有工具定义。这可以节省 token 并提高性能。
123
+
124
+ ### 为什么为第三方 API 启用?
125
+
126
+ 默认情况下,Claude Code 在使用第三方 API 代理(如 Kimi、自定义端点)时会禁用工具搜索。此功能修改该行为,为这些代理启用工具搜索。
127
+
128
+ ### 优势
129
+
130
+ - **Token 效率**:减少大型 MCP 工具目录的上下文窗口占用
131
+ - **性能提升**:延迟加载工具,响应更快
132
+ - **代理兼容**:支持 Kimi 和其他第三方 Claude API 提供商
133
+
134
+ ### 要求
135
+
136
+ - 您的代理必须支持 API 响应中的 `tool_reference` 块
137
+ - 仅支持 Claude Sonnet 4+ 和 Opus 4+ 模型(不支持 Haiku)
138
+
139
+ ### 配置说明
140
+
141
+ 使用官方 Anthropic API 时,工具搜索默认启用。但当 `ANTHROPIC_BASE_URL` 指向非第一方主机时,工具搜索默认禁用(大多数代理不转发 `tool_reference` 块)。
142
+
143
+ 通过 `ENABLE_TOOL_SEARCH` 环境变量控制工具搜索行为:
144
+
145
+ | 值 | 行为 |
146
+ | ---------- | ------------------------------------------------------ |
147
+ | (未设置) | 默认启用。当 `ANTHROPIC_BASE_URL` 为非第一方主机时禁用 |
148
+ | `true` | 始终启用,包括非第一方 `ANTHROPIC_BASE_URL` |
149
+ | `auto` | 当 MCP 工具超过上下文 10% 时激活 |
150
+ | `auto:<N>` | 自定义阈值激活(如 `auto:5` 表示 5%) |
151
+ | `false` | 禁用,所有 MCP 工具预先加载 |
152
+
153
+ **示例:**
154
+
155
+ ```bash
156
+ # 使用 5% 自定义阈值
157
+ ENABLE_TOOL_SEARCH=auto:5 claude
158
+
159
+ # 完全禁用工具搜索
160
+ ENABLE_TOOL_SEARCH=false claude
161
+
162
+ # 始终启用(适用于支持 tool_reference 的代理)
163
+ ENABLE_TOOL_SEARCH=true claude
164
+ ```
165
+
166
+ 或在 `settings.json` 的 env 字段中设置。
167
+
168
+ #### 禁用 MCPSearch 工具
169
+
170
+ 您还可以使用 `disallowedTools` 设置专门禁用 `MCPSearch` 工具:
171
+
172
+ ```json
173
+ {
174
+ "permissions": {
175
+ "deny": ["MCPSearch"]
176
+ }
177
+ }
178
+ ```
179
+
180
+ ## 什么是 `/keybindings`?
181
+
182
+ `/keybindings` 启用自定义键盘快捷键支持。在 `~/.claude/keybindings.json` 中配置您的键绑定。
183
+
184
+ ### 配置方法
185
+
186
+ 创建或编辑 `~/.claude/keybindings.json`:
187
+
188
+ ```json
189
+ {
190
+ "submit": ["ctrl+s"],
191
+ "interrupt": ["ctrl+c"],
192
+ "custom_commands": {
193
+ "ctrl+shift+l": "/loop 5m check status"
194
+ }
195
+ }
196
+ ```
197
+
198
+ ## 什么是 `/context1m`?
199
+
200
+ `/context1m` 为 Claude Opus 模型启用 1M token 上下文窗口。这允许您处理更大的代码库和更长的对话。
201
+
202
+ ### 要求
203
+
204
+ - Claude Code v2.1.76 或更高版本
205
+ - Claude Opus 4+ 模型
206
+ - 可能需要 Pro 计划或官方 API
207
+
208
+ ### 使用方法
209
+
210
+ ```bash
211
+ # 启用 1M 上下文
212
+ npx @unitsvc/cc-helper enable context1m
213
+
214
+ # 或使用别名
215
+ npx @unitsvc/cc-helper enable 1m
216
+ npx @unitsvc/cc-helper enable 1M
217
+ ```
218
+
219
+ ### 扩展思维支持
220
+
221
+ 使用第三方 API 代理时,扩展思维(推理)能力因模型而异:
222
+
223
+ | 模型 | 最大思维链长度 |
224
+ | -------------------- | --------------------- |
225
+ | qwen3.5-plus | 81,920 |
226
+ | qwen3-max-2026-01-23 | 81,920 |
227
+ | kimi-k2.5 | 81,920 |
228
+ | glm-5 | 32,768 |
229
+ | glm-4.7 | 32,768 |
230
+ | MiniMax-M2.5 | 32,768(思维链+回复) |
231
+ | qwen3-coder-next | 不支持思考模式 |
232
+ | qwen3-coder-plus | 不支持思考模式 |
233
+
135
234
  ## 功能特点
136
235
 
137
- - 一键启用 `/loop` 和 `/btw` 功能
236
+ - 一键启用 `/loop`、`/btw`、`/keybindings` 功能
237
+ - 可选 `/toolsearch` 用于第三方 API 代理
238
+ - 可选 `/context1m` 用于 1M 上下文窗口(v2.1.76+)
239
+ - 可单独启用特定功能
138
240
  - 轻松恢复原始状态
139
241
  - 自动备份原文件
242
+ - 自动禁用 npm 弃用警告
243
+ - 自动跳过入门引导流程
140
244
  - 零运行时依赖
141
245
  - 跨平台支持
246
+ - 支持版本:2.1.71 - 2.1.76+
142
247
 
143
248
  ### 示例
144
249
 
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  **English** | [**简体中文**](./README-zh.md)
8
8
 
9
- > ⚡ Enable hidden features in Claude Code CLI with one command: `/loop` and `/btw`
9
+ > ⚡ Enable hidden features in Claude Code CLI with one command: `/loop`, `/btw`, `/keybindings`, `/context1m`, and `MCPSearch`
10
10
 
11
11
  ## Requirements
12
12
 
@@ -14,15 +14,22 @@
14
14
  - Claude Code v2.1.71+
15
15
 
16
16
  ```bash
17
- npm install -g @anthropic-ai/claude-code@v2.1.71
17
+ npm install -g @anthropic-ai/claude-code@v2.1.76
18
18
  ```
19
19
 
20
20
  ## Usage
21
21
 
22
22
  ```bash
23
- # Enable all features (default)
23
+ # Enable default features (/loop, /btw, /keybindings)
24
24
  npx @unitsvc/cc-helper enable
25
25
 
26
+ # Enable specific features
27
+ npx @unitsvc/cc-helper enable loop
28
+ npx @unitsvc/cc-helper enable btw
29
+ npx @unitsvc/cc-helper enable keybindings
30
+ npx @unitsvc/cc-helper enable toolsearch
31
+ npx @unitsvc/cc-helper enable context1m # or: 1m, 1M
32
+
26
33
  # Check status
27
34
  npx @unitsvc/cc-helper status
28
35
 
@@ -32,11 +39,16 @@ npx @unitsvc/cc-helper disable
32
39
 
33
40
  ### Commands
34
41
 
35
- | Command | Description |
36
- | --------- | ------------------------ |
37
- | `enable` | Enable `/loop` and `/btw` features |
38
- | `disable` | Restore original |
39
- | `status` | Check current status |
42
+ | Command | Description |
43
+ | -------------------- | -------------------------------------------------------------------- |
44
+ | `enable` | Enable `/loop`, `/btw`, and `/keybindings` features (default) |
45
+ | `enable loop` | Enable only `/loop` feature |
46
+ | `enable btw` | Enable only `/btw` feature |
47
+ | `enable keybindings` | Enable only `/keybindings` feature |
48
+ | `enable toolsearch` | Enable toolsearch feature (requires explicit activation) |
49
+ | `enable context1m` | Enable 1M context window for Claude Opus (v2.1.76+, explicit opt-in) |
50
+ | `disable` | Restore original |
51
+ | `status` | Check current status with version requirements |
40
52
 
41
53
  ### Proxy Support
42
54
 
@@ -50,21 +62,6 @@ npx @unitsvc/cc-helper --proxy enable
50
62
  npx @unitsvc/cc-helper --proxy https://your-proxy.com enable
51
63
  ```
52
64
 
53
- ## Sponsors
54
-
55
- <table>
56
- <tr>
57
- <td width="60" valign="middle">
58
- <img src="https://img.shields.io/badge/🚀-GLM-blue?style=for-the-badge" alt="GLM"/>
59
- </td>
60
- <td valign="middle">
61
- <b>GLM Coding Plan</b><br/>
62
- <sub>Full support for <b>Claude Code</b>, <b>Cline</b>, and <b>20+ top coding tools</b> — starting at just <b>$10/month</b></sub><br/>
63
- <a href="https://z.ai/subscribe?ic=1YVKN4IRCQ"><b>👉 Subscribe now — limited-time deal!</b></a>
64
- </td>
65
- </tr>
66
- </table>
67
-
68
65
  ---
69
66
 
70
67
  ## What is `/loop`?
@@ -132,13 +129,133 @@ cancel the deploy check job # Cancel by description or ID
132
129
  /btw why use async/await in this case?
133
130
  ```
134
131
 
132
+ ## What is Tool Search?
133
+
134
+ Tool Search is a feature that allows Claude to dynamically search and load tools at runtime instead of sending all tool definitions upfront. This saves tokens and improves performance.
135
+
136
+ ### Why Enable for Third-Party APIs?
137
+
138
+ By default, Claude Code disables Tool Search when using third-party API proxies (like Kimi, custom endpoints). This feature patches that behavior to enable Tool Search for these proxies.
139
+
140
+ ### Benefits
141
+
142
+ - **Token efficiency**: Reduces context window usage for large MCP tool catalogs
143
+ - **Better performance**: Faster response times with deferred tool loading
144
+ - **Proxy compatibility**: Works with Kimi and other third-party Claude API providers
145
+
146
+ ### Requirements
147
+
148
+ - Your proxy must support `tool_reference` blocks in API responses
149
+ - Works with Claude Sonnet 4+ and Opus 4+ models (not Haiku)
150
+
151
+ ### Configuration
152
+
153
+ Tool Search is enabled by default when using official Anthropic APIs. However, when `ANTHROPIC_BASE_URL` points to a non-first-party host, Tool Search is disabled by default (most proxies do not forward `tool_reference` blocks).
154
+
155
+ Control Tool Search behavior using the `ENABLE_TOOL_SEARCH` environment variable:
156
+
157
+ | Value | Behavior |
158
+ | ---------- | -------------------------------------------------------------------------------- |
159
+ | (unset) | Enabled by default. Disabled when `ANTHROPIC_BASE_URL` is a non-first-party host |
160
+ | `true` | Always enabled, including for non-first-party `ANTHROPIC_BASE_URL` |
161
+ | `auto` | Activates when MCP tools exceed 10% of context |
162
+ | `auto:<N>` | Activates at custom threshold (e.g., `auto:5` for 5%) |
163
+ | `false` | Disabled, all MCP tools loaded upfront |
164
+
165
+ **Examples:**
166
+
167
+ ```bash
168
+ # Use custom 5% threshold
169
+ ENABLE_TOOL_SEARCH=auto:5 claude
170
+
171
+ # Disable tool search entirely
172
+ ENABLE_TOOL_SEARCH=false claude
173
+
174
+ # Always enable (useful for proxies that support tool_reference)
175
+ ENABLE_TOOL_SEARCH=true claude
176
+ ```
177
+
178
+ Or set the value in your `settings.json` env field.
179
+
180
+ #### Disabling MCPSearch Tool
181
+
182
+ You can also disable the `MCPSearch` tool specifically using the `disallowedTools` setting:
183
+
184
+ ```json
185
+ {
186
+ "permissions": {
187
+ "deny": ["MCPSearch"]
188
+ }
189
+ }
190
+ ```
191
+
192
+ ## What is `/keybindings`?
193
+
194
+ `/keybindings` enables custom keyboard shortcuts support. Configure your keybindings in `~/.claude/keybindings.json`.
195
+
196
+ ### Configuration
197
+
198
+ Create or edit `~/.claude/keybindings.json`:
199
+
200
+ ```json
201
+ {
202
+ "submit": ["ctrl+s"],
203
+ "interrupt": ["ctrl+c"],
204
+ "custom_commands": {
205
+ "ctrl+shift+l": "/loop 5m check status"
206
+ }
207
+ }
208
+ ```
209
+
210
+ ## What is `/context1m`?
211
+
212
+ `/context1m` enables 1M token context window for Claude Opus models. This allows you to work with much larger codebases and conversations.
213
+
214
+ ### Requirements
215
+
216
+ - Claude Code v2.1.76 or higher
217
+ - Claude Opus 4+ model
218
+ - May require Pro plan or first-party API
219
+
220
+ ### Usage
221
+
222
+ ```bash
223
+ # Enable 1M context
224
+ npx @unitsvc/cc-helper enable context1m
225
+
226
+ # Or use aliases
227
+ npx @unitsvc/cc-helper enable 1m
228
+ npx @unitsvc/cc-helper enable 1M
229
+ ```
230
+
231
+ ### Extended Thinking Support
232
+
233
+ When using third-party API proxies, extended thinking (reasoning) capabilities vary by model:
234
+
235
+ | Model | Max Thinking Tokens |
236
+ | -------------------- | ---------------------------- |
237
+ | qwen3.5-plus | 81,920 |
238
+ | qwen3-max-2026-01-23 | 81,920 |
239
+ | kimi-k2.5 | 81,920 |
240
+ | glm-5 | 32,768 |
241
+ | glm-4.7 | 32,768 |
242
+ | MiniMax-M2.5 | 32,768 (thinking + response) |
243
+ | qwen3-coder-next | Not supported |
244
+ | qwen3-coder-plus | Not supported |
245
+
135
246
  ## Features
136
247
 
137
- - Enable `/loop` and `/btw` with one command
248
+ - Enable `/loop`, `/btw`, `/keybindings` with one command
249
+ - Optional `/toolsearch` for third-party API proxies
250
+ - Optional `/context1m` for 1M context window (v2.1.76+)
251
+ - Enable specific features individually
138
252
  - Easy restore functionality
139
253
  - Automatic backup
254
+ - Auto-disable npm deprecation warning
255
+ - Auto-skip onboarding flow
140
256
  - Zero runtime dependencies
141
257
  - Cross-platform support
258
+ - Version support: 2.1.71 - 2.1.76+
142
259
 
143
260
  ### Examples
144
261
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitsvc/cc-helper",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "Claude Code /loop feature bypass tool",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -14,10 +14,8 @@
14
14
  },
15
15
  "keywords": [
16
16
  "claude code",
17
- "claude",
18
17
  "loop",
19
- "cli",
20
- "zai"
18
+ "cli"
21
19
  ],
22
20
  "author": "next-bin",
23
21
  "license": "AGPL-3.0",