How CommitCraft AI Generates
Perfect Commit Messages
From staged diff to conventional commit in under 3 seconds. Here's exactly what happens under the hood — no magic, just a well-engineered pipeline inside VS Code.
The 5-Step Process
Every commit generation follows the exact same deterministic pipeline.
You stage your changes
Use `git add .` in the terminal, or stage individual files in VS Code's Source Control panel. CommitCraft only reads staged changes — unstaged work is never touched. This keeps you in full control of what gets included in the commit.
$ git add src/auth/oauth.ts
$ git add src/middleware/session.ts
# Or stage via VS Code Source Control UIClick the ✨ button in Source Control
A ✨ icon appears directly in the VS Code Source Control toolbar — no extra panels, no external apps. Click it once. You can also trigger generation with the keyboard shortcut Ctrl+Shift+G (Cmd+Shift+G on Mac) or via the Command Palette.
CommitCraft reads your staged diff
The extension calls VS Code's built-in Git API to retrieve your staged diff. This is the same diff you'd see with `git diff --staged`. Only the diff text is read — not your full files, not your project tree, not any configuration.
// Internally calls:
const diff = await repo.diff(true) // true = staged only
// Large diffs are trimmed to 8KB before analysisThe diff is analyzed by Claude AI
The diff is sent to Claude Haiku — Anthropic's fast, cost-efficient model — with a structured prompt that instructs it to identify the change type, scope, and a precise description. The model is specifically prompted to output conventional commit format, not free-form text.
A commit message appears — review and accept
Claude's response is parsed into a title (the conventional commit line) and optional bullet points for the body. These appear in a VS Code panel for you to review. Click Accept to fill the Source Control input box, then commit as normal. Or regenerate if you want a different take.
feat(auth): add Google OAuth login with session persistence
+ Implement OAuth2 flow via passport-google-oauth20
+ Add Redis session store with 7-day TTL
+ Handle findOrCreate pattern for new usersUnder the Hood
For engineers who want to understand the technical implementation before trusting a tool with their workflow.
VS Code Git API
CommitCraft uses VS Code's built-in Git extension API — specifically `repo.diff(true)` to fetch only staged changes. This is the same API surface that VS Code's own Source Control UI uses, so it's stable and well-supported.
const diff = await repo.diff(true)
// true = staged (index) onlyDiff size limit
Before sending to the AI, diffs are trimmed to approximately 8,000 characters (8KB). This keeps API costs low, latency fast, and ensures the model focuses on the most semantically significant changes.
const trimmed = diff.slice(0, 8000)
// Front-loaded: top changes preservedClaude Haiku model
CommitCraft uses Claude Haiku — the fastest and most cost-efficient model in the Claude family. It's well-suited for structured output tasks like commit message generation where speed matters more than creative depth.
model: "claude-haiku-*"
max_tokens: 300
temperature: 0.3SCM input box injection
On Accept, the generated message is written directly to VS Code's Source Control input box using `repo.inputBox.value`. No clipboard tricks, no terminal commands — it just appears in the right place.
repo.inputBox.value = generatedMessage
// Ready to commit with Ctrl+EnterThree Commit Styles
CommitCraft adapts to your team's conventions. Switch styles from the VS Code settings panel — the same diff, different format.
Conventional Commits
Most popularThe industry standard. Works with semantic-release, standard-version, and automated changelog tools.
feat(auth): add Google OAuth login with session persistence
+ Implement OAuth2 flow
+ Add Redis session store (7d TTL)GitMoji
Fun & expressiveEmoji-prefixed commits that are visually scannable at a glance. Popular in design-oriented and open-source projects.
✨ feat(auth): add Google OAuth login
+ OAuth2 flow via passport-google
+ Redis sessions with 7-day TTLSimple
MinimalClean, plain-English commit messages for teams that prefer simplicity over strict formatting conventions.
Add Google OAuth login with session persistence
- OAuth2 integration via passport
- Redis-backed user sessionsYour Code Stays Private
CommitCraft is designed with privacy as a first principle. We built it to work with the minimum necessary data.
Only the diff is sent
CommitCraft sends only the staged git diff — not your full source files, not your project structure, not any file outside the diff.
No code storage
We do not store, log, or retain diffs or commit messages on our servers. Each request is processed and discarded.
No commit history logging
We don't track which commits you generate, how often you use the extension, or any metadata about your repository.
Technical Questions
Does it work with any programming language?
Yes — CommitCraft reads git diffs, which are language-agnostic. Whether you're working in TypeScript, Python, Go, Rust, Java, Ruby, C++, Swift, or anything else, the diff format is identical. The AI understands code changes across all languages and frameworks.
What if the diff is very large?
Large diffs are automatically truncated to approximately 8KB before being sent to Claude AI. The truncation is front-loaded — the most important changes at the top of the diff are preserved. For very large commits, consider splitting them into smaller, focused commits for the best results.
Can I use my own Claude API key?
Not yet. Currently, CommitCraft uses a managed API key so you don't need to configure anything. Support for bring-your-own API key (BYOK) is on the roadmap for a future release.
Does it work offline?
No — CommitCraft requires an internet connection to reach the Claude AI API. The diff analysis happens server-side. However, all other VS Code Git functionality works offline as normal; CommitCraft only activates when you click the generate button.
Ready to auto-generate your commits?
Install CommitCraft AI and get 5 free generations per month. No API key needed, no config required.
Install Free — VS Code Marketplace →