Borrowing it
Nothing to install: this file belongs to KonghaYao/peri. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/KonghaYao/peri/main/.claude/skills/learn-from-history/SKILL.mdgit clone --depth 1 https://github.com/KonghaYao/periWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/konghayao/peri/learn-from-history)<a href="https://agentmods.dev/skills/konghayao/peri/learn-from-history"><img src="https://agentmods.dev/badge/skills/konghayao/peri/learn-from-history/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/konghayao/peri/learn-from-history"><img src="https://agentmods.dev/badge/skills/konghayao/peri/learn-from-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00067 | $0.05752 |
| Opus 5.5 | $0.00027 | $0.02301 |
| Sonnet 5.5 | $0.00013 | $0.01150 |
| Haiku 4.5 | $0.00007 | $0.00575 |
Grade A, and why
learn-from-history scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 369 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Learn From History
把历史学习当成一个可观测改进环,而不是经验摘抄:固定输入,分层下钻证据,定位最窄变更面,为每项建议同时声明预测收益与回归风险,再由后续历史验证。
默认审计当前项目最近 7 个自然日期(含今天),不跨项目。默认只报告;用户已明确要求应用建议或提交时,按其授权范围完成,不重复确认。报告和 decision manifest 本身不扩大编辑、回滚或发布权限。
本流程采用 Agentic Harness Engineering 的三层可观测思想,并适配为有人确认的项目审计:
- 组件可观测:每个失败模式只归属一个首选变更面;
- 经验可观测:最终概览可下钻到 unit finding,再到固定 snapshot 的原始 thread;
- 决策可观测:每个变更建议都是带收益预测、回归风险和验收条件的可证伪契约。
事实源
- 运行编排与 unit prompt:
scripts/run_history.py - 提取逻辑:
scripts/extract_daily.py - run 与 decision manifest 校验:
scripts/validate_run.py - unit 报告格式:
references/analysis-template.md - 跨轮决策账本:
spec/reviews/history-learn-YYYY-MM-DD.json
extract_range.py 仅保留手工范围导出的兼容用途,不是主路径。
流程
0. 核对当前仓库的入口、产物位置与授权
先读根指引和 docs/standards/documentation.md。本仓库的维护入口是本文件及相邻 scripts/;其他安装目录中的旧副本不能替代受版本控制的实现。显式保留本轮用户要求的日期、项目、更新范围与提交授权,交接后从原始请求核对,不让压缩摘要重新解释权限。
本仓库按 DOC-HISTORY-001 / DOC-LINK-001 禁止重建 spec/reviews/,因此使用临时报告模式:报告与变更/验收记录写到本次 run 目录,稳定结论更新对应事实源;完整过程不进入仓库。该模式执行步骤 1–4、6 和已授权的编辑,使用 run validator 验证输入覆盖;步骤 5 和步骤 7 的持久 decision ledger 分支不适用,不声称通过 decision ledger 校验或形成跨轮因果归因。完成后按步骤 9 的临时模式清理输入。后文的 spec/reviews/ 账本协议仅用于明确允许该目录的仓库,不能借技能恢复已废弃目录。
1. 创建 snapshot run
从环境中的 Working directory 取得项目根,显式传入 --cwd:
python3 .claude/skills/learn-from-history/scripts/run_history.py \
--days 7 \
--cwd <工作目录>
只有用户明确要求跨项目时才使用 --all:
python3 .claude/skills/learn-from-history/scripts/run_history.py --days 7 --all
脚本创建权限为 0700 的唯一目录:
/tmp/learn-from-history/<run_id>/
manifest.json
snapshot/threads.db
extracted/<day>/*.txt
prompts/unit-NNN.txt
summaries/
它通过 SQLite backup 固定本次审计的数据边界,提取物权限为 0600。manifest.json 是本次运行的唯一输入清单,记录 snapshot digest、repository_root、日期、thread、消息数、输入 digest、降级统计和分析单元。
完成标准:命令 exit 0,manifest status=ready 或 status=empty。任一日期失败时命令必须 exit 非零;不得分析部分成功结果。empty 时报告近期无记录并结束。
2. 检查 manifest
Read manifest.json,核对:
project_filter或all_projects与用户范围一致;window.active_days、totals.thread_count、totals.message_count;totals.truncations与totals.parse_failures;- 每个
unit的输入、消息数、prompt、summary 和 sidecar 路径。
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed 6fb75b9d1d9f
- 1mo ago Changed · +16 lines d0d81f04ab6e
- 1mo ago Changed · +175 lines · +12 tokens per session 8e437731f234
- 1mo ago First seen · 178 lines · 55 tokens per session scan A 14b786c8059d
learn-from-history is a skill published in the GitHub repository KonghaYao/peri (247 stars, last pushed today), licensed Apache-2.0. It adds 67 tokens to every session and 5,752 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
code-review-context
Codex maintains a context (history of messages) that is sent to the model in inference requests.
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
plugin-creator
Create and scaffold plugin directories for Codex with a required .codex-plugin/plugin.json, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries…
codex-pr-body
Update the title and body of one or more pull requests.
remote-tests
Testing against remote executors in integration tests.
update-v8-version
Update Codex's pinned v8 / rustyv8 versions, validate the release-candidate path, and investigate failed V8 canary or artifact builds. Use when asked to bump V8, update rustyv8 artifacts, prepare or validate a V8 release candidate, check v8-canary, or diagnose why a V8 version update no longer builds.