agent-run-forensics
Skill này làm gì
Skill này khiến agent trả lời các câu hỏi về công việc trước đó của chính nó dựa trên bản ghi phiên đã lưu, thay vì đoán. Skill dành cho người cần biết vì sao một file bị thay đổi hoặc các bài kiểm thử có thực sự đạt không.
Khi nào nên dùng
- ✓Khi bạn muốn biết vì sao agent đã thay đổi một file trong phiên trước.
- ✓Khi bạn cần kiểm tra các kiểm thử có thực sự đạt trước khi tin vào một bản tóm tắt.
- ✓Khi bạn muốn đối chiếu bản tóm tắt của agent về việc nó đã làm với bản ghi.
Liên kết skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-run-forensics/skills/agent-run-forensics/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy kiểm tra phiên đã ghi lại và cho tôi biết vì sao config.yaml bị thay đổi và các kiểm thử có thực sự đạt không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tìm lần chạy bạn nói đến trong các phiên đã lưu, rồi dựng một dòng thời gian các bước và thay đổi file từ bản ghi. Nó đối chiếu từng khẳng định với bản ghi trước khi lặp lại như một sự thật.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Agent Run Forensics
Portability: 3 stdlib Python CLIs and one hook. Read-only, no network, no model calls. Secrets in transcripts are redacted in every output, with no switch to turn that off.
Agents are confidently wrong about their own history. Asked "why did you change
config.yaml?", an agent answers from what it remembers, and memory drops the
parts that matter: the test run that failed, the file a sed -i one-liner
rewrote, the edit made after the last green run. The harness recorded all of it.
This skill makes the answer come from that recording.
The rule: when a question is about something that already happened, read the trace before answering.
Workflow
# 1 - Find the run (skip if the question is about this session: the hook gives you its path)
python scripts/trace_finder.py --since 7d --touched config.yaml
# 2 - Read it: what happened, in order, and which files changed
python scripts/trace_timeline.py --trace <path> --files # SILENT = changed, never named by the agent
python scripts/trace_timeline.py --trace <path> --grep timeout # or --errors, --file PATH, --around N
# 3 - Walk back from the step in question
python scripts/trace_timeline.py --trace <path> --why 9
# 4 - Before repeating any summary as fact, check it
python scripts/claim_checker.py --trace <path> --claim "passed:pytest" --claim "not-edited:config.yaml"
Step 3 prints two lists and you keep them apart in the answer:
| Label | Means | Example |
|---|---|---|
recorded |
The harness wrote it down when it happened | the command, its exit code, the agent's words in the same message |
inferred |
Derived now by a named rule | prior-write, read-before-write, retry-after-failure, target-seen-in-output |
Say "the trace shows" only for recorded edges. Name an inferred edge as inferred, with its rule. The agent's own stated reason is recorded as a claim, not as the cause.
Step 4 turns each sentence of a summary into a typed claim (ran:, not-run:,
passed:, failed:, edited:, not-edited:, read:). STALE means the tests
passed but files changed afterwards; PARTIAL means exit 0 came from the last
command of a pipe or ; chain. Exit 4 is a contradiction: correct the account first.
Hard rules
- No trace, no answer. If the finder returns nothing (exit 2), say the run is not recorded here. Do not reconstruct it.
- Cite steps. Every factual sentence about the run points at a step number.
- Recorded and inferred stay separate. Never merge them into one confident sentence.
- Shell effects are inferred unless the harness diff (
bashEditDiff) confirms them. A command's text says what it was meant to do, not what it did. - Exit 0 of a compound line is the last command's.
pytest | tee logpassing says nothing about pytest. - Quote no secrets. Outputs are redacted; do not paste raw transcript lines around the redaction.
Scripts
| Script | Role | Exit codes |
|---|---|---|
scripts/trace_finder.py |
Lists recorded sessions by repo, window, touched file, text | 0 found · 2 none · 3 bad input |
scripts/trace_timeline.py |
Numbered steps, --files table, --why STEP chain |
0 · 2 filter matched nothing · 3 |
scripts/claim_checker.py |
Typed claims vs the recording | 0 all supported · 2 weak · 3 · 4 contradicted |
All support --help, --sample and --output json. trace_core.py is the shared parser.
The plugin's UserPromptSubmit hook (hooks/forensics_hint.py) adds one line naming this
session's transcript when a prompt asks about past work; disable it with AGENT_RUN_FORENSICS_HOOK=0.
References and assets
references/trace_sources.md: where each harness records, what is in a record, retention and limits (7)references/recorded_vs_inferred.md: why self-reports are not evidence, and the inference rules (7)references/claim_verification.md: turning a summary into claims, verdicts, and how to correct an account (7)assets/forensic_answer_template.md: the shape of an answerassets/claims_example.txt: a claims file for--claims-file
Câu hỏi thường gặp
Skill có thay đổi file hoặc gửi dữ liệu đi không?
Không. Skill chỉ đọc, không dùng mạng và không gọi mô hình.
Skill có thể hiện bí mật từ các phiên cũ không?
Không. Bí mật luôn được che trong đầu ra, và điều này không thể tắt.
Skill tìm một lần chạy cũ bằng cách nào?
Nó có thể tìm trong các phiên gần đây theo khoảng thời gian hoặc theo file đã được thay đổi.
Chi tiết
Mô tả gốc của tác giả
Use when asked why an agent did something, what a past session or run changed, whether tests really passed, or to verify a session summary. Answers from the recorded transcript, not memory, with trace_finder.py, trace_timeline.py and claim_checker.py.
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9527
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-launcher-orchestrator
29kGiúp agent của bạn lên kế hoạch, xây dựng, kiểm thử và lên lịch một Claude managed agent trong tài khoản riêng, từng bước một, bắt đầu từ một mục tiêu rõ ràng.
grade-iterate
29kCho phép agent của bạn chấm kết quả một managed AI agent theo bảng tiêu chí và cải thiện qua số vòng cố định, nên không bao giờ lặp vô tận.
interview
29kCho phép agent của bạn phỏng vấn bạn về ý tưởng agent AI và biến câu trả lời thành một kế hoạch xây dựng đơn giản trước khi khởi chạy bất cứ điều gì.
run-without-you
29kGiúp agent của bạn thiết lập một managed AI agent chạy theo lịch hoặc khi có sự kiện xảy ra, với thời gian cron được kiểm tra trước khi khởi chạy.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.