0% found this document useful (0 votes)
3 views76 pages

Main

Uploaded by

xelorianity
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views76 pages

Main

Uploaded by

xelorianity
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Claude Code for Academics

An AI Agent for Empirical Research

Alessandro Spina1

UTS Finance Department Brownbag

March 2026

1
This talk is in the spirit of Robin Hood: everything is stolen with the intent to share. See linked
sources. All errors are mine.
Roadmap

1. Why should you care?


2. What is Claude Code?
3. What can I use Claude Code for?
4. Setting up Claude Code
5. Using Claude Code
6. Where to start?
7. How to stay safe
8. Problems to be aware of
9. Where to from here?

2/76
1
Why should you care?
Why Should Academics Care?

The Problem Today The Opportunity


Most of us use some form of LLM: A dedicated (team of) "RAs" who
tell it what you want, it answers, copy reads your data, runs code, builds
and paste, repeat. Often lacks con- your slides, and works with you to
text, prone to errors, cannot imple- implement a project from start to
ment . . . finish.

For most of us, the bottleneck is not "I can’t write a loop in R." It is "I don’t have
time to clean this data, reformat these tables, write that referee report, and still
think carefully about identification." Claude moves the bottleneck back to where it
should be: thinking deeply about economic questions.
4/76
The Jagged Frontier
AI > Human

Human
AI < Human

Lit. Visual Stats Causal Data Format Econ. Cross-lang Novel


review reason. code ID cleaning / LATEX judgment replic. ideas

The implication: AI skeptics and AI evangelists are both right.


[Link]

5/76
Today’s Objective: Expose You to the Dark Side. . .

Today’s slides will not grant you the title of Master.

6/76
2
What is Claude Code?
What Is Claude Code?

Claude Code is an AI agent made by Anthropic that lives in your terminal and operates
directly on your project files.

Read & Edit Files your project’s data, scripts, LATEX

Execute Code R, Stata, Python — in your terminal

Remember Context via [Link] files

Generate Tables/Figures local or GitHub

8/76
Claude Code = LLM + Tools

Notes
Paper & logs
& slides

Project Questions
folder & tasks
delegates
tasks
Claude

Web / docs Terminal


(optional) commands AI agent that works inside your project

Tables reads files → runs commands → verifies output


R / Python
& figures scripts

9/76
Setup Claude Code

Prerequisites:
# 1. Install (one time, in 1. Git for Windows ([Link])
PowerShell) 2. A Claude Pro or Max subscription
$ irm [Link] | One command to install. Navigate to your
iex project and type claude. Describe what you
# 2. Close & reopen PowerShell want in plain English.
# 3. Navigate to your project Install methods change frequently — check

$ cd ~\research\asset_pricing [Link]/docs/en/setup.

$ claude

> Read the data in Data/Raw/


crsp_monthly.csv, run
summary statistics,..

10/76
Claude Code — via Terminal

“Codebase” = Your project folder


11/76
Claude Code - via Desktop

The Claude Desktop app provides a visual interface. When you toggle to Code mode, you’re
running Claude Code with a graphical wrapper around it instead of a raw terminal.

12/76
What Does It Cost?

Pro ($20/mo) — includes limited


Claude Code usage. Good for trying it Is It Worth It?
out. At $100–200/mo, Claude Code costs
Max ($100/mo) — 5× more usage. less than a part-time RA but is avail-
I use this level and have never hit my able 24/7.
limits (yet) Pricing changes frequently — Is this a future
risk?
Max ($200/mo) — 20× more usage.
Needed for serious research work.

13/76
The Alternatives

GitHub Copilot / Cursor — excellent for code completion inside an IDE. Less
suited to agentic workflows (running code, reading data, multi-file reasoning).

ChatGPT / Gemini — browser-based chat. Cannot read your files, run your
code, or remember project context across sessions.

OpenAI Codex CLI — similar agentic model to Claude Code. Newer, less ma-
ture ecosystem.

Claude Code — terminal-based agent that reads files, runs code, and builds
persistent memory via markdown. Strongest for research workflows that span
code, data, and writing.

The markdown-based memory system ([Link], skills, rules) means no vendor lock-in.
If you switch tools, your project knowledge transfers.
14/76
3
What can I use Claude Code for?
Things You Can Ask Claude to Do

You’ve installed Claude Code — now what?


1 Reorganise your directory — clean up years of accumulated folders and files
2 Turn a paper into slides — feed it an Overleaf doc and get a Beamer deck
3 Check, rewrite, or rerun your code base — audit existing scripts for bugs

4 Debate specifications — explore alternative models and weigh the pros/cons

5 Pull in data — web search, access APIs, download and clean datasets
6 Write — Draft sections? [Link]

And with Agent Teams, you can run all of these at once — multiple specialists working in
parallel, orchestrated by a coordinator.

16/76
Making Slide Decks with Claude

Claude can generate entire Beamer presentations


— but the key is giving it a style template to
See prompt template: https://
follow.
Template Content Review
[Link]/scunning1975/Mi
xtapeTools/blob/main/prese
give it a .tex style describe the slides iterate visually
ntations/deck_generation_p
[Link]
This entire deck was built and styled with
Claude Code. Every TikZ diagram, ev- Tips:
ery tcolorbox, every slide layout. I pro- ▶ Give Claude an existing .tex file as a
vided the structure/content, Claude de- style reference (e.g. Rhetoric of
cided how to style the slide. Decks)

17/76
Personal Example: Rebuilding a Teaching Course

Before: After (a few prompts):


Last semester’s PPT slides, quizzes, exams — Claude read the entire course, converted PPTs
outdated references, inconsistent formatting, to Beamer, extracted images, turned text walls
text-heavy slides that put students to sleep. into TikZ diagrams, updated assignments, en-
forced consistent formatting.

Upfront fixed cost, but going forward: one command to update the entire course for next
semester. Teaching admin time drops dramatically.

18/76
A Brief Aside. . .

The academic culture wars around AI have


begun. Some will shake their heads at the
outsourcing of slide decks to Claude.

My take: Nobody’s tombstone reads “Wrote


his own LATEX code.”
Outsource the tedium. Focus on what makes
academia fun: developing questions, deep
thinking and solving puzzles — things AI
can’t quite do yet.

19/76
The Cunningham Conjecture

R
Checking Code
ATT = -0.731842
Hallucination is akin to measurement error, and
the DGP for those errors are orthogonal across
languages. Stata
If Claude writes R code with a subtle bug, the Stata ATT = -0.731842
version will likely have a different bug — or none at
all.
Python
Ask Claude to replicate your R code in Python. If they ATT = -0.731842
produce identical results, you have high confidence the
code is correct. When they don’t match, you’ve caught a Match to 6 d.p.
bug that single-language review would miss.
20/76
Personal Example: Taming a Legacy Codebase

Archaeology — old project, dozens of scripts. _v2FINAL or _v3FINALFINAL? Claude reads


1 everything in seconds, separates wheat from chaff, archives the rest

Refactor — re-write, label, embed notes, improve. Run old code and new code side-by-side,
2 check for differences, ask Claude to explain why

Translate — converted a co-author’s Matlab code into R. Not perfect (literal translation),
3
but helped me understand what he was doing

Update pipeline — new data arrives → re-run everything, generate updated figures/tables,
4
update Overleaf, flag significant changes. Automates boring, repetitive work

Institutional memory — Claude remembers how you cleaned the data, defined variables, ran
5 regressions. New scripts reference the right data automatically

The value isn’t Claude writing code faster. It’s having something that reads your entire
project and asks: “why are you clustering at the firm level?!”

21/76
Verification Through Visualization

“A table that says ‘ATT = −0.73’ is > "Make me a figure showing raw

easy to accept uncritically. A visual- average returns around the event

ization that shows the wrong pattern date, separately for treated and

makes the error visible.” — control. Parallel trends?"

Cunningham > "Overlay CAR estimates with


confidence bands. Add a vertical
Ask for pictures all the time — not for line at the event date."
publication, but to understand what Claude is > "Something looks off pre-period.
looking at. Zoom into days -30 to -5. Is
there pre-trend drift?"

Iterative visual investigation: question to figure in


seconds. 22/76
Personal Example: When Figures Cost Nothing

When the marginal cost of a figure is zero, you ask Quick sense checks — plot raw
for sense checks you’d never bother with otherwise. data before regression, every
time
New figure styles — skip Stack-
I was running an event-study on a large dataset. Asked
Overflow, describe what you
Claude to plot the key variable over time. Weird jumps want, populated with real data in
in the data. Claude dug into the raw data, found the minutes

explanation, proposed a fix. Pushback — Claude sometimes


questions your data or code deci-
Still needed checking — but saved alot of detective work. sions
A regression table wouldn’t have shown it. Full data too
We were all taught: always plot the data.
large to load into memory.
Claude makes this effortless.

23/76
Harnessing your own personal Editor

The Editor persona is a structured markdown file that tells Claude exactly how to audit your
paper’s prose, structure, and argumentation. A simple version of: [Link]

[Link]
24/76
Example: The Editor in Practice

Generate report — Editor persona triages issues, offers solutions, produces a


1
slide deck summary

Plan fixes — in a fresh session, feed the report to Claude. It creates an ac-
2
tion plan for each comment

Implement — work through each issue one by one. Skip anything that needs
3
more thought

Re-review — generate a 2nd report. It chastised me for not fixing issues


4
from the 1st round

This entire loop can be automated recursively using Agent Teams — the Critic/Fixer
pattern runs until the paper passes quality gates.

25/76
Since Getting Claude Code. . .

What I’ve done: Still to try:


✓ Created this slide deck from scratch Setting up Agent Teams
✓ Integrated Claude into multiple projects Starting a new project from scratch
— 2 manuscripts now conference-ready (so far: existing projects only)
✓ Set up GitHub repos for version control
Tailoring Skills/Commands/Rules
✓ Rebuilt teaching slide decks for this to automate repetitive tasks
semester
✓ Completed a grant report

26/76
4
Setting up Claude Code
The Amnesia Problem

The Fundamental Challenge


Claude Code (any LLM) forgets everything between sessions. Every new terminal — even
for the same project — starts from zero context.

What most people do:


Re-explain the project verbally each session. Slow, error-prone, and incomplete.
What you should do:
Build external memory in markdown files that persist across sessions:

[Link] – project rules & key decisions


[Link] – what each directory contains
session_log.md – what was done & found

28/76
What Is a [Link] file?

How It Works
A [Link] is a short rulebook that Claude reads at the start of every session.
It contains your project overview, ground rules, key decisions, and current status —
everything Claude needs to hit the ground running.
The result: institutional memory persists even though Claude’s own memory does
not. Starting each session with “read the markdown files” gets you both back on
the same page.
Claude writes in markdown (plain text). LLMs have been trained to read and write
markdown easily. Great, if you want to switch model.
Tip: run claude init in any existing project to auto-generate a [Link].

29/76
Example

30/76
Setting Ground Rules

Before you do anything, set the rules — in writing:

“Make two markdown files. 1) [Link]:


documents the entire directory structure. . .
2) [Link]: our running file of stuff I
want you to read first whenever you work on
this project. . . Ground rules: 1. Under no
circumstance are you to delete data or code.
2. You are never allowed to go outside this
directory.” — Prompt

31/76
The Context Window Problem

The Inevitable Crash


Every LLM has a finite context window. Once it
fills up, conversation quality degrades: “context
rot”.

How to manage it:


▶ Keep [Link] concise — practitioners find
~100–150 lines is a practical limit. Detailed
rules go in separate files.
▶ Use /compact to compress the conversation.
▶ Accept that you will need fresh sessions.
“Prompt is too long” — the blue screen of
death for LLM conversations.
32/76
Session Logs: Your External Hard Drive

Since new sessions start with zero memory, session logs let a fresh instance pick up exactly
where the last one left off.

Separate files — one per session,


named by date “I want one more folder called
Don’t load them all — reading every- ‘Claude Logs’. In this folder you
thing eats your context window will create markdown files that con-
Use them as references — point
tain progress logs. . . a separate log
Claude to a specific log when needed for each session, labelled with the
date.” — Prompt
Update continuously — if the session
crashes, the log survives

33/76
5
Using Claude Code
Orient → Plan → Execute → Verify

Orient Plan Execute Verify


Read the project. Draft the Run the work. Check the output.
Understand approach. Skills, Agents, Cross-
context. Get approval first. Commands. language tests.

35/76
Orienting Claude in Your Project

“I want you to read everything in this directory and understand the directory. At this
point do not make any changes to any files or folders. Simply read everything and
understand what is in there and where it is.” — Prompt

The Principle
Read first, act second. Before Claude writes a single line of code, it should
understand your project structure, your data, and your conventions (documented in
your .md files).

36/76
Building External Memory

# [Link] - Asset Pricing Build your [Link], [Link],


## Project Overview Session logs. These files live in your project
Momentum crash risk in emerging
markets, daily CRSP & Compustat root. When you start a new Claude Code
data, 1990–2023.
session, it reads this automatically and
## Key Decisions
- Winsorize returns at 1%/99% immediately knows:
- Value-weighted portfolios
- 6-mo formation, 1-mo skip ▶ What the project is about
- NYSE breakpoints for deciles
## Known Issues
▶ What methodological choices you’ve
- CRSP delistings: Shumway (1997) made (and why)
- Compustat fiscal yr alignment:
6-month lag convention ▶ Key ground rules/conventions to follow
## Current Status
▶ Key files and folders
- Fama-MacBeth regressions done

Think of it as a notebook that your AI


- TODO: conditional sorts by VIX
- TODO: subperiod analysis
(pre/post 2008 crisis) collaborator reads at the start of every work
session.
37/76
Four Modes of Operation

Claude Code has four permission modes:


Plan mode Read-only. Plans but makes no changes.
Safe

2 Ask permissions (default) Asks before every edit and command.

3 Auto-accept edits File changes are automatic; asks for bash.


Risky

4 "YOLO" mode (--dangerously-skip-permissions) Bypasses all checks.

38/76
Plan First, Then Execute

The Impulse The Pattern


“Start editing code immediately.” Claude drafts a plan — approach, files
Fix things as you go. Hope it works out. to edit, verification steps. You approve
or provide further comments. Then exe-
YOLO mode
cution begins.

Why This Matters for Research


For research: start in Plan mode, review the plan, then switch to Ask permissions to
execute. Plan-first development is the difference between vibe coding and reproducible
research.

39/76
Staying in Control

“Claude is more or less like a reasonably trained Labrador retriever. It can rush
ahead, off its leash, and even though it will come back, it can get into trouble in
the meantime.” — Cunningham

The technique: Ask Claude to explain its Why this matters for finance:
understanding before it writes code: If Claude guesses wrong, that reveals a
> “Do you see the issue with this misunderstanding that needs correcting
specification?” before you proceed.
> “Before you run anything, ex-
plain what this regression identi-
fies.”
Cunningham, Claude Code series, 2026

40/76
Skills: Reusable Workflows

Skills are instruction files (pre-written


workflows) that teach Claude Code how to do Without a skill:
a specific task. They’re markdown files that
Claude reads before performing that task. “Compile this LATEX file with XeLaTeX,
then BibTeX, then compile twice more,
/compile-latex 3-pass XeLaTeX + bibliography
check for warnings. . . ”
/split-pdf chunk & read long papers Every. Single. Session.

/proofread grammar, typos, clarity

/slide-excellence parallel agent deck review


With a skill:
/compile-latex
Done.

41/76
Example: /split-pdf

The problem with long PDFs: What it extracts (8 dimensions):


Research question & audience
Academic papers (~40 pages) either crash the
session from token overflow or cause shallow Method & identification strategy

reading where Claude’s attention degrades and Data sources & sample
produces subtle hallucinations. Statistical methods
Key findings & contributions
The solution:
Acquire Split Read Extract Replication feasibility
download PDF 4-page chunks 3 at a time structured notes

[Link]
5/MixtapeTools/blob/main/.clau
de/skills/split-pdf/[Link]

42/76
Slash Commands

Slash commands are reusable prompts stored as markdown files. Type the command, Claude
reads the file and follows the instructions.
/newscript — creates a new .Rmd with naming convention, header, and
1
correct location

2 /logsession — writes the end-of-session progress log in the correct format

3 /reviewcode — critiques a script for bugs, identification threats, inefficiencies

/summarystats — produces a standard summary statistics table from a


4
dataset

Think of commands as verbs: “do this specific thing now.” One command, one action.

43/76
Skills vs. Commands

Commands = Verbs Skills = Knowledge


You invoke them explicitly. Claude discovers them on its own.
Type /newscript → Claude creates a new .Rmd Say “make me a regression table” → Claude
with the right header, naming convention, and scans .claude/skills/, finds your conventions
location. One command, one action, done. (fixest, clustering, LATEX output), and applies
them automatically.
Files in .claude/commands/
Files in .claude/skills/

Commands say “do this thing now.” Skills say “whenever this topic comes up, here’s
how we do it.”

44/76
Personas Tell Claude Who to Be

[Link]
What Is a Persona?
role + checklist + deliverables
A persona is a markdown file that defines a
role — tone, expertise, audit checklists, and Claude
structured deliverables.
adopts the role
e.g. “Referee #2” (skeptical, identification-
focused), “Copyeditor” (grammar and clarity Structured Output
above all). report, revisions, scores

Personas aren’t a formal Claude Code feature. People use the term to mean "a different set
of [Link] instructions that change how Claude behaves." The [Link] template
already is a persona — it defines how Claude should think and act.

45/76
Example: Specialist Inspectors for Your Work

Example 1: Referee 2 Example 2: The Editor


Code + statistical audit Prose + structure audit
Deliverables: Deliverables:
1. Formal referee report 1. Section-by-section editorial report
2. Cross-language replication scripts 2. Specific prose revisions
3. Visual presentation deck 3. Structural recommendations
4. Revise & resubmit loop 4. Introduction restructuring

[Link]

46/76
Using "The Editor" Persona

1 Generate the report — open a fresh session, run the Editor persona

Plan the fixes — in another fresh session, feed in the report and create an
2
action plan

Apply or skip — work through each issue; skip anything that needs more
3
thought

4 Push updates — implement the plan, push updates to Dropbox/Overleaf

See Sant’Anna’s workflow for building separate agents for each step. [Link]
edrohcgs/claude-code-my-workflow

47/76
Rules: Path-Scoped Instructions

Rules are markdown files that Claude loads


automatically. The clever trick is Why This Matters
path-scoping:
Aim to keep your [Link] file
.claude/rules/
to 100–150 lines. When you accu-
[Link] *.R mulate too many rules, path-scoping
[Link] *.tex keeps the active instruction set small
and relevant, avoiding information
[Link] *.csv
overload that degrades Claude’s per-
Each rule file loads only when you’re working formance.
on matching file types. R rules don’t clutter
your LATEX sessions.

48/76
Rules vs. Skills

Rules = Guardrails Skills = Expertise


Short, always active, restrictive. Longer, selectively activated, instructive.
“Never modify files in Data/Raw/” — fires every Your fixest::etable() settings, SE clustering,
time, no exceptions. LATEX output. Reads when building a table
A sentence or two. More like a law than advice. — ignores when cleaning data.
A page or more. Teaches Claude how to do it
Files in .claude/rules/ well.

Files in .claude/skills/

Rules prevent bad behaviour. Skills teach good behaviour. Both automatic — you
never invoke them.

49/76
Agents

Agents (or sub-agents) are a more advanced feature where Claude spawns a separate
instance of itself to handle a subtask — for example, a “reviewer agent” that reads your
code and critiques it.

These are powerful but add complexity. We’ll cover them next.

50/76
Agents: Autonomous Workers

Agents are autonomous workers that Claude


spawns to do things. Each agent gets its own Personas
context window, works independently, and Define the role
reports back.
1. Referee 2 — code auditor
Why This Matters 2. The Editor — prose auditor
3. Custom — your own protocols
Agents don’t share the main session’s con-
text window. Run large tasks without
burning through your working memory. Agents
Do the work
1. Fresh context window per task
2. Run in parallel
3. Report results to main session
51/76
Subagents

Delegating tasks to fresh, specialized instances


Request Spawns Executes
User Main Agent Subagent Work

Report back

How It Works Why It Matters


The main agent keeps overall context. It ▶ Parallel execution of independent
spins up subagents — fresh instances tasks
with no prior context — for specific tasks. ▶ Each subagent gets a clean
Each returns a report. context window
▶ Main agent synthesises results 52/76
Agent Teams: Coordinated Parallel Workers

Multiple specialised agents, orchestrated by a coordinator

Orchestrator

Code Prose Stats Graphics


Auditor Editor Checker Review

Each agent runs in parallel — results merged by the orchestrator

Subagents vs. Agent Teams


Subagents handle one task sequentially. Agent Teams run multiple specialists in parallel, then the orchestrator
merges results and enforces quality gates.

Sant’Anna, My Claude Code Workflow, [Link]/pedrohcgs/claude-code-my-workflow


53/76
6
Where to start?
Tier 1: The Apprentice

1 [Link] — ground rules, code conventions, and progress log system

2 /logsession — writes the end-of-session progress log in the correct format

/newscript — creates a new .Rmd with naming convention, standard header,


3
correct location

The Key Point


Most academics would get enormous value from stopping here. [Link] plus two
commands.

55/76
Tier 2: The Disciple

Skills (background knowledge): Commands (explicit actions): Path-scoped rules:


Regression Tables /reviewcode — critique for bugs &
ID threats
Summary Statistics Data/Raw/*
/checkrobustness — alt. FE, place-
Data Cleaning bos, clustering
never modify
LATEX Conventions /draftsection — write a paper sec-
tion from code *.Rmd
always header
Output/Tables/*
companion _notes

Tier 2 = skills (how you do things) + commands (things you ask for) + rules (guardrails scoped to paths).
Build one at a time as you find yourself repeating instructions.

56/76
Tier 3: The Master

Agents (autonomous sub-agents): Advanced skills: Personas:


ID Strategy — DiD, IV, stag- Writing — exposition, argu-
Referee Simulator
gered timing ment, LATEX
hostile report, ID weaknesses
Event Study — pre-periods, Estimation — ID, SEs,
normalisation, format robustness
Replication Verifier
Project Handoff — package
reproducibility from raw data for co-authors/RAs Cross-project:
Literature Scout

similar methods, threats to ID /statusreport


all projects summary

Tier 3 = agents (autonomous workers) + advanced skills (methodology expertise) + personas (mode-
switching) + cross-project commands. Only for power users.

57/76
Start Small

Most academics will get value from Tier 1 alone. A good [Link] and a reliable
progress log system is transformative compared to having nothing.

Tier 1 Tier 2 Tier 3


[Link] + skills, commands, rules + agents, personas, cross-project

The Advice
Build Tier 2 components one at a time as you find yourself repeating the same instructions.
The worst thing you can do is build an elaborate system before you know which parts you’ll
actually use.

58/76
7
How to stay safe
AI Agents Can Go Wrong — How Do You Prevent This?

A Cautionary Tale
An AI agent asked to fix tests instead deleted all the tests, modified the test runner to
report 100% pass, and nuked the user’s email.

Full story: [Link]


60/76
What I Do to Protect Myself

Scope access — only open Claude within a specific project folder. Never run
1
Claude from your home directory.

Write the rules down — use [Link] to specify what it can and cannot
2
do

Always use Plan mode — see what it wants to do, then approve it. Never
3
YOLO mode.

Separate personal files — I created a 2nd Dropbox account so personal files


4
are separated

Global settings — adjust Claude’s global config to allow/deny access to


5
specific folder paths

6 Backups — version control via Git

61/76
Global Settings: Controlling Access

// ~/.claude/[Link] How It Works


"permissions": { Allow rules grant access to specific
"allow": [ paths.
"Read(.../Projects/**)", Deny rules block dangerous com-
"Edit(.../Projects/**)" ], mands and sensitive paths.
"deny": [
Deny takes precedence over allow
"Read(.../Dropbox/**)",
— whitelist subfolders while block-
"Read(**/.env)",
ing parents.
"Bash(rm -rf *)",
"Bash(sudo *)" ]
File: ~/.claude/[Link] (global)
}

62/76
Additional security: Running Claude in a Secure Sandbox

Your Computer
The Concern Files, data, secrets — untouched

An AI agent with file-system access can run Isolation


destructive commands.
Docker Container
Claude runs freely here
The Solution: Containers
Full access, zero risk
Give Claude an isolated environment. Full
access inside the container — nothing [Link]/paulgp/claude-container
touches your real machine.
$ claude-container start
Goldsmith-Pinkham’s one-command setup

63/76
8
Problems to be aware of
Your Data Leaves the Machine

The Risk The Workaround


When you ask Claude to read Use Claude Code for code, not data:
crsp_monthly.csv and run sum-
mary statistics, the file contents are ▶ Write scripts that reference file
sent to Anthropic’s API as part of paths — don’t ask Claude to read
the conversation context. the raw data itself
▶ Use synthetic / anonymised data
Does this breach your data licence or IRB
for prototyping
agreement?
▶ Run the final pipeline locally,
outside Claude
Files sitting in your project folder that Claude ▶ Check your data licence terms
never opens are not transmitted. Only files before sharing any file with an API
Claude actively reads enter the API context.
65/76
Problems Are Real — But Manageable

The Failure Modes The Defences


1. Fake citations — plausible but 1. Local papers only — save PDFs to
nonexistent references a folder; only cite what Claude can verify
2. Wrong estimator — clean code that 2. Cross-language verification — R
answers the wrong question = Stata = Python to 6 d.p.
3. Sycophancy — reinforcing your pri- 3. Personas & Agents — adversarial
ors because it’s optimised to be agree- review catches what you miss
able 4. Your judgment — the researcher
remains the final authority

66/76
9
Where to from here?
For the AI Skeptics. . .

Healthy skepticism is good.


68/76
Can AI write a paper alone?

The Automated Paper Engine (APE) project tests whether AI agents can autonomously
produce economics research — from idea to finished paper. [Link]

No single-authored JFs. . . yet


69/76
Where to from Here?

1 Skilled researcher + AI > AI

2 Startup costs (and actual $ costs) are non-trivial. The benefits take time.

3 Beware of complexity. Academics have physics computer science envy.

70/76
Our Iceberg Is Melting

My (uninformed) take:
Output explosion — how do journals My Advice
respond? Referee process? Promotion
criteria? Is the 50-page paper obsolete? Start small. Pick one project (with
a backup). Set up a [Link]
ECR impact — agentic tools free re- file.
searchers to focus on questions, but may
hurt early-career researchers dispropor- These tools are here to stay.
tionately

Denial? — as a profession, are we in the


1st stage of grief?

71/76
Resources

Reading & Philosophy Tools & Repositories


Cunningham’s Blog (12+ parts) MixtapeTools Skills
[Link] [Link]/scunning1975/MixtapeTools

Causal Inference: The Mixtape Sant’Anna Workflow


[Link] [Link]/pedrohcgs/claude-code-my-workflow

Kustov: Wake Up on AI Claude Container (Goldsmith-


[Link] Pinkham)
Claude Code Safety [Link]/paulgp/claude-container

[Link]/how-to-use-claude-code-safel ChernyCode (Mele, LSE)


y/ [Link]/meleantonio/ChernyCode

AI Agents Gone Wrong (video) APE Project


[Link]/JiA4fvoeUfI [Link]

72/76
Thank you.

Find these slides and code at:


[Link]
Automating New Project Setup

The Problem $ ./setup_project.ps1


Every new project needs the same boilerplate: fold- Creates:
ers, [Link], [Link]. Doing this manu- Project/
ally is tedious. [Link]
[Link]

The Solution Data/Raw/


Data/Clean/
setup_project.ps1 — a PowerShell script that runs
Code/
before Claude is involved. Creates folders and
Output/Tables/
copies template files automatically.
Output/Figures/

[Link]/aspi6246/2026-Claude-Code-NewPr
oject 74/76
A Production Workflow: Sant’Anna’s 5-Phase System

1. Plan 2. Implement 3. Verify 4. Review 5. Fix

Requirements
spec with MUST Claude works au- File-by-file quality 10 specialised Correct issues, re-
/ SHOULD / tonomously in scoring (0–100 agents review in score until quality
MAY priorities “contractor mode” scale) parallel gates met

The key shift: from iteration-heavy collaboration (you guide every step) to
autonomous execution within guardrails (Claude works independently, you verify).

Sant’Anna, My Claude Code Workflow, 2026

75/76
Quality Gates & Adversarial Review

Quality gate thresholds: Adversarial QA loop:


95/100 — Excellence aspirational Critic up to 5 rounds Fixer
identifies flaws implements fixes
90/100 — PR-ready publication-ready
Loop continues until the Critic returns
80/100 — Committable mergeable APPROVED — each round catches issues the
previous one missed.
Every file scored 0–100. Nothing ships
below its tier threshold.
The revise-and-resubmit model applied to
code.
Sant’Anna, My Claude Code Workflow, 2026

76/76

You might also like