← Back to Skills Marketplace
ajitsingh25

Apply Learnings

by Ajit Singh · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
116
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install apply-learnings
Description
Analyze Claude Code session history to extract learnings that would have been helpful if provided earlier, then persist them for future sessions. Use when th...
README (SKILL.md)

Apply Learnings Skill

Analyze Claude Code session history to extract learnings that would have been helpful if provided earlier, then persist them for future sessions.

Overview

This skill performs comprehensive analysis of session transcripts to identify:

  1. Code Pattern Learnings - Framework conventions, idioms, and best practices discovered during the session
  2. Architectural Preferences - Where validation/logic should live, layer responsibilities
  3. Tool Usage Patterns - Failed tool calls, user corrections, successful retries
  4. Missing Context - Information the user had to provide that could be documented upfront

Usage

Analyze Current Session

python3 ~/.claude/skills/apply-learnings/scripts/analyze_session.py --scope current

Analyze All Historical Sessions

python3 ~/.claude/skills/apply-learnings/scripts/analyze_session.py --scope all

Analyze Specific Project

python3 ~/.claude/skills/apply-learnings/scripts/analyze_session.py --project /path/to/project

Workflow

When the user invokes this skill:

Step 1: Ask User for Scope

Ask which scope to analyze:

  • Current session - Only the current conversation
  • Current project - All sessions for the current working directory
  • All sessions - Complete history across all projects

Step 2: Run Analysis

Execute the analysis script:

python3 ~/.claude/skills/apply-learnings/scripts/analyze_session.py --scope \x3Cscope>

Step 3: Present Findings

Present findings organized by category:

Code Pattern Learnings

Conventions and idioms specific to the codebase/framework:

  • Dependency injection patterns (e.g., "use glue logger from context, not DI")
  • Error handling conventions
  • Naming patterns
  • Testing patterns

Architectural Preferences

Where different concerns should be handled:

  • Validation location (e.g., "validate at handler/mapper, not in controllers")
  • Error transformation boundaries
  • Layer responsibilities

Tool Usage Improvements

From the original tool-self-improver:

  • Failed tool calls and corrections
  • Common error patterns
  • Successful retry patterns

Missing Context

Information that would have helped earlier:

  • Project-specific conventions not in CLAUDE.md
  • Framework quirks
  • Team preferences

Step 4: Classify Destination for Each Learning

For each learning, determine the best destination. Do NOT put everything in CLAUDE.md — route to the most specific location:

Destination When to Use Example
~/.claude/MEMORY.md Cross-machine context: SRE tools, key people, tool conventions — anything useful on both Mac AND devpods SRE MCP session protocol, .env default paths, key people/Slack IDs
~/.claude/CLAUDE.md Cross-project behavioral rules, hard constraints, coding preferences "Always use double quotes for SSH commands"
Existing skill reference Learning directly relates to a specific skill's domain Glue logger pattern → /verification references; rebase tips → /arh-pr-workflow
Project CLAUDE.md Learning is specific to one project/repo "This repo uses custom test helpers in pkg/testutil"
New skill Learning represents a reusable workflow or substantial domain knowledge not covered by existing skills A complete debugging workflow for a specific system

Classification rules:

  1. Cross-machine tool/people context~/.claude/MEMORY.md (synced via TerraBlob to all machines)
  2. Check ~/.claude/skills/ — if a learning fits an existing skill, add it as a reference file or append to existing references
  3. If it's project-specific, target the project's CLAUDE.md (at repo root or ~/.claude/projects/)
  4. If it's a substantial, reusable workflow (3+ related learnings on one topic), propose a new skill
  5. Only put truly global behavioral rules in ~/.claude/CLAUDE.md
  6. When in doubt, prefer the more specific destination

Step 5: Present Routed Proposals

Present findings grouped by destination using AskUserQuestion:

I've identified the following learnings and where they should go:

**→ ~/.claude/CLAUDE.md** (global)
- [learning 1]
- [learning 2]

**→ ~/.claude/skills/verification/references/** (existing skill)
- [learning 3: web-code specific lint pattern]

**→ ~/.claude/skills/arh-pr-workflow/references/** (existing skill)
- [learning 4: rebase conflict resolution tip]

**→ ./CLAUDE.md** (this project only)
- [learning 5: project-specific convention]

**→ New skill: `debug-m3`** (proposed)
- [learning 6, 7, 8: related M3 debugging workflow]

Then ask user per destination group:

  • Apply as proposed — write to the suggested destination
  • Redirect — user specifies a different destination
  • Edit first — user wants to modify the content before applying
  • Skip — don't apply this group

Step 6: Apply Approved Changes

For each approved group:

  • CLAUDE.md additions: Append under appropriate existing section, or create new section if none fits. Deduplicate against existing content.
  • Existing skill references: Create or append to a references/learnings.md file in that skill's directory. Use ## Auto-learned (YYYY-MM-DD) header.
  • Project CLAUDE.md: Append under appropriate section in the project's CLAUDE.md.
  • New skill: Create ~/.claude/skills/\x3Cname>/SKILL.md with proper structure (description, when to use, the learned workflow/knowledge).

What Gets Detected

Code Pattern Signals

  • User corrections mentioning "use X instead of Y"
  • Explanations of framework conventions
  • References to existing patterns in codebase
  • "We prefer..." or "The convention is..." statements

Architectural Signals

  • Discussion of layer responsibilities
  • "This should be in X, not Y" corrections
  • Validation/error handling location guidance
  • Separation of concerns discussions

Tool Failure Signals

  • Tool calls with is_error: true
  • User rejections of tool calls
  • Interrupted requests
  • Successful retries after user guidance

Missing Context Signals

  • User providing information that wasn't asked for
  • Corrections about project-specific conventions
  • "Actually, in this codebase we..." statements
  • References to undocumented team practices

Example Learnings

Glue Framework Patterns

**Logger usage:**

- Use `ctx.Logger()` from the glue context instead of injecting logger via DI
- The context logger automatically includes request tracing

**Mapper conventions:**

- Mappers should only do type conversion, no business logic
- Return errors for invalid conversions, not validation errors

Validation Architecture

**Validation at edges:**

- Validate request payloads in handler layer (mapper or validation package)
- Controllers receive pre-validated entities
- Gateway responses should be validated/transformed at gateway layer

Go Monorepo Patterns

**BUILD.bazel:**

- Run `gazelle \x3Cdirectory>` after adding new imports
- Never run `bazel build //...` from root

**Testing:**

- Use table-driven tests
- Mocks generated with `mockgen` or `bin/glue mock`

Notes

  • Analysis is read-only; no sessions are modified
  • All changes require explicit user approval per destination group
  • Learnings are routed to the most specific destination, NOT all dumped into CLAUDE.md
  • Destinations: global CLAUDE.md, existing skill references, project CLAUDE.md, or new skills
  • Focus on actionable, specific guidance — avoid overly generic advice
  • Deduplicate against existing content before writing
Usage Guidance
Before installing or running this skill, be aware it will scan your conversation/session transcripts and tool inputs and can write extracted "learnings" into global files (like ~/.claude/CLAUDE.md or ~/.claude/MEMORY.md) and into other skills' reference directories. That process can capture and persist sensitive data (passwords, API keys, secrets pasted in sessions, or other PII). Recommended steps: - Inspect the full scripts locally (scripts/analyze_session.py) to verify exactly which paths are read and written and whether there is any network I/O. Confirm there are explicit redaction measures for secrets. - Run initially with the narrowest scope (e.g., --scope current) and review all extracted learnings before allowing any writes. - Back up the target files/directories you allow the skill to write (project CLAUDE.md, ~/.claude/*, and ~/.claude/skills/*) so you can revert unintended changes. - Deny or carefully review suggestions to persist learnings to shared/global files or to append into other skills' directories; prefer storing only project-local, user-reviewed notes. - If you use cross-machine syncing (TerraBlob or similar), consider disabling it while testing so learnings (which may include sensitive context) are not propagated automatically. - If you are unsure about whether the script modifies other skills or performs network access, run it in an isolated environment (e.g., a throwaway account or VM) first and monitor filesystem changes. If you want, I can (1) scan the rest of the script for any network calls or explicit file-write code you should watch for, or (2) suggest a safe reduced workflow for extracting and redacting learnings before persistence.
Capability Analysis
Type: OpenClaw Skill Name: apply-learnings Version: 1.0.0 The `apply-learnings` skill is a utility designed to analyze Claude Code session history and extract architectural preferences, coding patterns, and tool usage improvements. It uses a Python script (`analyze_session.py`) to parse local session logs and suggests updates to configuration files like `CLAUDE.md` or `MEMORY.md`. The workflow explicitly requires user approval before any file modifications occur, and the code contains no indicators of data exfiltration, obfuscation, or unauthorized remote execution.
Capability Assessment
Purpose & Capability
Name and description match the provided SKILL.md and the included analysis script: both are designed to scan Claude session transcripts, extract 'learnings', and persist them to per-project or global files (e.g., ~/.claude/CLAUDE.md, ~/.claude/MEMORY.md, or skill-specific reference directories). No unrelated credentials or binaries are requested.
Instruction Scope
The runtime instructions and script operate over session histories and tool call inputs across scopes 'current', 'project', or 'all'. The parser explicitly extracts user messages and tool inputs/tool failures — these can contain secrets or sensitive context. The SKILL.md and script propose persisting learnings into global files and into other skills' reference directories. There are no explicit safeguards described for detecting or redacting secrets, for limiting what is collected, or for preventing writes to other skills' directories.
Install Mechanism
There is no external install/download action: the skill is instruction-only and includes a local Python script. No URL downloads, package installs, or archive extraction are present in the provided metadata.
Credentials
The skill requests no environment variables, but it will read session transcripts and tool inputs (likely under ~/.claude and project directories) and then write learnings to global files and possibly other skill directories. This broad access to user data (including potential secrets typed in sessions or tool inputs) is not declared or limited, and no sanitization policy is described.
Persistence & Privilege
The skill does not declare always:true, but the SKILL.md instructs writing to shared/global locations (e.g., ~/.claude/MEMORY.md, ~/.claude/CLAUDE.md) and to append or create files in ~/.claude/skills/* (modifying other skills' reference files). Modifying other skills' directories and writing global, cross-machine files increases risk and should be explicitly consented to and audited.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install apply-learnings
  3. After installation, invoke the skill by name or use /apply-learnings
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the "apply-learnings" skill for analyzing and persisting session learnings. - Analyzes session history to extract helpful learnings such as code patterns, architectural conventions, tool usage patterns, and missing context. - Guides user through selecting the analysis scope: current session, project-wide, or all sessions. - Classifies each learning and proposes a destination: ~/.claude/MEMORY.md, ~/.claude/CLAUDE.md, existing skill references, project CLAUDE.md, or a new skill. - Presents routed proposals by group, allowing the user to review, redirect, edit, or skip. - Applies approved changes to the relevant destination files with deduplication and proper formatting. - Supports enriching CLAUDE knowledge across projects and sessions by auto-capturing lessons learned.
Metadata
Slug apply-learnings
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Apply Learnings?

Analyze Claude Code session history to extract learnings that would have been helpful if provided earlier, then persist them for future sessions. Use when th... It is an AI Agent Skill for Claude Code / OpenClaw, with 116 downloads so far.

How do I install Apply Learnings?

Run "/install apply-learnings" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Apply Learnings free?

Yes, Apply Learnings is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Apply Learnings support?

Apply Learnings is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Apply Learnings?

It is built and maintained by Ajit Singh (@ajitsingh25); the current version is v1.0.0.

💬 Comments