commit-context Skill (agentmemory): Why Is This Code Here
Traces a file, function or line back to the agent session that produced its commit, for developers asking why code is there.
- Installs
- 14K
- on skills.sh
- Stars
- 30.1K
- on GitHub
- Files
- 2
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
Point /commit-context at a file, function or line range. The skill finds the commit with git, then asks agentmemory which agent session produced it. You get the commit (SHA, branch, author, message) and the linked session with its start and end times and observation count.
If the commit was made before session linking existed, the lookup returns nothing and the skill says so instead of guessing the intent. It needs the agentmemory server and a git repository.
Good for
- Developers inheriting code an agent wrote and asking why it changed
- Reviewers who want the session behind a commit
- Teams using agentmemory to link commits to agent work
Install commit-context
Claude Code
- 1
Copy this prompt.
Install the commit-context skill in Claude Code. Run this command: npx -y @agentmemory/agentmemory@latest Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js 20 or newer.
This skill only works when the memory server is running and the agentmemory MCP tools are connected. The plugin route is the one the README recommends for Claude Code. The skills-only route installs all 17 skills but does not connect the MCP tools by itself. Pick one route, not both.
From the project README. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- Quick start
- Why
- Workflow
- Anti-patterns
- Checklist
- See also
- Troubleshooting
Key facts
- Author
- rohitg00
- Repository
- rohitg00/agentmemory
- Installs on skills.sh
- 14,025 as of 2026-11-02
- GitHub stars
- 30,069 for the whole rohitg00/agentmemory repo
- Last repo commit
- 2026-10-29
- What is inside
- 3 files including SKILL.md: EXAMPLES.md and TROUBLESHOOTING.md. It bundles no scripts.
- skills.sh audits
- Gen Agent Trust Hub: pass; Socket: pass; Snyk: pass
What it includes
git blame, git log -L, or the latest commit for a path
git blame -L start,end file for a line range, git log -L :function:file for a function, and git log -n 1 -- file for a bare path.
Try: “/commit-context src/auth/refresh.ts lines 40-52”
Runs code ·
Find the commitLooks up a full commit SHA in agentmemory
Takes the full SHA from git and returns the commit and any linked sessions. A null commit means the commit predates session linking.
Network ·
memory_commit_lookupCommit, linked sessions and high-importance observations
Shows sha, short sha, branch, author and message, then each linked session with id, project, times, observation count and summary. Observations with importance 7 or higher are added through memory_recall when it is available.
Present the resultReports only what git and the lookup return
SKILL.md says that when the lookup gives commit: null, the skill must say the commit predates linking and must not invent intent from the diff.
No-invention rule
From the official docs
Permissions
Medium risk
The skill runs read-style git commands and one memory lookup, but the agentmemory plugin behind it records your sessions through hooks. Check what is stored in the viewer.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
The plugin records your sessions through hooks
The README lists captured data: user prompts (privacy-filtered), tool name, input and output, errors, and the assistant reply of each turn. Review what is stored in the viewer, and use the forget skill to remove entries. github.com
Installing starts a local server and runs npm code
The setup command pulls the latest package with npx and starts a background server. On macOS and Linux it also needs curl, sh and tar for automatic runtime setup. github.com
Saved memories flow back into later sessions
plugin.json says the plugin injects context into future sessions, and the README says automatic injection through the shared hooks is opt-in. Recalled text is read by the assistant, so avoid saving text you do not trust. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only switch is documented for these skills. |
|---|---|
| Talks to | The server and viewer bind to loopback (127.0.0.1) by default. Compression or embeddings with a provider you configure use that provider. Local semantic search downloads an embedding model on first use if you set EMBEDDING_PROVIDER=local |
| Sign-in and keys | A local server creates a random secret at ~/.agentmemory/secret with mode 0600 and the bundled clients read it. A remote server needs AGENTMEMORY_SECRET in your environment. |
| Data retention | Memories are stored on your machine in the agentmemory data folder until you delete them. The README says API keys, bearer tokens and <private> tags are stripped before storage. |
| Scopes |
|
Questions
What does /commit-context do?
It finds the commit behind a file, function or line, then asks agentmemory which agent session produced that commit. You get the commit details and the session summary.
How do I install it?
Use the install box above. You need the agentmemory server running and its MCP tools connected, because the lookup comes from the server.
What if there is no linked session?
The skill reports that the commit predates session linking and gives you what git shows. It does not make up an intent.
Does it work on any git repo?
It uses git blame and git log, so it needs a git repository. Linked sessions only exist for commits that agentmemory recorded.
How is it different from commit-history?
commit-context drills into one location and its commit. commit-history lists many agent-linked commits at once. Both are in the same plugin.
Is it safe?
The skill bundles no scripts. It runs git blame or git log in your repo and calls one memory tool with a commit SHA. The agentmemory plugin around it installs hooks and runs a local server, which the permissions section covers.
Information
updated Nov 2, 2026
- Repository
- rohitg00/agentmemory
- Folder
plugin/skills/commit-context
Sources
Docs, issue trackers and discussions this page is built from.
Show all 7Hide
- rohitg00/agentmemory README · github.com
- skills CLI commands · github.com
- commit-context SKILL.md · github.com
- plugin hooks.json · github.com
- plugin .mcp.json · github.com
- plugin.json · github.com
- Shared TROUBLESHOOTING.md · github.com