commit-context
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe user wants commit context for: $ARGUMENTS
Run (or ) on the target file, function, or line in $ARGUMENTS to extract the most recent commit SHA that touched it. Use when a line range is given, when a function name is given, and when only a path is given.
git blamegit log -Lgit blame -L <start>,<end> <file>git log -L :<function>:<file>git log -n 1 -- <file>With the SHA in hand, look up the linked agent session via the MCP tool with . If the MCP tool is unavailable, fall back to HTTP: with when the secret is set.
memory_commit_lookupsha: "<full-sha>"GET $AGENTMEMORY_URL/agentmemory/session/by-commit?sha=<sha>Authorization: Bearer $AGENTMEMORY_SECRETPresent the result as:
- The commit SHA, short SHA, branch, author, message
- The linked session(s): id, project, started/ended timestamps, observation count, summary if any
- A short list of the most important observations from that session (importance >= 7) when available via
memory_recall
Do not fabricate intent. If the commit has no linked session, say so plainly and surface only what reveals. If returns an empty body, that means the commit predates session linking — do not invent a session.
git showmemory_commit_lookupcommit: null用户需要以下内容的提交上下文:$ARGUMENTS
在$ARGUMENTS指定的目标文件、函数或代码行上运行(或),提取最近修改该内容的提交SHA值。如果指定了行范围,使用;如果指定了函数名,使用;如果仅指定了路径,使用。
git blamegit log -Lgit blame -L <start>,<end> <file>git log -L :<function>:<file>git log -n 1 -- <file>获取SHA值后,通过 MCP工具,传入参数来查询关联的Agent会话。如果MCP工具不可用,当设置了密钥时,回退使用HTTP请求:,请求头携带。
memory_commit_lookupsha: "<full-sha>"GET $AGENTMEMORY_URL/agentmemory/session/by-commit?sha=<sha>Authorization: Bearer $AGENTMEMORY_SECRET结果呈现格式如下:
- 提交SHA、短SHA、分支、作者、提交信息
- 关联的会话:ID、项目、开始/结束时间戳、观测次数、摘要(如有)
- 该会话中最重要的观测列表(重要性≥7)(当可通过获取时)
memory_recall
请勿编造意图。如果该提交没有关联的会话,请直接说明,仅展示返回的内容。如果返回的空响应体,说明该提交早于会话关联功能的启用,请勿虚构会话。
git showmemory_commit_lookupcommit: null