commit-context — скилл для Claude Code: установка
Скилл связывает файл, функцию или строку с коммитом и сессией агента. Пригодится, когда нужно понять происхождение изменения.
npx skills add rohitg00/agentmemory --skill commit-context -a claude-codeЧто делает commit-context
Скилл начинает с Git: для строки или диапазона использует git blame, для функции — git log -L, для файла — git log -n 1 -- <file>. Затем передаёт полный SHA в memory_commit_lookup и показывает коммит, ветку, автора, сообщение и связанную сессию.
В результат могут войти идентификатор проекта, время начала и окончания сессии, число наблюдений, её краткое описание и наблюдения с важностью от 7 через memory_recall. Если lookup возвращает commit: null, скилл сообщает, что коммит предшествует связыванию сессий, и не приписывает агенту намерение. Без memory_commit_lookup связь коммита с сессией не сработает.
Какие задачи решает
- найти коммит, изменивший строку или диапазон
- отследить функцию до связанной сессии агента
- понять причину появления кода в файле
- показать автора, ветку и сообщение коммита
- отделить записанный контекст от догадок по diff
Примеры запросов агенту
- Покажи контекст коммита для
src/auth/refresh.tsчерез/commit-context. - Разберись, почему здесь появился этот код: функция
rotateRefreshTokens, используй/commit-context. - Найди сессию агента, связанную с изменением строки 40 в
src/auth/refresh.ts, через/commit-context.
Как установить commit-context
1Через Skills CLI (Vercel)
npx skills add rohitg00/agentmemory --skill commit-context -a claude-code2Вручную: положить файлы
~/.claude/skills/commit-context/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/commit-context/
1Через Skills CLI (Vercel)
npx skills add rohitg00/agentmemory --skill commit-context -a codex2Вручную: положить файлы
.agents/skills/commit-context/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add rohitg00/agentmemory --skill commit-context -a cursor2Вручную: положить файлы
.cursor/skills/commit-context/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install rohitg00/agentmemory commit-context2Вручную: положить файлы
.github/skills/commit-context/SKILL.md1Через Skills CLI (Vercel)
npx skills add rohitg00/agentmemory --skill commit-context -a gemini-cli2Командой платформы
gemini skills install https://github.com/rohitg00/agentmemory --path plugin/skills/commit-contextВручную: положить файлы
.devin/skills/commit-context/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add rohitg00/agentmemory --skill commit-context -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о commit-context
Как установить commit-context в Claude Code?
Выполните npx skills add rohitg00/agentmemory --skill commit-context -a claude-code, затем проверьте файл ~/.claude/skills/commit-context/SKILL.md.
Что делает commit-context?
Скилл находит SHA через Git и передаёт его в memory_commit_lookup. После этого он показывает данные коммита и связанную с ним сессию агента, если такая связь есть.
Что произойдёт, если commit: null?
Скилл сообщает, что коммит предшествует связыванию сессий. Намерение агента по одному diff не выводится.
Исходный текст
SKILL.md · Apache-2.0
---
name: commit-context
description: Trace a file, function, or line back to the agent session that produced its current commit. Use when the user asks "why is this code here", "what was the agent doing when this changed", "who wrote this", or wants context on a specific location in the codebase.
argument-hint: "[file, function, or line]"
user-invocable: true
---
The user wants commit context for: $ARGUMENTS
## Quick start
```bash
git blame -L 40,52 src/auth/refresh.ts # -> SHA 9a1b2c3d
```
```json
memory_commit_lookup { "sha": "9a1b2c3d4e5f60718293a4b5c6d7e8f901234567" }
```
Expected output:
```text
9a1b2c3 on main by dev: "rotate refresh tokens"
Linked session 7f3a9c2 "Auth refresh rework", 14 obs.
```
## Why
Report only what git and the lookup return. When the lookup gives `commit: null`,
the commit predates session linking; do not invent intent.
## Workflow
1. Find the SHA: `git blame -L <start>,<end> <file>` for a line range;
`git log -L :<function>:<file>` for a function; `git log -n 1 -- <file>` for a
bare path.
2. Look it up: `memory_commit_lookup { "sha": "<full-sha>" }`.
3. Present the commit (sha, short sha, branch, author, message), the linked
session(s) (id, project, started/ended, observation count, summary), and the
importance >= 7 observations via `memory_recall` when available.
## Anti-patterns
WRONG: lookup returns `{ "commit": null }`, you narrate "the agent was
refactoring auth" from the diff alone.
RIGHT: "This commit predates session linking, so there is no recorded agent
session. From `git show`: it changed token rotation in refresh.ts."
## Checklist
- SHA came from git blame/log, not a guess.
- `commit: null` reported as "predates linking", no fabricated session.
- Session details quote the lookup response verbatim.
- No intent claimed beyond what observations state.
## See also
- `commit-history`: list many agent-linked commits at once.
- `recall`: dig deeper into the linked session's observations.
## Troubleshooting
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) if `memory_commit_lookup` is not available.
© rohitg00 · Apache-2.0 · rohitg00/agentmemory