Ask HN: What technique do you use to make Claude Code deterministic?
1–10 of 20 posts
Re: Ask HN: What technique do you use to make Claude Code deterministic?
#2LLMs 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.
Re: Ask HN: What technique do you use to make Claude Code deterministic?
#3Anyone 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 dete…
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?
Re: Ask HN: What technique do you use to make Claude Code deterministic?
#4Anyone 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 dete…
Re: Ask HN: What technique do you use to make Claude Code deterministic?
#5Anyone 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 dete…
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.
Re: Ask HN: What technique do you use to make Claude Code deterministic?
#6Re: Ask HN: What technique do you use to make Claude Code deterministic?
#7Re: Ask HN: What technique do you use to make Claude Code deterministic?
#8Theoretically, 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.