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 (4,934 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 4,934 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.04934
Opus 5 $0.00034 $0.02467
Sonnet 5 $0.00013 $0.00987
Haiku 4.5 $0.00007 $0.00493

Measured today against content hash 8e437731f234, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 today.

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 · 353 lines

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

  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 仅保留手工范围导出的兼容用途,不是主路径。

流程

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 固定本次审计的数据边界,提取物权限为 0600manifest.json 是本次运行的唯一输入清单,记录 snapshot digest、repository_root、日期、thread、消息数、输入 digest、降级统计和分析单元。

完成标准:命令 exit 0,manifest status=readystatus=empty。任一日期失败时命令必须 exit 非零;不得分析部分成功结果。empty 时报告近期无记录并结束。

2. 检查 manifest

Read manifest.json,核对:

  • project_filterall_projects 与用户范围一致;
  • window.active_daystotals.thread_counttotals.message_count
  • totals.truncationstotals.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 通知不是通过证据,不轮询未完成结果。

Read the full file on GitHub · 353 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. today Changed · +175 lines · +12 tokens per session 8e437731f234
  2. 11d 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 (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.

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

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…

openinterpreter/openinterpreter · 77 tokens

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…

dimetron/pi-go · 0 tokens

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.

dimetron/pi-go · 35 tokens

memory-status

Show MemPalace memory system status — drawer counts, wings, rooms, knowledge graph stats, and embedding model state.

dimetron/pi-go · 27 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