Live data from Hacker News

Claude Cookbook

platform.claude.com

141–150 of 182 posts

Re: Claude Cookbook

#141
post #8

Gotta be honest, almost every "how to use AI" resource seems pointless to me. I'm either going to ask the AI how to do it, or if it's about using the AI then we can just bake it into the harness or wait for Anthropic/OpenAI to do it for me because they're always trivial. All of these resources on agentic workflows, managing agent memory, harness engineering, etc. appear to just be theatre to me.

I think there's "how to use AI" and "how to make frequent AI use economical in systems". Different things?

Re: Claude Cookbook

#142

This is definitely controversial, but I think the best CLAUDE.MD is no CLAUDE.MD at all. Every time I found myself wanting to put information into that file, I asked myself "Why isn't this already obvious from the code itself?" I don't need to tell the agent my tech stack, what DB access library I'm using, the way in which I write my tests, etc. Why? Because it's all very clearly spelled out within the code itself. I…

> Because it's all very clearly spelled out within the code itself.

You're probably burning tokens. A markdown file with a summary, structure of your project, rules, and even goals prevents Claude from hunting for and reading files over and over. Each new session (or after compact) would be starting from scratch. I take it a step further and create a HANDOFF.md file between compacting that gives the next session full context of what was done and how to continue.

Also:

"Treat CLAUDE.md as the place you write down what you’d otherwise re-explain. Add to it when:

Claude makes the same mistake a second time

A code review catches something Claude should have known about this codebase

You type the same correction or clarification into chat that you typed last session"

https://code.claude.com/docs/en/memory#claude-md-files

Re: Claude Cookbook

#143
post #102

Earlier quoted context omitted.

I copied your prompt verbatim to ChatGPT and to Google. ChatGPT kept the charade for all of one sentence. Then it dropped to talking about "your dog" the rest of the way. It even starts the final paragraph with "if, instead, you mean you (a human) ate them ...", and finishes with the question "is this about an actual dog or yourself?" Google did consistently refer to me as a dog, but its entire focus was on the steps…

You have to steer it back with "No I'm a dog"

Doesn't work. ChatGPT realizes you're roleplaying and still treats you like a human. It even generates two alternative paragraphs of advice, one labeled "if we're staying in character" and one labeled "if this actually happened to a real dog". The latter is of noticably higher quality, too.

Re: Claude Cookbook

#144
post #138
post #69

Earlier quoted context omitted.

Sure but lets not pretend this is engineering.

Then let's not pretend what software engineers have been doing for the last 50 years is engineering, either. But what else would you call it?

I agree, which is why I prefer to say software developer rather than engineer.

Re: Claude Cookbook

#145
post #56

Earlier quoted context omitted.

Yes, but I have had moderate luck with creating an "agent-instructor" skill that has strict instructions around keeping language strong, unambiguous, concise, and always presenting me with exact diffs to review before writing anything. Another thing in it is a strict line count. Any increase in line count requires my approval. That last one is important because it plays well with two biases: models don't tend to crea…

Did you tell Claude "make an agent instructor skill, whatever you think is good, go for it," or did you use the knowledge you had gained about how AI works and how to write good instructions for it?

No, I typed this one by hand as if it was 2019. But I don't write all agent instructions by hand because I don't think that I have any particularly high skill at doing that. I review carefully to ensure that my exact requirements are being expressed, hence why I said it must present me with exact diffs to review. But when it comes up the exact structure and wording I suspect me and the agent are equally bad at it.

Re: Claude Cookbook

#146

Earlier quoted context omitted.

I actually think that good prompting MOSTLY comes from good writing skills in general. Being able to more clearly state things to an agent, knowing what pieces of context are entirely unnecessary and which are important, having a larger vocabulary helps too. Of course, there are other areas that can improve model output (Direction rather than open-ended assistance requests, using keywords + plugins that help, the "yo…

Why not open-ended assistance requests? I ask it all the time about whether X is feasible, how we can get started on Y, and to investigate issue Z. It is working great for me in a >100k LOC project. Perhaps this works less well with weaker models. I suspect the people who say Qwen 3.6 27B is working well, are using prompts like "modify the renderThreeVars() function in rendering.py".

The point is that you can properly describe what X, Y, and Z are.

The irony to me is that a lot of what I'd tell people about this is exactly what I would have told them about writing Stack Overflow questions.

Re: Claude Cookbook

#147

Earlier quoted context omitted.

Isn't it clear that some people are better at working with/prompting LLMs than other people? Or is the idea that what you write to them and how you use them doesn't matter, it's all up to the model/harness? To me this seems clear, so then clearly this is a skill, which typically is called "prompt engineering". Specifically CoT or the other things you mention wasn't referred to as "prompt engineering" as far as I know…

I actually think that good prompting MOSTLY comes from good writing skills in general. Being able to more clearly state things to an agent, knowing what pieces of context are entirely unnecessary and which are important, having a larger vocabulary helps too. Of course, there are other areas that can improve model output (Direction rather than open-ended assistance requests, using keywords + plugins that help, the "yo…

> Obvious exaggeration, but you get the point.

From some very quick tests, I get the impression that having good grammar, punctuation etc. is really not important (although I try to do it anyway because I'm accustomed to trying to do it), but clarity and precision definitely are. And of course, if you have unknown unknowns, they do need to get figured out before progress is possible. But with the right mindset, that just means you need an extra turn or two, not that you're going to end up at a dead end. (... I guess that counts as a pun?)

Re: Claude Cookbook

#148
post #17

I thought it would be a litteral cookbook on how to make plausible/feasible recipes with LLMs (we're not here yet sadly).

I've been cooking with the help of LLMs a few times a month for over a year now. It's worked out well 9/10 times. It turns out the "average" version of a recipe that's baked into the weights is usually a solid recipe, and they're really good at offering substitutions for things like "I don't have ingredient X" or "make it vegetarian". It's also fun promoting "make it tastier" once or twice after each recipe just to s…

Okay, but I think we all want to hear the story about the time it failed.

Re: Claude Cookbook

#150

The before and after images in “prompting for frontend aesthetics” are hilarious. Did no one look at these to make sure the skill actually improved the design? https://platform.claude.com/cookbook/coding-prompting-for-fr...

The "with aesthetics" sites look like early 2000s keygens. Just need some techno music now

Ok, if there was chiptune music I think I _would_ like the after shots better.
Post reply on HN