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

fff-subconscious-pi

v0.2.2

Published

Background memory for the pi coding agent. Before each LLM call it greps your local text corpora (past session transcripts, notes) with fff, makes one cheap DeepSeek call, and injects a short synthesized insight into the prompt as context.

Readme

fff-subconscious-pi

A background memory layer for the pi coding agent. Before each LLM call it greps your local text corpora with fff, a fast local search engine, makes one cheap deepseek-v4-flash call to synthesize the hits into a short note, and injects that note into the prompt as a <fff_subconscious> block. The agent gets a reminder of what you worked on before, without being asked.

Install

pi install npm:fff-subconscious-pi

or straight from the repo:

pi install git:github.com/esinecan/fff-subconscious-pi

Requirements: python3 >= 3.10 on PATH and DEEPSEEK_API_KEY in the environment. On the first few context events after install, the extension bootstraps its own python venv in the background (.venv/ inside the package directory, with fff-search and openai, takes about a minute) and injects nothing until the .venv/.ready sentinel appears. From then on it is live. Unix-only for now, since the pipeline script uses fcntl and /tmp.

Point it at your own corpora

config.json in the package directory decides what gets searched:

  • fff.transcripts_root defaults to ~/.claude/projects, which is where the Claude Code CLI keeps past session transcripts. If you use Claude Code, this works as is. If not, point it at any directory of text you want recalled.
  • fff.canon_roots ships pointing at the author's private notes directories, which do not exist on your machine. Replace the entries with your own documentation or notes directories, or delete them.

A configured root that does not exist is named in /tmp/subconscious.log on every run and skipped, so a fresh install runs on whatever corpora it can find rather than failing.

What happens per prompt

pi.on("context", handler) fires before every LLM call with the full message history. The handler:

  1. Guards: venv ready, mode, minimum messages, minimum input length, dedup.
  2. Serializes the conversation into a temp transcript file.
  3. Runs the vendored observe.py with the package venv's python. That script extracts search terms from the recent conversation, greps every configured corpus with fff, and makes one deepseek-v4-flash call to turn the hits into a short note, or NO_UPDATE when they are not worth injecting. The model may also escalate once, asking for a deep read of one promising file or a widened search, at the cost of one more flash call.
  4. Reads the result from cache/ and injects it into the last user message as <fff_subconscious>...</fff_subconscious>.

A typical run takes about six seconds. Tool-call continuation turns re-inject the cached note without re-running the pipeline, and different user messages are spaced out by a cooldown. Any failure injects nothing.

Design notes

The pipeline script comes from a Claude Code hook setup by the same author and is vendored verbatim, so this package is self-contained. Claude Code runs it across two hooks: generation happens after each assistant reply, injection happens on the next prompt, and the injected note therefore always trails the conversation by one turn. Pi has no such split, only a single context event before each LLM call, so this extension runs the pipeline synchronously and injects a note built from the very prompt being answered. No lag, and a hard subprocess timeout (FFF_SUBCONSCIOUS_TIMEOUT_MS, default 60s) guarantees the LLM call never blocks on it.

One consequence of firing before the LLM call: on the first turn of a fresh session the transcript holds only the user's message, so the vendored config sets min_messages to 1. The note can then arrive on the opening question instead of waiting for turn two.

Configuration (env vars)

| Variable | Default | Purpose | |---|---|---| | FFF_SUBCONSCIOUS_MODE | every | every, first, or off. | | FFF_SUBCONSCIOUS_DEBUG | 0 | 1 for stderr logs prefixed [fff-sub]. | | FFF_SUBCONSCIOUS_COOLDOWN_MS | 120000 | Min gap between pipeline runs across user messages. | | FFF_SUBCONSCIOUS_MIN_MESSAGES | 1 | Skip if fewer messages. | | FFF_SUBCONSCIOUS_MIN_CHARS | 12 | Skip injection for inputs shorter than this. | | FFF_SUBCONSCIOUS_MAX_CHARS | 4000 | Hard cap on injected note length. | | FFF_SUBCONSCIOUS_TIMEOUT_MS | 60000 | Hard cap on the pipeline subprocess. | | DEEPSEEK_API_KEY | (required) | DeepSeek key for the flash calls. |

Tuning of the retrieval itself (corpora roots, max search terms, escalation budgets) lives in config.json.

Cache and logs

Notes are cached in cache/ inside the package directory, one file per working directory, keyed by sha256(cwd). Temp transcripts are cleaned up after each run. Delete the cache directory to force fresh queries. The pipeline logs to /tmp/subconscious.log, with a structured version in /tmp/subconscious-diag.log.