
Commit Context
When you're staring at a block of code wondering why the agent put it there, this traces it back to the exact session that wrote it. It uses git blame to find the commit SHA, then looks up the linked agent session with observation counts and context. The real value is distinguishing between "I can show you the 14-observation session where the agent rewrote auth" and "this predates session tracking, here's the raw commit." It's honest about the difference, which matters when you're debugging agent decisions versus inherited code. Pairs well with commit-history if you want the broader picture across multiple changes.
- skills.sh installs
- 14.3K
- GitHub stars
- 30.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add rohitg00/agentmemory --skill commit-context --agent claude-codeInstalls into .claude/skills of the current project.
Files
The user wants commit context for: $ARGUMENTS
Quick start
git blame -L 40,52 src/auth/refresh.ts # -> SHA 9a1b2c3d
memory_commit_lookup { "sha": "9a1b2c3d4e5f60718293a4b5c6d7e8f901234567" }
Expected output:
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
- 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. - Look it up:
memory_commit_lookup { "sha": "<full-sha>" }. - 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_recallwhen available.
Anti-patterns
WRONG: lookup returns { "commit": null }, you narrate "the agent was
refactoring auth" from the diff alone.
Sponsors
Details
- Repository
- github.com/rohitg00/agentmemory
- Categories
- Git & Pull Requests, AI & Agent Building
- First seen
- Jul 14, 2026