frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: What technique do you use to make Claude Code deterministic?

3•hbarka•7h ago
I’m curious to hear from the HN community how you tamed this probabilistic non-deterministic genius generate a deterministic and repeatable result 100% percent of the time.

Comments

anonym29•7h ago
Anyone telling you they have tamed LLMs into producing 100% deterministic answers has either scoped the problem space so narrowly as to border on meaningless (e.g. "Is earth flat?" with a structured output schema of a single JSON boolean value), hasn't done robust statistical validation to actually confirm truly deterministic outputs, or both.

LLMs are fundamentally non-deterministic. Trying to use them to solve deterministic problem spaces is selecting the wrong tool for the job, and expecting them to be 100% reliable is the wrong mindset for working with them.

magicalhippo•7h ago
Right, but do you care about how the sausage was made, or just how it looks and tastes?

You can get Claude Code to fulfill some interface contract with almost certainty. Exactly how it does that will vary between runs.

So to me the more interesting question is, what exactly is it you care about inside the sausage, and how do you verify that it's there in the right amounts?

hbarka•6h ago
I agree with your example about a deterministic answer but what I’m looking for is deterministic process. I seek the LLM’s opinion, not a boolean answer. For example, having an agentic skill or hook to do a SWOT analysis may one day (out of 1000 consistent days) result in the agent just produce S-W-O and no T in the process because it was simply context muddled that day.
anonym29•4h ago
In that case, you don't want to be using Claude Code, which is more of a consumer product; you instead want to control the inference stack yourself. What you are looking for is structured output (you give the inference engine a JSON schema you define that the response must conform to) + a JSON schema validator that parses the output, checks if the response is valid JSON. If it is, you're good to go, if not, run the inference again. llama.cpp supports structured outputs, as do some more consumer-oriented tools that wrap like LM Studio. If you don't want to buy hardware yourself or pay exorbitant cloud rental prices, p2p GPU rental marketplaces like vast.ai can offer much more economical options.
Leftium•1h ago
I've wondered if it would be possible (and beneficial) to make LLM's deterministic via a seed. Like how PRNG can specify a seed for repeatable deterministic pseudorandom numbers.

Theoretically, if you could specify a seed and the exact version of the model the output should always be the same. I wonder if this is possible with any open-weight models today?

---

On a more practical level, scripts (small programs) are deterministic so having the coding agent write (and possibly reuse) scripts might help.

Ask HN: After you ship a feature, what happens to what you learned?

3•gaggle_dk•12m ago•0 comments

Ask HN: What is your #1 practical lesson or "aha" moment from coding with AI?

5•johndavid9991•2h ago•7 comments

Ask HN: Do you use Claude Code, Codex, or something else?

3•JohnDSDev•3h ago•8 comments

Ask HN: Will programmers write more efficient code during the memory shortage?

141•amichail•1d ago•235 comments

Ask HN: Is anyone using the A2A protocol?

92•asim•2d ago•41 comments

Ask HN: What technique do you use to make Claude Code deterministic?

3•hbarka•7h ago•5 comments

Ask HN: What do you care about? What is your joy and purpose?

7•bix6•9h ago•17 comments

Ask HN: How to handle kernel struct changes (e.g. iov_iter) in eBPF?

3•morolis•9h ago•2 comments

Ask HN: What tools are you using for AI-assisted code review?

21•agos•2d ago•21 comments

Ask HN: Due to spam on GitHub, what platforms can I move my projects?

54•ciwolex•5h ago•55 comments

Ask HN: Need advice on distributing and testing what I build

3•darth-pixit•11h ago•2 comments

Forked CozoDB to give agents cognitive primitives

3•shanrizvi•20h ago•0 comments

Ask HN: What is the coolest tech progress outside AI?

13•vantareed•1d ago•9 comments

Ask HN: Is anyone else leaving AUR?

7•lordkrandel•1d ago•6 comments

Ask HN: What's a simple app you'd build if you had a weekend?

4•akashwadhwani35•18h ago•7 comments

Ask HN: I'm lost. How can I define ICP (Ideal Customer Profile)?

5•snowhy•2d ago•6 comments

Ask HN: Is there a way to stop the animated Google Doodles?

12•arnejenssen•2d ago•13 comments

Ask HN: Open-Source Intelligence

3•silent_butagrim•1d ago•5 comments

Ask HN: Is there a recognized standard for swarm intelligence benchmarking?

5•stephanieriggs•1d ago•1 comments

Self-adapting and mutating LLM based viruses/worms

3•rozumbrada•1d ago•4 comments

Ask HN: How do you effectively communicate or present?

10•hnthrow10282910•2d ago•7 comments

Ask HN: Conflicted about founding engineer role

8•gondolin1683•2d ago•18 comments

Trillions of dollars spent just to work on customer services?

8•YihaoZhang•1d ago•3 comments

Ask HN: Do you find vibe coding / agentic engineering to be fulfilling?

10•uejfiweun•2d ago•13 comments

Ask HN: Using OPA/Rego to secure MCP tool execution. Does it make sense?

5•wmolino•17h ago•1 comments

Ask HN: What's a prompt you've written that you're genuinely proud of?

11•akashwadhwani35•2d ago•7 comments

Ask HN: Has anyone had success with SBIR grants and what is the process like?

11•lyfeninja•2d ago•8 comments

Meetup.com login appears to be exceeding its reCAPTCHA Enterprise quota

4•infl8ed•1d ago•0 comments

Ask HN: Are other people seeing a spike in IT problems with businesses?

14•PaulHoule•3d ago•11 comments

Anthropic pauses credit change for Claude Code

36•fabianlindfors•5d ago•12 comments