Claude Code hook
c0ntextKeeper
Automatic context preservation for Claude Code. Never lose work to compaction again. 7 hooks, 187 semantic patterns, 3 MCP tools.
Install
npm install -g c0ntextkeeper && c0ntextkeeper setupFound in the project README. Check it for setup steps after installing.
git clone https://github.com/Capnjbrown/c0ntextKeeper.gitFrom 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…
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.
Details
- Repository
- Capnjbrown/c0ntextKeeper
- 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
Claude Leverage
68Filip-Podstavec/claude-leverage
Make any repo AI-first - write sustainable code from the start, or refactor a legacy codebase to prepare it for agent-driven development.Building blocks for Claude Code: subagents, slash commands, hooks, and workflow patterns. Copy what you need. A working developer's stack for Claude Code.
Secguard
61random1st/secguard
3-level security toolkit for AI agents: regex patterns, heuristic rules, ML classification. Claude Code hooks, git pre-commit, CI/CD scanner.
Evc
59SaigonXIII/evc
The open-source marketing agent workspace for Claude Code. 42 commands, 12 hooks, 4 industry starters.
Claude Hooks
41gabriel-dehan/claude_hooks
A Ruby DSL for creating Claude Code hooks
claude-hooks
17liberzon/claude-hooks
PreToolUse hook that splits compound bash commands and checks each part against allow rules.
AI Helpers
39opendatahub-io/ai-helpers
AI Helpers — collections of Skills, Hooks, Agents (compatible with Claude Code, Cursor and other tools) and Gemini Gems
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.