Skip to content

PostToolUse hook errors occurring during tool execution #622

@ksochacki123

Description

@ksochacki123

PostToolUse hook errors occurring during tool execution

Problem Statement

The claude-mem plugin is throwing multiple PostToolUse hook errors when tools like Edit, TodoWrite, and Read are executed. These errors appear to be occurring consistently across different tool operations, potentially preventing proper memory persistence or observation recording.

Environment

  • Claude-mem: 9.0.1
  • Claude Code: 2.1.1 (Claude Code)
  • Node.js: v24.3.0
  • Bun: 1.3.5
  • OS: macOS 15.3 (arm64)
  • Platform: darwin

Configuration

  • CLAUDE_MEM_MODEL: claude-sonnet-4-5
  • CLAUDE_MEM_WORKER_PORT: 37777
  • CLAUDE_MEM_WORKER_HOST: 127.0.0.1
  • CLAUDE_MEM_LOG_LEVEL: INFO
  • CLAUDE_MEM_CONTEXT_OBSERVATIONS: 50

Worker Status

  • Running: Yes
  • PID: 58095
  • Port: 37777
  • Uptime: 217 minutes
  • Active Sessions: 0
  • SSE Clients: 8

Database

  • Path: ~/.claude-mem/claude-mem.db
  • Exists: Yes
  • Size: 4.00 KB

Observed Behavior

When tools are executed in Claude Code, PostToolUse hooks are failing with errors. The following hooks are affected:

  • PostToolUse:Edit hook
  • PostToolUse:TodoWrite hook
  • PostToolUse:Read hook

Each hook error appears to be reported twice in the logs, suggesting the error may be occurring at multiple stages or being logged redundantly.

Error Logs

Running PostToolUse hooks… (1/2 done)
⎿  PostToolUse:Edit hook error
⎿  PostToolUse:Edit hook error
⎿  PostToolUse:TodoWrite hook error
⎿  PostToolUse:TodoWrite hook error
⎿  Read 112 lines
⎿  Running PostToolUse hooks… (1/2 done)
⎿  PostToolUse:Read hook error
⎿  PostToolUse:Read hook error

Expected Behavior

PostToolUse hooks should execute successfully without errors, allowing claude-mem to properly:

  • Observe and record tool usage
  • Persist relevant context to memory
  • Update the database with new observations

Additional Context

  • The worker appears to be running normally (uptime 217 minutes)
  • Database exists but is relatively small (4.00 KB), which may indicate data isn't being written successfully
  • There are 8 SSE clients connected but 0 active sessions
  • The errors occur consistently across multiple tool types (Edit, TodoWrite, Read)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions