Skip to content

Hooks quebram quando CLAUDE_PLUGIN_ROOT contém espaço (ex.: "Application Support" no macOS) #90

Closed

Description

@johnathancruz

Problema

Rodando o Claude Code dentro do lich, todos os hooks do plugin falham com:

Stop hook error: Failed with non-blocking status code: /bin/sh: /Users/johnathan/Library/Application: No such file or directory

Causa

Em hooks/hooks.json (e hooks/codex-hooks.json) os comandos são escritos sem aspas:

"command": "${CLAUDE_PLUGIN_ROOT}/hooks/report-state.sh done"

Dentro do lich, CLAUDE_PLUGIN_ROOT resolve para o cache do perfil, por exemplo:

/Users/johnathan/Library/Application Support/lich/profiles/claude/plugin_cache/lich-plugin/lich/0.20.6

O caminho padrão do macOS contém espaço (Application Support). Como a expansão fica sem aspas, o /bin/sh faz word splitting e tenta executar /Users/johnathan/Library/Application. Resultado: nenhum hook (SessionStart, PreToolUse, PostToolUse, Stop, SessionEnd...) chega ao lich, então estado do card, título e arquivos tocados não são reportados. Só o hook de Stop mostra o erro na tela; os outros falham em silêncio.

Ambiente

  • lich-plugin 0.20.6
  • macOS (Darwin 27.2.0)
  • CLAUDE_CONFIG_DIR=/Users/johnathan/Library/Application Support/lich/profiles/claude/pessoal

Correção sugerida

Envolver o caminho em aspas em todos os comandos dos dois arquivos:

"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/report-state.sh\" done"

Apliquei isso localmente no cache do plugin e o hook passou a executar (exit 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions