Show HN: Self-improving Claude Code with turn-counter hook A developer released a Claude Code skill, claude-skill-self-improve, that runs a recurring retro reviewing recent work, extracting reusable lessons into ~/.claude/ (CLAUDE.md, rules, memory, skills, agents) and pruning stale entries. A UserPromptSubmit hook script increments a per-session counter in ~/.claude/state/self-improve/.count and prints a [self-improve] line every N turns, defaulting to 20 and configurable via SELF_IMPROVE_EVERY (0 disables it), or the retro can be triggered manually with /self-improve. Each retro writes its summary to ~/.claude/state/self-improve/last-retro.md for the next retro to read, and lessons belonging in a project repo are listed as proposals rather than applied. A Claude Code skill that runs a recurring retro: it reviews recent work, extracts general, reusable lessons and folds them into ~/.claude/ CLAUDE.md, rules, memory, skills, agents , pruning stale entries as it goes. A UserPromptSubmit hook nudges it every N turns; it can also be run by hand with /self-improve . Note This skill is a starting point, not a finished product. It is meant to be adapted to your own use case: edit SKILL.md to match where your lessons should live, what counts as a good lesson for your work, and how often the retro should run. SKILL.md the skill scripts/self-improve-counter.sh turn-counter hook 1. Clone the skill into your skills folder: git clone git@github.com:JonnaMat/claude-skill-self-improve.git ~/.claude/skills/self-improve 2. Install the hook script: mkdir -p ~/.claude/hooks && cp ~/.claude/skills/self-improve/scripts/self-improve-counter.sh ~/.claude/hooks/ && chmod +x ~/.claude/hooks/self-improve-counter.sh 3. Register the hook in ~/.claude/settings.json merge with any hooks you already have : { "hooks": { "UserPromptSubmit": { "hooks": { "type": "command", "command": "~/.claude/hooks/self-improve-counter.sh" } } } } 4. Restart Claude Code and check /hooks lists the UserPromptSubmit entry. On every prompt the script reads session id from the hook's JSON payload, increments ~/.claude/state/self-improve/