plugin/skills/commit-context/SKILL.md
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", or wants context on a specific location in the codebase.
npx skillsauth add rohitg00/agentmemory commit-contextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The user wants commit context for: $ARGUMENTS
Run git blame (or git log -L) on the target file, function, or line in $ARGUMENTS to extract the most recent commit SHA that touched it. Use git blame -L <start>,<end> <file> when a line range is given, git log -L :<function>:<file> when a function name is given, and git log -n 1 -- <file> when only a path is given.
With the SHA in hand, look up the linked agent session via the memory_commit_lookup MCP tool with sha: "<full-sha>". If the MCP tool is unavailable, fall back to HTTP: GET $AGENTMEMORY_URL/agentmemory/session/by-commit?sha=<sha> with Authorization: Bearer $AGENTMEMORY_SECRET when the secret is set.
Present the result as:
memory_recallDo not fabricate intent. If the commit has no linked session, say so plainly and surface only what git show reveals. If memory_commit_lookup returns an empty commit: null body, that means the commit predates session linking — do not invent a session.
data-ai
Summarize the last N agent sessions for the current project, grouped by date. Use when the user asks "recap", "what have we been doing", "this week", "today", or wants a rollup of recent work.
data-ai
Resume the most recent agent session for the current working directory. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.
data-ai
List recent git commits that are linked to agent sessions, optionally filtered by branch or repo. Use when the user asks "show agent commits", "what has the agent shipped", or wants a list of commits with their session context.
tools
Show what happened in recent past sessions on this project. Use when user asks "what did we do last time", "session history", "past sessions", or wants an overview of previous work.