←back to thread

Claude Code now supports hooks

(docs.anthropic.com)
381 points ramoz | 1 comments | | HN request time: 0.472s | source
Show context
parhamn ◴[] No.44429511[source]
This needs a way to match directories for changes in monorepos. E.g. run this linter only if there were changes in this directory.
replies(4): >>44429545 #>>44429877 #>>44430548 #>>44434392 #
1. ramoz ◴[] No.44429545[source]
An abstraction via a script should work, right? They document that it pipes the JSON data to your command's stdin,

  ```lint-monorepo.sh

  # read that data
  json_input=$(cat)

  # do some parsing here with jq, get the file path (file_path)

  if [$file_path" == "$dir1"*]
    run lint_for_dir1
  ```