ProgrammerHumor

wholeCodebaseInTXTFile

wholeCodebaseInTXTFile
https://i.redd.it/mgs88k4c43df1.png
Reddit

Discussion

Semper_5olus

"But please pretend it's in different files because I'll have to separate it back up when I'm done."

There. That should work.

1 day ago
Flimsy_Meal_4199

I do stuff like this all the time (probably not at this scale)

Putting your files in markdown code blocks with the name of the file works really well

```main.py
# code here
```
-----
```pkg/file1.py
# more code
```
23 hours ago
theshubhagrwl

Time time you spend in merging and separating these files can be utilised in learning how to code in the first place.

16 hours ago
Flimsy_Meal_4199

Hooo boy lemme tell ya you can concatenate files to a text like this ez pz, especially if you have learned to code

Although for a large project you'll probably overflow the single message limit, but if you're dealing with a specific problem, implicating maybe 2-4 files it's a pretty good use case

I also really like to do python -m nbconvert ... --to markdown so I can shove notebooks (data, Euler problems, math textbook notes/problems) into the AI to talk about them

14 hours ago
VertigoFall

Before I used cursor I made an extension that concatenated everything and added it to the clipboard so I could just paste it directly in claude or whatnot

12 hours ago
boundbylife

I have a 'small' Flutter app. I have 16 model class files, 9 navigation class files, 3 parser class files, and a handful of utility class files. It's probably 15,000 lines.

Your solution is not tenable :-p

17 hours ago
Flimsy_Meal_4199

Good luck soldier

13 hours ago
Zamiatacz

https://github.com/mufeedvh/code2prompt This will help you

15 hours ago
boundbylife
  1. this is hilarious.
  2. It really does feel like that Python XKCD
8 hours ago
iCapn

At first I didn't see your code block backticks and read that as your code being in all H1 headers

15 hours ago
offlinesir

wholeScreenshotIn591x657Resolution

1 day ago
John_Carter_1150 OP
:py:

Sorry, couldn't find a better way to shoot the screen.

1 day ago
TimoSLE

A gun should be pretty effective

1 day ago
John_Carter_1150 OP
:py:

that's what I thought, but I didn't have one handy

1 day ago
PeriodicGolden

/r/shitnonamericanssay

1 day ago
lunch431

The REAL American would have known how to shoot anything.

1 day ago
TheFriendshipMachine

As an American, the struggle I'm having is choosing which gun to shoot my screen with!

(Shit, my profile actually backs that claim)

23 hours ago
AZEMT

22 hours ago
TheFriendshipMachine

22 hours ago
ThrowingPokeballs

Can you not just vibe code that?

1 day ago
offlinesir

it's really not that bad, I've seen worse.

1 day ago
djnz0813

Some more pixels please

22 hours ago
ProfBeaker

He's not trying to give you all the screen details, just the overall vibe.

1 day ago
Linkpharm2

Proof? Lemme see you eyeballing it perfectly

1 day ago
offlinesir

I downloaded the image and saw the height and width (in pixels!)

Proof: https://imgur.com/a/DHQAked

1 day ago
Linkpharm2

I was so expecting a rickroll

1 day ago
_Repeats_

xAI has your entire codebase. Hope you have patents and a good lawyer to protect your IP...

1 day ago
DanTheMan827

Here’s a question though… assuming the original code was written by AI, do you even own it to begin with?

1 day ago
Grandmaster_Caladrel

Depends on the ToS but generally yes. Morally is a separate question, but legally you own it.

1 day ago
Snipedzoi

Fym it's the new stack over flow copy here copy there it's all my code

1 day ago
Grandmaster_Caladrel

Not sure I know what fym stands for but the rest of the sentiment seems to match what I said.

22 hours ago
Gacsam

Stands for "fuck you mean?" [about morally]

22 hours ago
Grandmaster_Caladrel

Gotcha, thank you for the answer!

22 hours ago
Snipedzoi

Morally it's the same as stack overflows.

22 hours ago
PCgaming4ever

Pretty sure the answer is no to owning anything on the Internet that AI touches since the courts rules AI can scrape anything without legal ramifications

1 day ago
John_Carter_1150 OP
:py:

Don't start this argument, man...

1 day ago
LavaCreeperBOSSB

I was looking at cursor today and it claims you own the code

1 day ago
Vegetable-Willow6702

my ip is 127.0.0.1 and it's already been leaked many times so checkmate, nerds 😎

1 day ago
Constant-Tea3148

We all know that the one thing these companies really care about are your rights under copyright law.

1 day ago
typoscript

Do we actually think this matters here?

The tech companies that have code work parenting are less than .1%

1 day ago
otterquestions

Why would anyone care about your code base? 

23 hours ago
Vorenthral

Since they plan to train Grok off the code dumped in I am kinda tempted to just dump garbage code in from a different LLM and tell it it's google source code or some nonsense just to screw with the algorithm.

1 day ago
shinzanu

Fuck yes, been waiting for AI poisoning wars to arrive :D

23 hours ago
emetcalf

Write a program that vibe codes 100 projects per minute and submits them to Grok for optimization.

22 hours ago
Vorenthral

I love this idea

21 hours ago
UnrealCanine

uint_8 count;

for x in range(count):

System.out.println(x);
22 hours ago
otterquestions

Ever since GPT 3 they have had quality screening models to make sure the input data isn’t terrible

23 hours ago
littleessi

i'm sure that's as accurate as everything else llms do

16 hours ago
1T-context-window

Doing God's work!

23 hours ago
bhison
:cs::unity::ts:

Even funnier would to just create a feedback loop where you ask it to make the stupidest output then keep feeding that back in a different session and an input 

9 hours ago
ForeverDuke2

Surely this is a joke or only inteded for really small projects.

How would it even work for actual projects. Do I first need to consolidate the entire codebase in a single text file...? That itself is a huge endeavour.

1 day ago
jeremj22

Could probably write a script to cat all the files.

Getting whatever non-compiling trash the AI spits out back into your codebase is another matter...

1 day ago
eightysixmonkeys

Yeah and there’s absolutely no way the AI doesn’t get “confused” and start producing trash code once it has to deal with all the dependencies.

When I was using chatgpt a lot for webdev it constantly incorrectly messing up the import statements

1 day ago
egg_breakfast

That would technically work, but then you're already providing grok from the get go with code that doesn't compile. lol

22 hours ago
AsTiClol

Gitingest does this for you, creates a nice MD file with directory tree structures, separation of files and works with a single command, try replacing any github repository url with gitingest, it works really well if you wanna dump entire sdks for context, i use it a lot

5 hours ago
GaymerBenny
:j:

I'm relatively sure you can just upload multiple.txt files

21 hours ago
Visible_Whole_5730

lol my first thought too 🤣

20 hours ago
Shalcker

Asking model to create consolidation script is 99.9% certain to work. Could even ask it to do reverse script as well just to be sure entire pipeline works both ways.

And those scripts are generally very small.

15 hours ago
AsTiClol

gitingest!!!

5 hours ago
henkje112

I know it's a joke but i actually wrote a rust crate to copy a codebase to clipboard specifically for this use case. If you want to check it out, you can find it here: https://crates.io/crates/repoyank

I haven't tried for huge codebases, but for anything up to 30k tokens, Gemini 2.5 pro "understands" the filestructure and internal dependencies.

23 hours ago
AsTiClol

You should really check out gitingest for this

5 hours ago
henkje112

Gitingest is actually what inspired me, but I didn't want to send my data to yet another company (especially if I already have a local LLM) or have to manually copy and paste my repo if it's not listed on public git (my company uses a self-hosted GitLab).

4 hours ago
AsTiClol

you can use the gitingest python library to run it locally (i took the mild inconvenience to install the library globally. hasnt broken prod apps for me cuz i use uv)

you can do gitingest . to ingest a whole directory and it spits out a digest.txt

include -e filename to exclude certain filetypes as well

4 hours ago
GregoryfromtheHood

Wait, I didn't get the joke because this is how I use Claude and other services. How else are you supposed to feed it the right context and know that it knows everything you want it to know? If the codebase is too big, I just include as much as I can for context while using a token counter to make sure the text file isn't getting excessively large. I've even got python scripts for packing up parts of the codebase into a single txt file with headers separating the files.

Now I feel like there's a better way that I've been missing...

22 hours ago
sebjapon

Do you get good results like that? Is it really faster than solving the problem yourself?

How about asking a colleague for help?

21 hours ago
GregoryfromtheHood

Yep, I get great results like that, and for certain things yes, it's way faster than writing it myself. If I know the problem I need to solve and need to bounce ideas, then get the solution written the way I want, but without needing to write everything by hand, it's super handy. And by giving it the context of parts of the codebase that it needs, then it knows how it all fits together and can come up with things that neither me or my colleagues had thought of.

I know there are tools that can put your codebase in a vectordb and do RAG, but I like to control what context I send because I know the important parts of the code that it needs to solve a particular problem or just write a particular function for me if I'm being lazy.

That's why I shove stuff into one big text file, easiest way to feed it in.

21 hours ago
AsTiClol

Dunno why you're getting down voted. Works REALLY fucking good with gemini2.5

5 hours ago
rodeBaksteen

I went from manual copy paste in ChatGPT to Cursor and it changed my (work) life

16 hours ago
ETHedgehog-
:g:

all_code.txt

1 day ago
ba-na-na-
:cs::cp::py::js::ts:

1 day ago
Obvious-Phrase-657

Did it work tho? Gemini is able to handle this with the 1M token limit

1 day ago
Johalternate
:ts:

I dont think so. I just ran a quick script that turns your codebase into a single txt file (respecting .gitignore) on a project. The number of lines is 136,201. The number of characters is 3,679,767 (this includes the path/name of each file before the file contents). THe average length of a token is 4 characters according to google (source) That leaves us with very little wiggle room for interacting in a meaninful way.

23 hours ago
Piyh
:j::js::py::ts:bash::powershell::

I'm able to do it at work for repos under 10k LOC easily

7 hours ago
Hot-Entrepreneur2934

AMAZING! I'll start copy and pasting in all my files now!

1 day ago
BakalhauSalgado

For those wondering, "How would I combine the entire project into one file?" https://repomix.com/

22 hours ago
Positive_Minimum3468

Plottwist: contains 400k GitHub links

1 day ago
Yhamerith
:py:

Vibe coding or N@zi coding?

22 hours ago
timawesomeness
:re::re::re::re::re::re::re::re::re::re::re::re::re::re::re::re:

Violent antisemitism is one of the vibes needed for vibe coding with Grok

19 hours ago
naholyr

Why are people so stupid?

23 hours ago
bbjaii

Please don’t steal my code

1 day ago
coloredgreyscale
:j::py:

just manually copy your project into a single text file first, lol

23 hours ago
henkje112

I know it's a joke but i actually wrote a rust crate to copy a codebase to clipboard specifically for this use case. If you want to check it out, you can find it here: https://crates.io/crates/repoyank

I haven't tried for huge codebases, but for anything up to 30k tokens, Gemini 2.5 pro "understands" the filestructure and internal dependencies.

23 hours ago
eightysixmonkeys

Holy shit this is suicide fuel

1 day ago
Sculptor_of_man

There is 'vibe' coders and then there is what ever the hell this is.

19 hours ago
tanczosm

https://repomix.com/

18 hours ago
Alternative_Yard6033

People are so dumb and so ignorant nowadays

14 hours ago
Vincent-Thomas

Codebase in one txt file is crazy

6 hours ago