frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Large integer precision error in Bash command output rendering

https://github.com/anthropics/claude-code/issues/11506
24•rrwright•3h ago

Comments

rrwright•3h ago
Try it yourself: `echo '348555896224571969'`
CGamesPlay•2h ago
Looks like it has to be the full tool output to be coerced:

    > Can you run this through bash: echo '348555896224571969 plus 2 is 348555896224571971'
    
     Bash(echo '348555896224571969 plus 2 is 348555896224571971')
      ⎿  348555896224571969 plus 2 is 348555896224571971
timenotwasted•3h ago
Claude Code v2.0.37 Haiku 4.5 · Claude Pro

> run cmd echo '348555896224571969'

I'll run that echo command for you.

Bash(echo '348555896224571969') ⎿ 348555896224571970

The command output is: 348555896224571969

--

If I do it this way it gets the off by 1 and then fixes it when providing me the output, very interesting.

Insanity•2h ago
I forgot which blogpost mentioned it, but to paraphrase it states that managers won’t understand why you can’t just fix a bug like this in a few minutes like you would in traditional software.

This might be one of those cases, where the problem arises from the training set somehow.

alyxya•2h ago
This seems to be a software bug and not something about model behavior, though the model is in some sense doing the wrong thing by internally evaluating what the echo command should output rather than saying what the output actually is.

Edit: Based on the above comment showing javascript numerics behavior changing, it's more like some unusual interaction with the numeric string in the bash command being interpreted as an integer and running into precision issues.

amorriscode•1h ago
Merged a PR after seeing this thread so, thankfully, this was one of those bugs that you can just fix in minutes. ;)
fulafel•2h ago
Smells like floating point. Python prompt:

  >>> int(float('348555896224571969'))
  348555896224571968
It just exceeds the mantissa bits of doubles:

  >>> math.log2(34855589622457196)
  54.952239550875795
JavaScript (in)famously stores all numbers as floating point resulting in silent errors also with user perceived integers, so this might be an indication that Claude Code number handling uses JS native numbers for this.
ec109685•2h ago
They wrap bash with python.
fulafel•1h ago
I still suspect JS. It's much harder to shoot yourself in the foot with Python. Even if you use JSON:

  >>> json.loads('{"nr": 348555896224571969}')
  {'nr': 348555896224571969}
  >>> type(_['nr'])
  <class 'int'>
CGamesPlay•2h ago
Claude Code is simultaneously the most useful and lowest quality app I use. It's filled with little errors and annoyances but succeeds despite them. Not to mention the official documentation is entirely vibe-copywritten and any quality control is cursory at best.

It forcibly installs itself to ~/.local/bin. Do you already have a file at that location? Not anymore. When typing into the prompt, EACH KEYSTROKE results in the ENTIRE conversation scrollback being cleared and replayed, meaning 1 byte of new data results in kilobytes of data transferred when using Claude over SSH. The tab completion for @-mentioning is so bad it's worthless, and also async, so not even deterministic. You cannot disable their request for feedback. Apparently it lies in tool output.

It truly is a testament to the dangers of vibe coding, proudly displayed for everyone to take an example from.

ec109685•2h ago
Are you sure about the one char thing? I’d expect a huge flash if that was the case.
CGamesPlay•2h ago
No, I'm not sure about the precise mechanics of it, but I noticed it because of the huge flash when using it over a somewhat laggy SSH connection. It doesn't happy in all contexts. I've definitely seen it when typing into the new-ish Claude "ask questions about the plan" flow, and I've also noticed that it redraws the entire conversation history when each new line of output is presented in a long-running tool call.
DecoPerson•2h ago
Ha, interesting. Using Claude Code in Zed, I never encountered any of these defects.

I just open a Claude Code Thread, tell it what I want, bypass permissions (my remote is a container), and let it work. And it works wonderfully!

I guess the “integrated” part of IDE is pretty important.

jimbo808•1h ago
I use it daily for boilerplate and CRUD stuff, and have been since it came out. I honestly haven't experienced any bugs at all with it other than Anthropic server outages, etc. As far as agentic coding tools go, nothing else is close.

That being said, it's still an LLM, and LLMs are more of a liability than an asset to me. I was an early adopter and still use them heavily, but I don't attempt to use them to do important work.

o11c•33m ago
Does `mosh` work better than `ssh` for this?
cyral•2h ago
Typing "348555896224571969" into your browser's dev console will also return 348555896224571970
alyxya•2h ago
I don't think this is a bug specifically with Claude Code, rather it's due to Claude Code having javascript in the backend. The interesting thing to me is that the numeric string was interpreted as an integer.
ethmarks•2h ago
Is there any significance to the number 348555896224571969? How was this bug discovered and what was the discoverer doing?
rrwright•1h ago
Why did Hacker News rename the title of this post? It was originally: "Claude Code Introduces Off-by-One Errors"

Original: https://pasteboard.co/xTjaRmnkhRRo.png

Unilaterally Edited: https://pasteboard.co/rDPINchmufIF.png

sevg•1h ago
Looks like mods changed the title to the title of the GitHub Issue. This from HN guidelines is probably why:

> Otherwise please use the original title, unless it is misleading or linkbait; don't editorialize.

rrwright•1h ago
Good catch on the guidelines. But that github issue title obviously misses the point. The whole point is that it's a silent error in Claude Code.
sevg•1h ago
A matter of opinion, but I actually don’t think the current headline is too bad. When I saw the headline and “github.com/anthropic” next to it, my initial assumption was that it must be a problem introduced by Claude Code rather than a bug in bash or something.

That said, I don’t think your edited headline was bad either, but perhaps there wasn’t enough reason not to use the original (which is a default I personally appreciate on HN).

dragonwriter•1h ago
Probably for a couple reasons:

First, HN prefers the source title unless that title is misleaing clickbait.

Second, the problem is not consistently off-by-one errors, as there is a manifestation shown in the bug of an off-by-much-less-than-one error. The problem looks like a "for some reason it seems to be roundtripping numbers in text through a numeric representation which has about [perhaps exactly] the same precisions issues as float64" issue.

kazinator•1h ago
Note that the number is 18 digits long.

If there is a conversion to IEEE 64 bit double involved, that type is only guaranteed to record 15 decimal digits of precision, so this number cannot be represented with enough precision to recover all of its original digits.

In C implementations, this value is represented as DBL_DIG, which is typically 15 on systems with IEEE floating point.

(There is also DBL_DECIMAL_DIG which is typically 17; that's the opposite direction: how many decimal digits we need to print a double such that the exact same double can be recovered by parsing the value. DBL_DIG existed in C90, but DBL_DECIMAL_DIG didn't appear until, it looks like, C11.)

amorriscode•1h ago
We merged a fix for this that'll go out in the ~next release.

Also, for clarification, this bug was only impacting the display of numbers in the TUI, not what the model sees. The model sees raw results from bash.

Google will allow users to sideload Android apps without verification

https://android-developers.googleblog.com/2025/11/android-developer-verification-early.html
631•erohead•6h ago•253 comments

Steam Machine

https://store.steampowered.com/sale/steammachine
1705•davikr•13h ago•831 comments

Steam Frame

https://store.steampowered.com/sale/steamframe
1232•Philpax•13h ago•476 comments

Android 16 QPR1 is being pushed to the Android Open Source Project

https://grapheneos.social/@GrapheneOS/115533432439509433
62•uneven9434•3h ago•14 comments

The last-ever penny will be minted today in Philadelphia

https://www.cnn.com/2025/11/12/business/last-penny-minted
637•andrewl•14h ago•807 comments

Human Fovea Detector

https://www.shadertoy.com/view/4dsXzM
113•AbuAssar•6h ago•24 comments

Bitcoin's big secret: How cryptocurrency became law enforcement's secret weapon

https://bitwarden.com/blog/how-cryptocurrency-became-law-enforcements-secret-weapon/
83•LopRabbit•3h ago•39 comments

Mergiraf: Syntax-Aware Merging for Git

https://lwn.net/SubscriberLink/1042355/434ad706cc594276/
47•Velocifyer•1w ago•8 comments

Project Euler

https://projecteuler.net
400•swatson741•13h ago•98 comments

Comparing the Latitude of Europe and America

https://vividmaps.com/comparing-latitude-of-europe-and-america/
24•mooreds•4d ago•8 comments

CollectWise (YC F24) Is Hiring

https://www.ycombinator.com/companies/collectwise/jobs/tv3ufcc-forward-deployed-engineer
1•OBrien_1107•2h ago

Marble: A Multimodal World Model

https://www.worldlabs.ai/blog/marble-world-model
172•meetpateltech•8h ago•41 comments

GPT-5.1: A smarter, more conversational ChatGPT

https://openai.com/index/gpt-5-1/
292•tedsanders•11h ago•310 comments

Meta replaces WhatsApp for Windows with web wrapper that uses 1 GB RAM when idle

https://www.windowslatest.com/2025/11/12/meta-just-killed-native-whatsapp-on-windows-11-now-it-op...
99•DearAll•3h ago•25 comments

Large integer precision error in Bash command output rendering

https://github.com/anthropics/claude-code/issues/11506
24•rrwright•3h ago•25 comments

Transpiler, a Meaningless Word (2023)

https://people.csail.mit.edu/rachit/post/transpiler/
9•jumploops•6d ago•3 comments

On USB HID, Keyboard LEDs, and device emulation (2024)

https://epsilon537.github.io/boxlambda/usb-hid/
15•transpute•3h ago•1 comments

Learn Prolog Now

https://lpn.swi-prolog.org/lpnpage.php?pageid=top
261•rramadass•16h ago•182 comments

Fighting the New York Times' invasion of user privacy

https://openai.com/index/fighting-nyt-user-privacy-invasion
324•meetpateltech•16h ago•297 comments

Valve is about to win the console generation

https://xeiaso.net/blog/2025/valve-is-about-to-win-the-console-generation/
173•moonleay•7h ago•153 comments

Helm 4.0

https://github.com/helm/helm/releases/tag/v4.0.0
61•todsacerdoti•13h ago•67 comments

GLP-1 drugs linked to lower death rates in colon cancer patients

https://today.ucsd.edu/story/glp-1-drugs-linked-to-dramatically-lower-death-rates-in-colon-cancer...
114•gmays•11h ago•106 comments

Yt-dlp: External JavaScript runtime now required for full YouTube support

https://github.com/yt-dlp/yt-dlp/issues/15012
934•bertman•20h ago•552 comments

Digital ID, a new way to create and present an ID in Apple Wallet

https://www.apple.com/newsroom/2025/11/apple-introduces-digital-id-a-new-way-to-create-and-presen...
87•meetpateltech•14h ago•121 comments

Launch HN: JSX Tool (YC F25) – A Browser Dev-Panel IDE for React

95•jsunderland323•13h ago•72 comments

Robert Moses's unfinished business should be Mamdani's priority

https://www.eatingpolicy.com/p/robert-mosess-unfinished-business
9•rmason•2h ago•1 comments

Homebrew no longer allows bypassing Gatekeeper for unsigned/unnotarized software

https://github.com/Homebrew/brew/issues/20755
192•firexcy•9h ago•159 comments

How Tube Amplifiers Work

https://robrobinette.com/How_Amps_Work.htm
95•gokhan•12h ago•51 comments

A Commentary on the Sixth Edition Unix Operating System

https://warsus.github.io/lions-/
16•o4c•3h ago•2 comments

Voyager 1 is a light-day away by November 2026

https://www.iflscience.com/on-november-13-2026-voyager-will-reach-one-full-light-day-away-from-ea...
186•Neuronaut•7h ago•59 comments