npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

context-sieve

v0.1.0

Published

A daemon sentinel that captures AI agent breakthroughs and prevents context rot.

Readme

Context-Sieve 🧠

License: MIT

A background sentinel that captures "Aha!" moments from your AI agent sessions and turns them into permanent architectural rules.

The Problem: Context Rot & Dilution

When building with AI agents, they often repeat the same mistakes. You might fix a race condition in auth.ts, but the next agent that touches the file won't know the history. Documenting everything in a README leads to "Context Rot," and expecting the agent to read the whole repo leads to "Context Dilution."

The Solution: Semantic "Thought-Scraping"

Context-Sieve is a "plug-and-forget" background daemon.

  1. Capture: It watches configured agent logs and source files.
  2. Sieve: It detects "Success-after-Failure" arcs (e.g., an agent fails a test, realizes the bug, and fixes it).
  3. Hydrate: It extracts the "Lesson" and auto-injects it into a high-signal context target such as AGENTS.md, .sieve/context.md, or a legacy .gemini_context file.

Current implementation note: v0.1.0 now defaults to .sieve/logs and .sieve/context.md. Legacy Gemini paths are available through explicit config.

The next agent that wakes up instantly reads:

Rule #1: Always use connectSafe() in Auth to prevent V03 race conditions.

Quick Start

Installation

npm install -g context-sieve

Usage

Run the daemon in the background of your project:

context-sieve

Run the deterministic product harness:

npm run harness

Verify the npm package boundary and built CLI:

npm run smoke:package
npm run smoke:install

Initialize a config profile without hand-editing JSON:

context-sieve init --profile default

Run once with a profile override without writing config:

context-sieve --profile legacy-gemini

Review pending lessons before they become verified invariants:

context-sieve review
context-sieve review edit <id> "Refined rule text"
context-sieve review approve <id>
context-sieve review reject <id>

Check project wiring and health:

context-sieve status

Configuration

By default, Context-Sieve uses provider-neutral paths:

  • Logs: .sieve/logs
  • Context target: .sieve/context.md
  • Ledger: .sieve/memory.jsonl
  • Reflection timeout: 300000 ms

To target a compatibility file such as AGENTS.md, add .sieve/config.json:

{
  "contextTargets": [
    { "path": "AGENTS.md", "strategy": "managed-block" }
  ]
}

To use legacy Gemini logs/context explicitly:

context-sieve init --profile legacy-gemini

This writes:

{
  "logSources": [
    { "type": "tail", "path": ".gemini/logs", "legacy": true }
  ],
  "contextTargets": [
    { "path": ".gemini_context", "strategy": "replace", "legacy": true }
  ],
  "reflectionTimeoutMs": 300000
}

Note: The project is currently in the Incubator Phase (v0.1.0). The CLI and daemon logic are actively being hardened.

Architecture

  • The Engine: Stream-processes logs to find semantic breakthroughs.
  • The Watcher: Uses a portable Node-native file watcher with per-file offsets instead of shell tail.
  • The Adapters: Agent log and context targets should be provider-neutral. Gemini support is a legacy adapter, not the product identity.
  • The Ledger: Stores versioned JSONL entries in .sieve/memory.jsonl, reports malformed lines, and atomically rewrites reviewed entries.
  • The Messenger: Prompts the active agent for SIEVE_RULE: after a failure-to-success arc and records the semantic lesson.
  • The Review CLI: Lets humans edit, approve, or reject pending lessons before they become verified invariants.
  • The Status CLI: Reports config, log source, ledger, and context target health without mutating project files.
  • The Package Smoke Gates: Verify the npm tarball boundary, built CLI, and local tarball install before publish automation.
  • The Harness: Runs deterministic product-contract scenarios without real watchers or external agents.

License

MIT