SLOPSHOPPER

self-improvement-loop

Background reflection on Claude Code sessions that promotes recurring lessons into skills, hooks, rules and agents, tracks artifact usage feedback, and ships a…

v1.3.0MITupdated 2026-10-25kolezka/self-improvement-loop
A shopper browsing a rack in a slop shop
Preview could not run: hooks.json names ../dist/hook-module.js as the hooks module, but the repository has no such file
README

self-improvement-loop

Turn recurring Claude Code mistakes into reusable skills, hooks, rules and agents.

Stop explaining the same correction from scratch. This plugin reviews your coding sessions in the background, finds recurring lessons, and drafts changes for you to review. Keep what helps. Reject what doesn't.

CI Release License

Demo: review and accept a proposed skill, track its usage and feedback, and flag a misfiring hook

Watch as MP4 · Install guide · Report a bug

Get started

You need Bun 1.4.2 or newer, Git, and a working Claude Code CLI.

claude plugin marketplace add kolezka/marketplace
claude plugin install self-improvement-loop@kolezka

Start a new Claude Code session, then run:

/self-improvement-loop:loop

On a fresh install, this creates the config, a local learned/ repository, and ~/.local/bin/sil. The default model provider is your claude CLI. Background reviews make model calls and use your provider's quota or billing.

Open the web review console, or use the native Claude Code panel:

/self-improvement-loop:loop web

Keep coding. When proposals are ready, review their diffs in the console. To run the worker and console as background services on macOS or Linux:

sil schedule install --web

Make sure ~/.local/bin is on your PATH. For other model endpoints and troubleshooting, see the install guide. To install without a plugin, follow standalone installation.

Claude Code panel

Keep the loop beside your chat with the native Claude Code Mods panel. Browse worker status, proposal diffs, artifacts and activity without opening a browser. Capture and edit lessons, rate artifacts, or use action buttons to queue the loop's commands in your session.

With the plugin installed and a Claude Code build that supports Mods, start it with function hooks enabled:

CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude

Then open the panel inside the session:

/sil

Use /sil capture to start a lesson from selected chat text. Proposal acceptance, rejection and revision still use the web console or CLI. The panel requires the plugin; standalone installs use the web console or CLI instead.

See panel setup and requirements.

How it works

  1. Observe. Hooks record session events without calling a model.
  2. Reflect. A background worker reads session transcripts and extracts lessons.
  3. Draft. Recurring patterns become proposed skills, hooks, rules or agents on Git branches.
  4. Review. You inspect the diff and accept or reject it. Accepted artifacts can guide future sessions.
  5. Evaluate. Usage and feedback help identify what to refine or retire.

For example, repeated claims of "tests passed" without a test run could become a rule to run the relevant checks and report their results. This is an example of the workflow, not a guarantee that an agent will stop making that mistake.

Use it while you work

These commands are namespaced so they don't collide with commands from other plugins:

CommandUse it to
/self-improvement-loop:loopCheck status; add web for the console or run for a worker pass.
/self-improvement-loop:reflectQueue the current session for reflection.
/self-improvement-loop:learnTurn a mistake you just caught into a proposed rule, skill, agent or nudge.
/self-improvement-loop:toolifyTurn the last working answer into a reusable skill.
/self-improvement-loop:feedback skill:<name> goodRate an artifact; use bad for a misfire.

For terminal reviews, start with sil review list and sil review --help.

Your changes, your control

  • Review by default. Proposals are staged on branches. Acceptance is tied to the exact diff you reviewed. Local auto-merge is a separate, opt-in setting.
  • Local storage, your model provider. Reflections and feedback stay on disk. Transcript-derived content is sent to the model endpoint you configure. Local storage does not mean offline inference.
  • Separate projects. Work and personal projects can use separate "worlds", each with its own lessons, target repository and model policy.
  • No automatic publishing. Pushing or opening a PR requires human acceptance and an explicit per-world setting.

Other agents

Codex can read lessons, review proposals and record feedback after sil codex install. Its sessions do not feed the loop.

OpenClaw can feed sessions into the loop and receive lessons through AGENTS.md. See the OpenClaw guide.

Documentation

If the loop misses a repeated mistake, open an issue with a minimal, redacted example. Contributions are welcome.

MIT license.

Source 1 files
types/index.d.ts 82 lines
1// The plugin's state contract, named in .claude-plugin/plugin.json as "types".
2// `claude plugin validate` holds every $.state key the hooks module names to
3// what is declared here. Self-contained on purpose: no import, no reference.
4// apps/hook-module/src/ui/state.ts keeps its ConsoleUiState to this same shape,
5// and a test fails to compile if the two drift apart.
6
7/** One read's outcome, as the control bridge answers it. */
8export type SilControlResult =
9  | { ok: true; value: unknown }
10  | { ok: false; error: { code: string; message: string; retryable: boolean } };
11
12/** The native console's view, under the stable key `console`. Written only
13 * by the console's handlers and timer, never while it draws. */
14export type SilConsoleState = {
15  /** The world shown, or null while none is chosen. */
16  world: string | null;
17  section: "overview" | "review" | "artifacts" | "activity" | "settings";
18  /** Moves on every change of what is read (world, section, list page,
19   * proposal and its page), close, session end and reload; a reply tagged
20   * with an older one is dropped. */
21  generation: number;
22  selectedPattern: string | null;
23  loading: boolean;
24  /** When a read last came back with every result ok; ISO 8601. */
25  lastSuccessAt: string | null;
26  /** The latest result per read id. */
27  results: Record<string, SilControlResult>;
28  /** Shown as an error; set, the results may be stale. */
29  error: string | null;
30  /** First item of the section's list page. */
31  listOffset: number;
32  /** The open proposal, set exactly when `selectedPattern` is. */
33  proposal: SilProposalView | null;
34  /** First item of the Activity section's lessons page. */
35  lessonsOffset: number;
36  /** First world the world switcher offers; moving it reads nothing. */
37  worldOffset: number;
38  /** The Activity part shown; switching it reads nothing. */
39  activityTab: "queue" | "reflections" | "lessons" | "log";
40  /** The last slash command a button queued, and the host's refusal if any;
41   * cleared on a section or world change. */
42  commandNote: { id: string; command: string; args: string; target: string | null; error: string | null } | null;
43};
44
45/** Which part and page of the open proposal is shown, the pages before it,
46 * and the reviewed_state (64 hex) its first page was read at; every later
47 * page is asked for at that digest. */
48export type SilProposalView = {
49  part: "body" | "diff";
50  offset: number;
51  back: number[];
52  reviewedState: string | null;
53};
54
55/** The Lessons view inside Activity, under the key `lessons`. View settings,
56 * the editor's opaque snapshot, and its trimmed restore export only when its
57 * text passed the secret screen and the save limits. Never authority: a reload
58 * imports it through the editor's own restore and reads the store again. */
59export type SilLessonsState = {
60  version: 1;
61  /** Moves on every write, so a drawn pane redraws. */
62  rev: number;
63  open: boolean;
64  world: string | null;
65  filter: "saved" | "inbox" | "archived" | "important";
66  /** Flat project value (`world`, `unresolved` or a `p1_` id), or null. */
67  project: string | null;
68  search: string;
69  /** Opaque to every reader but the editor's own restore. */
70  restore: { [key: string]: unknown } | null;
71  /** Why `restore` is null although a draft exists. */
72  withheld: "sensitive" | "size" | null;
73  /** Opaque ids only, for the editor's own hydrate. */
74  snapshot: { [key: string]: unknown } | null;
75};
76
77declare module "claude-code" {
78  interface PluginState {
79    "self-improvement-loop": { console: SilConsoleState; lessons: SilLessonsState };
80  }
81}
82