Skip to content

bug: install registers precompact-session-digest hook in UserPromptSubmit with missing runner #528

@olucasalles

Description

@olucasalles

Description

Running npx aios-core@latest install registers precompact-session-digest.cjs as a UserPromptSubmit hook in .claude/settings.local.json, but the runner file it depends on does not exist in the installed version.

Screenshot

The error appears on every single user input in Claude Code:

UserPromptSubmit hook error

/AIOS:agents:devopsUserPromptSubmit hook error

Steps to Reproduce

  1. Run npx aios-core@latest install on a project
  2. Open Claude Code in the project
  3. Type any prompt (e.g., /AIOS:agents:devops)

Expected Behavior

No hook error should appear on every user input.

Actual Behavior

Every prompt shows:

⎿ UserPromptSubmit hook error

This happens on every single input, not just once, severely impacting UX.

Root Cause

The hook at .claude/hooks/precompact-session-digest.cjs requires:

.aios-core/hooks/unified/runners/precompact-runner.js

This file does not exist in the installed package. The hook logs the error to stderr:

[PreCompact Hook] Failed to load hook runner: Cannot find module '/path/to/.aios-core/hooks/unified/runners/precompact-runner.js'

Additionally, this hook appears to be intended for the PreCompact event, not UserPromptSubmit — it runs unnecessarily on every user input.

Generated settings.local.json (relevant section)

"UserPromptSubmit": [
  {
    "hooks": [
      {
        "type": "command",
        "command": "node \".claude/hooks/synapse-engine.cjs\""
      }
    ]
  },
  {
    "hooks": [
      {
        "type": "command",
        "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/precompact-session-digest.cjs\"",
        "timeout": 10
      }
    ]
  }
]

Workaround

Remove the second hook entry from UserPromptSubmit in .claude/settings.local.json.

Suggestion

Either:

  • Don't register the precompact-session-digest hook during install until the runner is shipped
  • Or ship the precompact-runner.js file with the install
  • Or add a file-existence check in the hook before attempting require()

Environment

  • AIOS Core version: 4.31.1 (installed via npx aios-core@latest)
  • Platform: macOS (Darwin 24.6.0)
  • Node.js: 18+
  • Claude Code: latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions