Skip to content
Development
Hook

Hooks

What davegoldblatt-recall runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
davegoldblatt-recall
20210 skills10 commands2 hooks

Claude Code

$ npx -y skills add davegoldblatt/total-recall --agent claude-code

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • "${CLAUDE_PLUGIN_ROOT}"/hooks/session-start.sh

PreCompact

  • "${CLAUDE_PLUGIN_ROOT}"/hooks/pre-compact.sh
Read hooks/hooks.json

Where it lives

  • hooks/pre-compact.shRunsGitHub
    Read the script
    #!/usr/bin/env bash
    # Total Recall — PreCompact Hook
    #
    # Fires before context compaction. Writes a compaction marker to today's
    # daily log. Does NOT read or parse conversation transcripts.
    #
    # Hook input: JSON object on stdin (ignored — we only write files).
    
    set -euo pipefail
    
    # Use Claude Code's project dir env var, fall back to git root or cwd
    PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
    MEMORY_DIR="$PROJECT_ROOT/memory"
    TODAY="$(date +%Y-%m-%d)"
    NOW="$(date +%H:%M)"
    DAILY="$MEMORY_DIR/daily/$TODAY.md"
    
    # Bail if memory system isn't initialized
    if [ ! -d "$MEMORY_DIR/daily" ]; then
      exit 0
    fi
    
    # Create today's daily log if it doesn't exist
    if [ ! -f "$DAILY" ]; then
      cat > "$DAILY" << EOF
    # $TODAY
    
    ## Decisions
    
    ## Corrections
    
    ## Commitments
    
    ## Open Loops
    
    ## Notes
    EOF
    fi
    
    # Drain stdin so the hook doesn't hang
    if ! [ -t 0 ]; then
      cat > /dev/null
    fi
    
    # Append compaction marker
    echo "" >> "$DAILY"
    echo "## [pre-compact $NOW]" >> "$DAILY"
    echo "" >> "$DAILY"
    echo "- Compaction occurred at $NOW. Review recent work and use /recall-write to preserve anything important." >> "$DAILY"
    echo "" >> "$DAILY"
    
  • hooks/session-start.shRunsGitHub
    Read the script
    #!/usr/bin/env bash
    # Total Recall — SessionStart Hook
    #
    # Fires on session start. Stdout is injected as additional context.
    # Reads open loops and recent daily log highlights to prime the session.
    
    set -euo pipefail
    
    # Use Claude Code's project dir env var, fall back to git root or cwd
    PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
    MEMORY_DIR="$PROJECT_ROOT/memory"
    
    # Bail if memory system isn't initialized
    if [ ! -d "$MEMORY_DIR" ]; then
      exit 0
    fi
    
    TODAY="$(date +%Y-%m-%d)"
    YESTERDAY="$(date -v-1d +%Y-%m-%d 2>/dev/null || date -d 'yesterday' +%Y-%m-%d 2>/dev/null || echo '')"
    
    echo "## Total Recall — Session Context"
    echo ""
    
    # Open loops (always relevant)
    OPEN_LOOPS="$MEMORY_DIR/registers/open-loops.md"
    if [ -f "$OPEN_LOOPS" ]; then
      ACTIVE_ITEMS=$(grep -c '^\- \[ \]' "$OPEN_LOOPS" 2>/dev/null || echo "0")
      if [ "$ACTIVE_ITEMS" -gt 0 ]; then
        echo "### Open Loops ($ACTIVE_ITEMS active)"
        grep '^\- \[ \]' "$OPEN_LOOPS" 2>/dev/null || true
        echo ""
      fi
    fi
    
    # Today's daily log
    DAILY_TODAY="$MEMORY_DIR/daily/$TODAY.md"
    if [ -f "$DAILY_TODAY" ]; then
      LINES=$(wc -l < "$DAILY_TODAY" | tr -d ' ')
      if [ "$LINES" -gt 5 ]; then
        echo "### Today's Log ($TODAY) — $LINES lines"
        tail -20 "$DAILY_TODAY"
        echo ""
      fi
    fi
    
    # Yesterday's daily log (brief)
    if [ -n "$YESTERDAY" ]; then
      DAILY_YESTERDAY="$MEMORY_DIR/daily/$YESTERDAY.md"
      if [ -f "$DAILY_YESTERDAY" ]; then
        echo "### Yesterday's Log ($YESTERDAY)"
        grep -A2 '## Decisions\|## Corrections\|## Commitments\|## Open Loops' "$DAILY_YESTERDAY" 2>/dev/null | head -20 || true
        echo ""
      fi
    fi
    
    # Word count warning on working memory
    if [ -f "$PROJECT_ROOT/CLAUDE.local.md" ]; then
      WORD_COUNT=$(wc -w < "$PROJECT_ROOT/CLAUDE.local.md" | tr -d ' ')
      if [ "$WORD_COUNT" -gt 1200 ]; then
        echo "**Warning**: Working memory (CLAUDE.local.md) at $WORD_COUNT words (limit: 1500). Consider pruning."
        echo ""
      fi
    fi
    

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

@davegoldblatt
Ships withdavegoldblatt-recall

A memory system for Claude Code that remembers what matters and forgets what doesn't.

Stars on GitHub

Momentum

stars in total
202
Star history of davegoldblatt/total-recall on GitHub, a chart by star-history.com

More plugins that ship hooks.

superpowers

superpowers

A development methodology for coding agents that makes the agent brainstorm before building, follow plans, run parallel work and finish branches in a disciplined way. You get fewer skipped steps and more consistent results from your coding assistant.

15 skills1 hook311k
@obra@obra
Install Plugin
ponytail

ponytail

A Claude Code plugin with skills for auditing a whole repo, reviewing a change, listing deferred shortcut comments, and showing measured savings and a quick command reference.

6 skills10 hooks188k
@dietrichgebert@dietrichgebert
Install Plugin
agent-skills

agent-skills

Walks a software change from a written spec through design, testing, code review, CI/CD, and release, applying the matching engineering skill at each stage. Useful for developers using Claude Code on full development workflows.

25 skills+3112k
@addyosmani@addyosmani
Install Plugin
planning-with-files

planning-with-files

Persistent file-based planning for AI coding agents on long-running, multi-step tasks. It keeps task_plan.md, findings.md and progress.md on disk, so work can resume after /clear or context compaction.

6 skills+228k
@othmanadi@othmanadi
Install Plugin
gsd-core

gsd-core

A spec-driven development workflow for Claude Code that guides a project through planning, phases, milestone audits and fixes. Includes skills to generate tests from UAT criteria and to audit completed work.

72 skills+311k
@open-gsd@open-gsd
Install Plugin
superpowers-zh

superpowers-zh

Chinese-language skill pack for Claude Code that adds workflow guidance for brainstorming, TDD, debugging, and code review, plus Chinese conventions for commits, documentation, and domestic Git platforms like Gitee and Coding.net.

21 skills1 hook8.5k
@jnmetacode@jnmetacode
Install Plugin
socraticode

socraticode

Gives Claude Code semantic search, dependency graph and architecture context over a codebase, so an AI assistant can explore and understand a project's code. Includes skills for indexing a project and managing its file watching.

2 skills+33.4k
@giancarloerra@giancarloerra
Install Plugin
cocoindex-code

cocoindex-code

A lightweight code search engine that uses AST-based semantic search with local embeddings and incremental indexing. It helps Claude Code users find code faster and more efficiently.

1 skill1 MCP+13k
@cocoindex-io@cocoindex-io
Install Plugin

Questions about the hooks in davegoldblatt-recall.

Which coding agents can use the hooks in davegoldblatt-recall?
The hooks in davegoldblatt-recall install in Claude Code and Cursor: each runs Claude Code hooks from .claude/settings.json, so copy the hooks there.