Created
April 6, 2026 14:43
-
-
Save harshamv/d6d08049b31cdee12cee3796e72ef9ab to your computer and use it in GitHub Desktop.
Claude Code: Commit & Push Workflow for CLAUDE.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Commit & Push Workflow | |
| ### When to commit | |
| Commit at logical feature boundaries — not after every command. Triggers: | |
| - Context shifts to a new feature or concern | |
| - User says "wrap it up", "done", "next", "checkpoint", or similar | |
| - When in doubt, ask before committing | |
| Never create a commit after every individual file change. Squash small fixups into the main feature commit to keep history clean. | |
| ### Always ask first | |
| Before committing, show the proposed commit message and wait for approval: | |
| > "Ready to commit. Here's the message — ok to proceed?" | |
| Only proceed after explicit approval. | |
| ### Commit format | |
| Use conventional commits with detailed bullet-point bodies when multiple concerns are touched: | |
| ``` | |
| feat(scope): short description | |
| - path/to/file.ts: what changed and why | |
| - path/to/other.ts: what changed and why | |
| ``` | |
| Examples: | |
| ``` | |
| feat(app): add user profile screen | |
| - src/screens/Profile.tsx: new profile screen with avatar and bio | |
| - src/navigation/index.ts: added profile route | |
| ``` | |
| ``` | |
| fix(api): handle null response from auth endpoint | |
| - src/lib/auth.ts: added null check before token extraction | |
| ``` | |
| Scope by concern: `feat`, `fix`, `docs`, `chore`, `refactor`. Split body by scope when changes span multiple areas. | |
| ### Build check before every commit | |
| Adapt these commands to your project's stack: | |
| | Stack | Type check | Build/bundle check | | |
| |---|---|---| | |
| | React Native (Expo) | `pnpm tsc --noEmit` | `npx expo export --platform web` | | |
| | Next.js | `pnpm tsc --noEmit` | `pnpm build` | | |
| | Node/Express | `pnpm tsc --noEmit` | `pnpm build` | | |
| | Plain JS | — | `pnpm build` | | |
| Fill in the commands for this project: | |
| - **Type check:** `______` | |
| - **Build check:** `______` | |
| Fix all errors silently before committing. If stuck, ask explicitly with the error and suggested fixes — never commit broken code. | |
| ### Push | |
| Always commit and push together in one step. Never commit without pushing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment