Lessons 会话审查
- 作者仓库星标 3,507
- 许可证 Apache-2.0
- 作者仓库 okteto
Lessons Skill
Manages the self-improvement loop. Use this skill when:
- The user corrects a mistake or gives feedback that should change future behavior
- You want to review past lessons at the start of a session
- After completing a task, to capture any patterns worth preserving
Lesson file
All lessons live in .claude/lessons.local.md.
Workflow: Recording a Lesson
Step 1: Read the current lessons file
cat .claude/lessons.local.md
Step 2: Identify the lesson
From the user correction, extract:
- Mistake: What went wrong (be specific, not generic)
- Pattern: The concrete rule to apply going forward
- Trigger: The condition that should activate this rule
Step 3: Append the entry
Add a new entry at the bottom of .claude/lessons.local.md, above the closing comment:
## 2026-03-17 — [short title]
**Mistake**: [What went wrong]
**Pattern**: [Rule to apply going forward]
**Trigger**: [When to apply this rule]
Use absolute dates (YYYY-MM-DD), never relative ("today", "last week").
Step 4: Confirm
Report the new entry to the user briefly:
Lesson recorded: [short title]
Workflow: Reviewing Lessons
At the start of a session, or when asked:
- Read
.claude/lessons.local.md - Identify lessons relevant to the current task
- Internalize them — do not re-state them all back to the user unless asked
- Apply them silently
Workflow: Pruning Lessons
Lessons become stale when:
- They reference a pattern that's been fixed in the code
- They duplicate another lesson
- They're too generic to be actionable
When pruning, remove the entry entirely. Don't leave tombstones.
Rules
- Never invent a lesson that wasn't triggered by an actual correction
- Be specific: "always read the file before editing" is better than "be careful"
- One lesson per entry — don't bundle unrelated corrections together
- Update an existing lesson if a correction refines a known pattern rather than creating a duplicate
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @okteto · Apache-2.0
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Workflow: Recording a Lesson
Step 1: Read the current lessons file
From the user correction, extract: Mistake: What went wrong (be specific, not generic) Pattern: The concrete rule to apply going forward
Add a new entry at the bottom of .claude/lessons.local.md, above the closing comment:
Report the new entry to the user briefly:
At the start of a session, or when asked: Read .claude/lessons.local.md Identify lessons relevant to the current task
# Lessons Skill
Manages the self-improvement loop. Use this skill when:
- The user corrects a mistake or gives feedback that should change future behavior
- You want to review past lessons at the start of a session
- After completing a task, to capture any patterns worth preserving
## Lesson file
All lessons live in `.claude/lessons.local.md`.
## Workflow: Recording a Lesson
### Step 1: Read the current lessons file
```bash
cat .claude/lessons.local.md
```
### Step 2: Identify the lesson
From the user correction, extract:
- **Mistake**: What went wrong (be specific, not generic)
- **Pattern**: The concrete rule to apply going forward
- **Trigger**: The condition that should activate this rule
### Step 3: Append the entry
Add a new entry at the bottom of `.claude/lessons.local.md`, above the closing comment:
```markdown
## 2026-03-17 — [short title]
**Mistake**: [What went wrong]
**Pattern**: [Rule to apply going forward]
**Trigger**: [When to apply this rule]
```
Use absolute dates (YYYY-MM-DD), never relative ("today", "last week").
### Step 4: Confirm
Report the new entry to the user briefly:
```
Lesson recorded: [short title]
```
## Workflow: Reviewing Lessons
At the start of a session, or when asked:
1. Read `.claude/lessons.local.md`
2. Identify lessons relevant to the current task
3. Internalize them — do not re-state them all back to the user unless asked
4. Apply them silently
## Workflow: Pruning Lessons
Lessons become stale when:
- They reference a pattern that's been fixed in the code
- They duplicate another lesson
- They're too generic to be actionable
When pruning, remove the entry entirely. Don't leave tombstones.
## Rules
- Never invent a lesson that wasn't triggered by an actual correction
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Lesson file → Workflow: Recording a Lesson → Step 1: Read the current lessons file → Step 2: Identify the lesson → Step 3: Append the entry → 2026-03-17 — [short title]
要点 -> Mistake · Pattern · Trigger · Manages the self-improvement loop. · All lessons live in .claude/lessons.local.md. · Use absolute dates (YYYY-MM-DD), never relative ("today", "last week"). · 1. Read .claude/lessons.local.md 2. · When pruning, remove the entry entirely.
文件/命令 -> .claude/lessons.local.md
内容 SHA-256 -> d2414a6b9d2d
方法与流程
适用与边界
原文中的明确线索
.claude/lessons.local.md