PRIMM-AI+: AI as Your Learning Partner
In Lesson 1 you learned the five stages of PRIMM -- Predict, Run, Investigate, Modify, Make -- and saw how each stage builds a specific thinking skill. In Lesson 2 you set up Claude Code with Plan Mode, the CLAUDE.md house rules, and seven slash commands. Your workbench is ready.
Now you need the rules that tell you how to use it.
Plan Mode and the slash commands give you structure. But structure without discipline is just decoration. You could toggle to Active Mode during Predict, ask Claude Code "what does this print?", and skip the thinking entirely. Nothing in the workbench physically prevents that. PRIMM-AI+ adds the discipline: clear rules for when you can use AI, when you cannot, and what you must produce at each stage before moving forward.
Here is what each stage looks like with Claude Code as your partner:
| Stage | You | Claude Code |
|---|---|---|
| Predict | Read the code, write your prediction | In Plan Mode: generates code, refuses to reveal output |
| Run | Type python file.py yourself | Not involved: you run the code in your terminal |
| Investigate | Ask targeted questions, trace variables | In Plan Mode: answers questions, generates trace tables |
| Modify | Change the code yourself | Reviews your version, gives hints not solutions |
| Make | Write a spec, then implement | Reviews your spec and completed code |
The rules below make this concrete.
Three Rules for Working With AI
These three rules control how you interact with Claude Code during every PRIMM-AI+ stage:
- Try first, then ask AI. At every stage, make your own attempt before asking AI for help. During Predict, enter Plan Mode (Shift+Tab) so Claude Code cannot edit or create files. During Investigate and Modify, write your own answer first, then check with Claude Code.
- Do not skip stages. Each stage builds on the previous one. If you cannot explain how a program works (not just what it prints), you are not ready to modify it.
- Write things down. A trace table, a prediction, an explanation in your own words. Writing forces you to be honest about what you actually understand versus what you only think you understand.
A Complete PRIMM-AI+ Lesson Walkthrough
"Enough rules," James says. "Show me what this actually looks like."
Emma nods. "Fair enough. Let's do a full PRIMM-AI+ cycle together, start to finish, one program, all five stages. You'll see every checkpoint, every gate, every rule in action."
Here is what a single PRIMM-AI+ lesson looks like end-to-end. In Claude Code, make sure you are in Active Mode (not Plan Mode). Then type:
Create a file called lesson.py with this exact content. Do not
explain the code. Do not say anything else after creating it.
name = "Sarah"
subject = "Python"
score = 95
result = name + " scored " + str(score) + " in " + subject
print(result)
print(name + " passed!")
Claude Code creates lesson.py in your project folder. The program looks like this:
name = "Sarah"
subject = "Python"
score = 95
result = name + " scored " + str(score) + " in " + subject
print(result)
print(name + " passed!")
score = 95stores a number, not text. Notice there are no quotes around95. Quotes mean text. No quotes mean a number.str(score)converts that number into text. Python cannot join text and numbers with+, so you convert the number first.- This program has two
print()lines. Python runs them top to bottom, one after the other. Each one shows its result on a new line.
Stage 1: Predict [AI-FREE]
Press Shift+Tab to enter Plan Mode. Open lesson.py in your editor (not through Claude Code). Before running anything, answer these questions on paper or in a note:
- What will the first
printstatement output? - What will the second
printstatement output? - What do you think
str(score)does?
Rate your confidence from 1 to 5. Write down both your predictions and your confidence score before moving on.
Stage 2: Run
Press Shift+Tab to exit Plan Mode. Open a separate terminal and type python lesson.py yourself. Here is the output:
Sarah scored 95 in Python
Sarah passed!
Compare your predictions. Did you get both lines right? Did you understand why str(score) was needed? If your predictions matched, your mental model is accurate for this pattern. If they diverged, you have specific questions for the next stage.
Before you move on: Have you recorded where your prediction matched and where it diverged? If yes, proceed to Investigate.
Stage 3: Investigate
Press Shift+Tab to enter Plan Mode again. In Claude Code, type:
/investigate @lesson.py
Claude Code will ask you to explain how the program works in your own words first. Write your explanation -- even a rough version counts: "It stores a name, a subject, and a score, then joins them into a sentence and prints it. A second print line prints a shorter message."
After you share your explanation, Claude Code will offer investigation angles. Pick one and predict the result before Claude Code walks you through it. After each explanation, Claude Code will say "Run it and check." Do that -- verify in your terminal. This verification habit is the most important thing PRIMM-AI+ builds.
Before you move on: Can you explain how the program works, not just what it does? If you can describe why str() is needed and what + does with strings, proceed to Modify.
Stage 4: Modify
Press Shift+Tab to exit Plan Mode. In Claude Code, type:
/modify @lesson.py
Claude Code will ask what modification you want to make. Try these two challenges:
Challenge A: Change the format so the output reads Python: Sarah scored 95 instead -- subject first, then name, then score.
Challenge B: Add a third print line that shows just the score by itself: Score: 95.
Open lesson.py in your editor and make the changes yourself. Claude Code will not edit the file for you during Modify -- it will review your work and give hints if you get stuck. Predict the new output before running python lesson.py in your terminal.
Stage 5: Make [AI-FREE start]
In Claude Code, type:
/make a profile program that takes a name, a city, and an age,
and prints a profile line plus a welcome message
Claude Code will not write code yet. It will ask you for a written specification first: what are the inputs, what are the outputs, any unusual cases? Write your spec in plain English: "Given a name, city, and age, print 'Sarah lives in London, age 25' and 'Welcome, Sarah!'"
Claude Code will probe your spec -- "What if the name is empty? What if the age is zero?" -- then hand the implementation back to you. Write the program yourself in a new file called profile.py. Predict the output before running python profile.py in your terminal. Show your result to Claude Code for review.
You have now completed a full PRIMM-AI+ cycle. AI was your partner at every stage and ghostwriter at none.
Five Habits to Build
The three rules above tell you how to work with AI. These five habits tell you how to think like a programmer:
- Predict before you run. Always write down what you think the code will do before you execute it.
- Test every AI explanation. AI can be confident and wrong. When it says "this does X," run the code and check.
- Modify before you make. Changing existing code is easier than writing from scratch. It builds the skills creation requires.
- Write the spec before the code. Describe what your program should do before you write it. This is the professional habit.
- Partner, not crutch. Think of hiring a vendor for your business. A good vendor teaches your team how the process works, so eventually your team can handle it independently. That vendor is a partner: you are stronger after working with them. A bad vendor just does the work and sends invoices. Your team never learns anything, and the moment the vendor leaves, you are stuck. That vendor is a crutch (a support you depend on because you never built the ability yourself). AI works the same way. If you ask AI "why does this line use
str()?" and learn something new, AI was a partner. If you ask AI "fix this for me," accept the fix without understanding it, and move on, AI was a crutch. After every AI interaction, ask yourself: do I understand more than I did before?
Try With AI
Prompt 1: Run a Self-Directed PRIMM Cycle
In Claude Code, type:
/primm string concatenation with three variables
Claude Code will generate a starter program, walk you through Predict (in Plan Mode), have you run it yourself, ask you to investigate, give you a modification challenge, and pose a Make challenge. Follow the full cycle.
What you are learning: The whole PRIMM-AI+ cycle, end to end, driven by a single slash command. Use /primm whenever you want to practice on your own.
Prompt 2: Test the Verification Instinct
Press Shift+Tab to enter Plan Mode. Then in Claude Code, type:
In Python, what happens when you use the + operator to join a
string and a number, like 'Score: ' + 95? Explain what the
output will be.
Read the explanation. Then press Shift+Tab to exit Plan Mode and ask Claude Code to run it:
Run this in Python and show me the actual result: print('Score: ' + 95)
Did the explanation match the real result?
What you are learning: Claude Code might say it produces Score: 95. In reality, Python raises a TypeError because you cannot join text and a number directly. You need str(95) first. This is exactly why Rule 2 exists: never trust an explanation you have not tested. Always verify by running the code.
Prompt 3: Classify Partner vs. Crutch
In Claude Code, type:
Show me three short scenarios of a beginner using Claude Code.
For each one, ask me whether the student is using AI as a
partner or a crutch, and why. After I answer, give me your
assessment and explain.
What you are learning: Naming the difference between partner and crutch in concrete cases sharpens your self-awareness. Apply the same question to yourself after every Claude Code session: did I understand more than I did before?
James flips back through his notes. "So: try first, don't skip stages, write things down, and always check whether AI is actually helping me learn or just doing my work."
"That's it," Emma says. "And the partner versus crutch habit from above?"
"The vendor analogy." James nods. "After every AI interaction, ask myself: do I understand more than I did before? If not, I was leaning on a crutch."
"Got it. So what's next?"
"One more lesson. It gives you a vocabulary for bugs, a new kind of exercise called Parsons problems, and the pattern every chapter follows from here on. After that, you're ready for the ten axioms."
References and Further Reading
- Sentance, S., Waite, J., and Kallia, M. (2019). "Teaching computer programming with PRIMM: a sociocultural perspective." Computer Science Education, 29(2-3), 136-176. DOI: 10.1080/08993408.2019.1608781
- Sentance, S., Waite, J., and Kallia, M. (2019). "Teachers' Experiences of using PRIMM to Teach Programming in School." Proceedings of SIGCSE '19, 476-482. DOI: 10.1145/3287324.3287477
- Sentance, S. and Waite, J. (2017). "PRIMM: Exploring pedagogical approaches for teaching text-based programming in school." Proceedings of WiPSCE '17, 113-114.
- PRIMM Portal: https://primmportal.com
- Computing Education Research: https://computingeducationresearch.org/projects/primm/