#coding-assistants #graph #hook-handler #passive #ai-coding #artificial-intelligence

codemem-hooks

PostToolUse hook handler for passive capture from AI coding assistants

9 releases (breaking)

0.7.0 Mar 3, 2026
0.6.2 Feb 28, 2026
0.5.0 Feb 28, 2026
0.4.0 Feb 28, 2026
0.1.0 Feb 27, 2026

#1321 in Machine learning


Used in codemem-cli

Apache-2.0

695KB
15K SLoC

codemem-hooks

PostToolUse hook handler for passive capture of AI assistant observations.

Overview

Parses incoming hook payloads from AI coding assistants (Claude Code, Cursor, Windsurf), extracts relevant information per tool type, and produces structured memories with graph nodes and edges.

Supported Tools

Tool Memory Type Extraction
Read Context File content, path, extension tags
Glob Pattern Glob pattern, discovery tags
Grep Pattern Search regex, match results
Edit / MultiEdit Decision Semantic diff summary (functions added/removed, import changes)
Write Decision New file content, path, extension tags

Key Features

  • SHA-256 content hashing for deduplication
  • Diff-aware memory via similar crate (semantic summaries of code changes)
  • Edge materialization: EVOLVED_INTO edges when a file is edited after being read
  • Per-tool tag extraction (file extension, directory, glob pattern, search regex)

Dependencies

~98MB
~2M SLoC