Overview
This skill covers Grille's Git module — 13 tools for structured git operations via libgit2 (no subprocess). Compared to process_run + git.exe: 1.8× more token-efficient on average, up to 20-25× on diffs. No subprocess spawn overhead. Structured data Claude can reason over rather than text to parse.
All path parameters must be within fs_allowed_paths. Write tools require git_write_enabled = true in role config. git push is not implemented — SSH agent is inaccessible from the Grille subprocess context on Windows (OS limitation).
Tools
Read-only:
git_status — Working tree and index state per file. Staged vs unstaged. ~3× more token-efficient than raw git status.
git_log — Commit history: hash, author, date, message. Filter by branch, author, file path, since. Max 100 commits.
git_diff — Diff summary (summary_only=true, default) or full patch (summary_only=false). Modes: working tree vs index, staged vs HEAD, two commits. Filter with file_path. Always start with summary.
git_branches — Branch list with last commit info and ahead/behind counts vs upstream. include_remote=true for remote-tracking branches.
git_show — Single commit detail: author, date, message, file-level diff stats (or full patch). Defaults to HEAD.
git_stash_list — All stash entries with index, message, and timestamp.
git_remote — List configured remotes with fetch and push URLs. Answers "where does this repo push to?" and "what is the origin URL?"
git_blame — Per-line authorship for a file via libgit2. Params: path (repo root), file (relative path), start_line, end_line (default 200-line window), newest_commit (ref/SHA, default HEAD). Output: line | sha8 | author | date (YYYY-MM-DD) | content. Cap 200 lines — use start/end to target a function. Answers: "Who wrote this?", "When was this changed?", "Which commit introduced this bug?".
Write (require git_write_enabled = true):
git_commit — Stage files and commit. files=["."] stages all. Returns new commit hash.
git_checkout — Switch branch or create new (create_branch=true).
git_stash — Stash working tree changes. include_untracked=true for new files.
git_stash_pop — Apply and remove a stash entry. Default index=0.
git_fetch — Fetch from remote without merging. Returns structured ref diff: updated branches (with commit count), new refs, pruned refs. Parameters: remote (default "origin"), prune (default false).
Patterns
Check state before starting work:
grille:git_status path="C:\\dev\\myproject"
grille:git_branches path="C:\\dev\\myproject"
Review recent history:
grille:git_log path="C:\\dev\\myproject" max_commits=10
grille:git_log path="C:\\dev\\myproject" file_path="src/tools/net.rs"
Inspect a commit:
grille:git_show path="C:\\dev\\myproject" commit="c5ee1cd"
grille:git_show path="C:\\dev\\myproject" commit="HEAD" summary_only=false
Review changes (always start with summary):
grille:git_diff path="C:\\dev\\myproject"
grille:git_diff path="C:\\dev\\myproject" staged=true
grille:git_diff path="C:\\dev\\myproject" file_path="src/main.rs" summary_only=false
grille:git_diff path="C:\\dev\\myproject" commit_a="v0.4.1" commit_b="HEAD"
Commit:
grille:git_status path="C:\\dev\\myproject"
grille:git_commit path="C:\\dev\\myproject" message="feat(net): add net_connections" files=["."]
grille:git_commit path="C:\\dev\\myproject" message="fix: port parsing" files=["src/tools/net.rs"]
Branch:
grille:git_checkout path="C:\\dev\\myproject" target="main"
grille:git_checkout path="C:\\dev\\myproject" target="feature/networking" create_branch=true
Check remotes:
grille:git_remote path="C:\\dev\\myproject"
Fetch:
grille:git_fetch path="C:\\dev\\myproject"
grille:git_fetch path="C:\\dev\\myproject" prune=true
grille:git_fetch path="C:\\dev\\myproject" remote="upstream"
Stash:
grille:git_stash path="C:\\dev\\myproject" message="WIP"
grille:git_stash_list path="C:\\dev\\myproject"
grille:git_stash_pop path="C:\\dev\\myproject"
Token efficiency vs process_run
| Operation |
process_run |
git module |
git status (10 files) |
~180 tokens |
~60 tokens |
git log -10 |
~250 tokens |
~80 tokens |
git diff summary |
~600 tokens |
~150 tokens |
git show summary |
~500 tokens |
~40 tokens |
Key rule: summary_only=true is the default on git_diff and git_show. Request summary_only=false only when you need to read actual code. A full diff on an active project can be 2000+ tokens.
⛔ Common mistakes
summary_only=false by default — always start with summary; drill into specific files only when needed.
- Trying to push — not supported. Use
process_run with git.exe (if allowed) or push manually in a terminal.
- Forgetting
git_write_enabled = true — write tools return a clear config error if missing.
- Using
process_run + git.exe for log/diff/status — the git module is 3-12× more token-efficient. Prefer it.
1---2name: grille-git3description: Use when performing git operations on a repository via Grille. WHEN: 'git status', 'what changed', 'commit history', 'git log', 'show diff', 'what files changed', 'commit these changes', 'switch branch', 'create branch', 'stash changes', 'fetch from remote', 'where does this repo push to', 'what is the origin URL', 'git remotes', 'who wrote this line', 'who last changed this', 'git blame', 'per-line authorship', 'which commit changed this', 'git_status', 'git_log', 'git_diff', 'git_branches', 'git_show', 'git_stash_list', 'git_commit', 'git_checkout', 'git_stash', 'git_stash_pop', 'git_fetch', 'git_remote', 'git_blame'. DO NOT USE WHEN: 'push to remote' (git push not supported — SSH agent OS limitation; use process_run with git.exe manually); 'clone a repository' (out of scope); 'merge or rebase' (interactive, not supported).4---56## Overview78This skill covers Grille's Git module — 13 tools for structured git operations via libgit2 (no subprocess). Compared to `process_run` + `git.exe`: 1.8× more token-efficient on average, up to 20-25× on diffs. No subprocess spawn overhead. Structured data Claude can reason over rather than text to parse.910All `path` parameters must be within `fs_allowed_paths`. Write tools require `git_write_enabled = true` in role config. `git push` is not implemented — SSH agent is inaccessible from the Grille subprocess context on Windows (OS limitation).1112## Tools1314**Read-only:**15- `git_status` — Working tree and index state per file. Staged vs unstaged. ~3× more token-efficient than raw `git status`.16- `git_log` — Commit history: hash, author, date, message. Filter by branch, author, file path, `since`. Max 100 commits.17- `git_diff` — Diff summary (`summary_only=true`, default) or full patch (`summary_only=false`). Modes: working tree vs index, staged vs HEAD, two commits. Filter with `file_path`. Always start with summary.18- `git_branches` — Branch list with last commit info and ahead/behind counts vs upstream. `include_remote=true` for remote-tracking branches.19- `git_show` — Single commit detail: author, date, message, file-level diff stats (or full patch). Defaults to HEAD.20- `git_stash_list` — All stash entries with index, message, and timestamp.21- `git_remote` — List configured remotes with fetch and push URLs. Answers "where does this repo push to?" and "what is the origin URL?"2223- `git_blame` — Per-line authorship for a file via libgit2. Params: `path` (repo root), `file` (relative path), `start_line`, `end_line` (default 200-line window), `newest_commit` (ref/SHA, default HEAD). Output: line | sha8 | author | date (YYYY-MM-DD) | content. Cap 200 lines — use start/end to target a function. Answers: "Who wrote this?", "When was this changed?", "Which commit introduced this bug?".2425**Write (require `git_write_enabled = true`):**26- `git_commit` — Stage files and commit. `files=["."]` stages all. Returns new commit hash.27- `git_checkout` — Switch branch or create new (`create_branch=true`).28- `git_stash` — Stash working tree changes. `include_untracked=true` for new files.29- `git_stash_pop` — Apply and remove a stash entry. Default `index=0`.30- `git_fetch` — Fetch from remote without merging. Returns structured ref diff: updated branches (with commit count), new refs, pruned refs. Parameters: `remote` (default `"origin"`), `prune` (default false).3132## Patterns3334**Check state before starting work:**35```36grille:git_status path="C:\\dev\\myproject"37grille:git_branches path="C:\\dev\\myproject"38```3940**Review recent history:**41```42grille:git_log path="C:\\dev\\myproject" max_commits=1043grille:git_log path="C:\\dev\\myproject" file_path="src/tools/net.rs"44```4546**Inspect a commit:**47```48grille:git_show path="C:\\dev\\myproject" commit="c5ee1cd"49grille:git_show path="C:\\dev\\myproject" commit="HEAD" summary_only=false50```5152**Review changes (always start with summary):**53```54grille:git_diff path="C:\\dev\\myproject"55grille:git_diff path="C:\\dev\\myproject" staged=true56grille:git_diff path="C:\\dev\\myproject" file_path="src/main.rs" summary_only=false57grille:git_diff path="C:\\dev\\myproject" commit_a="v0.4.1" commit_b="HEAD"58```5960**Commit:**61```62grille:git_status path="C:\\dev\\myproject"63grille:git_commit path="C:\\dev\\myproject" message="feat(net): add net_connections" files=["."]64grille:git_commit path="C:\\dev\\myproject" message="fix: port parsing" files=["src/tools/net.rs"]65```6667**Branch:**68```69grille:git_checkout path="C:\\dev\\myproject" target="main"70grille:git_checkout path="C:\\dev\\myproject" target="feature/networking" create_branch=true71```7273**Check remotes:**74```75grille:git_remote path="C:\\dev\\myproject"76```7778**Fetch:**79```80grille:git_fetch path="C:\\dev\\myproject"81grille:git_fetch path="C:\\dev\\myproject" prune=true82grille:git_fetch path="C:\\dev\\myproject" remote="upstream"83```8485**Stash:**86```87grille:git_stash path="C:\\dev\\myproject" message="WIP"88grille:git_stash_list path="C:\\dev\\myproject"89grille:git_stash_pop path="C:\\dev\\myproject"90```9192## Token efficiency vs process_run9394| Operation | process_run | git module |95|-----------|------------|------------|96| `git status` (10 files) | ~180 tokens | ~60 tokens |97| `git log -10` | ~250 tokens | ~80 tokens |98| `git diff` summary | ~600 tokens | ~150 tokens |99| `git show` summary | ~500 tokens | ~40 tokens |100101**Key rule:** `summary_only=true` is the default on `git_diff` and `git_show`. Request `summary_only=false` only when you need to read actual code. A full diff on an active project can be 2000+ tokens.102103## ⛔ Common mistakes104105- **`summary_only=false` by default** — always start with summary; drill into specific files only when needed.106- **Trying to push** — not supported. Use `process_run` with `git.exe` (if allowed) or push manually in a terminal.107- **Forgetting `git_write_enabled = true`** — write tools return a clear config error if missing.108- **Using `process_run` + `git.exe` for log/diff/status** — the git module is 3-12× more token-efficient. Prefer it.