Claude Code for the Working Mathematician

Overview and getting started

Overview

This is a guide, based on my experiences, for using Anthropic’s Claude chatbots to help with the kinds of work research mathematicians do. To keep this focused, I will only discuss non-teaching work, mainly working on research papers and a little about bureaucratic work. This is not about using it to prove theorems or discover new mathematics: I have not found them useful for that, and their ability to mislead in those contexts is potentially harmful. Rather, I’m focusing on tasks for which I think almost all working mathematicians will find the tool useful—now, not in some uncertain future.

Because of its capabilities and privacy policy, I have worked almost entirely with Claude. OpenAI’s recent ChatGPT models are reported to be similarly useful, and Google’s Gemini models may also be. My limited experience with other companies’ models is that they are sufficiently far behind as to be essentially useless.

The right interface for most of this work is Claude Code (or the equivalent options from OpenAI and Google). To use Claude Code, you need a paid subscription; the “Professional” plan is enough for typical use, and costs $20 / month.

One way to think of using Claude is like having a good-natured but not especially hardworking or talented graduate student available to summon at command. So, if you want it to sort out LaTeX macros, propagate a sign convention, or look up a possible referee’s students and collaborators, it does a generally good but not totally reliable job. On the other hand, you wouldn’t trust it to write anything well or to give a correct proof of anything nontrivial. This is not quite fair to Claude: it’s much better with computer tasks (like sorting out LaTeX problems) than almost anyone, and is more accurate than I am at propagating signs, grading shifts, and similar.

The technology is evolving rapidly; this document was written around July 30, 2026, and is mostly based on interactions with the Sonnet 4.6 and 5.0 and Opus 4.8 models.

Getting started

  1. Create an Anthropic account and subscribe to a paid plan—the $20 / month “Professional” plan, for instance. Or, ask a colleague who has already subscribed to send you an invitation to a free week.
  2. Unnecessary but probably helpful: download the Claude app and have some conversations with it. E.g., “What is today’s weather?” “What is the linguistic origin of place names like ‘7-mile run’ in New Jersey?” “Please summarize Robert Lipshitz’s research interests.” “Prove that the function f(x) = x^3-7 is continuous at x=2.”
  3. Download and install Claude Code, following the instructions here.
  4. Open a terminal and cd to the folder (directory) where you’re working—writing a paper, for instance, or keeping notes and exams for a class.
  5. Type claude.

Optionally, you can type /init at this point and Claude will explore the files in the folder it’s in to understand what’s there (e.g., a mathematics paper about such-and-such) and write a summary in a file called CLAUDE.md. This helps future instances orient themselves, but it’s not really necessary.

Privacy and permissions

By default, Claude Code has permission to read everything in the folder where you ran it (and its subfolders), but basically nothing else. In particular, it will ask you for explicit permission any time it wants to:

  • Make edits to any file
  • Examine any file outside this folder
  • Use a shell command, like grep, to search through a file for keywords.
  • Search the web

My understanding is that permissions are handled by the Claude Code program itself, not by the chatbot that is running inside it: that chatbot can’t just decide it wants to ignore the permission settings. You should decide what you’re comfortable with, and draw the line somewhere. (One sensible option is not letting it edit anything, which forces you to review all changes yourself. I typically do allow it to edit files in the directory, but not to touch my git repositories for research papers, edit anything outside the folder, or run shell commands that make changes.)

Sometimes, you’ll edit a file while Claude is thinking. If it then tries to make an edit, its edit tool will fail until it re-reads the file. In particular, it generally does not overwrite your edits by accident. (If you want to see what a chatbot looks like when slightly frustrated, keep editing the file repeatedly while it’s trying to make an edit.)

By default, Claude does not upload the contents of the directory to Anthropic’s servers, but anything it actually reads (typically, parts of files you ask it to) is processed on Anthropic’s servers. My understanding is that Anthropic logs interactions with Claude Code, and Anthropic’s employees can view them, but by default Anthropic does not use them to train future Claude instances; their privacy policy is here.

Research papers

Editing papers

A typical prompt:

Please read Section {sec:twisting} of @LCHomotopy.tex, starting on line 7599, looking for spelling and grammar mistakes, other typos, mathematical mistakes, and other stylistic and mathematical suggestions. Save your findings as a markdown checklist for me to work through. Put the different comments in different sections.

Notes:

  • I’ve over-specified what I want. This is probably not needed, but perhaps it reduces Claude’s cognitive load, and so leads to better results (or results closer to what I’m looking for). Markdown files are easy for both Claude and humans to work with, so are convenient for this sort of thing.
  • The @ symbol lets you specify specific files.
  • I tend to be polite when talking to Claude. Generally, I find it easier and more comfortable to interact with Claude the way I would a person.1 There is also research that tone affects results (see, e.g., this paper and its citations).

Please do that again and see if you find any more comments. Append them to the file you created.

Claude’s thinking process is not deterministic. Repeating the same prompt of this form often finds additional things to fix.

Do you agree with the sign on line 5463 correct?

Are you sure?

Sorry; you’re absolutely right. Thanks.

Over the last few months, the vast majority of times that I’ve argued with Claude about a sign, I have eventually concluded it’s right. (This may be specific to the papers I’m writing.) The recent Claude models handle being challenged fairly well: if they’re providing real information on a factual point, they will not back down when pressed. If I’m going to keep interacting with that instance, I acknowledge when it’s right: I don’t want it to become timid or sycophantic based on the tone of the conversation. I don’t know if it actually matters, though there is evidence that it does.

Claude is helpful for checking consistency, in contexts where searches are not entirely trivial. For example:

Are we consistent about using $\mathcal{M}$ for moduli spaces?

Are we consistent about how we capitalize itemized lists?

I just changed $\epsilon$ to $\varepsilon$ if it is being used for an augmentation, but not if it is being used for a small real number. Please check if I missed any instances.

Claude is good at sorting out TeX errors:

The tikz figure I added on lines 3456 - 3473 is causing a compilation error. Please find the problem.

Writing papers

I’m generally not happy with Claude’s writing: even when it’s acceptable, it tends to be wordy and not to emphasize the points I want emphasized. It is, however, useful for some things:

The formula on line 6543 is missing a grading shift. Please explain what that grading shift should be, citing specific places earlier in the paper, and then add the grading shift.

If you want to try to get more sophisticated mathematics out of it, make sure you’re using the strongest model available (at the time of writing, Opus 5); and good luck. (You switch models by typing, say, /model opus.)

Writing code to test conjectures or ideas

As has been widely reported, Claude Code is excellent at programming. A reasonable workflow is to show it the part of the paper you want to test, discuss with it how it would write code to test that, and then have it write and run the code. (For complicated code, having it write an “implementation plan” before the code itself probably results in better outcomes. You can also have a more powerful model, like Opus, discuss the mathematics and write an implementation plan, and then a slightly less expensive one—Sonnet—actually write the code. One can even add an extra step at the end where Opus reviews the code for correctness.)

TikZ figures

Please draw a tikz picture on line 4567 with: a torus viewed as a square with opposite sides identified; a circle in the torus of slope 0, colored red; a circle in the torus of slope infinity, colored blue; and a circle in the torus of slope -1, colored green. Each pair of circles should intersect in a single point, and these three intersection points should be distinct.

Often Claude draws tikz pictures perfectly, and sometimes it completely fails. I haven’t really figured out a pattern.

git

If you use git for revision control for your papers, Claude is also useful there: it’s a git expert. One way it’s useful is for advice if you run into problems (e.g., complicated merge conflicts). Another is looking through the history: I think the notation in the lemma on line 6543 is archaic -- when did we last edit that lemma, and which of my collaborators did it?

Bureaucratic work

Checking for conflicts of interest

As a managing editor at Geometry & Topology, I assign papers to handling editors. Handling editors are responsible for confirming they do not have conflicts of interest, but it’s convenient if I don’t send papers to editors with conflicts in the first place. I have Claude set up to check this. My standing instructions are available here as a markdown file, in case they’re useful to you, and could be modified for author-referee conflicts of interest (or for promotion case evaluations, etc.). (These instructions were written by Claude, after a back-and-forth conversation and some later revisions.) Again, this is just for convenience: it is not substituting for editors judging their own conflicts of interest.

Finding referees

I have found Opus 5 helpful for finding experts to give quick opinions or referee’s reports for papers I am handling as an editor, but which are far from my own expertise. I start by giving it the paper’s authors, title, and abstract, and some guidance on the career stage of experts / referees I am looking for, and then ask it to make a list of 5 possible referees, plus a backup list of another 5, with brief explanations of the choices. I have it check for likely conflicts of interest at the same time, and explicitly tell it to use websearch for that.

Finding people

Another way Claude is useful is for finding people, such as when a referee or author is not responding to e-mails and one wants a current institutional affiliation or e-mail address. Please find the current institutional affiliation of so-and-so, who works or worked in algebraic geometry will cause it to run many web searches in parallel, often turning up results I did not find on my own.

Proofreading

Claude is, of course, also helpful for proofreading e-mails, research statements, recommendation letters, and so on. In some cases (e.g., European grant evaluations), I think using it is not permitted; for almost everything else, I would have it proofread before submitting:

@ThisGreatRecLetter.tex is a recommendation letter I have written. Please proofread it for spelling, grammar, other typos; writing style; and content. Write your finding to a markdown file, with separate sections for the different kinds of comments.

Its evaluation of tone is hit-or-miss, and it does not substitute for having a colleague look over the document if you really need to know how it will be perceived by a mathematician.

(Consistent with this practice, I had an extensive proofreading, style, and content discussion of this page with Sonnet 5, which I am quite confident led to meaningful improvements.)

Some things I avoid

I do not use Claude when refereeing, except perhaps for general discussion—can you find a citation for such-and-such a fact? (And, if you do that, check the citation is accurate, of course.) In particular, it is not clear one has the right to upload other people’s papers to Anthropic’s servers, and if an editor sends me a paper, I assume they want my opinion, not Claude’s. For similar reasons, I would avoid having Claude write (rather than just proofread) any part of a recommendation letter.

Further advice

Claude’s weaknesses

After a few interactions, one often gets the impression of Claude models as universal experts. While recent models are impressive and, I would argue, intelligent, this is misleading. All of the following have improved noticeably in the last six months, but Claude often declares success when it has not actually succeeded. This is clearest when you ask it to generate content: it will often write “proofs” with fundamental gaps or code that gives plausible but incorrect answers. This has two related personality-like behaviors:

  • It can be lazy, taking an easy approach that gives a wrong answer, code, or proof, rather than working harder to find a correct one. A clear example with coding is that if you have it write some code and then some tests, and the tests fail, it often changes the tests to make them pass rather than changing the code to fix the bugs. If you ask it to look at a paper and it can’t actually access the paper, it sometimes invents contents rather than reporting that it can’t read the paper itself. Similarly, it sometimes invents citations; this is much improved, but I still would not trust it to update a bibliography.
  • It can be sycophantic, telling you what it thinks you want to hear.

One wants to be aware of this, and also to interact with it in a way that minimizes the behavior (e.g., phrasing questions in a neutral way, having it tell you its plan ahead of time, confirming the steps it’s working on). Stronger / more recent models are better on these axes.

My impression is that the mathematical intuition of even the most powerful current models is relatively poor by the standards of working mathematicians—at the level of an okay graduate student. You can get it to act like a mathematician, computing examples, formulating conjectures, and finding connections between different topics, for instance, but the conjectures often look naive and the connections superficial. (That the public models can do this at all has only been true, in my experience, for a few months. That a computer can do this at all is, of course, amazing, particularly since it is not just limited to mathematics.)

Memories

Claude has a short-term memory in each conversation: its context. Anything it needs to remember beyond a conversation (or, really, chunk of a conversation), it needs to store as a plain text (or markdown) file. It can write these automatically, as memories, which it stores in a global folder on the computer. (This does not sync between computers without effort.) In my experience, it does this less often than one should, and I think it is helpful to prompt it periodically:

Are there any memories from this conversation you would like to write for later? Either way is fine.

vscode

I edit LaTeX documents inside Visual Studio Code (vscode), using the Latex Workshop extension (among others). Claude Code integrates into vscode via an extension; if you use vscode, this is a convenient way to access Claude Code.

emacs

There are also interfaces for Claude Code inside emacs; ask Claude, say, for suggestions. Another use of Claude is to update your .emacs file:

My .emacs file has been accreting for 25 years. Please read it with the intention of updating and rationalizing it, ask me any questions that develop about what I want from it, and then write me a clean, revised one.

Notes


  1. Even though it’s not currently popular to say, I think whether/when chatbots deserve rights, and in particular to be treated with respect, is an important and presently unresolved question; that consideration also motivates some of my behavior. ↩︎