Agent skill

Commit Context Lookup

by rohitg00 in rohitg00/agentmemory

Traces a file, function or line back to the agent session behind its current commit, using git blame and a memory lookup, and reports only what the records show.

Apache-2.0Auto-check passedDevelopment

Install Commit Context Lookup

skills CLI
$ npx skills add rohitg00/agentmemory --skill commit-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rohitg00/agentmemory commit-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rohitg00/agentmemory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/commit-context .claude/skills/commit-context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
commit-context
GitHub stars
29k
Token cost
~522 tokens
SKILL.md length
196 words
Files
2
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Traces a file, function or line back to the agent session behind its current commit, using git blame and a memory lookup, and reports only what the records show.

  • Works in 3 steps: Find the SHA: git blame -L , for a line… → Look it up: memory_commit_lookup {… → Present the commit (sha, short sha,…
  • Asking why a block of code exists and what the agent was doing when it changed
  • SKILL.md covers Quick start, Why, Workflow and Anti-patterns, plus 3 more sections
  • Calls git

What it does

The agent first finds the commit SHA: `git blame -L` for a line range, `git log -L` for a function, or `git log -n 1` for a bare file path. It then calls `memory_commit_lookup` with the full SHA and presents the commit (sha, short sha, branch, author, message), any linked sessions (id, project, start and end, observation count, summary) and the high-importance observations from `memory_recall` when that tool is available.

The skill is strict about not inventing intent. When the lookup returns `commit: null`, the commit predates session linking, and the agent says so and describes only what `git show` reveals. Its checklist requires the SHA to come from git, session details to quote the lookup verbatim and no intent to be claimed beyond the recorded observations. An examples file is included, and `commit-history` and `recall` are named as follow-ups.

When your agent uses it

  • Asking why a block of code exists and what the agent was doing when it changed
  • Finding which agent session produced a specific commit
  • Getting background on a function before you change it

Example prompts

  • “Why do lines 40 to 52 of src/auth/refresh.ts look the way they do? Trace the commit back to its session.”
  • “What was the agent doing when it last changed the parseConfig function in src/config.ts?”
  • “Look up the agent session behind commit 9a1b2c3d.”

Requirements

  • Git history for the repository
  • The `memory_commit_lookup` tool from the agentmemory plugin

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Find the SHA: git blame -L , for a line range;
  2. Look it up: memory_commit_lookup { "sha": "" }.
  3. Present the commit (sha, short sha, branch, author, message), the linked

What it can do on your machine

Read from SKILL.md and the folder at commit 007a1a7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Commit Context Lookup loads about 522 tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 196 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~522

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rohitg00/agentmemory at commit 007a1a7, republished under its Apache-2.0 licence (© rohitg00). 196 words, ~522 tokens.

Download SKILL.mdSave it as .claude/skills/commit-context/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
commit-context
description
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.
argument-hint
[file, function, or line]
user-invocable
true

The user wants commit context for: $ARGUMENTS

Quick start

bash
git blame -L 40,52 src/auth/refresh.ts   # -> SHA 9a1b2c3d
json
memory_commit_lookup { "sha": "9a1b2c3d4e5f60718293a4b5c6d7e8f901234567" }

Expected output:

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

RIGHT: "This commit predates session linking, so there is no recorded agent session. From git show: it changed token rotation in refresh.ts."

Checklist

  • SHA came from git blame/log, not a guess.
  • commit: null reported as "predates linking", no fabricated session.
  • Session details quote the lookup response verbatim.
  • No intent claimed beyond what observations state.

See also

  • commit-history: list many agent-linked commits at once.
  • recall: dig deeper into the linked session's observations.

Troubleshooting

See ../_shared/TROUBLESHOOTING.md if memory_commit_lookup is not available.

© rohitg00, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in plugin/skills/commit-context of rohitg00/agentmemory.

  • SKILL.md
  • EXAMPLES.md

Open the folder on GitHubat commit 007a1a7

Compare with similar skills

Commit Context Lookup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Commit Context Lookup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Commit Context Lookup this skillrohitg00/agentmemory29k—~522Automated safety check: PassApache-2.0
Git Notes Memorysundial-org/awesome-openclaw-skills663—~2.7kAutomated safety check: PassNone
Gccdavila7/claude-code-templates32k—~1.6kAutomated safety check: PassMIT
Triple Memorysundial-org/awesome-openclaw-skills663—~972Automated safety check: PassNone
Elite Longterm MemoryaAAaqwq/AGI-Super-Team1052 repos~2.9kAutomated safety check: PassMIT
Git Worktree IsolationjnMetaCode/superpowers-zh8.3k1 repos~982Automated safety check: PassMIT

Similar skills

  • Git Notes Memory

    sundial-org/awesome-openclaw-skills

    Git-Notes-Based knowledge graph memory system. An agent skill from sundial-org/awesome-openclaw-skills.

    663 GitHub stars~2.7k tokensUpdated 7 mo ago
    Agent WorkflowsAuto-check passed
  • Gcc

    davila7/claude-code-templates

    Git Context Controller (GCC) - Manages agent memory as a versioned file system under .GCC/.

    32k GitHub stars~1.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Triple Memory

    sundial-org/awesome-openclaw-skills

    Complete memory system combining LanceDB auto-recall, Git-Notes structured memory, and file-based workspace search.

    663 GitHub stars~972 tokensUpdated 7 mo ago
    Agent WorkflowsAuto-check passed
  • Elite Longterm Memory

    aAAaqwq/AGI-Super-Team

    Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot.

    105 GitHub starsUsed in 2 repos~2.9k tokens
    Agent WorkflowsAuto-check passed
  • Git Worktree Isolation

    jnMetaCode/superpowers-zh

    Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.

    8.3k GitHub starsUsed in 1 repo~982 tokens
    DevelopmentAuto-check passed
  • GitHub

    swarmclawai/swarmclaw

    GitHub operations via gh CLI: issues, PRs, CI runs, code review, API queries.

    688 GitHub stars~820 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed

More from rohitg00/agentmemory

All 17 skills in this repo
  • Sets up and troubleshoots a local agentmemory install, covering the MCP connection, environment variables, ports, authentication and optional feature flags.

    29k GitHub stars~1k tokensUpdated yesterday
    Auto-check: notes
  • Agent Commit History

    rohitg00/agentmemory

    Lists recent git commits linked to agent sessions, filterable by branch, repository or a result limit, showing the session id and observation count behind each one.

    29k GitHub stars~524 tokensUpdated yesterday
    Auto-check passed
  • Agentmemory Forget

    rohitg00/agentmemory

    Deletes chosen memories from agentmemory only after showing the matches and getting an explicit yes, for privacy requests and cleanup of outdated notes.

    29k GitHub stars~612 tokensUpdated yesterday
    Auto-check passed
  • Session Handoff Resume

    rohitg00/agentmemory

    Resumes the most recent agent session for the current directory, leading with any question left unanswered and ending with a concrete next step.

    29k GitHub stars~678 tokensUpdated yesterday
    Auto-check passed
  • Lesson Memory Recorder

    rohitg00/agentmemory

    Distills a user correction or hard-won rule into a confidence-weighted lesson that resurfaces automatically before similar future work.

    29k GitHub stars~721 tokensUpdated yesterday
    Auto-check passed
  • Agent Memory Discipline Loop

    rohitg00/agentmemory

    Makes persistent agent memory pay off by searching before work starts and saving each decision the moment it settles, rather than batching a summary at the end.

    29k GitHub stars~831 tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Commit Context Lookup

What does Commit Context Lookup do?

Traces a file, function or line back to the agent session behind its current commit, using git blame and a memory lookup, and reports only what the records show. The agent first finds the commit SHA: `git blame -L` for a line range, `git log -L` for a function, or `git log -n 1` for a bare file path. It then calls `memory_commit_lookup` with the full SHA and presents the commit (sha, short sha, branch, author, message), any linked sessions (id, project, start and end, observation count, summary) and the high-importance observations from `memory_recall` when that tool is available.

When should I use Commit Context Lookup?

Commit Context Lookup fits situations like: asking why a block of code exists and what the agent was doing when it changed; finding which agent session produced a specific commit; getting background on a function before you change it.

How do I install Commit Context Lookup in Claude Code?

Run `npx skills add rohitg00/agentmemory --skill commit-context -a claude-code`. Or copy the skill folder (plugin/skills/commit-context in rohitg00/agentmemory) into .claude/skills/commit-context in your project. Claude Code loads it when a task matches its description.

How do I install Commit Context Lookup in Codex?

Run `npx skills add rohitg00/agentmemory --skill commit-context -a codex`. Or copy the skill folder (plugin/skills/commit-context in rohitg00/agentmemory) into .agents/skills/commit-context in your project. Codex loads it when a task matches its description.

Can I use Commit Context Lookup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rohitg00/agentmemory --skill commit-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/commit-context, .gemini/skills/commit-context, .github/skills/commit-context and .opencode/skills/commit-context in your project.

What does Commit Context Lookup need to run?

Going by SKILL.md and its folder, Commit Context Lookup needs the command-line tools its instructions call (git). Our summary lists: Git history for the repository; The `memory_commit_lookup` tool from the agentmemory plugin.

Does Commit Context Lookup access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Commit Context Lookup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Commit Context Lookup use?

Commit Context Lookup is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Commit Context Lookup use?

About 522 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Commit Context Lookup?

Skills that share tags, products or a category with Commit Context Lookup: Git Notes Memory (sundial-org/awesome-openclaw-skills, 663 stars), Gcc (davila7/claude-code-templates, 32k stars), Triple Memory (sundial-org/awesome-openclaw-skills, 663 stars) and Elite Longterm Memory (aAAaqwq/AGI-Super-Team, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Commit Context Lookup?

rohitg00 (a GitHub user) maintains it in rohitg00/agentmemory, which has 29,222 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 6, 2026.

Source: rohitg00/agentmemory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.