Using Claude Code for Economic Research

Setup, pitfalls, and practical advice for VS Code

Periklis Daflos

2026-03-18

Disclaimer

AI tooling is a rapidly evolving field. The information in this presentation may become outdated within days. Always check the official documentation for the latest updates.

LLM Capabilities have improved dramatically over the past year…

Capabilities of LLMs over time (source: METR Long Tasks)

… even more so for local AI agents

Coding a full game with a few prompts

Consulting for a company

But what are local AI agents?

  • Most people have interacted with LLMs through chatbots (ChatGPT, Claude, Gemini, etc.)
  • But LLMs are way more capable when they have more context to work with
    • Not just your initial prompt but also, e.g., your files, project structure, terminal output, and git history
  • Solution: Integrate AI agents locally, either in your terminal or your editor (e.g., VSCode)
    • These agents can read and write your local files, speeding up your workflows
    • 2025 saw the introduction of several such agents mostly for coding (Cursor, Claude Code, Codex, etc.) but also for other tasks (e.g., Claude Cowork)
  • This presentation focuses on integrating Claude Code within VSCode, the most intuitive option for users without extensive coding experience
    • NB: OpenAI’s Codex offers a similar experience and comparable capabilities

Using Claude Code within VSCode

Installation

  1. Create a Claude/Anthropic account
    • Claude Code is a paid feature of Claude. The lowest tier (~21€) is enough to start. If you hit limits, supplement with OpenAI’s cheapest tier instead of upgrading
  2. Install VSCode and the VSCode Claude Code extension
  3. Open a project folder within VSCode
    • Claude Code can then automatically access the files in that folder
      • Be aware that your prompts and files are processed on Anthropic’s servers, so avoid referencing sensitive/confidential data files themselves
    • Additionally, using a versioning system such as git is highly advisable in case Claude Code makes a mistake and you want to revert to a previous version
  4. Click on the Claude (Code) Logo on the top right and connect Claude Code to your Claude/Anthropic account

Quick recap: Tokens and context

Tokens

  • Large Language Models (LLMs) use text input to generate text output
  • Tokens are the units that measure input and output (~¾ word or 1 punctuation mark)
  • LLM costs scale with token count, and bigger models (e.g., Opus) cost more per token
  • Subscriptions typically cap (type of) token usage per session (~5 hours) and week
  • Tradeoff: A lighter model may need more conversation/context to match a larger model’s output so choosing the right model matters

Context

  • More input or context (project files, documentation etc.) generally means better output
  • Tokens accumulate with each message and loaded context, together making up the context window, which is limited in size (more on this later)

Basic Usage

  • Adding context to your prompt can be done in multiple ways
    • Either by mentioning the files directly in your prompt (e.g., take a look at the README...), by attaching files through the + symbol in the prompt box, by selecting lines of code inside VSCode (automatically passed to Claude), by using @file.py to reference a specific file or by dragging files into the prompt box with Shift
  • Choose different operating modes on the bottom right of the prompt box
    • Try to always start with Plan mode: describe your goal, iterate on the initial plan, approve the plan, then let Claude execute (think of it like briefing a RA)
    • For the beginning, use the safer Ask before edits instead of Edit automatically
  • Use Shift+Enter to create a new line without sending

Basic Usage (continued)

  • Typing / in the prompt box (or clicking on /) opens various options
    • Toggle between models of varying capabilities using Switch model...
      • Sonnet handles most everyday tasks well, while Opus excels at complex tasks but costs considerably more. Avoid Haiku for anything beyond trivial queries
    • Set Effort to medium (higher if you need more compute) and enable Thinking
    • Check your current session usage with Account & usage...
  • The context indicator () shows your model context window usage
    • Claude automatically compacts the context window after a certain threshold (use /compact to do this manually)
    • Start fresh conversations for new tasks rather than continuing indefinitely
    • Be aware that recall quality worsens with larger context, though this has improved significantly (Opus/Sonnet now handle up to 1M tokens well, up from 256k)

Persistent Context

The blank slate problem

  • Without persistent context, every new session starts from zero
    • All relevant information must be provided again with each prompt
  • Three mechanisms can fix this:
CLAUDE.md (global) CLAUDE.md (project) Skills
Scope All sessions Each project One task
Loaded Automatically Automatically On demand (/)
Purpose Who you are Project specifics How to do X
Location Home directory Project folder Global or project
  • We’ll now walk through what to include in each

CLAUDE.md (global)

Location: ~/.claude/CLAUDE.md | Loaded: every session | Purpose: who you are

What to include:

  • Your role in 1-2 sentences
  • Tools and software you use
  • Skill levels (be honest!)
  • Communication preferences
  • Writing style with examples (guide)

Bad example:

“I’m a researcher. I do data analysis.”

Good example:

“Predoctoral RA at a policy school, working on field experiments studying education interventions in East Africa. Cleaning survey data in Stata; analyzing in R and Python.”

CLAUDE.md (project)

Location: CLAUDE.md in project root | Loaded: in that project | Purpose: project specifics

What to include:

  • Project goals and current status
  • Data sources and variable definitions
  • Coding conventions
  • File structure
  • Build commands
  • Theoretical framework or empirical strategy

Example (abbreviated):

# Project: Regional Labor Markets

Panel data analysis of local labor market
dynamics across European NUTS-2 regions.

## Build & run
pip install -e .
pytask

## Project structure
src/labor_markets/
  data/             <- raw input data
  data_management/  <- cleaning + merging
  analysis/         <- regressions & figures
bld/                <- generated outputs

Skills: reusable task instructions

Location: ~/.claude/skills/ | Loaded: on demand via / | Purpose: how to do X

Simple skill (single file):

# ~/.claude/skills/explain-code/SKILL.md
---
name: explain-code
description: Explains code with visual
  diagrams and analogies.
---

When explaining code, always include:
1. Start with an analogy
2. Draw a diagram (ASCII art)
3. Walk through step-by-step
4. Highlight a common gotcha

Multi-file skill:

~/.claude/skills/revise/
├── SKILL.md          # Main instructions
├── template.md       # Template to fill in
├── examples/
│   └── sample.md     # Expected format
└── scripts/
    └── validate.sh   # Executable script

SKILL.md is required. Other files are optional: templates, example outputs, scripts, or reference docs. Reference them from SKILL.md so Claude knows when to load them.

See Claude documentation and Building Skills (Claude Blattman) for more information.

What it’s great at and where it falls short

What it’s great at

“A room full of experts while you think.” — Morten Nyboe Tabor

  • Translation (=Coding!): words → code, (coding) language → (coding) language, notes → polished text, etc.
  • Prototyping: Quickly try out different approaches, explore complex datasets and prototype e.g. dashboards or annotation interfaces
  • Brainstorming: Ask for multiple options based on your project specifics. Use planning mode extensively!
  • High-quality Editing/Refereeing/Replicating: Models are getting better than dedicated solutions like Refine and skills have been emerging specifically for this (1, 2, 3)

Where it falls short

The verification problem

  • In the beginning, you verify every line, then, at some point, you stop looking at all. This becomes a dangerous slippery slope when:
    1. You’re unfamiliar with the coding language and can’t verify
    2. You can’t easily verify outputs (e.g., by writing tests)
    3. You’re working on a high-stakes project (outside of prototyping)
  • Some models (specifically, Opus/Sonnet) are better than others at challenging nonsensical prompts (though not necessarily at returning correct output!)
  • One mitigation: cross-language replication. Run key analyses in R, Python, and Stata without referencing existing code — if results agree, confidence increases
  • The binding constraint is not intelligence but human verification bandwidth (Some Simple Economics of AGI, Catalina et al. 2026)

Resources

Questions?

Ask Claude!

Slides: perikl.is/slides/claude-code-tutorial/