Skip to content
Development
Skill

/learn-from-session

Analyze Claude Code sessions to learn what went right/wrong and suggest high-confidence improvements to skills. Use when asked to analyze a session, learn from a session, or review workflow effectiveness.

From plugin
manifest-dev
7845 skills

Claude Code

$ npx -y skills add doodledood/manifest-dev --skill learn-from-session --agent claude-code

SKILL.md

learn-from-session.SKILL.md
name: learn-from-session
description: 'Analyze Claude Code sessions to learn what went right/wrong and suggest high-confidence improvements to skills. Use when asked to analyze a session, learn from a session, or review workflow effectiveness.'
user-invocable: true
metadata:
  internal: true

**User request**: $ARGUMENTS

Analyze a Claude Code session to identify what went well and what could be improved, then suggest high-confidence fixes to skills in this repository.

**Input formats**:

  • Session ID (UUID): `184078b7-2609-46e0-a1f2-bb42367a8d34`
  • Session file path: `~/.claude/projects/.../session-id.jsonl`
  • Inline commentary: Text description of what happened

**Output**: High-confidence issues only with evidence-based suggestions for skill improvements.

**Signal quality bar**: Only recommend changes that would have **prevented specific rework** in the session. A fix is high-signal when ALL of: 1. You can point to exact message numbers where rework occurred 2. The skill change would have triggered BEFORE that rework 3. Following the change would have produced correct output initially

**Definition - high-signal fix**: A skill change that passes the 3/3 counterfactual test (see Phase 5.2).

---

Phase 1: Parse Input & Setup

1.1 Identify input type

| Input Pattern | Type | Action | |---------------|------|--------| | UUID format (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`) | Session ID | Find and read session file | | Path ending in `.jsonl` | Session file | Read directly | | Other text | Commentary | Analyze inline, may reference sessions |

1.2 Locate session file (if session ID)

Session files are stored at:

~/.claude/projects/{project-path-encoded}/{session-id}.jsonl

**Note**: `{project-path-encoded}` replaces path separators with URL-safe encoding (e.g., `/home/user/myproject` becomes `-home-user-myproject`). Don't rely on exact path structure—use find instead.

Use Bash to find:

find ~/.claude/projects -name "*{session-id}*" -type f 2>/dev/null

**If file not found**: Ask user to provide the session file path directly or check if session ID is correct.

1.3 Create analysis log

Path: `/tmp/session-analysis-{session-id-short}-{timestamp}.md`

**Purpose**: External memory that persists findings beyond LLM working memory. Write to this file IMMEDIATELY after each discovery—never batch multiple findings into one write.

# Session Analysis Log

Session: {id or "inline commentary"}
Started: {timestamp}
Status: IN_PROGRESS

---

## Session Overview
<!-- Write immediately after Phase 2 parsing -->

**Initial request**:
**Skills invoked**:
**Outcome**:
**Session length**:

---

## Pattern Detection

### Iterations Found
<!-- Write immediately after detecting iterations - before moving to corrections -->

### User Corrections Found
<!-- Write immediately after detecting corrections - before moving to deviations -->

### Workflow Deviations Found
<!-- Write immediately after detecting deviations - before moving to missing questions -->

### Missing Questions Found
<!-- Write immediately after detecting missing questions - before moving to post-impl -->

### Post-Implementation Fixes Found
<!-- Write immediately after detecting post-impl fixes - before skill comparison -->

---

## Skill Comparison

### Skills Discovered
<!-- Write immediately after discovering which skills were used -->

### Skill: {name}
<!-- Write immediately after analyzing EACH skill - don't batch -->

---

## Potential Issues
<!-- Write each issue as identified during comparison -->

---

## Counterfactual Analysis
<!-- Write results of 3/3 test for each issue -->

---

## Final Recommendations
<!-- Populated after refresh step -->

1.4 Create todo list

**CRITICAL**: Write to log IMMEDIATELY after each finding—never batch writes.

- [ ] Setup: Create log file, parse session, write overview
- [ ] Pattern detection: iterations, corrections, deviations, missing questions, post-impl fixes (write each to log)
- [ ] Skill discovery: extract skills, locate files, write to log
- [ ] (expand: "Analyze {skill}" for each skill found)
- [ ] Refresh context: read FULL analysis log
- [ ] Counterfactual analysis: test each issue, write recommendations
- [ ] Output final report

**Expansion**: When skills are discovered, add one todo per skill:

- [ ] Analyze {skill-name} skill + write findings to log

**Why write-after-each-step matters**: By synthesis, early findings suffer context rot. Writing externalizes findings to a file that persists. The refresh step moves ALL findings to context end (highest attention zone).

---

Phase 2: Parse Session

2.1 Session file structure

Claude Code sessions are JSONL files with these record types:

| Type | Contains | |------|----------| | `user` | User messages, `message.content` field | | `assistant` | Claude responses, tool calls, thinking | | `system` | System events, commands, hooks | | `file-history-snapshot` | File state tracking |

2.2 Extract key events

Use `jq` to parse:

# User messages
cat {session-file} | jq -r 'select(.type == "user") | .message.content' 2>/dev/null

# Tool calls
cat {session-file} | jq -r 'select(.type == "assistant") | .message.content | if type == "array" then .[] | select(.type == "tool_use") | .name else empty end' 2>/dev/null

# Skill invocations
grep -o '"skill":"[^"]*"' {session-file} | sort | uniq -c

2.3 Build session overview

Extract and log:

  • **Initial request**: First user message (the goal)
  • **Workflow used**: Which skills invoked (`/spec`, `/plan`, `/implement`, etc.)
  • **Workflow skipped**: Skills that would typically apply but weren't invoked (see table below)
  • **Outcome**: Success, partial, or required rework
  • **Session length**: Message count, duration if available

**Expected skills by task type** (use to detect skipped workflows):

| Task Indicators in Request | Expected Skills | |---------------------------|-----------------| | "build

Read more
@doodledood
Ships withmanifest-dev

Hand your agent a task. Get back work you can trust. manifest-dev is a set of free, open-source skills for coding agents.

Stars on GitHub

Momentum

stars in total
78
Star history of doodledood/manifest-dev on GitHub, a chart by star-history.com

Other skills on manifest-dev.

design-principles

design-principles

Design principles for manifest-dev: how its maintainer wants the visual and interaction design guidance the plugin ships, and the…

harden-task-file

harden-task-file

Harden a manifest-dev task guidance file for one-shot quality — either /define''s quality-gate/Default set or figure-out''s probe…

mirror-pairs

mirror-pairs

The red-flag lists mirrored between figure-out''s and define''s task files, so a change to one side lands on the other. Use when…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about learn-from-session.

Which coding agents can use learn-from-session?
learn-from-session installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.