peri: Skill for Claude Code

.claude/skills/learn-from-history/SKILL.md

learn-from-history is a skill for Claude Code from KonghaYao/peri. It costs 67 tokens per session (5,752 once invoked), scanned A, original, Apache-2.0.

A process for examining recent agent conversations in a project and turning them into a fixed snapshot for analysis. It looks for repeated failures, successful patterns, stable rules, and possible improvements to skills.

In plain words
What is it for?
Use it to review the last seven days of project conversations, identify recurring problems, and suggest ways to automate or improve agent behavior.
Why use it?
It prevents conclusions from being based on an incomplete or changing conversation history. It also checks that the selected project, dates, and extracted records match the requested scope.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is KonghaYao/peri's own configuration. It tells Claude Code how to work on peri itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything peri configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/KonghaYao/peri/main/.claude/skills/learn-from-history/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/KonghaYao/peri

Made for: Claude Code.

Wrote 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.

agentmods badge for learn-from-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/konghayao/peri/learn-from-history/github.svg)](https://agentmods.dev/skills/konghayao/peri/learn-from-history)
Your own site
<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.

agentmods 80×15 button for learn-from-history

Your own site · 80×15
<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>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,752 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash 6fb75b9d1d9f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/extract_daily.py, scripts/extract_range.py, scripts/run_history.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.claude/skills/learn-from-history/SKILL.md · 369 lines

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 的三层可观测思想,并适配为有人确认的项目审计:

  1. 组件可观测:每个失败模式只归属一个首选变更面;
  2. 经验可观测:最终概览可下钻到 unit finding,再到固定 snapshot 的原始 thread;
  3. 决策可观测:每个变更建议都是带收益预测、回归风险和验收条件的可证伪契约。

事实源

  • 运行编排与 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 路径。

Read the full file on GitHub · 369 lines

Files

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.

Changes

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.

  1. 1mo ago Changed 6fb75b9d1d9f
  2. 1mo ago Changed · +16 lines d0d81f04ab6e
  3. 1mo ago Changed · +175 lines · +12 tokens per session 8e437731f234
  4. 1mo ago First seen · 178 lines · 55 tokens per session scan A 14b786c8059d

Subscribe to this mod's changes

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.

Related

Other skills, from other repositories

code-review-context

Codex maintains a context (history of messages) that is sent to the model in inference requests.

openinterpreter/openinterpreter · 7 tokens

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…

openinterpreter/openinterpreter · 114 tokens

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…

openinterpreter/openinterpreter · 86 tokens

codex-pr-body

Update the title and body of one or more pull requests.

openinterpreter/openinterpreter · 17 tokens

remote-tests

Testing against remote executors in integration tests.

openinterpreter/openinterpreter · 12 tokens

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.

openinterpreter/openinterpreter · 86 tokens