but-agentlog
它能做什么
这项技能查看与某个代码分支或审查相关联的早期 AI 智能体会话。适合接手工作、需要了解之前已尝试过什么的开发者。
适用场景
- ✓当你接手某个分支,想了解之前做过什么时。
- ✓当有人要求你跟上某个分支、审查或修改的进展时。
- ✓当你需要从早期的智能体会话中恢复上下文时。
技能链接
https://github.com/gitbutlerapp/gitbutler/blob/master/crates/but-agentlog/skill/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我做任何修改之前,请先让我了解这个分支上发生过什么。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会使用 GitButler 附带的 agentlog 命令,以简短概览列出相关会话。只有当概览不够详细时,才会打开某一个会话的详情。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
GitButler Agentlog Skill
Use but agentlog to skim prior agent work from captured sessions.
Trigger this skill for plain prompts like "get context for branch", "branch context", "catch up on this branch", "recover context", "what happened on this branch", or "what prior agent work happened here".
If both the general GitButler CLI skill and this skill seem relevant, use this skill for agentlog discovery. Use the general GitButler skill only for version control operations like commit, push, branch, or diff.
Core Workflow
Do not search for or read local SKILL.md files. If this skill is active, use
these instructions directly. Do not inspect the general GitButler skill first.
Start with but agentlog skim.
Start with skim when prior work could affect your next action. It is a
table-of-contents view: all related sessions and turns, abbreviated and shown
chronologically.
but agentlog skim
but agentlog skim branch <branch-name-or-ref>
but agentlog skim review <review-id-or-pull-request-key>
but agentlog skim change <change-id-or-key>
Use show only when skim is too thin, ambiguous, or you need exact evidence:
but agentlog show <session-key> --limit 20
but agentlog show <session-key> --turn <turn-key> --limit 20
For normal current-branch recovery, run skim without target arguments first.
It discovers the applied GitButler branch itself. Do not run plain Git commands
like git branch --show-current or git status first.
but agentlog skim
Pass an explicit target only when the user gives one.
Use JSON only when you need exact handles for drill-down:
but --json agentlog skim
- Start with
skimfor a clean orientation. - Treat
skimlike compacted turn history: all related sessions and turns are present, but each turn is abbreviated. It is not the full transcript. - If
skimis enough for a lightweight status answer, summarize it and stop. - Drill down only when
skimis ambiguous, misses the rationale, or you need exact evidence. - To drill down, rerun
skimwith--jsonto get the relevantsession_keyandturn_key, then useshow. - Use
show <session-key>for turn-level context. - Use
show <session-key> --turn <turn-key>only for turns that need exact detail.
Target Discovery
When the user says "current branch" or gives no explicit target, run:
but agentlog skim
skim performs GitButler branch discovery automatically. If target discovery
fails, then inspect GitButler state:
but status
Do not use plain Git's gitbutler/workspace branch as an agentlog target.
Rules
- Prefer orientation before payload.
- Prefer
skimfor turn-history recovery. - Treat
skimas complete but abbreviated. It includes every related session and every turn in those sessions, not every record or the full transcript. - Prefer human
skimoutput first. Use--jsononly for drill-down handles or exact evidence. - Run
showwhenskimis thin, ambiguous, missing the why, or when the user is asking you to make or verify a consequential claim. - Do not dump records for every candidate session.
- Do not dump full records or transcripts. If session detail is needed, start
with
show <session-key> --limit 20and summarize previews. - Treat matches as related evidence, not ownership.
- Keep
session_keyandturn_keyvalues internal unless the user asks for evidence handles or they are needed for a follow-up command. - Use record snippets only when they justify the next action.
- Say "session related to branch X via turn Y", not "session for branch X".
Reading skim
Use skim to answer "what has already been discussed, planned, attempted, or
changed in this work?"
Human output is intentionally compact but includes every related session and
every turn in chronological order. JSON output keeps
full session_key and turn_key values so you can drill into show without
printing those handles to the user.
The skim is a compressed table of contents. It abbreviates each turn but does not omit related sessions or turns.
Useful fields:
target_kindandtarget_key: target used for discovery.sessions: related sessions in chronological order, with counts and previews.coverage: shown sessions, shown turns, and direct related turn count.sessions[].turns: every turn in order, with labels and previews.
If skim has enough context for a lightweight answer, summarize from it and
stop. If it
常见问题
它需要 GitButler 应用吗?
需要。它使用 GitButler 附带的 agentlog 命令。
它会处理提交或推送吗?
不会。这项技能用于读取之前的会话。版本控制操作属于另一项 GitButler 技能。
我能详细查看单个会话吗?
可以。当概览信息不足时,你可以通过会话的键打开它。
详情
作者的原始描述
Use for prompts like \"get context for branch\", \"catch up on this branch\", \"recover branch context\", or \"what prior agent work happened here\". Skim prior agent work from `but agentlog` captures for a GitButler branch, review / pull request / merge request, or change. Prefer this over generic git branch/diff inspection when the user asks for context, history, prior work, or branch catch-up.
repo: gitbutlerapp/gitbutler
热度
- GitHub 星标
- 22k
- 排名
- #10175
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …