# sips-context-distiller

Adopt this skill: https://proskills.md/skills/other/rasputinkaiser-self-improvement-plugin-skills-sips-context-distiller

Page: https://proskills.md/skills/other/rasputinkaiser-self-improvement-plugin-skills-sips-context-distiller
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/sips-context-distiller/SKILL.md
size: 670
upstream: https://github.com/rasputinkaiser/self-improvement-plugin/blob/main/skills/sips-context-distiller/SKILL.md

```text
---
name: sips-context-distiller
description: Extract bounded, source-linked context from large files or many inputs. Use when context is too large, files are oversized, or a task needs concise excerpts.
---

# SIPS Context Distiller

Use `homebase_context_scan` to find context-drain risks and `homebase_distill_context` to extract bounded excerpts from the relevant files.

Keep excerpts source-linked with paths and line references where possible. Mark omissions explicitly; a distilled packet is working context, not full-file proof.

If exact behavior matters, follow the distilled packet by reading the precise source lines before editing or making a final claim.
```

## File: README.md
upstream: https://github.com/rasputinkaiser/self-improvement-plugin/blob/main/README.md

````text
# SIPS — Self-Improvement Plugin System

![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)
![License: MIT](https://img.shields.io/badge/license-MIT-green)
![Status: dev](https://img.shields.io/badge/status-dev-orange)
![Claude Code plugin](https://img.shields.io/badge/Claude_Code-plugin-8A5CF6)
![Codex plugin](https://img.shields.io/badge/ChatGPT_Codex-plugin-10A37F)

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W7C9TC7)

**A self-improvement harness for Claude Code and ChatGPT / Codex.** SIPS wraps a coding-agent session with memory-aware startup, safer tool use, verification hooks, bounded fresh-context delegation, and session closeout — so long-running sessions remember prior work, avoid repeated mistakes, recover from drift, and capture lessons before the context window disappears.

It does not try to make an agent smarter by swapping models. It improves the *work loop* around whatever model you already run.

> **SIPS 0.11 — visual evidence and explainable memory reuse.** Compose tools with declared units, roles and context identities; inspect dependency drift; run bounded diagnostic policies against recorded probe outcomes. Frozen behavioral cases independently evaluate proposed policies. Passing tests never activate a change automatically. [Workflow and migration guide](docs/sips-09.md).

*Historical companion: [Swift Harness](https://github.com/RasputinKaiser/Swift-Harness), an experimental macOS control surface for the retired NCode setup. Its repository is marked RIP; compatibility with current SIPS is not established.*

Each session can answer:

- What did we learn last time?
- Is this edit risky?
- Did the changed script still pass a smoke check?
- Is this task stuck enough to split out?
- What should future sessions remember?
- Which agent patterns have worked or failed before?

**Suggested GitHub topics:** `agent-harness`, `ai-agents`, `claude-code`, `codex`, `memory-fabric`, `self-improvement`, `automation`, `evals`, `python`, `developer-tools`

## Start here

- [Install](#install) the plugin in your host, then try the [first-session checks](#first-session-checks)
- [Verify](#verify) a source checkout before changing the harness
- [Troubleshooting](docs/troubleshooting.md) covers missing tools, stale installs, hooks, and state paths
- [Architecture](ARCHITECTURE.md) and [Graph runtime docs](Graph-Theory/README.md) explain the internals
- [In-run improvement](docs/sips-in-run-improvement.md) and [visual evidence](docs/sips-visual-evidence.md) describe newer workflows
- [Contributing](CONTRIBUTING.md), [evaluation evidence](EVAL.md), and [decision history](LEDGER.md) provide contributor context

## Supported hosts

SIPS installs as a plugin in either harness, from the same repo:

- **Claude Code** — reads `.claude-plugin/marketplace.json` (marketplace `sips-local`).
- **ChatGPT / Codex** — reads `.agents/plugins/marketplace.json` (marketplace `harness-local`).

Delegation agents declare `model: inherit`, so they run on whatever model the host session already uses. The plugin never depends on a specific model or on model swaps; the gain comes from context control, scoped recall, verification, and recorded outcomes.

## Install

### Claude Code

```bash
/plugin marketplace add RasputinKaiser/Self-Improvement-Plugin
```

Then install **`harness-self-improvement`** from the marketplace UI, or use the
marketplace name declared in this repository:

```text
/plugin install harness-self-improvement@sips-local
```

### ChatGPT / Codex

Register the local checkout as a marketplace in a Codex host with plugin support.
The repository ships `.agents/plugins/marketplace.json` with marketplace name
`harness-local`; select that marketplace and install:

```text
harness-self-improvement@harness-local
```

For a staged local distribution, `install.sh` delegates to
`scripts/local_release.py`. From a source checkout, this creates a new staging
directory and a `release.json` receipt without installing into a host:

```bash
bash install.sh --stage /tmp/sips-local-stage
```

Choose a directory that does not already exist. The separate `--install` action
changes the Codex cache and configuration, backs them up under the stage's
`recovery/` directory, and probes a fresh MCP subprocess. Review
[`local_release.py`](scripts/local_release.py) before using it. A successful
subprocess probe does not prove an already-open host session has refreshed.

## First-session checks

After installation, restart or reload the host if it has not discovered the plugin.
Begin with inspection before starting an improvement loop:

- On Codex: “Use `$sips-control-plane` to show SIPS status and available routes”
- On Codex: “Use `$sips-proof-scanner` to inspect this repository's verification surfaces”
- On Claude Code: use `/recall` to inspect relevant prior lessons, then `/verify` when you want to run harness checks

The control-plane skill uses `homebase_status`, `homebase_routes`, and freshness
checks when native `sips-homebase` tools are available. If tools are deferred,
discover the exact capability before treating it as missing. See
[troubleshooting](docs/troubleshooting.md) for the source/cache/session boundary.
Commands such as `/improve`, `/goal`, and `/selfloop` can change durable state;
choose them deliberately for the task you want to run.

## Requirements

| Requirement | Notes |
|---|---|
| Python 3.10+ | Runs the hook and utility scripts. CI covers 3.10 and 3.12 on macOS and Linux. |
| Claude Code or Codex with plugin support | Each host loads its supported adapter surfaces. The Codex manifest declares skills and MCP; Claude Code also has command, agent, and hook files. Do not assume identical host discovery behavior. |
| POSIX host | macOS / Linux. Windows is untested. |

Runtime scripts resolve `$SIPS_HOME` first, otherwise `~/.codex/sips`. Retired host directories are never a runtime fallback. The SIPS-owned Memory Fabric subsystem is vendored in-repo — no external memory plugin is required.

## What it adds

| Surface | Purpose |
|---|---|
| Lifecycle hooks | Run checks and memory actions during startup, prompt submit, tool use, compaction, and session close. |
| Slash commands | Direct user control over recall, improvement, verification, retrospectives, goals, escalation, and fan-out. |
| Delegation agents | Send bounded subtasks into fresh context while keeping the parent session clean. |
| SIPS Homebase MCP | Portable `homebase_*` tools shared across Claude Code and Codex. |
| Codex skills | Expose the Homebase surfaces as organized, first-class plugin rows. |
| Utility scripts | Validate, test, snapshot, restore, inspect, and improve the harness over time. |

## Adaptive core

`observe → diagnose → propose → build → evaluate → ready_for_review`

The active task agent writes the candidate; SIPS owns evidence, frozen evaluation, durable state, and review. Activation and rollback require an explicit reviewed candidate digest. The `homebase_adaptation_read` and `homebase_adaptation_write` MCP tools share the same controller as the CLI. NCode is retired; Codex is primary and Claude Code compatibility is retained.

## Core workflow

A typical session looks like this:

1. Session starts.
2. The harness validates itself.
3. Memory Fabric health is checked.
4. Prior patterns and lessons are surfaced.
5. The user submits a task.
6. Relevant prior lessons are ranked and injected.
7. Before risky edits, preflight checks run.
8. After tool use, smoke checks and escalation checks run.
9. Before compaction, a continuity packet is written.
10. After compaction, session learnings are recorded.
11. At stop, the task outcome is captured for future pattern analysis.

The intent is to make each session leave behind useful state instead of vanishing into a transcript.

## Slash commands

| Command | Purpose | Use when |
|---|---|---|
| `/improve` | Runs a self-correction sweep and acts on the top recommendation. | You want the harness to f
````
