Session overview
This Friday support session (Fri 6 Feb, 9:00 AM GMT) focused on agentic coding with Cursor and Python learning guidance. Antonio ran the session from home with a different audio setup; participants could ask questions via unmute, chat, or Q&A. The session is intended as a self-paced commitment device: materials are on the course website, and the Friday slot is optional help and a chance to ask questions about Python or AI coding tools.
Key topics covered
Cursor / Cursor licensing and alternatives
- The student discount promoted on Cursor’s website is currently valid only for US accounts. Antonio will follow up with Cursor and meetup contacts to try to extend it to other countries.
- Cursor has a free version with limits; for most student and coding-agent use, the free tier is likely sufficient.
- Antigravity (Google) is a similar tool and can be used instead of Cursor if preferred. Default recommendation: use Cursor, but any similar tool is acceptable.
Cursor features and workflow
- Sidebar: Shows files from the opened directory; supports notebooks (e.g. Workshop 3 on NumPy).
- AI-native: Cursor works more like an assistant for coding than a traditional editor. Changes appear inline (red = deleted, green = added), with a review workflow to compare old vs new files side-by-side.
- Multiple agents: You can run several coding agents in parallel via the plus button and have multiple tasks running at once.
Models and model selection
- Cursor offers many models: Claude Opus 4.6 (Anthropic), OpenAI (e.g. GPT-5.2), Gemini, Grok (xAI), Kimi (large open-source, hosted).
- Auto mode: Cursor picks the model per task; on the free plan, Auto is unlimited and recommended for students. Different models suit different tasks (e.g. planning vs execution); Auto handles that automatically.
Agent modes: Ask, Plan, Agent
- Ask: Ask questions about the code on screen (e.g. “This notebook is about NumPy. What is NumPy?”).
- Plan: Ask the AI to decompose a larger task into step-by-step sub-tasks before execution (e.g. “Create a copy of this notebook and a plan to complete all the work”).
- Agent: Execute the plan — switch to Agent mode or click “Build plan” to have the AI run the plan and modify files.
Typical workflow: Plan → review or edit the plan → Build plan (execution) → Review changes → Accept or edit changes.
Demo: Workshop 3 (NumPy) notebook
- Task given: Create a copy of the Workshop 3 notebook and complete all exercises cell-by-cell.
- The agent created a copy (
workshop 3 completed) and implemented solutions in the copy so the original stayed intact. - The agent produced a to-do list and used the terminal to create the copy and edit cells. Antonio’s local settings file logs Cursor instructions and session actions for traceability.
Reviewing and accepting changes
- Use Review to compare old and new files side-by-side (old left, new right). Red = deleted, green = added.
- You can accept changes cell-by-cell (recommended at first) or “Keep all changes” / accept all at once.
- Recommendation: For the first few times, check every change carefully; the AI can make subtle mistakes.
Parallel agents and adding explanations
- Antonio demonstrated parallel agents: one adding comments to a specific cell, another adding comments to all completed cells.
- Example comment added for matrix multiplication: “Matrix multiplication use
@not*. We get A rows times B columns. Not element-wise.” - Asking the agent to “create some comments for every cell … be as detailed as possible … learning Python as a beginner” produced detailed explanations that were kept.
Workshop 3 exercise examples
- 3.1: Create an array from the list 10, 20, 30, 40, 50 — agent produced the correct solution.
- 3.2: Create an array of seven zeros — correct.
- 3.6: Comments and explanations were added; a second agent produced more detailed beginner-friendly comments. Linear algebra notes included (solving linear systems, matrix multiplication, turning column vectors for economists).
Best practices and responsibilities
- Learn the basics first: Agentic coding is a productivity layer on top of Python knowledge.
- Always check AI output: You remain responsible for correctness of code and for the economic reasoning behind it.
- Do not blindly trust AI: The AI is not an economist and may produce incorrect economic reasoning. Think of it as a research assistant who does the coding while you review and direct the research.
- When output is wrong, fix it yourself or instruct the agent to modify or redo the work.
Recommendations and next steps
- This week: Go through the first three workshop notebooks by yourself; if time permits, start notebooks for weeks 4 and 5 (data and pandas).
- Next week’s session: More advanced work with Cursor and agentic coding.
- Antonio will upload additional resources on the website about using AI coding agents (Cursor or alternatives).
- Experiment: Embed the loop instruction → output → check into your routine to speed up learning and coding productivity.
Action items (instructor)
- Press about the student discount for non-US accounts.
- Upload resources to the website.
- Run a more advanced session next week.
Reminders for students
- Do Workshops 1–3 and verify AI outputs when you use agents.
- Use the Video recordings on the Resources page (including Workshop 3 recording) to revisit this session.
What's next
Next week will cover more sophisticated agentic coding with Cursor. Continue working through Workshops 1–3 yourself and start experimenting with the Ask → Plan → Agent → Review workflow.
Related resources
- Workshop 3 recording: Available in the Video recordings section on the Resources page.
- Workshop notebooks: Student versions and Colab links on the Resources page.
- AI Prompting Guide: On the course website; use it together with agentic workflows.
- Python for Economics Preparatory Course: Moodle course, enrolment code: PS-P4E23-24