The AI Economist / May 10, 2026 / 4 min read

How to Use Claude Code with Stata

A practical setup for Stata, reusable skills, PDF tooling, and the economists starting to automate empirical papers.

Intro

In this article:

  • I walk you through the exact setup for Stata + Claude Code (PATH, reusable skill, and PDF tooling)
  • Some recent experiments by two different economists (Paul Novosad and Yanagizawa-Drott) to automate the generation of economics papers in hours with agentic coding tools

Let's get into it.

Deep dive

Claude Code with Stata

I've done 1:1 Claude Code training sessions with a dozen economists, almost all of whom use Stata.

Using Claude Code effectively with Stata requires a few setup steps you don't need with more common languages like Python or TypeScript.

I've created a written guide and a YouTube video.

Stata GUI setup from the tutorial

Here's the broad steps I outline in those two resources:

1. Getting Stata on PATH. Claude Code runs in your terminal, so it needs to find Stata. The tutorial shows how to add the Stata executable to your system PATH so Claude can call it directly with a stata command.

2. Creating a reusable Stata skill. A skill is a persistent instruction file that tells Claude Code how to work with Stata across all your projects. Once you set it up, every new session knows your Stata version, preferred packages (e.g. reghdfe, estout, did_multiplegt), and output conventions.

3. Handling PDF docs. Stata docs are large PDFs, which are expensive to include in LLM context.

By giving Claude Code access to a few tools, it becomes able to query those PDFs much more efficiently.

The tools I suggest:

  • pandoc for converting PDFs to text
  • pdfgrep for searching across PDFs from the command line
  • pdfplumber for extracting tables and structured data

Briefs

Economists are Getting Claude Code Pilled

Paul Novosad (Dartmouth) kicked this off with a now-viral claim: in about three hours, he used Claude Code to generate a full analysis package around a land reform question. (tweet)

Paul Novosad on writing a paper in ~3 hours

One point Novosad makes is that he doesn't think that this is a good paper but perhaps across all economics papers getting published today, it is getting close to the point that unsophisticated one-shot approaches can create mediocre papers of the type that actually do get published. (tweet)

Paul Novosad on challenge to the journal system

David Yanagizawa-Drott (University of Zurich) asks a different question: can policy evaluation be automated reliably, cheaply, and quickly? He positions this as an open research program rather than a solved capability. (tweet)

David Yanagizawa-Drott on automating policy evaluation

He also - separately - attempts to one shot a macro paper. He's not a macroeconomist - is it possible now for non specialists to use coding agents to produce what in the past would be considered "good" research? (tweet)

David Yanagizawa-Drott original macro tweet

Here are his initial reflections on what he's doing:

David Yanagizawa-Drott on the two-worlds framing

I largely agree with Novosad's take here. There are large sets of applied micro and applied macro papers that are fairly rote exercises, and for which the set of empirical steps done can be defined by a decision tree. These types of papers are likely just a model improvement or a well-designed Claude plugin away from being fully automated.

Paul Novosad final verdict on research quality

Get the The AI Economist newsletter

How PhD economists are accelerating research with agentic tools, plus cutting-edge breakdowns of AI economics research