LECTURE:LIVE DECK: CLAUDE-AI / 00-INTRO FMT: 16:9 SLIDE 01/01 ↩ SITE
┌─ Module 00 ─ Getting Started ──

Using Claude AI

A hands-on guide to AI for research & writing.

instructor
Tai Lo Yeung
course
Postgraduate Workshop · Empirical Methods
institution
Università della Svizzera italiana (USI)
status
● SESSION READY
▶ Press → / Space / Click to begin
┌─ Motivation ──

Even the AFA is now calling for AI-written papers.

If finance’s flagship association is soliciting AI-driven research, working fluently with these tools is now a core research skill — and that’s what this session is about.

┌─ Roadmap ──

Two hours, two halves.

Hour 1 · Foundations
  • What “vibe coding” is
  • Why it matters for research
  • The toolbox
  • The core loop
  • Prompting well
  • Trust, but verify
  • First hands-on
Hour 2 · In Practice
  • Where AI fits the research pipeline
  • Data → analysis → figures → writing
  • Workflow automation
  • Reproducibility & documentation
  • Pitfalls & ethics
  • Build-your-own lab

Goal: leave able to run a real research task end-to-end with an AI partner.

Hour 01

1

Introduction to Vibe Coding for Research

What it is, why it matters, and how the loop works.

0:00 Chatbot → agent: tools & the loop
0:20 Prompting & skills
0:35 Trust, but verify
0:45 Hands-on + recap
┌─ Hour 1 · Concept ──

What is “vibe coding”?

You describe what you want in plain language; the AI writes and runs the code. You steer by results, not syntax.

  • Term popularized by Andrej Karpathy (2025): lean on natural language, let the model handle the code.
  • You stay in charge of intent, judgment, and verification.
  • The model handles boilerplate, syntax, libraries, and debugging.
  • It’s not “no code” — it’s code by conversation.

The bottleneck shifts from “can I code this?” to “is this the right thing, and is it correct?”

┌─ Hour 1 · Motivation ──

Why this matters for your research

  • Lower barrier — build real tools without being a software engineer.
  • Speed — data cleaning, plots, and scaffolding in minutes, not hours.
  • Breadth — work across Python, R, Stata, LaTeX, and shell without mastering each.
  • Focus — spend your time on the economics, not the syntax errors.
  • Reproducibility — every step is captured as code plus conversation.

This is the skill the AFA session is really testing.

┌─ Hour 1 · Tools ──

The toolbox

Think & draft

Claude.ai

Chat for reasoning, writing, quick analysis, brainstorming.

Build & run

Claude Code

Reads your files, runs code, edits whole projects, automates.

In-editor

Cursor / VS Code

AI inside your editor for line-by-line, in-context help.

Alternatives

ChatGPT & co.

Similar capabilities — the same principles transfer.

This course uses Claude, but the workflow is tool-agnostic.

┌─ Hour 1 · Setup ──

My take: use the Claude app, not the terminal.

It’s the same Claude Code underneath — the desktop app just wraps it in a friendlier window.

  • One app, two modes — switch between plain chat and agentic coding without leaving the window.
  • No command line to fear — panels and buttons instead of memorized commands.
  • Identical capabilities — same model, same files, same slash-commands and skills as the terminal.
  • Anything you see in a terminal demo works exactly the same in the app.
same model same files same commands same skills

Pick the window you like — the brains are identical.

┌─ Hour 1 · Method ──

The loop: how vibe coding actually works

  1. Describe the goal + context (data, language, constraints).
  2. The AI proposes code.
  3. Run it — locally or inside the tool.
  4. Inspect the result — numbers, plots, errors.
  5. Refine in plain language: “dates are off — parse as YYYY-MM.”
  6. Repeat until correct, then lock it in.

Tight loops beat long prompts. Small steps, check often.

┌─ Hour 1 · Prompting ──

Anatomy of a good prompt

  • Context — what the data is, what tools you use.
  • Goal — the specific outcome you want.
  • Constraints — language, packages, conventions.
  • Format — how you want the answer back.
you ▸ Here's panel.csv: firm-month returns, 2010–2023. Winsorize ret at 1/99% within month, then regress ret on lagged size + B/M with month + firm FE. Use Python + linearmodels. Show the code and the coefficient table.

Context + goal + constraints + format. Vague in → vague out.

┌─ Hour 1 · Skills ──

Why skills matter

A skill turns a repeatable task into a one-word command — write the instructions once, reuse them forever.

  • Consistency — your standards, applied the same way every time.
  • No re-explaining — stop re-pasting the same instructions into chat.
  • Cheap — a skill loads only when it’s used, so it barely touches context until you need it.
  • Auto-invoked — Claude picks the right skill from its description; you don’t have to remember.
  • Shareable — hand the same capability to coauthors and students.

Rule of thumb: if you’ve typed it twice, make it a skill.

┌─ Hour 1 · Skills ──

Skills in the wild

Some you get for free; some you build.

built-in

/code-review

Structured review of your changes before you commit.

built-in

/debug

A systematic hunt for why something breaks.

documents

PDF · DOCX · PPTX · XLSX

Turn results into a report, Word doc, slide deck, or spreadsheet.

meta

skill-creator

A skill that helps you build your own skills.

yours

/econ-write

Your own writing helper — we build this in Hour 2.

Type / in Claude to see every skill available to you.

Start with the built-ins; roll your own when you spot a pattern.

┌─ Hour 1 · The #1 rule ──

Trust, but verify

AI is confident even when it’s wrong. For research, verification is your job — and it’s non-negotiable.

  • Hallucinated citations — check every reference exists and says what's claimed.
  • Plausible-but-wrong code — eyeball outputs; run sanity checks.
  • Silent data errors — print N, ranges, missingness at each step.
  • Version control everything (git) so you can see exactly what changed.

Treat the AI as a fast, brilliant, slightly unreliable RA.

┌─ Hour 1 · Hands-on ──

Hands-on: your first task

Live demo — from a raw file to a result, by conversation.

  1. Drop a messy CSV into Claude.
  2. “Clean it, and describe exactly what you changed.”
  3. “Plot the time series of the average return.”
  4. Spot a problem → fix it by conversation.
  5. Export the script so it’s reproducible.

Follow along — bring a dataset you know well.

┌─ Hour 1 · Recap ──

What you can already do

  • Define a research task clearly.
  • Pick the right tool for it.
  • Run the loop: describe → run → inspect → refine.
  • Verify outputs instead of trusting them.
  • Keep the whole thing reproducible.

Next hour: plug this into the real research pipeline.

Hour 02

2

Practical Applications & Workflow Automation

From one-off tasks to an automated, reproducible pipeline.

0:00 The research pipeline: literature → data → writing
0:25 Working smart: git, permissions, tokens, skills
0:40 Reproducibility, pitfalls & ethics
0:50 Hands-on lab + recap
┌─ Hour 2 · Map ──

Where AI plugs into your pipeline

01

Collect

Scrape, pull APIs, assemble raw sources.

02

Clean

Merge, reshape, match, validate, document.

03

Analyze

Regressions, robustness, replication.

04

Visualize

Publication figures and LaTeX tables.

05

Write

Draft, edit, referee responses, LaTeX.

AI touches every stage — but you own the design and the checks.

┌─ Hour 2 · Application 1 ──

Literature review at scale

  • Point an agent at a folder of PDFs → get a structured comparison table.
  • OCR older scans into clean text you can search and quote.
  • Chase a citation to its source — the agent opens the paper and quotes the page.
  • Summarize, cluster, and contrast methods across a whole reading list.
you ▸ Read every PDF in ./papers. Build a table: cite key, question, data, method, headline finding. Flag any claim you can't ground in the text. # then I verify

Speed is the easy part — verifying the table is the real work.

┌─ Hour 2 · Application 2 ──

Data wrangling

  • Merge messy sources; reshape long ↔ wide.
  • Fuzzy-match firm or person names.
  • Parse dates, units, and currencies consistently.
  • Build a clean panel — with every transformation logged.
you ▸ Merge these 3 files on firm_id + year, flag unmatched rows, and tell me how many I lost and why. # then: show me the 10 worst name mismatches

The tedious 80% — done in minutes, fully documented.

┌─ Hour 2 · Application 3 ──

Analysis & replication

  • Run a result across many specifications at once.
  • Generate robustness and sensitivity tables.
  • Replicate a published result from its description.
  • Translate code across Stata ↔ R ↔ Python.
  • Explain unfamiliar code you inherited.

Ideal for replication packages and referee robustness asks.

┌─ Hour 2 · Application 4 ──

Figures & tables

  • Publication-quality plots from a description.
  • Match a journal’s house style.
  • Generate LaTeX booktabs tables straight from results.
  • Iterate on aesthetics by talking, not tweaking by hand.

“Make it look like the figures on my website.” — and it can.

┌─ Hour 2 · Application 5 ──

Writing & LaTeX

  • Draft and tighten prose; cut 800 words to 500.
  • Build LaTeX scaffolding; fix cryptic compile errors.
  • Draft referee-response letters point by point.
  • Translate and clarify — but never let it invent citations.

Your voice and your claims; its speed and its syntax.

┌─ Hour 2 · Automation ──

Workflow automation

Move from chatting to agents that do multi-step work on your files.

  • Claude Code reads and edits a whole project.
  • Chain steps: clean → estimate → tabulate → compile.
  • Batch the same task over hundreds of files.
  • Schedule recurring jobs; save reusable scripts.

Automate the boring 80%; spend your time on the 20% that’s economics.

┌─ Hour 2 · Working safely ──

No git? Use the copy-folder trick.

You don’t need to learn version control to work safely. This is “manual git” — and it’s enough to start.

  1. Before you start, duplicate your project folder (paper/ → paper-backup/).
  2. Work as normal — let the AI change files.
  3. Happy with the result? Delete the backup. Done.
  4. Not happy? Delete the working copy and restore the backup.

Date your copies — paper-2026-06-02 — so you can keep a few. Five minutes, total peace of mind.

When you’re ready, real git just automates exactly this.

┌─ Hour 2 · Working fast ──

Stop clicking “allow”

By default, Claude Code asks before it edits a file or runs a command. Safe — but click-heavy once you trust it.

  • Shift+Tab cycles modes: normal → auto-accept edits → plan.
  • /permissions pre-approves the safe commands you use a lot.
  • Full speed: launch with --dangerously-skip-permissions to skip every prompt.

Only skip permissions on a throwaway copy or sandbox — never with sensitive data or untrusted content.

Made a copy? Let it run free, then review the result — not every step.

┌─ Hour 2 · Context ──

Context is the model’s working memory

Everything shares one window — the system prompt, your CLAUDE.md, every file read, every tool output, and the whole chat so far.

  • It’s finite. Fill it and older details get pushed out or summarized away.
  • It hurts quality. A bloated context makes answers slower, pricier, and less accurate — the model attends less reliably to any one fact.
  • Auto-compact kicks in near the limit — helpful, but summarizing can drop the detail you cared about.
  • So treat context as precious: load what’s relevant, not everything.

Inspect with /context · summarize with /compact · reset with /clear.

A lean, focused context isn’t just cheaper — it gives better answers.

┌─ Hour 2 · Working cheap ──

Make your usage last

Long conversations cost more, slow down, and drift. A few habits keep you fast and lean.

  • /clear — start a fresh chat for each new task (project memory is kept).
  • /compact — squeeze a long chat to free space, same task.
  • /context — see what’s filling the window.
  • /model — drop to a smaller model for simple jobs.
  • Point at specific files, not the whole repo.

One task per conversation. /clear early, /clear often.

┌─ Hour 2 · Agents ──

Use many agents, not one big chat

Each agent runs in its own fresh context — so split a big job across several instead of cramming it into one.

  • One agent reading 10 papers runs out of room by paper six. Ten agents — one per paper — each stay sharp.
  • Each returns just its result; your main context stays clean.
  • Run them in parallel → faster, and no single context overflows.
  • An orchestrator agent dispatches the others and merges their findings.
you ▸ For each PDF in ./papers, spawn an agent to pull {question, data, method, finding}. Collect every agent's result into one comparison table. # /agents

Divide the work, divide the context — one focused agent per job.

┌─ Hour 2 · Extend ──

Build your own econ commands

A “skill” turns a prompt you reuse into a one-word command. Type /econ-write and it runs your saved instructions.

/econ-write

Rough notes → journal-style prose, in your voice.

/lit-review

Summarize & compare a set of papers.

/reg-table

Results → clean LaTeX booktabs table.

/robustness

Propose & run standard robustness checks.

/referee-reply

Draft a point-by-point response letter.

/clean-panel

Standardize a messy panel dataset.

Make one: a SKILL.md in ~/.claude/skills/econ-write/ — a short description plus your instructions. You add yours; I can scaffold more.

Your best prompts, saved once and shared with your students.

┌─ Hour 2 · Reproducibility ──

Reproducibility & documentation

This is exactly what the AFA session asks you to capture.

  • Keep your conversation transcripts (including initial prompts).
  • Log time spent and document human contributions.
  • Track line-contribution % — what was AI, what was you.
  • Commit code and prompts to git; a README that regenerates everything.

Reproducibility isn’t bureaucracy — it’s the new credibility.

┌─ Hour 2 · Guardrails ──

Pitfalls & best practices

Pitfalls
  • Hallucinated citations
  • Subtle, silent data bugs
  • Over-trusting fluent output
  • Losing context over long chats
  • Pasting confidential / embargoed data
Practices
  • Verify every output
  • Work in small, checkable steps
  • Version-control everything
  • Keep a human in the loop
  • Know what data you may share

Speed without verification is just faster mistakes.

┌─ Hour 2 · Ethics ──

Ethics & disclosure

  • Know each journal’s AI policy before you submit.
  • Disclose AI use honestly — the AFA session requires it.
  • You are accountable for every result and every citation.
  • AI is a tool, not a co-author.
  • Protect confidential data and referee material.

Disclosure builds trust; concealment destroys it.

┌─ Hour 2 · Lab ──

Hands-on: build a mini pipeline

  1. Pick a dataset you care about.
  2. Clean it → run one regression → make one figure → output one LaTeX table.
  3. Wrap it into a single script you can re-run.
  4. Save the prompts alongside the code.

Goal: one reproducible artifact you actually keep.

┌─ Hour 2 · Knowledge vault ──

Turn your notes into a knowledge vault

Obsidian stores everything as plain Markdown (.md) in a local folder — exactly what Claude reads and writes best.

  • Your whole vault is plain text → Claude reads, searches, and edits all of it directly — no export, no API.
  • Notes link to notes ([[wiki-links]]) → a graph of ideas that compounds as it grows.
  • Local and yours — private, portable, future-proof.
# disposition-effect.md Investors sell winners and hold losers. Related: [[Prospect Theory]] · [[Fear and Greed]] Source: [[Odean 1998]]

A folder of PDFs isn’t a system — linked Markdown is.

┌─ Hour 2 · Knowledge vault ──

Obsidian + Claude: the workflow

  1. Install Obsidian — a vault is just a folder of .md files.
  2. Point Claude Code at that folder — open it as your project.
  3. “Read this paper; write a note with the key claims and [[link]] it to related notes.”
  4. Ask across everything: “What do my notes say about X?” — Claude reads the whole vault.
  5. Let it surface connections and gaps you missed.

Free for personal use · obsidian.md · your vault stays on your machine.

Capture once; let Claude connect, retrieve, and grow it.

┌─ The rules ──

Three rules, whatever the tool

don’t trust — check

Verify every claim

Outputs, citations, numbers. The model is confident even when it’s wrong.

so you can roll back

Version every artefact

Code, data, drafts — even the copy-folder trick counts.

be honest

Attribute every input

Disclose AI use. You own every result and every citation.

Verify · Version · Attribute — the whole course in three words.

┌─ Wrap-up ──

Recap & where to go next

You can now
  • Run the vibe-coding loop
  • Cover the full research pipeline
  • Automate multi-step work
  • Document it to AFA standards
Resources
  • docs.claude.com — Claude & Claude Code
  • The AFA 2027 call for papers
  • This deck — on the course page
  • Office hours — bring your project

Start with one real task this week. That’s the whole secret.

End of session

Questions?

Tai Lo Yeung · tai.lo.yeung@usi.ch

Now go build something.