Obsidian plugin that automatically commits and pushes vault changes to Git after a configurable period of inactivity. Commit messages are generated by Claude AI based on the staged diff.
Desktop only. Requires Git in PATH.
- Any file change in the vault (create, modify, delete, rename) resets an inactivity timer.
- When the timer expires with no further changes, the plugin runs
git add -A, generates a commit message via the Anthropic API, and commits. - If push is enabled, it fetches the remote, rebases if needed, and pushes.
On startup, if there are uncommitted changes from a previous session, a commit is triggered immediately.
- Git installed and available in PATH
- An Anthropic API key
- Node.js and npm (for install script only)
~/.npmrcauthenticated against the Gitea registry (read token):@vctrtvfrrr:registry=https://git.codelab.tec.br/api/packages/vctrtvfrrr/npm/ //git.codelab.tec.br/api/packages/vctrtvfrrr/npm/:_authToken=<your-read-token>
# Install into ~/obsidian (default)
./install.sh
# Install into a different vault
./install.sh /path/to/your/vaultThen in Obsidian: Settings → Community plugins → Enable Auto Commit.
To update, run ./install.sh again after a new release.
Open Settings → Auto Commit:
| Setting | Default | Description |
|---|---|---|
| Inactivity interval (minutes) | 15 |
How long to wait after the last change before committing |
| Branch | (current branch) | Branch to push to; leave empty to use the current branch |
| Remote | origin |
Git remote name |
| Push after commit | on | Automatically push after each commit |
| Model | Claude Haiku 4.5 | Anthropic model used to write commit messages |
| Effort | low |
How much the model reasons before writing; Sonnet 5 and Opus 5 only |
| Prompt | (empty) | Required. Full instructions for the commit message |
| Anthropic API key | — | API key used to generate commit messages |
The prompt is mandatory: with no prompt there is no commit. A fresh install — and an upgrade from 1.5.x — starts blocked, showing a failure icon and a tooltip in the status bar until you write one. This is deliberate: the old commit message style field held a line of style, not a prompt, so its value is discarded rather than turned into a half-baked prompt.
The prompt carries everything about the content of the message — language, writing style, column limits, subject format, whether a body is required, whether to use Conventional Commits. The settings field shows a suggested prompt as a placeholder; copy it and edit, or write your own. That placeholder is never saved and is never used as a fallback.
The plugin keeps exactly one rule for itself: the model's response is the commit message and nothing else, with no code fences, no decorative quotation marks and no preamble. That is not style — the response goes straight into git commit -m, so a code fence would land literally in your history. See ADR-0002.
| Model | Trade-off | Effort |
|---|---|---|
| Claude Haiku 4.5 | Fastest and cheapest (default) | Not supported |
| Claude Sonnet 5 | Better instruction following | Supported |
| Claude Opus 5 | Highest quality, most expensive | Supported |
Haiku 4.5 stays the default so that upgrading never raises your bill without asking. It does not reliably respect a subject column limit, though — if that bothers you, pick Sonnet 5 or Opus 5.
Effort (low through max) controls how much the model reasons before writing. The field is disabled on Haiku 4.5, which does not accept the parameter.
Changes under .obsidian/ are excluded from the diff sent to the AI, because Obsidian rewrites those files on every session and the noise both crowds out the real changes and blows the size limit. They are still committed normally.
When .obsidian/ is the only thing that changed, it becomes the diff sent to the AI, so the commit still gets a description — a short one, without a body.
Settings are stored obfuscated in .obsidian/plugins/obsidian-auto-commit/data.json to avoid leaking the API key through Git diffs.
The command Auto Commit: Run now (accessible via the command palette) triggers a commit immediately, respecting all the same guards as the automatic timer.
- Empty prompt: no Git command runs at all — nothing is staged. Shown as a failure icon and tooltip in the status bar, with no popup.
- Special repo state (merge, rebase, cherry-pick, bisect, detached HEAD): skipped silently.
- No changes: no-op.
- Diff sent to the AI > 200 KB: aborted with a persistent notice; no commit is created and everything remains staged. The diff is never truncated.
- AI unavailable: aborted with a persistent notice; staged changes remain for the next cycle or manual commit.
- Incomplete AI response (cut short by the token budget, or a refusal): treated the same way — no commit is created, changes remain staged. A truncated message is never committed.
- Rebase conflict on push: rebase is aborted, local commit is preserved, persistent notice shown.
- Push failure: local commit is kept; next cycle will retry the push.
- Concurrent runs: if a commit is already in progress, the new trigger is ignored.
npm installnpm run build # production build → main.js
npm run dev # watch mode
npm run typecheck # type-check only, no outputCopy the plugin files to your vault after each build:
VAULT=~/obsidian
PLUGIN_DIR="${VAULT}/.obsidian/plugins/obsidian-auto-commit"
mkdir -p "${PLUGIN_DIR}"
cp manifest.json main.js "${PLUGIN_DIR}/"Then reload the plugin in Obsidian (Settings → Community plugins → disable → enable).
- Bump the version:
npm version patch # or minor / major - Push the tag:
git push --follow-tags
The Gitea Actions workflow (.gitea/workflows/release.yml) picks up the v* tag, builds, and publishes to the npm registry automatically. Requires the NODE_AUTH_TOKEN secret (write token) configured in the repo settings.