Week 04: From Copilot to Agentic CLI Workflows
From AI-assisted coding in VS Code to terminal-native AI workflows
Week 04: From Copilot to Agentic CLI Workflows
From AI-assisted coding in VS Code to terminal-native AI workflows

About the class
In Week 3, you already used AI in a real coding workflow with VS Code + GitHub Copilot. This week builds directly on that foundation and introduces agentic AI in the terminal: tools that can inspect your project files, run commands, and iterate in-place.
The jump is not “AI vs no AI.” It is IDE assistance vs terminal-native execution. Instead of manually moving between editor, terminal, and chat tabs, you can run a tighter loop in one interface and still keep the verification habits from Week 3.
Tool Options
We use Claude Code in this class, but the workflow transfers:
| Tool | Interface | Notes |
|---|---|---|
| Claude Code | Terminal CLI agent | Default in this course. |
| Gemini CLI | Terminal CLI agent | Similar command-line workflow. |
| Codex CLI | Terminal CLI agent | OpenAI alternative for terminal workflows. |
There are differences in UX and permissions, but the core process is the same: define the task, inspect outputs, verify results, iterate.
Everything you learn today transfers to alternatives. Tools evolve quickly, so focus on process rather than product-specific details.
Learning Objectives
By the end of this session, students will:
- Explain the difference between Week 3 Copilot workflows and terminal agent workflows
- Install and configure Claude Code on their machine
- Use Claude Code to explore, understand, and analyze a multi-file dataset
- Apply verification habits (row counts, summary checks, sanity checks) while using autonomous AI steps
Before class
Setup Required - Do This Before Class
1. Installation and setup
Follow the installation guide: Installing AI CLI Tools
We use Claude Code, but Gemini CLI or Codex CLI also work. The guide covers all options for Windows, Mac, and Linux.
Claude Code lives in the Terminal. New to the terminal? Start with Terminal Basics
2. Confirm Week 3 tooling still works
- VS Code opens your project and Copilot is active
- You can run Python from a terminal (
python --version) - You can use basic git commands (
git status)
3. Ensure Python packages
Claude Code can run Python code, so Python must be installed:
- Download from python.org/downloads
- Check “Add Python to PATH” during installation
- Install packages:
python -m pip install pandas numpy matplotlib
4. Ensure you have a GitHub account
- and know the basics of working with git
Class Plan
🤝 Review on readme docs (20 min)
Review Readme assignment
- broad discussion of experience
What worked, what was different?
- First run
- Extended context window run 1 (create a system prompt)
- Extended context window run 2 (with slideshows)
Problems with AI generated reports.
Read each other document.
- control?
- style?
Part 1: Why CLI if Copilot already works? (30 min)
Why CLI Tools? The Core Benefits
Week 3 already removed a lot of friction with Copilot. The remaining friction is mostly interface-switching and manual orchestration:
- Ask for code in the editor
- Run it in terminal
- Inspect logs/errors manually
- Go back to chat/inline suggestions and repeat
CLI agents compress this loop:
Files are already there - Claude Code sees your CSV files, R scripts, and outputs directly - No uploading, no repeated copy-paste, minimal context handoff - Just: “Look at these files and calculate average occupancy by city”
Code runs immediately - AI writes code and executes it in one step - Sees errors and fixes them automatically - You get results, not just code snippets
Context stays intact - Remembers your entire project structure - Understands how files relate to each other (hotels.csv joins with cities.csv) - Keeps track of what you’ve done across multiple steps
Iteration is fast - “Something looks wrong” -> AI investigates without you copying data - “Try it a different way” → Runs new approach immediately - No manual round-trips for every change
This covers the basics to get started. For advanced workflows (custom commands, git integration, large-scale data handling), see Advanced CLI Workflows.
What Stays the Same
- Prompting discipline: Clear task descriptions still matter most
- Statistical thinking: You still define variables, assumptions, and checks
- Verification habits: You still validate joins, units, missing values, and outputs
- Iteration mindset: Break problems into steps, inspect, refine, repeat
What changes is the execution surface: terminal-native tools can plan and run across files faster, but you remain responsible for quality.
Discussion: How Would You Do This?
Task: “What’s the average hotel occupancy by city in this dataset?”
You have a folder with several CSV files. You want to answer this question using AI assistance.
Think-pair-share (10 min):
- What steps would you take using ChatGPT or Claude.ai (chat interface)?
- What information would you need to give the AI (or Copilot Chat)?
- What could go wrong? How would you handle errors?
Discuss with a neighbor, then share with the class.
The friction: Manual context handoff and tool-switching slow down the loop.
Part 2: Hands-on - First steps (25 min)
Setting Up Claude Code
set up folder
Create a git project folder for the Austrian Hotels data austrian-hotels-data
get the data
Download the Austrian Hotels dataset from here.
launch Claude Code
Open your terminal, navigate to your data folder:
cd path/to/austrian-hotels-data
claude
Task 1: setup
Ask to set up a data analysis project folder with data already there.
Have a look, ask changes if you’d like
Task 2: data
Get all csv files in the /data folder
Ask for a summary of data tables
Interact to learn more about the data
- What files are in this folder? Give me a quick overview.
- Show me 5 sample rows from each CSV file.
Task 3: relations
- ask to look at data as linked tables, and tell you keys to join them
- Read the hotels and cities files. How are they related? What’s the join key?
Task 4: simple analysis
- Look at the CSV files here and calculate average occupancy by city
- write python code, run it, and show results
Task 5 Discussions
- How does this compare to using ChatGPT?
- Where do you see the biggest advantages? Any downsides or risks?
- What analysis questions could you ask with this data?
Part 3: Hands-on - Cleaning
Task 1: Class discussion on potential problems
- What are the crucial steps when cleaning tabular data?
Task 2: Cleaning with Claude Code
- Use Claude Code to find problems.
- Create clean versions of data tables in a new folder
/data_cleaned.
Part 4: Hands-on - Joining tables
Task 1: quick review on joins
- Review of key concepts Joining Tables Guide
Task 2 joining tables
Join hotels and cities - “Join the hotels and cities data. How many hotels are in each province?”
Aggregate occupancy - “What’s the average occupancy rate by city? Show me a table sorted highest to lowest.”
Find patterns - “Which 5-star hotels have the lowest average daily rate? Something seems off - investigate.”
Tips:
- If something looks wrong, ask “Why did that happen?” or “Check the row counts”
- Ask Claude Code to show intermediate steps: “Show me the data after the join, before aggregating”
- If you get an error, just wait - Claude Code will often fix it automatically
Task 3, manual check
- open a created data table and look into it.
- how would you test and debug?
Part 5: Hands-on Generate New Data
The Power Move: AI Creates Data
One of the most useful capabilities of Claude Code is generating realistic simulated data. This is exactly how the Austrian Hotels dataset was created - by an earlier version of Claude!
Task 1: Creating Booking Channel Data
- Let us create a new data table:
I want to create a new CSV file called hotel_bookings.csv that shows
what percentage of each hotel's bookings come from different channels
Write Python code to generate this, using the hotels_modified.csv as input.
- How could you be more specific to get realistic patterns?
- How would you check?
Part 6: Debugging and Iteration
When Things Go Wrong
Claude Code isn’t perfect. Common issues:
- Wrong join type - Ask: “How many rows before and after the join? Did we lose data?”
- Missing values - Ask: “Are there NaN values? Where did they come from?”
- Unexpected results - Ask: “Walk me through the calculation step by step”
- Code errors - Often Claude Code fixes these automatically. If not, just describe what went wrong.
- Hallucinations - AI may generate plausible but incorrect code or stats. Always verify.
Trust but Verify
Always check:
- Row counts after joins
- Summary statistics (do means make sense?)
- A few random rows (do values look realistic?)
Good habit: Ask Claude Code to explain what it did:
Explain the code you just wrote. What assumptions did you make?
Operation tips
- Use git-based projects.
- CLI tools are file-based, so git gives safer iteration.
- Version history makes rollbacks and debugging much easier.
- Start with a three-step loop:
- Inventory: “What files are here?”
- Plan: “What steps should we run?”
- Execute and verify.
Resources
Bottom Line for Data Analysis
CLI tools shine when you have:
- Complex multi-file projects with data pipelines (
raw → clean → analysis → exhibits) - Need for reproducible workflows that others can run
- Large datasets or documents requiring substantial context
- Iterative analysis where the AI should test and debug autonomously
IDE/chat assistants remain better for:
- Quick one-off questions or code snippets
- Exploratory conversations about methodology
- Situations where you want tight control over each step
Discussion Questions
End of Class Reflection:
Workflow change: How did using Claude Code feel different from Copilot or chat-based AI? What was faster? What was harder?
Trust calibration: When did you trust Claude Code’s output? When did you double-check? How do you decide?
Use cases: For what tasks would you now prefer Claude Code over Copilot/ChatGPT/Claude.ai? When would you still use IDE or chat tools?
Data generation: What did you learn from creating synthetic data? How could this help in your own projects?
Assignment
Due: Sunday 23:55 before Week 5
Summary: Using Claude Code, create a new data table that joins to the Austrian Hotels dataset, then perform an analysis that answers an interesting question.
Resources
Claude Code & Terminal:
- Terminal Basics - Essential commands
- Install Claude Code - Installation guide
- Claude Code Documentation - Official docs
Additional references
- Short showcase of what is possible now (2026 Jan) ) – must watch 15 mins
Course Reference:
- Technical Terms Glossary - Key AI/data concepts
- Joining Tables Guide - Join types explained
- Advanced CLI Workflows - Power features for experienced users
Austrian Hotels Dataset:
- Dataset Overview - All files and documentation
- Data Schema - Table descriptions and relationships
Python Basics (if needed):
- Python for Data Analysis - Free online book
- pandas documentation: pandas.pydata.org
Some personal comments
- This is where AI gets genuinely useful for data work. Chat interfaces are great for learning and quick questions, but agentic AI changes how you actually do the work.
- The booking channel data we use in class? It was generated by Claude Code while preparing this course. Meta, isn’t it?
- Don’t worry if setup takes time. Getting your environment right is a one-time cost that pays off quickly.