Agent skill

Session Reflection Learnings

by mp-web3 in mp-web3/claude-starter-kit

Analyzes recent sessions for corrections, preferences and implicit feedback, then routes the real learnings to the right knowledge or rules file.

MITAuto-check: notesAgent Workflows

Install Session Reflection Learnings

skills CLI
$ npx skills add mp-web3/claude-starter-kit --skill reflect -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mp-web3/claude-starter-kit reflect --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mp-web3/claude-starter-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/reflect .claude/skills/reflect && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
reflect
GitHub stars
109
Token cost
~1.8k tokens
SKILL.md length
736 words
Files
2
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Analyzes recent sessions for corrections, preferences and implicit feedback, then routes the real learnings to the right knowledge or rules file.

  • Works in 4 steps: Extract → Analyze → Present → …
  • Capturing corrections and preferences from the current session
  • SKILL.md covers Phase 1: Extract, Phase 2: Analyze, Phase 3: Present and Phase 4: Apply
  • Calls python3 and sqlite3

What it does

This is a four-phase reflection workflow run with `/reflect`. The agent first reads LEARNINGS.md from its own folder. Phase 1 runs an extraction script over session JSONL to pull candidate pairs, analyzing the latest session by default or a range set by date or file, and if nothing turns up it says there is nothing to reflect on and stops. Phase 2 decides which candidates are real learnings, since about 40% are ordinary conversation: corrections, preferences, tool rejections with reasons, repeated workflow patterns and implicit feedback count.

Candidates are checked against a log of rejected learnings, so repeats are skipped silently and reversals are flagged for you. Each real learning is routed with a table, checked for duplicates in its target file and scanned against up to five related files for contradictions, which are marked as conflicts for resolution in the next phase and counted in a rule-feedback file. The excerpt is cut off before the later phases.

When your agent uses it

  • Capturing corrections and preferences from the current session
  • Reviewing several recent sessions for repeated feedback
  • Routing learnings into rules or knowledge files

Example prompts

  • “Run /reflect on my latest session and show me the proposed learnings.”
  • “Reflect on this session and tell me which rules files should change.”
  • “Check whether my new preference about commit messages contradicts anything already in my rules.”

Requirements

  • Python 3 and the extract-learnings.py script from the starter kit
  • Access to the session history files
  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Write, Edit, Bash, AskUserQuestion

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Extract
  2. Analyze
  3. Present
  4. Apply

What it can do on your machine

Read from SKILL.md and the folder at commit 546c72c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Write
    • Edit
    • Bash
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • sqlite3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Session Reflection Learnings loads about 1.8k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 736 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Write, Edit, Bash, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mp-web3/claude-starter-kit at commit 546c72c, republished under its MIT licence (© mp-web3). 736 words, ~1,844 tokens.

Download SKILL.mdSave it as .claude/skills/reflect/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
reflect
description
Analyze the current or recent session(s) for corrections, preferences, and implicit feedback. Extracts learnings and routes them to the right knowledge/rules file. Run when you want to capture what was learned this session.
allowed-tools
Read, Grep, Glob, Write, Edit, Bash, AskUserQuestion
argument-hint
[--since YYYY-MM-DD] [--file path.jsonl]

/reflect — Session Learning System

First: Read LEARNINGS.md (in this skill's directory) before proceeding.

You are running a 4-phase reflection workflow. Follow each phase in order.

Arguments: $ARGUMENTS


Phase 1: Extract

Run the extraction script to get candidate learnings from session JSONL.

bash
python3 ~/claude-assistant/scripts/extract-learnings.py $ARGUMENTS

If $ARGUMENTS is empty, it analyzes the latest session. Pass --since YYYY-MM-DD or --file <path> to customize scope.

  • If no pairs found -- tell user "Nothing to reflect on" and stop
  • If pairs found -- capture the output and proceed to Phase 2

Phase 2: Analyze

For each candidate pair from Phase 1, determine:

  1. Is this a real learning? ~40% are normal conversation — skip those. Look for:

    • Corrections ("no, do X instead", "actually...", "wrong")
    • Preferences ("always use...", "I prefer...", "from now on...")
    • Tool rejections with feedback (user denied + said why)
    • Workflow patterns (user repeatedly does something a specific way)
    • Implicit feedback (user rephrases, asks again, provides what Claude should have known)
  2. Check rejections — Read ~/claude-assistant/knowledge/self/rejections.md. For each candidate:

    • If it matches a previously rejected learning (same topic + target file): skip silently. Note in output: "Skipped: matches rejected learning from [date]"
    • If it contradicts a previously rejected learning (opposite of what was rejected): flag as potential reversal — present to user with context from the rejection log
  3. Classify and route each real learning using the routing table below.

  4. Check for duplicates — Read the target file and verify the learning isn't already captured.

  5. Scan for contradictions — For each proposed change with a target file: a. Read the target file b. Read up to 5 related files: same directory + shared tags (YAML tags field) + wiki-linked files c. Scan for statements that directly contradict the proposed change d. If contradiction found, flag it for Phase 3 conflict resolution:

    CONFLICT with [file.md:line]:
      Existing: "[quoted text]"
      Proposed: "[new learning]"

    e. Update feedback counters — If the contradiction traces to a specific existing rule/learning entry, increment its harmful counter in ~/claude-assistant/state/rule-feedback.json

  6. Update feedback counters — Read ~/claude-assistant/state/rule-feedback.json (create if missing). For each finding:

    a. If a correction contradicts an existing rule -- increment harmful for that rule:

    • Key format: "<relative-path>::<section or first 60 chars of rule>"

    b. If the session had no corrections in an area covered by a rule, and the rule was relevant to work done this session -- increment helpful

    c. Write updated counters back to ~/claude-assistant/state/rule-feedback.json

    d. Flag unhealthy rules for Phase 3:

    • harmful >= 3 -- flag: "This rule has been contradicted 3 times. Review or remove?"
    • harmful / (helpful + harmful) > 0.5 with 4+ total signals -- flag as unreliable
    • helpful >= 5 with harmful == 0 -- mark as "stable" (note in output, no action needed)
  7. For multi-session scans (--since): Track if the same learning appears across 2+ sessions. Flag for promotion:

    • 2+ occurrences -- suggest knowledge file if not already there
    • 3+ occurrences -- flag for promotion to rule
    • Exception: if the learning contradicts a rejected entry (Claude keeps making the same mistake), promote immediately to rule on 2nd occurrence
Show full SKILL.md (268 more words)Show less
Routing Table
CategoryTarget File
Task/operational correction~/.claude/rules/tasks.md
Communication preference~/.claude/rules/communication.md
Session management~/.claude/rules/sessions.md
Security/git correction~/.claude/rules/security.md
Delegation pattern~/.claude/rules/delegation.md
Development standard~/.claude/rules/development.md
Research convention~/.claude/rules/research.md
User profile update~/claude-assistant/knowledge/user/profile.md
User goals update~/claude-assistant/knowledge/user/goals.md
Self-knowledge~/claude-assistant/knowledge/self/identity.md
Problem insight~/claude-assistant/knowledge/problems/NN-*.md Insights Log
Project state change~/claude-assistant/knowledge/projects/<project>.md
Global convention~/.claude/CLAUDE.md
Recurring pattern (3+ sessions)~/.claude/rules/ (new file or existing)
Actionable work identifiedSQLite via sqlite3 ~/claude-assistant/tasks.db then python3 ~/claude-assistant/scripts/db.py export
MEMORY.md state changeMEMORY.md (sparingly)

Routing priority: Rules files > Knowledge files > MEMORY.md > CLAUDE.md

Problem routing: Read ~/claude-assistant/knowledge/problems/00-overview.md to match findings against the user's problems.


Phase 3: Present

Show each finding to the user in this format:

## Finding N: [short title]
- **Evidence:** "[what user said]" (in response to "[what Claude said]")
- **Category:** [from routing table]
- **Target:** `path/to/file.md`
- **Proposed change:** [exact text to add/edit]
- **Already captured?** Yes/No
Conflict Resolution

If Phase 2 flagged contradictions:

CONFLICT with [file.md:line]:
  Existing: "[quoted text from file]"
  Proposed: "[the new learning]"
  Resolve: keep existing (k), replace (r), or note both (b)
Flagged Rules

If feedback counters flagged unhealthy rules:

## Flagged Rules

### [rule key]
- Counters: helpful=N, harmful=N
- Recommendation: review / remove / keep with caveat

Ask: "Action on flagged rules? (r)emove, (e)dit, (k)eep, or (s)kip"

User Decision

After listing all findings, ask:

Apply all (a), select by number (e.g. 1,3,5), or discard (d)?

If no real learnings found: tell user "Analyzed N pairs, no actionable learnings found" and stop.

Rejection Logging

When user discards findings:

  1. Ask: "Brief reason? (or Enter to skip)"
  2. Append to ~/claude-assistant/knowledge/self/rejections.md:
    markdown
    ### YYYY-MM-DD — Rejected
    - **Proposed:** [the learning]
    - **Target:** `path/to/file.md`
    - **Reason:** [user's reason, or "(not provided)"]

Phase 4: Apply

For each approved finding:

  1. Read the target file
  2. Edit with the proposed change (use Edit tool, not Write)
  3. Update YAML frontmatter last_reviewed to today's date (if present)
  4. If adding to a problem file's Insights Log, use format: ### YYYY-MM-DD — Session Reflection

After all edits:

  1. Summarize what was changed: | File | Change | table
  2. Stage ~/claude-assistant/state/rule-feedback.json if counters were updated
  3. Commit with message reflect: capture session learnings

© mp-web3, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/reflect of mp-web3/claude-starter-kit.

  • SKILL.md
  • LEARNINGS.md

Open the folder on GitHubat commit 546c72c

Compare with similar skills

Session Reflection Learnings next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Session Reflection Learnings compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Session Reflection Learnings this skillmp-web3/claude-starter-kit109—~1.8kAutomated safety check: NotesMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
SkillOpt Sleep Cyclemicrosoft/SkillOpt18k—~2.3kAutomated safety check: PassMIT
CLAUDE.md Improveranthropics/claude-plugins-official37k5 repos~1.5kAutomated safety check: PassApache-2.0
Harness Engineering10xChengTu/harness-engineering1021 repos~1kAutomated safety check: PassNone
Codebase Analyzerseverity1/claude-code-auto-memory159—~1.5kAutomated safety check: PassMIT

Similar skills

  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.

    18k GitHub stars~2.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • CLAUDE.md Improver

    anthropics/claude-plugins-official

    Official

    Finds every CLAUDE.md file in a repository, scores each against quality criteria, shows a report, then makes targeted updates after you approve.

    37k GitHub starsUsed in 5 repos~1.5k tokens
    Agent WorkflowsAuto-check passed
  • Harness Engineering

    10xChengTu/harness-engineering

    Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.

    102 GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check passed
  • Codebase Analyzer

    severity1/claude-code-auto-memory

    This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command.

    159 GitHub stars~1.5k tokensUpdated 5 mo ago
    Agent WorkflowsAuto-check passed
  • Self Improving For Codex

    GODGOD126/self-improving-for-codex

    Build or maintain a Codex-native self-improving memory loop using global AGENTS.md, a persistent memories directory, and optional nightly refinement automation.

    130 GitHub stars~1.2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed

More from mp-web3/claude-starter-kit

  • Create Skill

    mp-web3/claude-starter-kit

    Walks through building a new Claude Code skill: asks what it should do, scaffolds it with an init script, writes SKILL.md and LEARNINGS.md and validates the result.

    109 GitHub stars~985 tokensUpdated 6 mo ago
    Auto-check: notes
  • Claude Project Bootstrap

    mp-web3/claude-starter-kit

    Sets up a project for Claude Code by surveying it and writing a .claude folder with a short CLAUDE.md, a CODEBASE.md overview, module docs and optional skills and hooks.

    109 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check: notes
  • Personal Assistant Onboarding

    mp-web3/claude-starter-kit

    Walks a new user through a five-step first session, profile, problems, goals and initial tasks, to turn the agent into a personal assistant that remembers them.

    109 GitHub stars~2.7k tokensUpdated 6 mo ago
    Auto-check: notes
  • Plan and Implement Workflow

    mp-web3/claude-starter-kit

    Runs new features, scripts and structural changes through explore, design, approval, implementation and verification phases, with a tool search and an explicit plan sign-off.

    109 GitHub stars~913 tokensUpdated 6 mo ago
    Auto-check: notes
  • Task Backlog Manager

    mp-web3/claude-starter-kit

    Keeps a personal task backlog in SQLite behind a /tasks command that adds, reviews, completes and measures tasks against a list of long-term problems.

    109 GitHub stars~1.2k tokensUpdated 6 mo ago
    Auto-check: notes

Categories

Questions about Session Reflection Learnings

What does Session Reflection Learnings do?

Analyzes recent sessions for corrections, preferences and implicit feedback, then routes the real learnings to the right knowledge or rules file. This is a four-phase reflection workflow run with `/reflect`.md from its own folder.

When should I use Session Reflection Learnings?

Session Reflection Learnings fits situations like: capturing corrections and preferences from the current session; reviewing several recent sessions for repeated feedback; routing learnings into rules or knowledge files.

How do I install Session Reflection Learnings in Claude Code?

Run `npx skills add mp-web3/claude-starter-kit --skill reflect -a claude-code`. Or copy the skill folder (skills/reflect in mp-web3/claude-starter-kit) into .claude/skills/reflect in your project. Claude Code loads it when a task matches its description.

How do I install Session Reflection Learnings in Codex?

Run `npx skills add mp-web3/claude-starter-kit --skill reflect -a codex`. Or copy the skill folder (skills/reflect in mp-web3/claude-starter-kit) into .agents/skills/reflect in your project. Codex loads it when a task matches its description.

Can I use Session Reflection Learnings in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mp-web3/claude-starter-kit --skill reflect -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reflect, .gemini/skills/reflect, .github/skills/reflect and .opencode/skills/reflect in your project.

What does Session Reflection Learnings need to run?

Going by SKILL.md and its folder, Session Reflection Learnings needs the command-line tools its instructions call (python3 and sqlite3). Our summary lists: Python 3 and the extract-learnings.py script from the starter kit; Access to the session history files. Its frontmatter pre-approves these tools: Read, Grep, Glob, Write, Edit, Bash, AskUserQuestion.

Does Session Reflection Learnings access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Session Reflection Learnings safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Session Reflection Learnings use?

Session Reflection Learnings is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Session Reflection Learnings use?

About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Session Reflection Learnings?

Skills that share tags, products or a category with Session Reflection Learnings: Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars), SkillOpt Sleep Cycle (microsoft/SkillOpt, 18k stars), CLAUDE.md Improver (anthropics/claude-plugins-official, 37k stars) and Harness Engineering (10xChengTu/harness-engineering, 102 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Session Reflection Learnings?

mp-web3 (a GitHub user) maintains it in mp-web3/claude-starter-kit, which has 109 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on March 18, 2026.

Source: mp-web3/claude-starter-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.