claude-auto 0.13.3 → 0.13.4
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.
- package/.claude-auto/.claude.hooks.json +2 -1
- package/README.md +242 -88
- package/dist/bundle/scripts/auto-continue.js +1 -1
- package/dist/bundle/scripts/pre-tool-use.js +1 -1
- package/dist/src/cli/cli.test.js +246 -0
- package/dist/src/cli/cli.test.js.map +1 -1
- package/dist/src/cli/install.d.ts +2 -0
- package/dist/src/cli/install.d.ts.map +1 -1
- package/dist/src/cli/install.js +10 -5
- package/dist/src/cli/install.js.map +1 -1
- package/dist/src/cli/install.test.js +85 -0
- package/dist/src/cli/install.test.js.map +1 -1
- package/dist/src/cli/tui/log-tailer.d.ts.map +1 -1
- package/dist/src/cli/tui/log-tailer.js +1 -7
- package/dist/src/cli/tui/log-tailer.js.map +1 -1
- package/dist/src/cli/tui/log-tailer.test.js +19 -0
- package/dist/src/cli/tui/log-tailer.test.js.map +1 -1
- package/dist/src/cli/tui/tui.test.js +17 -0
- package/dist/src/cli/tui/tui.test.js.map +1 -1
- package/dist/src/commit-validator.test.js +188 -0
- package/dist/src/commit-validator.test.js.map +1 -1
- package/dist/src/hook-state.d.ts +1 -1
- package/dist/src/hook-state.d.ts.map +1 -1
- package/dist/src/hooks/auto-continue.js +1 -1
- package/dist/src/hooks/auto-continue.js.map +1 -1
- package/dist/src/hooks/auto-continue.test.js +26 -0
- package/dist/src/hooks/auto-continue.test.js.map +1 -1
- package/dist/src/hooks/pre-tool-use.js +1 -1
- package/dist/src/hooks/pre-tool-use.js.map +1 -1
- package/dist/src/hooks/pre-tool-use.test.js +7 -0
- package/dist/src/hooks/pre-tool-use.test.js.map +1 -1
- package/dist/src/validator-loader.test.js +22 -0
- package/dist/src/validator-loader.test.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,172 +1,326 @@
|
|
|
1
1
|
# Claude Auto
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Husky-style hooks and skills management for Claude Code.
|
|
4
4
|
|
|
5
|
-
[](LICENSE) []()
|
|
5
|
+
[](https://github.com/BeOnAuto/claude-auto/actions) [](https://www.npmjs.com/package/claude-auto) [](LICENSE) []()
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Purpose
|
|
10
10
|
|
|
11
|
-
AI
|
|
11
|
+
Without Claude Auto, you babysit every AI coding session. You watch, nudge, correct, and context-switch constantly. One task at a time, full attention required.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Claude Auto installs a quality loop into Claude Code via hooks. Validators gate every commit. Reminders inject your guidelines into every prompt. Deny-lists protect files from modification. Auto-continue keeps the agent working until the plan is done. The system earns trust, and trust enables parallelization via git worktrees.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- One task at a time, full attention required
|
|
17
|
-
- The bottleneck is your attention, not AI's speed
|
|
15
|
+
## Key Concepts
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
- **Hooks**: Four integration points (SessionStart, PreToolUse, UserPromptSubmit, Stop) that let Claude Auto observe and control Claude Code's behavior
|
|
18
|
+
- **Validators**: Markdown files with YAML frontmatter that ACK or NACK commits based on your criteria
|
|
19
|
+
- **Reminders**: Context-injection files that surface your guidelines at the right moment
|
|
20
|
+
- **Deny-list**: Glob patterns that protect files from modification
|
|
21
|
+
- **TCR Discipline**: Test && Commit || Revert. Bad code auto-reverts
|
|
22
|
+
- **Auto-Continue**: Keeps the agent going until the plan is done
|
|
20
23
|
|
|
21
24
|
---
|
|
22
25
|
|
|
23
|
-
##
|
|
26
|
+
## Installation
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
```bash
|
|
29
|
+
npx claude-auto install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx claude-auto install
|
|
36
|
+
npx claude-auto doctor
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
After installation, Claude Auto automatically:
|
|
40
|
+
|
|
41
|
+
- Injects hooks that validate every commit against your criteria
|
|
42
|
+
- Creates reminders that inject your guidelines into prompts
|
|
43
|
+
- Sets up file protection via deny-lists
|
|
44
|
+
- Merges settings with smart project/local overrides
|
|
26
45
|
|
|
27
|
-
|
|
28
|
-
| ------------------ | -------------------------------------------- | ------------------------------- |
|
|
29
|
-
| **Auto-Planner** | Generates plan from your requirements | No need to specify every detail |
|
|
30
|
-
| **Supervisor AI** | Validates every commit against your criteria | Automated review |
|
|
31
|
-
| **TCR Discipline** | Test && Commit \|\| Revert | Bad code auto-reverts |
|
|
32
|
-
| **Auto-Continue** | Keeps going until the plan is done | You check back, not babysit |
|
|
46
|
+
**Next steps:**
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
- [Getting Started guide](./docs/getting-started.md)
|
|
49
|
+
- [The Ketchup Technique](./docs/ketchup-technique.md)
|
|
35
50
|
|
|
36
51
|
---
|
|
37
52
|
|
|
38
|
-
##
|
|
53
|
+
## How-to Guides
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
### Verify Installation Health
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx claude-auto doctor
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Fix Broken Symlinks
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx claude-auto repair
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### List Active Reminders
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx claude-auto reminders
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Configure for CI/CD
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx claude-auto install --non-interactive
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Multiply with Git Worktrees
|
|
41
80
|
|
|
42
81
|
```bash
|
|
43
|
-
# Create worktrees for parallel features
|
|
44
82
|
git worktree add ../feature-auth feature/auth
|
|
45
83
|
git worktree add ../feature-payments feature/payments
|
|
46
|
-
git worktree add ../feature-dashboard feature/dashboard
|
|
47
|
-
```
|
|
48
84
|
|
|
49
|
-
|
|
85
|
+
cd ../feature-auth && npx claude-auto install
|
|
86
|
+
cd ../feature-payments && npx claude-auto install
|
|
87
|
+
```
|
|
50
88
|
|
|
51
|
-
|
|
52
|
-
| ----------------------------- | ------------- |
|
|
53
|
-
| Manual coding | 1 |
|
|
54
|
-
| AI-assisted (babysitting) | 1-2 |
|
|
55
|
-
| **Claude Auto + Worktrees** | **10+** |
|
|
89
|
+
Each worktree runs its own Claude Auto instance, all quality-validated.
|
|
56
90
|
|
|
57
91
|
---
|
|
58
92
|
|
|
59
|
-
##
|
|
93
|
+
## CLI Reference
|
|
94
|
+
|
|
95
|
+
### Commands
|
|
96
|
+
|
|
97
|
+
#### `claude-auto install`
|
|
60
98
|
|
|
61
|
-
|
|
99
|
+
Install and configure Claude Auto in your project.
|
|
62
100
|
|
|
63
101
|
```bash
|
|
64
|
-
|
|
102
|
+
claude-auto install [target-path] [options]
|
|
65
103
|
```
|
|
66
104
|
|
|
67
|
-
|
|
105
|
+
| Option | Type | Default | Description |
|
|
106
|
+
| ------ | ---- | ------- | ----------- |
|
|
107
|
+
| `--local` | boolean | false | Use development mode (runs TypeScript source directly via tsx) |
|
|
68
108
|
|
|
69
|
-
|
|
109
|
+
#### `claude-auto doctor`
|
|
70
110
|
|
|
71
|
-
|
|
111
|
+
Verify every expected symlink is valid and report issues.
|
|
72
112
|
|
|
73
|
-
|
|
113
|
+
```bash
|
|
114
|
+
claude-auto doctor
|
|
115
|
+
```
|
|
74
116
|
|
|
75
|
-
|
|
117
|
+
#### `claude-auto status`
|
|
76
118
|
|
|
77
|
-
|
|
119
|
+
Show symlink status for hook scripts, validators, and reminders.
|
|
78
120
|
|
|
79
|
-
|
|
121
|
+
```bash
|
|
122
|
+
claude-auto status
|
|
123
|
+
```
|
|
80
124
|
|
|
81
|
-
|
|
82
|
-
| -------------------------------- | ------------------------------ |
|
|
83
|
-
| Watching one AI session | Directing multiple workstreams |
|
|
84
|
-
| Nudging, correcting in real-time | Defining, approving, releasing |
|
|
85
|
-
| Serial productivity | Parallel productivity |
|
|
86
|
-
| Marginal gains (1.5x) | Multiplicative gains (10x+) |
|
|
87
|
-
| Brain captured by supervision | Brain freed for the next thing |
|
|
125
|
+
#### `claude-auto repair`
|
|
88
126
|
|
|
89
|
-
|
|
127
|
+
Recreate broken or missing symlinks between the package and project directories.
|
|
90
128
|
|
|
91
|
-
|
|
129
|
+
```bash
|
|
130
|
+
claude-auto repair
|
|
131
|
+
```
|
|
92
132
|
|
|
93
|
-
|
|
133
|
+
#### `claude-auto reminders`
|
|
134
|
+
|
|
135
|
+
List active reminders with name, hook, and priority metadata.
|
|
94
136
|
|
|
95
137
|
```bash
|
|
96
|
-
|
|
97
|
-
|
|
138
|
+
claude-auto reminders
|
|
139
|
+
```
|
|
98
140
|
|
|
99
|
-
|
|
100
|
-
|
|
141
|
+
#### `claude-auto clean-logs`
|
|
142
|
+
|
|
143
|
+
Remove old log files from the logs directory.
|
|
101
144
|
|
|
102
|
-
|
|
145
|
+
```bash
|
|
146
|
+
claude-auto clean-logs [options]
|
|
103
147
|
```
|
|
104
148
|
|
|
105
|
-
|
|
149
|
+
| Option | Type | Default | Description |
|
|
150
|
+
| ------ | ---- | ------- | ----------- |
|
|
151
|
+
| `--older-than` | number | 60 | Keep logs newer than N minutes |
|
|
106
152
|
|
|
107
|
-
-
|
|
108
|
-
- Creates reminders that inject your guidelines
|
|
109
|
-
- Sets up file protection via deny-lists
|
|
110
|
-
- Merges settings with smart project/local overrides
|
|
153
|
+
#### `claude-auto tui`
|
|
111
154
|
|
|
112
|
-
|
|
155
|
+
Launch the full-screen terminal UI with live log tailing.
|
|
113
156
|
|
|
114
|
-
|
|
157
|
+
```bash
|
|
158
|
+
claude-auto tui
|
|
159
|
+
```
|
|
115
160
|
|
|
116
|
-
|
|
161
|
+
### Configuration File
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"autoContinue": { "mode": "smart" },
|
|
166
|
+
"validateCommit": { "mode": "strict", "batchCount": 3 },
|
|
167
|
+
"denyList": { "enabled": true },
|
|
168
|
+
"promptReminder": { "enabled": true },
|
|
169
|
+
"subagentHooks": {
|
|
170
|
+
"validateCommitOnExplore": false,
|
|
171
|
+
"validateCommitOnWork": true,
|
|
172
|
+
"validateCommitOnUnknown": true
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
117
176
|
|
|
118
|
-
|
|
177
|
+
Configuration lives in `.claude-auto/.claude.hooks.json`. See the [Configuration guide](./docs/configuration.md) for all options.
|
|
119
178
|
|
|
120
|
-
|
|
179
|
+
### Settings Layering
|
|
180
|
+
|
|
181
|
+
Settings merge in priority order:
|
|
182
|
+
|
|
183
|
+
1. `templates/settings.json` (package defaults)
|
|
184
|
+
2. `.claude/settings.project.json` (team overrides)
|
|
185
|
+
3. `.claude/settings.local.json` (personal overrides)
|
|
121
186
|
|
|
122
187
|
---
|
|
123
188
|
|
|
124
|
-
##
|
|
189
|
+
## How It Works
|
|
190
|
+
|
|
191
|
+
```mermaid
|
|
192
|
+
flowchart LR
|
|
193
|
+
A[Claude Code] --> B[Hook Scripts]
|
|
194
|
+
B --> C{Hook Type}
|
|
195
|
+
C -->|SessionStart| D[Load Reminders]
|
|
196
|
+
C -->|PreToolUse| E[Validate Commits + Deny-list]
|
|
197
|
+
C -->|UserPromptSubmit| F[Inject Reminders]
|
|
198
|
+
C -->|Stop| G[Auto-Continue Decision]
|
|
199
|
+
E -->|ACK| H[Allow]
|
|
200
|
+
E -->|NACK| I[Block + Revert]
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Hook scripts read JSON from stdin, delegate to handlers in `src/hooks/`, log results, and output JSON to stdout. Validators are batched (default 3 per Claude CLI call) for efficient parallel validation. Reminders are matched by hook type, mode, and tool name, then injected as `<system-reminder>` blocks.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Troubleshooting
|
|
208
|
+
|
|
209
|
+
### Command Not Found
|
|
210
|
+
|
|
211
|
+
**Symptom:** `claude-auto: command not found`
|
|
212
|
+
|
|
213
|
+
**Cause:** Package not installed globally or not in PATH.
|
|
214
|
+
|
|
215
|
+
**Solution:**
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npx claude-auto install
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Hooks Not Firing
|
|
222
|
+
|
|
223
|
+
**Symptom:** Commits go through without validation.
|
|
125
224
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
225
|
+
**Cause:** Settings not merged or symlinks broken.
|
|
226
|
+
|
|
227
|
+
**Solution:**
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
npx claude-auto doctor
|
|
231
|
+
npx claude-auto repair
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Enable Debug Logging
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
DEBUG=claude-auto npx claude-auto install
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Debug logs write to `.claude-auto/logs/claude-auto/debug.log`.
|
|
135
241
|
|
|
136
242
|
---
|
|
137
243
|
|
|
138
244
|
## Documentation
|
|
139
245
|
|
|
140
|
-
| Guide
|
|
141
|
-
|
|
|
142
|
-
| [Getting Started](./docs/getting-started.md)
|
|
143
|
-
| [Installation](./docs/installation.md)
|
|
246
|
+
| Guide | Description |
|
|
247
|
+
| ----- | ----------- |
|
|
248
|
+
| [Getting Started](./docs/getting-started.md) | First-time setup and core concepts |
|
|
249
|
+
| [Installation](./docs/installation.md) | Detailed installation guide |
|
|
144
250
|
| [The Ketchup Technique](./docs/ketchup-technique.md) | The planning methodology |
|
|
145
|
-
| [Configuration](./docs/configuration.md)
|
|
146
|
-
| [Hooks Guide](./docs/hooks-guide.md)
|
|
147
|
-
| [Reminders Guide](./docs/reminders-guide.md)
|
|
148
|
-
| [Validators Guide](./docs/validators-guide.md)
|
|
149
|
-
| [API Reference](./docs/api-reference.md)
|
|
150
|
-
| [Architecture](./docs/architecture.md)
|
|
251
|
+
| [Configuration](./docs/configuration.md) | All configuration options |
|
|
252
|
+
| [Hooks Guide](./docs/hooks-guide.md) | Hook system deep-dive |
|
|
253
|
+
| [Reminders Guide](./docs/reminders-guide.md) | Context injection system |
|
|
254
|
+
| [Validators Guide](./docs/validators-guide.md) | Commit validation rules |
|
|
255
|
+
| [API Reference](./docs/api-reference.md) | Programmatic access |
|
|
256
|
+
| [Architecture](./docs/architecture.md) | System design internals |
|
|
257
|
+
| [Origin Story](./docs/origin-story.md) | How Claude Auto came to be |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Architecture
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
src/
|
|
265
|
+
├── cli/ # CLI commands (install, doctor, repair, status, reminders, tui)
|
|
266
|
+
│ └── tui/ # Full-screen terminal UI with live log tailing
|
|
267
|
+
├── hooks/ # Hook handlers (session-start, pre-tool-use, user-prompt-submit, auto-continue)
|
|
268
|
+
├── commit-validator.ts # Batched commit validation with appeal support
|
|
269
|
+
├── config-loader.ts # Cosmiconfig-based configuration
|
|
270
|
+
├── deny-list.ts # File protection via micromatch patterns
|
|
271
|
+
├── reminder-loader.ts # Markdown + YAML frontmatter reminder system
|
|
272
|
+
├── settings-merger.ts # Three-layer settings merge with lock-file caching
|
|
273
|
+
├── hook-state.ts # Hook state management (.claude.hooks.json)
|
|
274
|
+
├── validator-loader.ts # Markdown validator loader
|
|
275
|
+
└── index.ts # Public API barrel exports
|
|
276
|
+
scripts/
|
|
277
|
+
├── session-start.ts # SessionStart hook entry-point
|
|
278
|
+
├── pre-tool-use.ts # PreToolUse hook entry-point
|
|
279
|
+
├── user-prompt-submit.ts # UserPromptSubmit hook entry-point
|
|
280
|
+
└── auto-continue.ts # Stop hook entry-point
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Dependencies
|
|
284
|
+
|
|
285
|
+
| Package | Usage |
|
|
286
|
+
| ------- | ----- |
|
|
287
|
+
| commander | CLI framework |
|
|
288
|
+
| cosmiconfig | Configuration file discovery |
|
|
289
|
+
| gray-matter | YAML frontmatter parsing for validators and reminders |
|
|
290
|
+
| micromatch | Glob pattern matching for deny-lists |
|
|
151
291
|
|
|
152
292
|
---
|
|
153
293
|
|
|
154
294
|
## Development
|
|
155
295
|
|
|
296
|
+
### Prerequisites
|
|
297
|
+
|
|
298
|
+
- Node.js 18+
|
|
299
|
+
- pnpm 10+
|
|
300
|
+
|
|
301
|
+
### Setup
|
|
302
|
+
|
|
156
303
|
```bash
|
|
157
304
|
git clone https://github.com/BeOnAuto/claude-auto.git
|
|
158
305
|
cd claude-auto
|
|
159
306
|
pnpm install
|
|
160
|
-
pnpm test
|
|
161
307
|
pnpm build
|
|
162
308
|
```
|
|
163
309
|
|
|
310
|
+
### Commands
|
|
311
|
+
|
|
312
|
+
| Command | Description |
|
|
313
|
+
| ------- | ----------- |
|
|
314
|
+
| `pnpm build` | TypeScript compile + esbuild bundle scripts |
|
|
315
|
+
| `pnpm test` | Run all tests (vitest) |
|
|
316
|
+
| `pnpm type-check` | TypeScript type checking |
|
|
317
|
+
| `pnpm lint` | Biome lint check |
|
|
318
|
+
| `pnpm check` | Full CI: build + type-check + test + lint |
|
|
319
|
+
|
|
164
320
|
---
|
|
165
321
|
|
|
166
322
|
## License
|
|
167
323
|
|
|
168
|
-
MIT
|
|
324
|
+
MIT © 2025 BeOnAuto, Inc.
|
|
169
325
|
|
|
170
326
|
See [LICENSE](LICENSE) for details.
|
|
171
|
-
|
|
172
|
-
---
|
|
@@ -4971,7 +4971,7 @@ function handleStop(autoDir, input2) {
|
|
|
4971
4971
|
if (input2.stop_hook_active) {
|
|
4972
4972
|
return { decision: "allow", reason: "stop hook already active" };
|
|
4973
4973
|
}
|
|
4974
|
-
const modesToSkip = skipModes
|
|
4974
|
+
const modesToSkip = skipModes;
|
|
4975
4975
|
if (input2.permission_mode && modesToSkip.includes(input2.permission_mode)) {
|
|
4976
4976
|
return { decision: "allow", reason: `skipping mode: ${input2.permission_mode}` };
|
|
4977
4977
|
}
|
|
@@ -11611,7 +11611,7 @@ async function handleCommitValidation(claudeDir2, sessionId, command, options2,
|
|
|
11611
11611
|
const context = getCommitContext(process.cwd(), command);
|
|
11612
11612
|
const state = createHookState(autoDir).read();
|
|
11613
11613
|
const onLog = (event, name, detail) => {
|
|
11614
|
-
activityLog(autoDir, sessionId, "pre-tool-use", `validator ${event}: ${name}
|
|
11614
|
+
activityLog(autoDir, sessionId, "pre-tool-use", `validator ${event}: ${name} \u2192 ${detail}`);
|
|
11615
11615
|
};
|
|
11616
11616
|
const results = await validateCommit(validators, context, options2.executor, onLog, state.validateCommit.batchCount);
|
|
11617
11617
|
const nacks = results.filter((r) => r.decision === "NACK");
|