11 ms·
Who needs Git when you have 1M context windows?
- hiccuphippo 1y agoI would have pressed Ctrl-Z in my editor like mad until I got the file. If I was using vim I could even grep for it through my history files, thanks to vim-persisted-undo.
- cimi_ 1y agoJetbrains IDEs have 'Local History' that keeps a record of all edits to files - I looked in mine now and I have changes from more than 3w ago :)
- j45 1y agoThe more I think about it, the more 1M context windows are available while the system has low usage.
- SketchySeaBeast 1y agoA fun anecdote, and I assume it's tongue in cheek, although you never know these days, but is the LLM guaranteed to give you back an uncorrupted version of the file? A lossy version control system seems to me to be only marginally better than having no VCS at all.
- iLoveOncall 1y agoI'd say it's more likely guaranteed to give you back a corrupted version of the file. I assume OP was lucky because the initial file seems like it was at the very start of the context window, but if it had been at the end it would have returned a completely hallucinated mess.
- shallmn 1y agoI dont know where Gemini stores the context, but if I’m using a local LLM client app, that context is on my machine verbatim.
- SketchySeaBeast 1y agoIf you ask the LLM to give you back that context does it give back to you verbatim?
- cmsj 1y agostatistically, maybe.
- SketchySeaBeast 1y agoStochastically correct is the best sort of correct?
- flerchin 1y agoWell, it'll give you what the tokenizer generated. This is often close enough for working software, but not exact. I notice it when asking claude for the line number of the code with specific implementation. It'll often be off by a few because of the way it tokenizes white space.
- onionisafruit 1y agoThanks. I noticed the same thing about line numbers but I didn’t know the reason. It has made me double check I’m in the right file more than once.
- mathieuh 1y agoI frequently (basically every conversation) have issues with Claude getting confused about which version of the file it should be building on. Usually what causes it is asking it do something, then manually editing the file to remove or change something myself and giving it back, telling it it should build on top of what I just gave it. It usually takes three or four tries before it will actually use what I just gave it, and from then on it keeps randomly trying to reintroduce what I deleted.
- adastra22 1y agoFrom experience, no. I’ve customized my agent instructions to explicitly forbid operations that involve one-shot rewriting code for exactly this reason. It will typically make subtle changes, some of which have had introduced logic errors or regressions.
- wongarsu 1y agoWhen I used toolcalls with uuids in the name, tiny models like quantized qwen3-0.6B would occasionally get some digits in the UUID wrong. Rarely, but often enough to notice even without automation. Larger models are much better, but give them enough text and they also make mistakes transcribing it
- dotancohen 1y agoDon't take this as career advice! This is an amusing anecdote. But the only lesson to be learned is to commit early, commit often.
- beefnugs 11mo agoThe lesson is to trust microsoft Recall. "Hey copilot, what are all my passwords and credit card numbers"
- f1shy 1y agoAnd in general maybe have a better working methodic, or however you name it. Sounds like messing around to me.
- onionisafruit 1y agoI like to mess around. Some of my best work comes out of messing around. The trick is making sure you mess around in a way that lets you easily hold onto whatever improvements you make. For me that means committing obsessively.
- SketchySeaBeast 1y agoAnd branches are free.
- dotancohen 11mo agoIn git. It took me a while to get out of the SVN mindset when branches were expensive and slow to create.
- cranium 1y agoCommit even as a WIP before cleaning up! I don't really like polluting the commit history like that but with some interactive rebase it can be as if the WIP version never existed. (Side ask to people using Jujutsu: isn't it a use case where jujutsu shines?)
- everyone 1y agoOk great, now u have retrieved that code that you dont even understand and is completely unmaintainable.
- globular-toast 1y agoIf you're an engineer it can be quite shocking to see how people like the author work. It's much more like science than engineering. A lot of trial and error and swapping things around without fully understanding the implications etc. It doesn't interest me, but it's how all the best results are obtained in ML as far as I can tell.
- RA_Fisher 1y agoI'm a scientist and I'd never work that way. I'm methodical, because I've learned it's the fastest and highest-ROI approach. Guessing without understanding is extremely unlikely to produce the best results in a repeatable manner. It's surprising to me when companies don't know that. For that reason, I generally want to work with experts that understand what they're doing (otherwise is probably a waste of time).
- big_hacker 1y agoAgreed. Most plausible reason they "can't remember" the good solution is because they were vibe coding and didn't really understand what they were doing. Research mode my ass.
- the_af 1y agoI cannot wrap my head around the anecdote that opens the article: > Lately I’ve heard a lot of stories of AI accidentally deleting entire codebases or wiping production databases. I simply... I cannot. Someone let a poorly understood AI connected to prod, and it ignored instructions, deleted the database, and tried to hide it. "I will never use this AI again", says this person, but I think he's not going far enough: he (the human) should be banned from production systems as well. This is like giving full access to production to a new junior dev who barely understands best practices and is still in training. This junior dev is also an extraterrestrial with non-human, poorly understood psychology, selective amnesia and a tendency to hallucinate. I mean... damn, is this the future of software? Have we lost our senses, and in our newfound vibe-coding passion forgotten all we knew about software engineering? Please... stop... I'm not saying "no AI", I do use it. But good software practices remain as valid as ever, if not more!
- graemep 1y agoIts a matter of priorities. Its cheap and fast and there is a chance that it will be OK. Even just OK until I move on. People often make risky choices for those reasons. Not just with IT systems - the crash of 2008 was largely the result of people betting (usually correctly) that the wheels would not fall off until after they had collected a few years of bonuses.
- f1shy 1y agoI do not know who is doing the math, but deleting production data does not sound very cheap to me...
- graemep 1y agoNo, but the decision is taken on the basis that it probably will not happen, and if it does there is a good chance that the person taking the decision will not be the one to bear the consequences. That is why I chose to compare it to the 2008 crash. The people who took the decisions to take the risks that lead to it came out of it OK.
- 1y ago
- ants_everywhere 1y agoI'm not sure it's the context window. Gemini cli keeps a shadow git repo to be able to rollback changes in cases like this: https://gemini-cli.xyz/docs/en/checkpointing https://gemini-cli.xyz/docs/en/checkpointing. It's disabled by default, but even with the default setups, you can find large snippets of code in ~/.gemini/tmp. tl;dr: Gemini cli saves a lot of data outside the context window that enables rollback. I'm sure other agents do the same, I only happen to know about Gemini because I've looked at the source code and was thinking of designing my own version of the shadow repo before I realized it already existed.
- Flavius 1y agoWho needs anything when you can keep everything in a 16 TBs txt file?
- SketchySeaBeast 1y agoThere's probably a meme in here somewhere about how we wrapped your JSON in our JSON so we can parse JSON to help you parse your JSON.
- eisbaw 1y agoLol. The context window is actually just a buffer in your client. The guy could probably simply scroll up...
- ed_elliott_asc 1y agoI’m completely paranoid about claude messing with my .git folder so I push regularly
- tripplyons 1y agoFor the same reason, I run OpenCode under Mac's sandbox-exec command with some rules to prevent writes to the .git folder or outside of the project (but allowing writes to the .cache and opencode directories). sandbox-exec -p "(version 1)(allow default)(deny file-write* (subpath \"$HOME\"))(allow file-write* (subpath \"$PWD\") (subpath \"$HOME/.local/share/opencode\"))(deny file-write* (subpath \"$PWD/.git\"))(allow file-write* (subpath \"$HOME/.cache\"))" /opt/homebrew/bin/opencode
- mobeigi 1y agoI'm waiting for the day someone builds a wrapper around LLM chats and uses it as a storage medium. It's already been done for GitHub, YouTube videos and Minecraft.
- Aurornis 1y agoI suppose if you want an extremely lossy storage medium that may or may not retrieve your data, stores less than a 3.5” storage medium, and needs to be continually refreshed as you access it.
- tripplyons 1y agoFor Minecraft did they just write text in a book item?
- deleted 1y ago[deleted]
- yggdrasil_ai 1y agoIf you sent the python file to Gemini, wouldn't it be in your database for the chat? I don't think relying on uncertain context window is even needed here! A big goal while developing Yggdrasil was for it to act as long term documentation for scenarios like you describe! As LLM use increases, I imagine each dev generating so much more data than before, our plans, considerations, knowledge have almost been moved partially into the LLM's we use! You can check out my project on git, still in early and active development - https://github.com/zayr0-9/Yggdrasil https://github.com/zayr0-9/Yggdrasil
- lazyfanatic42 1y agoI confused it with this for a min, which I have played with: https://github.com/yggdrasil-network/yggdrasil-go https://github.com/yggdrasil-network/yggdrasil-go
- yggdrasil_ai 1y agoBrowsing that repo is a bit trippy after being used to my own all this time haha.
- big-and-small 1y ago1M context is amazing, but even after 100k tokens Gemini 2.5 Pro is usually incapable of consistently reproducing 300 LOC file without changing something in process. And it actually take a lot of effort to make sure it do not touch files it not suppose to.
- Lerc 1y agoWith Gemini I have found some weird issues with code gen that are presumably temperature related. Sometimes it will emit large block of code with a single underscore where it should be a dash or some similar very close match that would make sense as a global decision but is triggered for only that one instance. like code containing the same identifier. add_value(thing,other_thing) add_value(thing,other_thing) add_value(thing,other_thing) add_value(thing,other_thing) add-value(thing,other_thing) add_value(thing,other_thing) add_value(thing,other_thing) Not to mention sneakily functions back in after being told to remove them because they are defined elsewhere. Had a spell where it was reliably a two prompt process for any change, 1) do the actual thing, 2) remove A,B and C which you have reintroduced again.
- this_user 1y agoI have had some very weird issues with Gemini 2.5 Pro where during a longer session it eventually becomes completely confused and starts giving me the response to the previous prompt instead of the current one. I absolutely would not trust it to handle larger amounts of data or information correctly.
- alansaber 1y agoExactly, 1M context tokens is marketing, relatively little training was done at that input size.
- cmsj 1y agoI do.
- desipenguin 1y agoIntern I work with, got something working, but was not saved anywhere. No git No email to others in the project (That is how they work) He complained to me that he "could not find it in ChatGPT history as well" I think @alexmolas was lucky
- lordnacho 1y agoI find git is just about the only thing you need to lock down when using AI. Don't let it mess with your git, but let it do whatever else it wants. Git is then a simple way to get a summary of what was edited.
- jbentley1 1y agoI use Crystal which archives all my old claude code conversations, I've had to do this a few times when I threw out code that I later realized I needed.
- jasonjmcghee 1y agoClaude Code archives Claude Code conversations. "claude -r" - or go to equivalent of "~/.claude/sessions" or something like that
- kristjansson 1y agoIf it’s in the context window … it’s sitting around as plain text. I guess asking is easier than scrollback?
- rfw300 1y agoIndeed. OP, nothing is "in" an LLM's context window at rest. The old version of your file is just cached in whatever file stores your IDE's chat logs, and this is an expensive way of retrieving what's already on your computer.
- kristjansson 1y agoI mean there is the chance it's on someone else's computer ^W^W^W^ the cloud, and his provider of choice doesn't offer easy access to deep scrollback ... which means this is only inefficient, not inefficient and pointless.
- red2awn 1y agoTechnically it doesn't have to be since that part of the context window would have been in the KV cache and the inference provider could have thrown away the textual input.
- Cr8 1y agopossible - but KV caches are generally _much_ bigger than the source text and can be reproduced from the source text so it wouldn't make a lot of sense to throw it out
- siva7 1y agoThis is something i'm currently working on as a commercial solution - the whole codebase sits in a special context window controlled by agents. No need for classic SCM.
- deleted 1y ago[deleted]
- iamleppert 1y agoIt stands to reason the OP doesn't understand the code or what he's (probably the LLM) has written if he can't manage to reproduce his own results. We have all been there, but this kind of "try stuff" and "not understand the cause and effect" of your changes is a recipe for long-term disaster. Noticeably also is a lack of desire to understand what the actual change was, and reinforcement of bad development practices.
- smallpipe 1y agoThat’s a lot of words for “I suck at my job”
- BestHackerOnHN 1y ago[dead]
- wseqyrku 1y ago"Who needs git when [..]" No matter how that sentence ends, I weep for our industry.
- waffletower 1y agoReminds me of a colleague back in the day who would force push to main and just leave a "YOLO" comment in the commit.
- 0xffff2 1y agoIt's mind-blowing to me that any multi-user git repo is set up to allow pushes to main at all.
- deleted 11mo ago[deleted]
- waffletower 11mo agoIt was years ago at a small outfit
- nicman23 11mo agowhat a chad
- shepardrtc 1y agoAt my last job, whenever a commit wouldn't build, we would blast it into a slack channel with an alert that included the comment and the name of the developer.
- vlovich123 1y agoAh yes. Public shaming. The “beatings will continue until morale improves” strategy of code development. Next time, you may want to suggest an evergreen strategy where commits are tested before they’re merged.
- Aeolun 1y agoWhat does this have to do with 1M context windows… That’s just Cursor keeping your old file around.
- tripplyons 1y agoI would recommend the Code Supernova model in Cursor if you want a 1M token context window. It's free right now since the model is being tested in stealth, but your data will be used by XAI or whoever it turns out the model creator is.
- simonw 1y agoI had a similar anecdotal experience a few weeks ago. I was working on a blog entry in a VS Code window and I hadn't yet saved it to disk. Then I accidentally hit the close-window keyboard shortcut... and it was gone. The "open last closed window" feature didn't recover it. On a hunch, I ran some rg searches in my VS Code Library feature on fragments of text I could remember from what I had written... and it turned out there was a VS Code Copilot log file with a bunch of JSON in it that recorded a recent transaction with their backend - and contained the text I had lost. I grabbed a copy of that file and ran it through my (vibe-coded) JSON string extraction tool https://tools.simonwillison.net/json-string-extractor https://tools.simonwillison.net/json-string-extractor to get my work back.
- throwzasdf 1y ago[dead]
- magicalhippo 1y agoLooking back, writing interrupt service routines[1] for DOS as a self-taught teenager has been massively helpful. Primarly because it taught me to save every other word or so, in case my ISR caused the machine to freeze. [1]: https://wiki.osdev.org/Interrupt_Service_Routines https://wiki.osdev.org/Interrupt_Service_Routines
- texuf 1y agoThere's an option now in vscode to autosave every few seconds.
- 6LLvveMx2koXfwn 1y agoIf you can't remember what you wrote a 'few seconds' ago then you have more problems than having to work in vscode!
- JambalayaJimbo 11mo agoI have ADHD bro
- scroblart 1y agothis shit is so depressing, having a "secret sauce" and it being just mystical and unknowable, a magic incantation which you hopefully scribbled down to remember later
- jdlyga 1y agoThis is just junior level developer thinking. There's so much that this developer doesn't know that they don't know.
- bad_username 1y ago> I refactored all the sketchy code into a clean Python package, added tests, formatted everything nicely, added type hints, and got it ready for production. The fact that type hints are the last in the list, not first, suggests the level of experience with the language
- seanw265 1y agoLiving life on the edge, huh? Sometimes I notice myself go a bit too long without a commit and get nervous. Even if I'm in a deep flow state, I'd rather `commit -m "wip"` than have to rely on a system not built for version control.
- didi_bear 1y agoMost IDEs have Local History built-in to retrieve any version of a file, including untracked deleted files: VSCode Timeline, all JetBrains, Eclipse... Are people coding on notepad ?
- jasonjmcghee 1y agoJetbrains local history, stacked clipboard, and recent locations (all searchable) are such a massive developer experience boost.
- defraudbah 1y agoin a console talking to your ai friend
- lbrito 1y ago>give me the exact original file of ml_ltv_training.py i passed you in the first message I don't get this kind of thinking. Granted I'm not a specialist in ML. Is the temperature always 0 or something for these code-focused LLMs? How are people so sure the AI didn't flip a single 0 to 1 in the diff? Even more so when applied to other more critical industries, like medicine. I talked to someone who developed an AI-powered patient report summary or something like that. How can the doctor trust that AI didn't alter or make something up? Even a tiny, single digit mistake can be quite literally fatal.
- svg7 11mo agoYou just evaluate it against whatever test data you used and compute a bunch of metrics. You decide to use the model, if "bad things" happen at an acceptable enough rate.
- BinaryIgor 1y agoOver the years, I've heard so many stories like these without happy ending - developers wasting days and sometimes even a week or two of work, because they do like to commit and use git often - that my long-time upheld practice is to pretty much always create feature/develop branches and commit as often as possible, often multiple times per hour.
- iambateman 1y agoThis article is nonsense.
- actinium226 1y ago> Who needs git best practices when you have an LLM that remembers everything? OK, but if you'd used git properly, you wouldn't have had this problem in the first place.
- unsignedchar 1y agoCan someone come up with a conversion factor for context window sizes to glacier depletion?
- maxdo 1y agoIt has nothing to do with context window . Its cursor stores locally gigabytes of data including your requests and answers. It’s a classical rag , not a “long context”
- stavros 1y agoI've had this exact thing happen, but with the LLM deciding to screw up code it previously wrote. I really love how Jujutsu commits every time I run a "jj status" (or even automatically, when anything changes), it makes it really easy to roll back to any point.
- GrantMoyer 1y agoLike the author, I've also found myself wanting to recover an accidentally deleted file. Luckily, some git operations, like `git add` and `git stash`, store files in the repo, even if they're not ultimately committed. Eventually, those files will be garbage collected, but they can stick around for some time. Git doesn't expose tools to easily search for these files, but I was able to recover the file I deleted by using libgit2 to enumerate all the blobs in the repo, search them for a known string, and dump the contents of matching blobs.
- _pdp_ 1y agoThis isn't actually a Gemini - a copy of the file was already stored locally by Cursor. Most modern editors, including VS Code, can recover files from local history without needing Git. The interesting thing here is the common misconception that LLMs maintain internal state between sessions which obviously they don't. They don't have memory and they don't know about your files.
- sshine 1y agoUsing LLMs as an extra backup buffer sounds really neat. But I was trained with editing files in telnet over shaky connections, before Vim had auto-backup. You learn to hit save very frequently. After 3 decades I still reflexively hit save when I don’t need to. I don’t forget to stage/commit in git between my prompts. The new checkpoint and rollback features seem neat for people who don’t have those already. But they’re standard tools.
- jbki 11mo agowhen is "when you don't need to"? I map `:update` to a easiy to reach key so I do it reflexively after practically every few seconds
- ElijahLynn 1y ago> And I never committed the changes that got me the +5%. Damn, I forget how much of a noob I used to be. I used to lose changes sometimes. But I commit very, very very often now or at least git stash, which creates some type of hash to recover from.
- pdntspa 1y agoI find gemini 2.5 pro starts losing its shit around 50K tokens, using Roo Code. Between Roo's system prompt and my AGENTS.md there's probably about 10k used off the bat. So I have about 30-40k tokens to complete whatever task I assign it. It's a workable limit but I really wish I could get more out of a single thread before it goes crazy. Does this match others' experience?
- AntoineN2 1y agofirst three words shot fear into my soul
- notacoward 11mo agoGit is not just for saving personal history. It's also, and more importantly, a collaboration tool. Your contex window is no substitute for that, and can't even be relied on to be either complete or accurate over what might be years of development.