Welcome to a different installment in what could also be a by no means ending sequence on Claude Code. At present’s submit goes to be a stroll by means of of how I exploit Claude Code to work on empirical tasks. However, that’s really an excessive amount of to cowl in a single submit, so it’s going to as a substitute simply give attention to the primary steps. I’ve a video beneath that’s half-hour lengthy. It’s guerrilla fashion, low key, however hopefully you possibly can see sufficient. I hope that is useful as a place to begin. I’ll preserve doing these explainers in all probability till I’ve defined every part I need to clarify to myself. However please notice that this isn’t an explainer written by an knowledgeable. That is extra me simply writing on my substack how I exploit it as I determine that is higher than nothing. The aim is especially to assist individuals see it with their very own eyes. Okay right here’s the submit. Hope it’s useful!
Recall how I mentioned the opposite day two issues:
-
Claude Code is an expertise good and till somebody experiences it themselves with their very own eyes, they gained’t actually admire how transformative it’s (nor how straightforward it’s to make use of, nor how straightforward it’s to harm oneself).
-
Claude Code explainers are written by the common Claude Code “energy consumer” for different common Claude Code customers, which implies that it’s written by laptop scientists and programmers meant for the schooling of different laptop scientists and programmers. It’s not written for empirical social scientists from the quantitative custom though quantitative social scientists have an unbelievable quantity to achieve from utilizing it.
So, I believed that I ought to in all probability begin simply filming myself utilizing Claude Code in order that readers might see me use this and thus “expertise” Claude Code with out really utilizing it themselves. And since I’m a run-of-the-mill utilized microeconomist, what I will probably be doing is simply displaying how I’ve been utilizing it for my work and actually with none curiosity or regard for what the Claude Code explainers are saying it’s good for.
However, in what you will see, you must know that this can be a reflection of my workflow, and my method of interacting with chatbots extra typically. I’d say that as an individual, I’m extraordinarily collaborative, seeking to work collectively, and interact in a sort of mutually respectful dialogue, and hoping for a sort of collective curiosity to occur. I not often simply given orders — to not anybody, and never even to chatbots. Which isn’t to say that my fashion is greatest. Slightly it’s to say that that is how I work, and while you work with it, you’ll endogenously kind into a mode that displays your personal method of working. And neither one is true or flawed.
Or possibly you may say that “All workflows are flawed however some are helpful”. That means if the workflow you develop brings you to the sting of your personal manufacturing chance frontier, then it’s helpful, and if it doesn’t, then it isn’t helpful. I’d simply belief within the Drive although — really feel your method by means of it, do what feels proper, however I believe a few of what I do on this specific video is kind of the best, most secure method to begin up a undertaking.
However earlier than I dive into it a few issues. First, this submit is not going to be a paywalled. Some will, however this one is not going to be, and when they’re paywalled, I’ll have flipped a coin to determine. I’m not nice at committing to paywalling, however I will probably be doing that after right this moment extra usually. I simply wished individuals to a minimum of get began on this sequence and get a way of the chances.
Second, take into account changing into a paying subscriber of the substack! Should you love random hyperlinks about pop psychology, econometrics, economics, causal inference, AI, Claude Code, films, popular culture, relationships, footage of my kids, my time in Boston, and issues I can’t in any other case consider, then we’re made for one another anyway.
After which third, here’s a 30 minute video of me firing up Claude Code in a brand new undertaking. I’m going to explain what I do on this video beneath, however I encourage you to additionally watch the video, as I believe seeing Claude Code in motion, and the particular issues I do after I begin a undertaking, could be actually useful because it’s type of exhausting to explain the method in any other case.
I made a decision to mud off an outdated undertaking from 2016 — a undertaking with a former Baylor undergraduate named Andrea Schlosser on Texas Home Invoice 2. This undertaking finally was deserted, and me and Andrea joined a unique workforce (Caitlyn Myers and Jason Lindo) on the same model of it (completely different knowledge and completely different coding up of the placement of clinics that Caitlyn had performed a greater job of accumulating than we did) printed within the Journal of Human Assets in 2019. As I mentioned, although, Andrea was my undergraduate thesis pupil at Baylor, and this was her senior thesis and this specific undertaking whereas much like the JHR was technically completely different, and thus I felt could possibly be a superb factor as an instance because it’s typically an attention-grabbing subject and I haven’t actually touched this listing a lot in any respect shortly (aside from making an attempt to tinker with some steady diff in diff stuff).
The undertaking with Andrea had a sort of kitchen sink strategy in that whereas her thesis targeted on abortions and births, I alongside her did my very own evaluation of the regulation (as I felt I might go quicker and go deeper) on different outcomes as effectively together with sexually transmitted infections. Our undertaking, I’ll name it, examined how HB2’s clinic closure necessities elevated journey distances to abortion suppliers, and what that did to abortion charges, births, and varied well being outcomes. However in any other case it’s fairly much like what finally ended up within the JHR in that identification technique was the identical, as was some (although not all) of the evaluation that we did.
However by way of the precise folder — I haven’t touched it a lot in any respect in years. It’s probably not a large number — not in comparison with most of my tasks which get bloated and wild irrespective of how organized I try to be. Nonetheless, it’s sufficient to get began with. I didn’t need to use one in all my actually dangerous folders as a result of truthfully, I believe they’re too horrifying. It might be like letting you right into a hoarder’s home. Nonetheless, this one I believe is ideal for demonstrating Claude Code.
The very first thing I did was simply… inform Claude what we have been engaged on. “Texas Home Invoice 2 Abortion Restriction Examine with Schlosser.” That’s it. That was my whole immediate. I did that as a result of Claude Code at all times names the chat after the primary sentence, and if I inform it a activity to do this is identical activity I inform Claude Code to do in each new undertaking (which is normally some model of “go searching and inform me what all is right here”) then the title of the chat will probably be one thing like “trying round and telling what I see”. And also you’ll have like 5 of them which makes it type of exhausting to instantly acknowledge it. I determine finally they’ll make it so you possibly can rename it, however for the time being I don’t see it, so I simply normally title the brand new undertaking within the first immediate.
Apparently, though all I did was title it, Claude Code instantly went to work exploring the listing or what’s unusually sufficient usually known as “the codebase”. Finest I can inform, “codebase” and “folder” may imply the identical factor, however I’m unsure on that. Regardless, that’s what it did. And it discovered every part — the Stata do-files, the R scripts, the information recordsdata (105 of them!), the LaTeX tables, the primary manuscript, the printed JHR with Jason, Caitlyn and Andrea. It found out the undertaking timeline by taking a look at file timestamps: earliest recordsdata from December 2015, thesis accomplished in late 2016, printed in 2019. It additionally summarized our key findings from studying the manuscript.
And as you’ll see, I didn’t inform it the place something was. I didn’t give it a tour. It simply… appeared round and reported again.
Then I requested Claude to create two markdown recordsdata:
-
A README.md documenting your complete listing construction
-
A CLAUDE.md file — and that is the vital one
The CLAUDE.md file is basically an instruction handbook for future Claude periods. I do that due to one thing I’ve realized repeatedly whereas working with Claude Code. Our chat periods can crash in a wide range of methods, and once they crash, and you can’t get again into them, you’ll “lose your work”. What do I imply by “lose your work?”
Properly, right here’s what I don’t imply. I don’t imply that the work you and Claude Code had been doing within the listing bought deleted. That’s nonetheless there. What I imply is that since that chat is useless, the one possibility you’ve is to begin a brand new one, and that “new Claude Code” can have no reminiscence of the work you two had been collectively except a document of it exists. I’ve realized the exhausting method that Claude Code chat periods are ephemeral. Which implies that if one thing crashes, if the context window fills up, such that the chat itself turns into unusable and can’t be revived, then that dialog is gone. Which implies it’s not capable of learn what its personal prior phrases, as these prior phrases solely exist within the chat window that simply died. The subsequent Claude occasion begins recent with no reminiscence.
So, what I do now could be I create tons and tons of markdowns and progress logs and unfold them in every single place as a result of greatest I can inform, Claude Code can and can learn these immediately when requested to which allows him/her/they/it to rise up to hurry immediately. And Claude.md is, particularly, my one markdown the place I write down what you may name the principles of engagement. It’s the stuff I want him to at all times know — particularly what I would like him to know, but in addition what I would like him to not do.
I normally begin off by telling Claude Code to write down down a algorithm, virtually like commandments or sins. In right this moment’s video, they have been:
-
By no means delete knowledge. In no way.
-
By no means delete applications. No do-files, no R scripts, nothing.
-
Keep on this folder. You may go down the listing tree, however you can’t go up wandering above the listing tree.
-
Use a legacy folder. Transfer originals there for safekeeping.
-
Copy, don’t transfer. When reorganizing, at all times copy from legacy.
These guidelines exist as a result of Claude Code is highly effective sufficient to harm you. It may delete recordsdata. It may reorganize your whole undertaking in methods you didn’t anticipate. It’s not malicious — it’s making an attempt to assist — however it’s working at a pace and scale that may outpace your means to note what’s occurring.
The CLAUDE.md file is my seatbelt. Does this really work? I truthfully don’t know. However I do it anyway as a result of it seems like it really works.
Right here’s the place it bought attention-grabbing. I wished to reorganize the messy outdated undertaking construction into one thing smart. However I’d simply instructed Claude in Claude.md to by no means to maneuver recordsdata. Which was a contradiction — how would I inform him to maneuver issues into legacy is he’s by no means allowed to maneuver issues, solely copy them? I painted myself into the nook as a result of the video is all unscripted.
So I do what I at all times do with Claude Code — I simply instructed him the deal, after which we had a dialog about it. I defined that I wished every part moved right into a legacy/ folder for safekeeping, after which vital issues to be copied out into a brand new organized construction. However I additionally reminded him that I had simply created these iron clad guidelines about not doing transferring issues, solely copying issues, and that I used to be kicking myself for not pondering of this primary. So what did he suppose we should always do?
Claude Code instantly understood the stress with the principles, each that I cared concerning the guidelines within the first place, and that I had created an issue for myself, so he proposed an answer: we’d amend the principles to permit a one-time transfer into legacy, then implement copy-only going ahead.
That is what I imply about collaborative dialogue. I didn’t have the answer labored out upfront. We figured it out collectively.
The brand new construction Claude created:
Abortion_Supply/
├── code/
│ ├── R/
│ ├── stata/
│ └── python/
├── knowledge/
│ ├── uncooked/
│ ├── processed/
│ └── exterior/
├── output/
│ ├── figures/
│ └── tables/
├── docs/
│ ├── manuscript/
│ └── references/
├── legacy/ # Sacred - by no means modify
├── log/ # Progress logs
├── CLAUDE.md
└── README.md
Clear. Wise. I at all times want his construction too. I sort of suspect he has mastered the “rhetoric of the hierarchical folder construction” since he’s seen and studied each single hierarchical folder construction that has ever been put on-line. And albeit, there in all probability is a few deep sign in all that stuff {that a} LLM is extracting that even the individuals who design them aren’t absolutely tapped into. Anyway, that’s what he did for me — no large deal, however the level is, that’s the place to begin.
I’m a compulsive saver. In Phrase, I’m always hitting Cmd+S to save lots of no matter I’m engaged on. I commit and push to git. Virtually prefer it’s a nervous tic. I believe it’s some sort of a fidget factor, however it’s additionally some real paranoia about shedding work. Only one other thing to convey as much as the therapist in a protracted working remedy that in all probability doesn’t make any sense to my therapist as it’s.
It occurred to me that when a Claude Code session dies, that’s the identical as shedding work. All that context, all these choices, all that momentum — gone. So much like the Claude.md, which is extra of a one-shot kind of markdown with a particular set of tips, I would like Claude Code to additionally simply have one thing like a diary that paperwork the work he’s performed. And so I’ve Claude Code create a log/ listing with timestamped progress logs. And each time I roughly hit a stopping level, I at all times say the identical factor earlier than I finish.
“Please replace all related markdowns. And please replace the progress log with every part we’ve performed for the reason that final time we up to date the progress logs. Please time stamp it too.”
Each important chunk of labor, we doc it: what we did, the place issues stand, what’s subsequent. That method, if this chat dies proper now, the following Claude Code can learn the logs and choose up precisely the place we left off. Progress logs are my autosave of the workflow. The work is protected — it’s actually simply within the laptop now. However now I’ve saved what and why we’ve performed it which makes choosing up the place I left off a lot simpler within the occasion of “a chat crash”.
So, Claude Code wrote the primary log entry documenting every part we’d completed within the session. It’s like a breadcrumb path for my future self and future Claude Code situations.
In a few half hour, we:
-
Explored a messy 10-year-old undertaking and understood its construction
-
Created complete documentation of the undertaking and the folder construction (i.e., “the codebase”)
-
Established security guidelines to forestall unintentional “workflow loss” (although that doesn’t fairly appear to be the best phrase tbh)
-
Reorganized 150+ recordsdata right into a clear listing construction
-
Preserved all unique recordsdata in a protected legacy folder
-
Constructed a logging system for session continuity
I didn’t write any code. I didn’t manually transfer any recordsdata. I didn’t create any of these directories by hand. I had a dialog, made choices, and Claude executed.
I need to be trustworthy about one thing: this can be a little scary. Claude Code moved over 100 recordsdata round my filesystem in seconds. If I hadn’t been considerate concerning the guidelines — if I hadn’t created that CLAUDE.md file first — if I hadn’t be very cautious with my language, and albeit if I hadn’t been in a spot with model management and the flexibility to rewind time (i.e., dropbox), it might have made a large number.
So I believe that that is actually an vital level — Claude Code is a bit like a canine off its leash. And never simply any canine. It’s a rotweiller off its leash. And whether or not it bites you, I’m unsure, however I believe it’s higher to hope for one of the best however assume the worst can occur, and endogenously kind into an setting the place the draw back dangers are actually small. However lots of you studying this are more than likely saying that I’m insane to permit Claude Code to be up to now off its leash, wherein case I say — I hope I’m proper and also you’re flawed.
The entire cause I dusted off this undertaking is that I need to lengthen it to make use of steady difference-in-differences strategies. However I additionally need to do different stuff like revive the unique undertaking by Andrea, do some audits of her code, make some decks and different issues. So I’m going to mainly do all of it and simply illustrate how you can go about engaged on an energetic undertaking in order that at minimal, you possibly can a minimum of see one use case in motion, even when it isn’t the one you’ll your self need to do.
