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
When you stage many files, `lazycommit` can automatically split your changes into logical groups and create multiple commits with proper Conventional Commit messages.
115
+
116
+
- Auto-trigger: when staged files ≥ 5, or when the diff is large
- Deep split: if everything falls into one big bucket (e.g., `app/api/*`), it auto-splits by second-level directory (like `analytics`, `projects`, `sessions`)
119
+
- Token-safe AI: each group uses a compact `git diff --cached --numstat` summary (not full diffs) to generate the commit line
120
+
121
+
Usage:
122
+
123
+
```sh
124
+
# Just run as usual; grouping triggers automatically when applicable
125
+
lazycommit
126
+
127
+
# Force grouping even for < 5 files
128
+
lazycommit --split
129
+
```
130
+
112
131
#### Handling large diffs
113
132
114
-
For large commits with many files, lazycommit automatically stays within API limits:
133
+
For large commits with many files, lazycommit automatically stays within API limits and maintains clean history:
115
134
116
-
-**Automatic detection**: Large diffs are detected
117
-
-**Per-file splitting**: Diffs are split by file first
118
-
-**Safe chunking**: Each file diff is chunked conservatively (default: 4000 tokens)
119
-
-**Combination**: Results are combined into one concise message
135
+
-**Automatic detection**: Large diffs and many-file changes are detected
136
+
-**Logical grouping**: Files are grouped into conventional buckets; single huge buckets are auto-split by second-level directory (e.g., `app/api/<group>/...`)
137
+
-**Token-safe summaries**: Each group sends a small `--numstat` summary to AI instead of full diffs
138
+
-**Sequential commits**: In multi-commit mode, groups are committed one-by-one with their own messages
120
139
121
140
### Git hook
122
141
@@ -229,7 +248,14 @@ lazycommit config set proxy=
229
248
230
249
#### model
231
250
232
-
Default: `openai/gpt-oss-120b`
251
+
Default: `llama-3.1-8b-instant`
252
+
253
+
The Groq model to use for generating commit messages. Available models include:
254
+
-`llama-3.1-8b-instant` (default) - Fast, efficient for conventional commits
255
+
-`llama-3.1-70b-versatile` - More detailed but slower
256
+
-`llama-3.1-120b-versatile` - Most capable but slowest
257
+
258
+
For conventional commit generation, the 8B instant model provides the best balance of speed and quality.
233
259
234
260
#### timeout
235
261
@@ -267,17 +293,6 @@ You can clear this option by setting it to an empty string:
267
293
lazycommit config set type=
268
294
```
269
295
270
-
#### chunk-size
271
-
272
-
Default: `4000`
273
-
274
-
The maximum number of tokens per chunk when processing large diffs. This helps avoid API limits and keeps requests fast:
275
-
276
-
```sh
277
-
lazycommit config set chunk-size 4000
278
-
```
279
-
280
-
**Note**: Must be between 1000-8000 tokens (Groq API limit).
281
296
282
297
## How it works
283
298
@@ -289,12 +304,13 @@ The tool uses Groq's fast inference API to provide quick and accurate commit mes
289
304
290
305
For large commits that exceed API token limits, lazycommit automatically:
291
306
292
-
1.**Splits by file** to avoid oversized requests
293
-
2.**Chunks each file** into manageable pieces (default: 4000 tokens)
294
-
3.**Processes chunks** and combines results into a single message
295
-
4.**Falls back gracefully** to a high-level summary if needed
307
+
1.**Detects large/many-file diffs** and switches to a scalable flow
308
+
2.**Groups files** by conventional type/scope; if only one large bucket remains, **auto-splits by second-level directory** (e.g., `app/api/<group>/...`)
309
+
3.**Generates messages per group** using compact `git diff --cached --numstat` summaries (not full diffs)
310
+
4.**Commits sequentially** per group with clear, conventional messages
311
+
5. When a single commit is requested, **uses compact summaries** to generate conventional messages efficiently
296
312
297
-
This ensures you can commit large changes (like new features, refactoring, or initial project setup) without hitting API limits.
313
+
This ensures you can commit large changes (like new features, refactoring, or initial project setup) without hitting API limits, while keeping a clean history.
298
314
299
315
## Troubleshooting
300
316
@@ -307,17 +323,12 @@ If you get a 413 error, your diff is too large for the API. Try these solutions:
0 commit comments