recall-reasoning
Recall the reasoning behind a past change by locating the Claude Code transcript that produced it. Use when the user asks to \"recall reasoning\", \…
它会碰到什么
关于「读环境变量(配置)」:这个技能会读 process.env 之类的环境变量,但读到的都是端口、目录、超时这类配置项,没有读取密钥类变量。扫描规则原本把「读环境变量」一律算作「读凭据」,本站按变量名做了细化区分,命中明细仍如实列在下面。
逐条看命中(2 条严重或高危)
- 高
scripts/find_transcript.py:29exec-spawnresult = subprocess.run(
- 高
scripts/find_transcript.py:87cred-envreadconfig_home = os.environ.get('CLAUDE_CONFIG_DIR')
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Recall Reasoning
Locate the Claude Code transcript that produced a given change and extract the implementer's reasoning. Useful for answering reviewer questions, writing post-hoc explanations, or recovering forgotten context.
Inputs
Accept any of:
- A commit SHA
- A file path, optionally with a line number (
<path>:<line>) - A reviewer question plus surrounding context (file and line)
If only a file is given, git blame resolves the commit that last touched the line.
Step 1: Resolve the Commit and Run the Script
Call scripts/find_transcript.py with either --commit <sha> or --file <path>[:<line>]. Pass --cwd /path/to/repo when searching a different repo than the current working directory.
python3 <skill-dir>/scripts/find_transcript.py --file <path>:<line>
python3 <skill-dir>/scripts/find_transcript.py --commit <sha>
The script:
- Resolves the commit via
git rev-parseorgit blame - Enumerates directories under the effective Claude configuration home's
projects/tree and filters their transcripts by authoritativecwdrecords, covering path encoding, truncation, collisions, and subdirectory launches - Ranks candidate transcripts whose mtime is within
--window-daysof the commit (default 14) - Scores candidates by mentions of touched files and tool-use edits on them
- Extracts cleaned user prompts and substantive assistant text from the top candidates
The JSON output has status, commit, project_dir (the top candidate's directory when matched), project_dirs (directories with matching cwd records in the time window), and candidates with session_id, score, match_reasons, and excerpts.
Status values:
ok— candidates returnedno-commit— couldn't resolve a commitno-transcripts— the effective Claude configuration home has no project transcript directoriesno-match— transcripts exist but none match the touched files in the window
Step 2: Read and Synthesize
If status is ok:
- Start with the top candidate (highest score). Read its excerpts first.
- If the excerpts already explain the change, stop. If they are thin or ambiguous, read the full transcript at
jsonl_pathdirectly for more context. - Ignore candidates with low scores or scores far below the top — they are false positives.
- When the reasoning spans multiple excerpts, quote the most specific one.
Synthesize a concise summary tied to the question being answered:
- Lead with the why. The diff already shows the what.
- Quote the implementer's own words when they already say it well.
- Keep it to one or two paragraphs. Don't narrate the whole session.
If status is anything other than ok, report that no reasoning was found and fall back to reading the commit diff and surrounding code. Say so explicitly so it's clear whether the answer still holds up.
Step 3: Output
Return the reasoning in this shape:
**Commit:** <short-sha> — <subject>
**Transcript:** <session-id> (score <N>)
<one or two paragraphs of reasoning, quoting the implementer where useful>
If no transcript was found:
**Commit:** <short-sha> — <subject>
**Transcript:** none found (<status>)
<fallback explanation derived from reading the commit and current code>
Then use the TaskList tool and proceed to any remaining task.
Rules
- Treat excerpts as evidence, not ground truth. The implementer's intent at the time may have changed. If the current code contradicts an excerpt, note the discrepancy.
- Only read the full
.jsonlif the excerpts are insufficient. These files are large. - Never quote noise prefixes like
<command-message>or skill-loading stubs. The script filters these out, but stay alert if reading a transcript directly. - If multiple candidates have similar high scores, name both and prefer the one whose time window contains the commit.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
同名技能的其他版本
有 2 个不同仓库或目录里都有叫 recall-reasoning 的技能。它们内容并不相同,别混用:
- tobihagemann/turbo — Recall the reasoning behind a past change from Codex session history when available, falli