Claude Code hook

c0ntextKeeper

Automatic context preservation for Claude Code. Never lose work to compaction again. 7 hooks, 187 semantic patterns, 3 MCP tools.

61 stars 7 forksHooks Source

Install

Install
npm install -g c0ntextkeeper && c0ntextkeeper setup

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/Capnjbrown/c0ntextKeeper.git

From the README

c0ntextKeeper

  The only automatic context preservation system for Claude Code
  Zero configuration. Works out of the box. Never lose work to compaction again.

  Quick Start •
  Use Cases •
  AI Search •
  How It Works •
  Docs

At a Glance

| ⚡ Fast |  Note: The CLI command is c0ntextkeeper (all lowercase with zero).
The project name is c0ntextKeeper (capital K), but commands are always lowercase.

What This Enables

Try it now:

Ask Claude Naturally

No regex. No exact keywords. Just ask:
*What did I implement for authentication last week?*
*How did I fix that database connection error?*
*What commands do I run most often?*

Claude uses c0ntextKeeper's 3 MCP tools automatically. Your queries are processed with word expansion, stop word filtering, and 60-day temporal decay scoring.

📖 Full MCP Guide →

Why c0ntextKeeper

| Production Ready | 483 tests passing,  Full MCP documentation: MCP Guide - includes search algorithm details, configuration, and troubleshooting.

Installation Options

Prerequisites
- Node.js 18.0.0 or higher
- Claude Code CLI installed

Global Installation (Recommended)

From Source

Verify Installation

All CLI Commands (30 total)

Core Commands

Search & Discovery

Hook Management (7 subcommands)

Context Management (3 subcommands)

Storage & Maintenance

Development

📖 Full CLI Reference with examples →

Storage Architecture

Directory Structure

Key Features
- Per-Session Files - Unique timestamped files per hook event
- Atomic Writes - No race conditions or data corruption
- JSON Format - Human-readable storage
- Hybrid Storage - Project-local or global (configurable)

Configuration

Config File

Located at ~/.c0ntextkeeper/config.json:

Environment Variables

Security

c0ntextKeeper automatically protects sensitive…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
TypeScript
License
MIT
Last updated
31 July 2026
Topics
agentic-workflowai-toolsanthropicclaude-aiclaude-codeclicontext-engineeringcontext-preservationdeveloper-toolshooksmcpnodejs

FAQ

What is c0ntextKeeper?

Automatic context preservation for Claude Code. Never lose work to compaction again. 7 hooks, 187 semantic patterns, 3 MCP tools. It is a hook for Claude Code, from Capnjbrown/c0ntextKeeper on GitHub.

How do I install c0ntextKeeper?

Run npm install -g c0ntextkeeper && c0ntextkeeper setup, then follow the setup in the README.

Is c0ntextKeeper popular?

Capnjbrown/c0ntextKeeper has 61 GitHub stars and 7 forks. It was last updated on 31 July 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.