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.04934 |
| Opus 5 | $0.00034 | $0.02467 |
| Sonnet 5 | $0.00013 | $0.00987 |
| Haiku 4.5 | $0.00007 | $0.00493 |
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 today.
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 — 353 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Learn From History
把历史学习当成一个可观测改进环,而不是经验摘抄:固定输入,分层下钻证据,定位最窄变更面,为每项建议同时声明预测收益与回归风险,再由后续历史验证。
默认审计当前项目最近 7 个自然日期(含今天),不跨项目。报告和 decision manifest 是审计产物,不构成编辑授权;不自动修改或回滚规则、skill、代码。
本流程采用 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 仅保留手工范围导出的兼容用途,不是主路径。
流程
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 路径。
本流程按 thread 的 updated_at 日期归档完整 thread,不按消息切断因果链。报告中写清该语义。
不要扫描 run 目录猜测输入,也不要读取其他 run 的同名文件。
3. 执行分析单元
每个 unit 的完整任务已经写入 prompts/unit-NNN.txt。派发 general-purpose agent 时,把该 prompt 文件内容作为任务;子 agent 自己直接 Read/Write,不得再次调用 Agent,不得修改仓库。
调度规则:
- 1 个 unit:同步执行;
- 2 个以上独立 unit:可后台并行,最多 3 个;
- 超过 3 个:分批启动,当前批次全部收到终态后再启动下一批;
- agent 失败时优先 resume 原 child thread,不创建重复任务;
- background 的 started/completed 通知不是通过证据,不轮询未完成结果。
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.
- today Changed · +175 lines · +12 tokens per session 8e437731f234
- 11d 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 (163 stars, last pushed yesterday), licensed Apache-2.0. It adds 67 tokens to every session and 4,934 once invoked, about $0.0003 per session on Opus 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.
qa-testing
Verify your work by actually operating the app or website you changed, instead of assuming it works. Strongly recommended whenever you build, modify, or debug a web app, website, or desktop GUI app. Drive real browsers with the agent-browser CLI and native desktop apps with the cua-driver CLI. These are installed on…
memory-index
Index a folder's contents into the MemPalace semantic memory for search and retrieval. Use this skill whenever the user asks to "index a folder", "index a directory", "index memory", "mine a project into memory", "make a folder searchable", "embed a folder", "ingest code into the palace", or "index this directory for…
memory-mine
Mine project files or conversations into the MemPalace memory system. Indexes source code and conversation history as searchable palace drawers with semantic embeddings and room assignment.
memory-status
Show MemPalace memory system status — drawer counts, wings, rooms, knowledge graph stats, and embedding model state.
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…