Intro
In an earlier article I discussed /goal, a feature in Codex and Claude Code that lets you run long-running tasks in a single thread — how to use it, how economists are already using it, and some suggested use cases for your own work.
Today, I want to introduce another way to use /goal when combined with a few other Claude Code and Codex features.
Let's get into it.
Optimizing AI for Understanding
Something I've been thinking quite a lot about is how to optimize for learning and understanding in the AI era.
Andrej Karpathy recently resurfaced a quote I've also been thinking about:
Paul Novosad, a development economist at Dartmouth, noticed something similar: in 2021, after ten weeks, most students had an OLS regression and maybe one student had an interaction term or fixed effects. In 2026, after three weeks, the median student has a DSGE survival model with heterogeneous agents and spends the rest of the quarter working backwards to understand it (tweet).
Everybody who has played around with AI for a bit will encounter this experience: you generate code that does something very interesting, and perhaps even very true, but you don't actually understand the whole thing that has been produced.
Maybe the new normal is that we should accept that and think of ourselves as having moved to higher levels of abstraction.
However, understanding other types of things, like an economic model or an econometric procedure, or the argument in a paper, seem to me to be things that we can't just outsource to AI.
The relevant question is: can we use AI to accelerate the rate at which we understand these things?
I am thinking about this "understanding acceleration" from a lot of angles. Today I want to introduce one attack I've made on the question: using Codex to make it easier for me to read books and papers on my Kindle.
Sponsored
Work with Aniket
Want help making Claude Code or Codex useful for your actual research?
I offer 1:1 sessions for economists who want help with a real project: setting up tools, improving a research workflow, turning repeated patterns into skills, or deciding when to use Claude Code vs. Codex.
I also run group workshops for departments, research centers, and institutions on agentic coding for economics research.
Book a 1:1 session
Discuss a group workshop
What does a Kindle have to do with learning?
I travel frequently, so I often don't have access to a printer or the capacity to carry around a bunch of papers.
However, if I'm reading a technical book or paper, I ideally want to read it on paper or as close to paper as possible.
Reading on my computer is distracting, and I'm inevitably scatterbrained there.
So, if I'm reading anything technical or anything that requires deep thought, my preferred format is a Kindle rather than my computer.
EPUBs vs PDFs on Kindle
Kindles can handle both PDFs and EPUBs. However, EPUBs are much more native to a Kindle. You can scale the text more easily and use internal links to equations or figures, for example.
PDFs, on the other hand, often look tiny on a normal Kindle, and you can't select or take notes on specific lines because the whole PDF page is effectively rendered as an image.
Unfortunately, most academic papers and many books are distributed as PDFs. You can read them more naturally on a device like a Kindle Scribe, and I'm looking to buy one, but I currently have a 7-inch Kindle.
So the question becomes: can Codex help me take various documents and get them onto my Kindle in a format I can actually read?
I tested this out on three documents:
- A PDF of Joshua Gans's book The Microeconomics of Artificial Intelligence
- Scott Cunningham's book Causal Mixtape
- Chetty et al.'s papers on teacher value-added
How to do the conversion
You can use tools like Pandoc for one-shot conversion, but you typically don't end up with well-formatted text.
What you want Codex or Claude Code to do is go through the document more carefully: make sure math is well formatted, section headings are in the right place, and tables and figures are handled properly.
To do this, I used the /goal feature covered in that earlier article.
Effectively, I set a goal like this:
/goalConvert<document X>to an EPUB which I can read on my Kindle. Confirm visually and functionally that the inline math is well formatted, that figures are appropriately placed, and that internal links work properly. Use the in-app browser and/or Calibre for these confirmations. For large documents, proceed chapter by chapter, confirming each chapter before continuing.
I'm sure there are better ways to do this. But the task generally fits the shape of a good goal: it is long-running, because fixing broken PDF-converted math into usable EPUB math takes a while, and there is a method of confirming or validating as you go along. Codex can spot-check rendered EPUBs and see whether the math, figures, and links are broken.
How well did the goal do?
Joshua Gans's book is distributed as a PDF for free on his site. Codex made some clear formatting errors in its first pass because I hadn't told it to validate its work. I had also tried to have it one-shot the whole conversion without splitting the task up by chapter.
After adding both of those constraints to my goal, it was able to create a largely readable EPUB for my Kindle.
Scott Cunningham's book is available on the Causal Mixtape website. Under the hood, it uses some kind of markup or typesetting system called Quarto. I had heard of Quarto. I don't really know what it is, and I don't really care.
Codex told me it discovered this and that it would make it much easier to produce a well-formatted EPUB. That was exactly right. The EPUB it came up with for Scott Cunningham's book was very nice, didn't really need further coaxing, and just worked quite well.
Lastly, I had Codex work on some of Raj Chetty's papers on teacher value-added. My results with these papers were more mixed. Some equations and inline math were formatted properly, while others were not.
Footnotes were actually formatted quite well, and the way they work on Kindle is in some sense superior to physical paper: you can click on a footnote and have it show up on the screen. However, in my one-shot goal approach, figures and tables were just totally missing from the paper.
I suspect this is a solvable problem, and it is a problem worth solving. Having well-formatted papers on my Kindle would be really useful.
The general approach I think I'll take is to have a staged sub-agent workflow: first extract all figures and tables, perhaps as images, before compiling the rest of the EPUB. Then, in my "prepare Kindle EPUB" skill, add a designated step where references to figures, equations, or tables link to the relevant figure, table, or equation image.
Last step: email it to yourself
In order to get a book onto a Kindle, you can send an email to <username>@kindle.com. I have Codex set up with a skill to send emails, so it can handle the email and attachment itself.
The real power of this comes when you're on the road. I have Codex mobile set up on my phone. So I can take my Kindle to a cafe for a focused reading session. If I want to get a new paper on my Kindle, I tell Codex from my phone to grab the paper and apply the EPUB conversion skill to it.
I've been using this more for articles I want to read than for academic papers, since I'm still fine-tuning the academic paper conversion skill.
Still, I'm pretty happy with the experiment. I expect it to bear fruit. Once I have a rock-solid skill created, you'll be the first to know about it.
Get the The AI Economist newsletter
How PhD economists are accelerating research with agentic tools, plus cutting-edge breakdowns of AI economics research
