Skip to content

Hook paths in .claude/settings.json break on project move #75

@lhparker1

Description

@lhparker1

What happened

After relocating a Prism project on disk, the langfuse hooks written into .claude/settings.json still point at the old absolute path. The PreToolUse hook (langfuse_session_init_hook.py) then fails on every tool invocation, which blocks the entire session (including the Skill tool, so /prism-feedback itself cannot run). Recovery requires editing settings.json from outside Claude Code.

Reproduction

  1. prism new <project> (or prism init) in dir A.
  2. Move the project to dir B (e.g. reorganize into a subfolder).
  3. Start Claude Code in dir B. Every tool call fails with:
    python3: can't open file '<dir A>/.claude/hooks/langfuse_session_init_hook.py'

Suggested fix

Write hook paths as ${CLAUDE_PROJECT_DIR}/.claude/hooks/... (or resolve relative to the project root at runtime) instead of hard-coding absolute paths at project creation time.

Environment

  • ASTRA: 0.1.2
  • Prism: 0.1.2.dev23+g2897ae8b9
  • Python: 3.13.11
  • OS: Linux 6.4.0-150600

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions