Skip to content
hfjddjksajPublic

About

Claude Code skill: per-round git auto-commit safety net with progress tracking (cross-platform Stop hooks)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-git

A Claude Code skill that gives any code project an automatic, per-round git safety net — your work gets committed every round and is never lost, with readable progress tracking on top.

What it does

When activated in a code project, Claude:

  1. Runs git init, writes a sensible .gitignore (with a mandatory secrets block), creates status.md + progress.md, and makes the initial commit.
  2. With your explicit approval, installs a project-local Stop hook that runs after every round:
    • autocommit — commits anything left uncommitted as a safety net. Commit only: it never pushes, never rewrites history, always exits 0.
  3. Offers two more hooks as separate, opt-in choices — neither installed by default, with their consequences spelled out first:
    • progress-check — if a round changed files but left both status.md and progress.md untouched, it blocks the stop once with a reminder so Claude (which has the context) refreshes them and commits. Trade-off: some rounds take one extra beat, and it can also fire on your own manual edits. It never loops and never writes content itself.
    • autopush — pushes after each round's commit, and only when the branch already has an upstream and is ahead of it. Committing is local and free; pushing publishes your work, so it is a separate hook and a separate decision. Never creates remotes or upstreams, never force-pushes.
  4. Records a per-round routine in the project's CLAUDE.md so future sessions keep the progress files current and write meaningful commit messages.

The two progress files

They have deliberately opposite semantics, so neither turns into the other:

file what it is write semantics
status.md a snapshot of the project now — current status, active decisions, next steps, known issues overwrite: anything completed, superseded, or fixed gets deleted
progress.md the project's history — dated entries, newest at the top append-only: never rewrite or delete past entries

progress.md gets an entry only for a meaningful node — a feature landing, a decision, a real bug fixed, a direction change. Typo fixes and formatting passes stay in git log where they belong. That filter is what keeps the history worth reading, and it's what makes deleting freely from status.md safe.

Projects set up under the older single-file layout (progress.md as the snapshot) get split automatically the next time the skill runs there.

Cross-platform: every hook ships as both bash (.sh, macOS/Linux) and PowerShell (.ps1, Windows).

Install

Clone into your personal Claude Code skills directory:

macOS / Linux

git clone https://github.com/hfjddjksaj/auto-git.git ~/.claude/skills/auto-git

Windows (PowerShell)

git clone https://github.com/hfjddjksaj/auto-git.git "$env:USERPROFILE\.claude\skills\auto-git"

Then start a new Claude Code session in any code project and say something like "set up auto-git" / "开启自动提交" — or just start building; the skill triggers automatically when a new code project is scaffolded. The hooks are only ever installed per-project, and only after you approve them.

Update later:

git -C ~/.claude/skills/auto-git pull

Layout

SKILL.md                      # the skill definition Claude Code loads
scripts/
  autocommit.sh / .ps1        # Stop hook: commit safety net (never pushes)
  progress-check.sh / .ps1    # Stop hook: stale progress-file reminder (opt-in)
  autopush.sh / .ps1          # Stop hook: safe push (opt-in)
assets/
  gitignore-base.txt          # universal .gitignore starting point
  status-template.md          # status.md template (snapshot)
  progress-template.md        # progress.md template (history)
references/
  gitignore-languages.md      # per-language .gitignore blocks

Safety rules

  • Local-first: only ever adds commits — no reset, rebase, amend, or force-push.
  • Committing never publishes: autocommit cannot push. Pushing is autopush, a separate hook you have to opt into, and it only pushes when an upstream is already configured and the branch is ahead.
  • Secrets block in .gitignore is mandatory, as is .claude/worktrees/ so a worktree never gets committed into its parent. Hooks respect .gitignore.
  • Hooks always exit 0 — they can never block or break your session.
  • Hooks are worktree-aware: they act on the tree Claude is actually working in, so work on a worktree branch is committed to that branch.

License

MIT


中文说明

这是一个 Claude Code skill:为代码项目提供每轮自动 git 提交的安全网 —— 每一轮的工作都会被提交,永远不会丢失,并自动维护两个进度文件: status.md 记录项目当前状态(覆盖式,做完的、被推翻的、修好的直接删掉), progress.md 记录项目历史(只追加,最新的在最上面,只写有意义的节点)。

安装(macOS / Linux):

git clone https://github.com/hfjddjksaj/auto-git.git ~/.claude/skills/auto-git

Windows(PowerShell):

git clone https://github.com/hfjddjksaj/auto-git.git "$env:USERPROFILE\.claude\skills\auto-git"

装好后,在任意代码项目里新开一个 Claude Code 会话,说"开启自动提交"即可; 新建项目时 skill 也会自动触发。autocommit hook(兜底提交)只会装进具体项目, 且安装前会征求你的同意;它只提交,不推送。另外两个 hook 都是可选项, 安装时单独询问并先说明后果,不同意就不装:progress-check(进度提醒)、 autopush(安全推送 —— 仅在分支已有上游且领先时推,从不创建远端或强推)。

旧版本里 progress.md 本身就是快照;已经用旧版装好的项目,skill 下次在那里 跑到时会自动拆成 status.md + progress.md,不会丢内容。

更新:git -C ~/.claude/skills/auto-git pull

About

Claude Code skill: per-round git auto-commit safety net with progress tracking (cross-platform Stop hooks)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages