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

claude-context-auto-handoff

v1.0.5

Published

A Claude Code plugin to automate session handoffs before context compaction.

Readme

claude-context-auto-handoff

English | 한국어

Claude Code plugin that automatically saves session context and generates token-efficient handoff manifests before Claude compacts or stops.

npm version License: MIT


Requirements

  • Node.js 18+ — must be on PATH as node
  • Claude Code or Codex — plugin and hooks require Claude Code CLI or Codex CLI

Overview

Claude's context window eventually fills and compacts — losing design decisions, active blockers, and next steps mid-session. This plugin hooks into PreCompact and Stop events to trigger an AI-authored handoff document before that happens, so the next session picks up exactly where this one left off.

Handoff content is written in telegraphese (no articles, no filler, no code snippets) and structured to maximize token efficiency while preserving all decision context the next session needs.


Components

Tools

  • generate_handoff_manifest — Writes a structured .claude/handoff.md to the current project directory. Also archives to .claude/handoffs/handoff-{timestamp}.md.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | summary | string | ✅ | Terse session recap (telegraphese) | | nextSteps | string[] | ✅ | Ordered todo list for the next session | | taskDescription | string | ✗ | High-level goal + core intent (why this matters) | | currentStatus | string | ✗ | What is done vs what remains — state why, not just what | | keyDecisions | string[] | ✗ | Architecture choices and reasons. Format: "Decision: X — Reason: Y" | | failedApproaches | string[] | ✗ | Already-failed attempts. Format: "Approach: X → Result: Y → Lesson: Z" | | modifiedFiles | string[] | ✗ | Changed files with delta notes. Format: "path/to/file: what changed" — no code | | implicitRules | string[] | ✗ | Tech stack, naming conventions, env vars — anything not derivable from reading code | | blockers | string | ✗ | Unresolved errors or open questions |

Skills

| Command | Behavior | |---------|----------| | /handoff-save | Gather session context and call generate_handoff_manifest | | /handoff-resume | Read .claude/handoff.md and restore context in a new session |

Hooks

Claude Code hooks are built-in. Codex hooks require copying templates/.codex to your project root (see Codex installation).

| Event | Behavior | |-------|----------| | PreCompact | Prompts the model to call generate_handoff_manifest before context compression | | Stop | Warns if handoff is stale or missing after each response | | SessionStart | Auto-restores context from .claude/handoff.md if it exists |


Quick Start

Linux / macOS

curl -fsSL https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.sh | bash

Windows (PowerShell)

irm https://raw.githubusercontent.com/Ethualo/context-handoff-mcp-server/main/scripts/setup.ps1 | iex

npm (cross-platform)

npm install -g claude-context-auto-handoff
claude-context-handoff-setup

Installation

As a Claude Code plugin

claude plugin install claude-context-auto-handoff

As an npm package

npm install -g claude-context-auto-handoff
claude-context-handoff-setup  # hooks.json 자동 배치

Manual MCP configuration (Claude Code)

Add to your Claude Code settings.json:

{
  "mcpServers": {
    "context-handoff-manager": {
      "command": "node",
      "args": ["/path/to/build/index.js"]
    }
  }
}

Codex

Add to ~/.codex/config.toml (global MCP config):

[mcp_servers.context-handoff]
command = "node"
args = ["/path/to/build/index.js"]

Then copy the hook templates to your project root:

cp -r /path/to/claude-context-auto-handoff/templates/.codex ./.codex

This enables the same SessionStart, PreCompact, and Stop hooks as Claude Code.


Usage

Claude Code

All three hooks fire automatically — SessionStart restores context on session open, PreCompact saves before compression, Stop warns if handoff is stale. Generated manifests are saved to .claude/handoff.md.

Manual checkpoint:

/handoff-save

Manual resume (if auto-restore didn't trigger):

/handoff-resume

Codex

Same three hooks fire automatically via .codex/hooks.json. No slash commands — hooks handle everything.

| Event | Behavior | |-------|----------| | SessionStart | Reads .claude/handoff.md and injects content as context | | PreCompact | Prompts Codex to call generate_handoff_manifest before compression | | Stop | Warns if handoff is stale (>5 min) or missing |

Output format

# Session Handoff Snapshot
> **Generated:** 6/22/2026, 3:30:00 PM

## 🎯 High-Level Objective
* **Goal:** Build Next.js 15 app syncing Supabase + Notion stock data in real-time
* **Core Intent:** Minimize client re-fetches via Zustand store — cost control

## 📌 Current State & Next Steps
* **Status:** Task 3 (Zustand store) complete
* **Blocker:** Notion API rate limit (3 req/s) — buffer layer needed
* **Next Action:** Implement Supabase Edge Functions debounce queue

## 🛠️ Modified Files Delta
* src/store/stockStore.ts: Zustand store skeleton + syncStatus state
* src/app/api/notion/sync/route.ts: POST handler written, Supabase not wired yet

## 🚫 Failed Approaches (DO NOT RETRY)
* Approach: Call Notion API directly from Server Actions → Result: Rate limit hit on re-render → Lesson: Queue middleware mandatory
* Approach: useEffect polling → Result: Supabase read usage spike → Lesson: Abandoned

## 🔑 Crucial Context & Implicit Rules
* Stack: Next.js 15 (App Router), Supabase v2, Zustand v5
* Naming: API endpoints always route.ts, PascalCase store names
* Env: NEXT_PUBLIC_SUPABASE_ANON_KEY active

---
*Run `/handoff-resume` in the next session to restore this context.*

License

MIT