Guide
What you get: Typing /commit writes a Conventional Commits style message for your staged changes and makes one local commit. Best for Developers using Claude Code (or Codex via a skill) who want consistent commit messages without writing them by hand..
Before you start
- A git repository with staged changes
- Claude Code: save as .claude/commands/commit.md (its allowed-tools line covers git diff, git status and git commit)
- Codex: save as .agents/skills/commit/SKILL.md with name and description front matter, and let Codex write to .git (its workspace-write sandbox blocks this by default)
Worked example (Oct 17, 2026, Claude Code 2.1.296; Codex 0.151.0 (gpt-5.6-sol))
Input
Staged change to src/app/layout.tsx: title 'Create Next App' -> 'Acme Notes', new description. Ran /commit in Claude Code and $commit in Codex. {{commit_style}} = Conventional Commits.Result
Claude Code commit: "chore: rename app metadata to Acme Notes". Codex commit (second run): "feat: brand app metadata for Acme Notes"
Claude Code: one local commit, subject plus one 'why' bullet; it also added a Co-Authored-By trailer (Claude Code's default attribution, not from the template). Codex run 1 with -s workspace-write FAILED: git could not create .git/index.lock because the sandbox keeps .git read-only, so no commit was made. Codex run 2 with --add-dir <repo>/.git succeeded: one commit, subject plus two 'why' bullets. No push in any run; untracked files were left out. After this test step 3 waits for your OK before committing (in the test it committed straight away). Codex needed write access to .git for the commit (run 2 used --add-dir .git).
How to check it worked
- git log -1 shows exactly one new commit
- The subject line matches the staged diff and is under 72 characters
- git status shows nothing left staged, and untracked files were not committed
Common problems
- Codex in its default workspace-write sandbox cannot write to .git, so the commit fails until you allow it
- In headless (-p) mode you only see the final reply, so the 'show me the message' step is not a real chance to approve it
- Claude Code may append its own Co-Authored-By trailer
Log in to join the discussion.