PlugWiki

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

  1. Quick start
  2. Why
  3. Workflow
  4. Anti-patterns
  5. Checklist
  6. See also
  7. Troubleshooting

Key facts

Author
rohitg00
Installs on skills.sh
14,025 as of 2026-11-02
Last repo commit
2026-10-29

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 commit

  • Looks 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_lookup

  • Commit, 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 result

  • Reports 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-onlyNo read-only switch is documented for these skills.
Talks toThe 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 keysA 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 retentionMemories 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
  • Runs git blame or git log on files you name, then queries agentmemory by commit SHA

  • The Claude Code plugin registers 12 hooks that run node scripts on events such as every prompt, every tool call and the end of each turn

  • The plugin ships a .mcp.json that starts a node bridge to the local memory server

  • Setup runs npx -y @agentmemory/agentmemory@latest, writes config to ~/.agentmemory and starts a server on localhost:3111

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

Folder
plugin/skills/commit-context

rohitg00/agentmemoryskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 7
  1. rohitg00/agentmemory README · github.com
  2. skills CLI commands · github.com
  3. commit-context SKILL.md · github.com
  4. plugin hooks.json · github.com
  5. plugin .mcp.json · github.com
  6. plugin.json · github.com
  7. Shared TROUBLESHOOTING.md · github.com

Updated Nov 2, 2026.