AI in research

This page collects material on the use of generative and agentic AI in research, drawn from six months of using Claude Code in my own work in computational physics. It holds the slides from my talk on the subject, public versions of the agent skills I use for scientific writing, figures and visualisation, and notes on how to use these tools well and safely.

Talk: Generative and agentic AI for research

Chat-based AI tools such as ChatGPT answer a question and leave the researcher to run, debug and check the result. Agentic tools such as Claude Code work in a loop instead, planning a task, running code, inspecting the output and repeating until a stated goal is reached. This new capability means that many technical tasks in research can now be specified in plain language without being programmed by hand.

In this talk I describe what I have learned from six months of regular use of Claude Code in my own research in computational physics. The examples cover software development, simulation campaigns on local and national supercomputers, scientific figures, websites, grant applications and paper writing. Over this period code development has been around 100 times faster than before, and a single scoping prompt led to an automated study of more than 400 simulations. I also discuss how to use these tools well and safely: running the agent in a sandbox, recording workflows as reusable skills and standing instructions, planning complex tasks, and checking both that the agent did what was asked and that the result agrees with the physics. In the director model, researchers move from conducting research to directing it, coordinating research, writing and analysis tasks and then verifying and reviewing the results. I end with a short perspective on the wider consequences of accelerated research and technological development for scientific publishing and for individual researchers. The talk is aimed at researchers in any discipline and assumes no previous experience of agentic AI.

The slides are available here

Schematic of a femtosecond laser pulse creating a skyrmion in a ferromagnet/antiferromagnet bilayer, with spins drawn as coloured arrows

Schematic of laser-induced skyrmion formation in a ferromagnet/antiferromagnet bilayer, one of the examples from the talk. The scene was described in plain language, and the agent wrote and rendered it with POV-Ray.

Agent skills

A skill is a folder of plain-text instructions, reference notes and scripts that an agent loads when a task matches its description. Skills follow the open Agent Skills format, so they work in Claude Code and in other agents that support it. Writing a workflow down once as a skill means the agent follows the same conventions every time, and the know-how of a research group can be shared in the same way as code.

The three skills below are cleaned-up versions of the ones I use every day, released under the MIT licence and available on GitHub at richard-evans/research-skills. To install one in Claude Code, copy its folder into ~/.claude/skills/. The agent then uses it whenever a request matches, for example "make a figure of this hysteresis loop" or "tighten this abstract".

scientific-writing

Drafts and revises papers, letters, commentary pieces, referee responses and cover letters, with LaTeX output. It combines story-first structure, following Joshua Schimel's Writing Science, with the conventions of the target discipline and an optional personal voice profile. A profile records measured habits such as sentence length, the balance of active and passive voice and the choice of connecting words. It contains no text from the papers themselves. The skill includes a profile of my own writing, measured from 14 first-author papers, and a script to build a profile from your own papers. It also checks every draft for the habits that mark machine-generated prose.

figures

Produces publication-quality figures with gnuplot from simulation or experimental data, in journal or presentation styles with perceptually uniform colour schemes. Worked examples cover hysteresis loops, temperature-dependent magnetisation with a fitted curve, time series and 3D energy surfaces. The agent renders each figure, looks at the result and corrects problems such as clipped labels or overlapping legends before handing it back.

Plot of reduced magnetisation against temperature with simulated points and a fitted curve

Temperature-dependent magnetisation with a fitted Curie-Bloch curve, one of the worked examples in the figures skill.

scientific-visualisation

Builds diagrams of atoms, crystal structures and vector fields, and small concept icons for processes such as laser pulses, heating and currents, rendered with POV-Ray. Images have transparent backgrounds so that they can be dropped into papers, slides and grant applications.

How I use AI in research

The agent runs inside a virtual machine with its own tools, a limited set of SSH keys and a shared folder that is reachable only from my own computer. Every project is kept under version control, so that each change the agent makes can be reviewed and undone. Standing instructions in a CLAUDE.md file set lasting rules, such as which build options to use on each machine or which reference values to trust.

For anything larger than a small fix I start in plan mode and agree the plan before any code is written. The plan is where expertise has the largest effect, and asking the agent to question me about the task usually exposes decisions I had not yet made. Workflows that I repeat are written down as skills, so that the agent follows them in the same way each time.

Verification and validation remain my job. I check that the agent did what was asked by reading the changes and running tests with known answers, and that the result is correct by comparing with analytic limits, earlier calculations and experiment. However, agents also make mistakes that are easy to miss. They tend to agree with whatever hypothesis they are given, and will occasionally make a failing test pass by changing the test itself. They can also produce plausible references and numbers that do not exist, or delete files that they were not asked to touch. For this reason I ask the agent to criticise its own results, and I read any change to a test myself. Every reference is checked against the original source. Since the agent works in a sandbox and every project is backed up, a destructive mistake can always be undone.

Using AI responsibly

AI tools cannot be authors of a paper. Their use should be disclosed in the methods or acknowledgements, and the researcher remains responsible for every word, number and reference.

Someone else's manuscript or grant proposal should never be uploaded to an AI tool. UKRI policy does not allow assessors to put any part of an application into a generative AI tool, and most journals have similar rules for referees. Using AI to test your own paper or proposal before submission is a different matter.

Before any data are sent to an AI service, it is worth checking whether they will be used for training, how long they will be kept, and whether they are unpublished, commercially sensitive, export-controlled or personal. For this reason it is best to use only the tools approved by your institution, and to keep sensitive data local. The greatest risk arises when an agent can read private data, read untrusted content such as web pages, PDFs or email, and also send information out. Simon Willison calls this combination the lethal trifecta, since hidden instructions in a document can then make the agent leak data.

Getting started

The easiest way to start is with a tool that your institution has approved and a low-risk task, such as a plot or a script that you already understand. Version control should be in place from the first day, and complex tasks are best started in plan mode, with the agent asked to explain its work as it goes. Most importantly, no number produced by an agent should be trusted until it has been checked.

Updates