rohitg00 avatar

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-code

Installs 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

  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.

Sponsors

Details

Repository
github.com/rohitg00/agentmemory
Categories
Git & Pull Requests, AI & Agent Building
First seen
Jul 14, 2026

More from rohitg00/agentmemory

All 15
1github avatarmake-repo-contributiongithub/awesome-copilotAll changes to code must follow the guidance documented in the repository. Before any issue is filed, branch is made, commits generated, or pull request (or PR)11.1Kskills.sh installs
2github avatarcreate-github-issues-feature-from-implementation-plangithub/awesome-copilotCreate GitHub Issues from implementation plan phases using feature_request.yml or chore_request.yml templates.9.5Kskills.sh installs
3sanyuan0704 avatarcode-review-expertsanyuan0704/code-review-expertcode review expert8.2Kskills.sh installs
4affaan-m avatarsecurity-reviewaffaan-m/eccUse this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provid7.6Kskills.sh installs
5mattpocock avatartriage-issuemattpocock/skillstriage issue6.3Kskills.sh installs
6wshobson avatarreview-agent-setupwshobson/agentsConfigure human-in-the-loop gating for AI agent review actions in Claude Code. Use when setting up a project where an agent may post PR reviews, comments, merge5.6Kskills.sh installs