Live data from Hacker News

Claude Code now supports hooks

docs.anthropic.com

161–170 of 184 posts

Re: Claude Code now supports hooks

#161

As an aside, people say AI will eliminate coding jobs, but then who will configure these hooks? Or think about adding such a feature? These kinds of tooling and related work will still be there unless AI evolves to the point that it even thinks of this and announces this to all other AI entities and they also implement it properly etc.

If programmers become 10x more productive but demand only grows by 5x, what will happen?

in my experience software demand never slows, its just priced out. Remember a decade ago we were developing a lot slower due to hardware constraints and other things, now we develop much faster but the features we develop are more complex and there are more of them.

I'm not convinced there is a limiter on software demand as it seems to grow alongside development speed. We all have huge backlogs in any non-trivial system.

Re: Claude Code now supports hooks

#162
post #108

I frequently have to remind Claude Code of the instructions in the CLAUDE.md file, as well as various general aspects of the code base. Maybe this will enable a fix

> Stop using early returns in void functions! It’s in the clause.md you shouldn’t do that in this project!

Reading CLAUDE.md (22 seconds, 2.6k tokens..)

You’re absolutely right!

Re: Claude Code now supports hooks

#163

As an aside, people say AI will eliminate coding jobs, but then who will configure these hooks? Or think about adding such a feature? These kinds of tooling and related work will still be there unless AI evolves to the point that it even thinks of this and announces this to all other AI entities and they also implement it properly etc.

> people say AI will eliminate coding jobs

Yes.

> then who will configure these hooks?

It will also create jobs.

> unless AI evolves to the point that it even thinks of this and announces this to all other AI entities and they also implement it properly

Also yes.

---

People think that technology is some sort of binary less jobs/more jobs thing.

Technology eliminates some jobs and creates others.

Re: Claude Code now supports hooks

#164
.claude/settings.local.json fragment:

  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|MultiEdit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.file_path' | xargs bin/save-hook.sh"
          }
        ]
      }
    ]
  }
I jumped at this HN post, because Claude Code Opus 4 has this stupid habit of never terminating files with a return.

To test a new hook one needs to restart claude. Better to run the actual processing through a script one can continually edit in one session. This script uses formatters on C files and shell scripts, and just fixes missing returns on other files.

As usual claude and other AI is poor at breaking problems into small steps, and makes up ways to do things. The above hook receives a json file, which I first saved to disk, then extracted the file path and saved that to disk, then instead called save-hook.sh on that path. Now we're home after a couple of edits to save-hook.sh

This was all ten minutes. I wasted far more time letting it flail attempting bigger steps at once.

Re: Claude Code now supports hooks

#165
Find it a bit odd they didn't model this as an MCP server itself, and making hooks just mcp tools with pre-agreed names.

Wouldn't it be nice to have the agent autodiscover the hooks and abstracting their implementation details away under the mcp server, which you could even reuse by other agents?

Re: Claude Code now supports hooks

#166
post #114

Earlier quoted context omitted.

I think it's going to go the opposite way: we'll get a lot more custom made software, that fits exactly what a small customer needs. The code might be utter crap, the design might not be award winning, but it will be custom made to a degree that you can't customize your average Savas.

I think the kind of people, who in the past constructed extremely useful (if brittle) solutions with Excel, will be creating all sorts of AI bespoke and very useful tools. It won't bother them at all what the code looks like under the hood. Not that the code will look worse that what an "average" developer produces. Claude and ChatGPT both write better code than most of the existing code I usually look at.

Beautifully formatted, exquisitely incorrect code that provides the simulacra of a feature on the happy path and subtly fails in all other scenarios with hard to detect, impossible to debug errors. Can't wait (it's already there to be honest).

Re: Claude Code now supports hooks

#167

Earlier quoted context omitted.

I think the kind of people, who in the past constructed extremely useful (if brittle) solutions with Excel, will be creating all sorts of AI bespoke and very useful tools. It won't bother them at all what the code looks like under the hood. Not that the code will look worse that what an "average" developer produces. Claude and ChatGPT both write better code than most of the existing code I usually look at.

Beautifully formatted, exquisitely incorrect code that provides the simulacra of a feature on the happy path and subtly fails in all other scenarios with hard to detect, impossible to debug errors. Can't wait (it's already there to be honest).

Better than poorly formatted code, making basic mistakes like SQL query string concatenation, from someone who didn't bother to write any tests. You just have to treat it like code you got from someone else. It would be hard for AI to produce more magical errors that are harder to debug than what humans write. LLMs are one of the best debugging tools out there too.

Re: Claude Code now supports hooks

#168
post #80

As an aside, people say AI will eliminate coding jobs, but then who will configure these hooks? Or think about adding such a feature? These kinds of tooling and related work will still be there unless AI evolves to the point that it even thinks of this and announces this to all other AI entities and they also implement it properly etc.

I generally agree that "we" will still be needed, but OTOH, who needs prettier if no human is ever going to read the code?

How can you do quality assurance on code no one can understand?

Re: Claude Code now supports hooks

#169
post #114

Earlier quoted context omitted.

And we may get an ugly transitory period where a lot of programs go from being clearly hand made with some degree of care and some fine details that show the developer's craftsmanship, to awful prefab and brutalist software that feels inhuman, mass-produced, and nothing is really fit for the job but still shipped because it kind of works well enough. People go to museums to admire old hand-carved furniture and travel…

I think it's going to go the opposite way: we'll get a lot more custom made software, that fits exactly what a small customer needs. The code might be utter crap, the design might not be award winning, but it will be custom made to a degree that you can't customize your average Savas.

Yeah and then you’ll get hundreds of slightly different protocols formats and standards and nothing will talk to each other anymore without bespoke integration

Re: Claude Code now supports hooks

#170

As an aside, people say AI will eliminate coding jobs, but then who will configure these hooks? Or think about adding such a feature? These kinds of tooling and related work will still be there unless AI evolves to the point that it even thinks of this and announces this to all other AI entities and they also implement it properly etc.

To misuse a woodworking metaphor, I think we’re experiencing a shift from hand tools to power tools. You still need someone who understands the basics to get the good results out of the tools, but they’re not chiseling fine furniture by hand anymore, they’re throwing heaps of wood through the tablesaw instead. More productive, but more likely to lose a finger if you’re not careful.

I like this metaphor because power tools didn’t lead to more sophisticated craftspeople despite the increase in efficiency and potential. I think it will be the same with code. More outputs, not necessarily more refined or better in any way, but not innately bad either.
Post reply on HN