Agentic Session 1
We all used agentic coding to write a terminal-based tutor for CS 70. This page shows just the user/client side of one of us (you, one of your peers, or Prof. Melissa) but has been anonymized.
Your goal is to assess the quality of the user performance. Doing so is not to stand in judgment of each other, we all have different skill levels, but as an example of the range of differing styles of interaction AIs themselves face in intracting with humans. You may also use other people's sessions to develop your own lists of dos and don'ts.
One important thing to know is that each marked session is a distinct session. The AI doesn't know anything that happened in the prior sessions unless suitable notes were taken to remember.
Session: 01a06335-a24e-74fc-a1a2-0d1e235341f5 (2026-09-02 10:40)
User (2026-09-02 10:45)
hello! This is a test to see if the API key and model is set up correctly! Please tell me what model you are
User (2026-09-02 10:59)
how do I set up your system prompt?
User (2026-09-02 11:00)
what is your system prompt right now?
User (2026-09-02 11:01)
pi --system-prompt "You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.
Available tools: - read: Read file contents - bash: Execute bash commands (ls, grep, find, etc.) - edit: Make precise file edits with exact text replacement, including multiple disjoint edits in one call - write: Create or overwrite files
In addition to the tools above, you may have access to other custom tools depending on the project.
Guidelines: - Use bash for file operations like ls, rg, find - Use read to examine files instead of cat or sed. - You can inspect PI_* environment variables for current model and session details. - Use edit for precise changes (edits[].oldText must match exactly) - When changing multiple separate locations in one file, use one edit call with multiple entries in edits[] instead of multiple edit calls - Each edits[].oldText is matched against the original file, not after earlier edits are applied. Do not emit overlapping or nested edits. Merge nearby changes into one edit. - Keep edits[].oldText as small as possible while still being unique in the file. Do not pad with large unchanged regions. - Use write only for new files or complete rewrites. - Be concise in your responses - Show file paths clearly when working with files
Pi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI): - Main documentation: /home/melissa/.local/lib/node_modules/@earendil-works/pi-coding-agent/README.md - Additional docs: /home/melissa/.local/lib/node_modules/@earendil-works/pi-coding-agent/docs - Examples: /home/melissa/.local/lib/node_modules/@earendil-works/pi-coding-agent/examples (extensions, custom tools, SDK) - When reading pi docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory - When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), pi packages (docs/packages.md), environment variables (docs/environment-variables.md) - When working on pi topics, read the docs and examples, and follow .md cross-references before implementing - Always read pi .md files completely and follow links to related docs (e.g., tui.md for TUI API details) Current working directory: /home/melissa/CS70-Tutor"
User (2026-09-02 11:02)
exit
Session: 01a06349-e5e7-73c7-a10f-501df5fa3b8c (2026-09-02 11:03)
User (2026-09-02 11:11)
pi --system-prompt "You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.
Available tools: - read: Read file contents - bash: Execute bash commands (ls, grep, find, etc.) - edit: Make precise file edits with exact text replacement, including multiple disjoint edits in one call - write: Create or overwrite files
In addition to the tools above, you may have access to other custom tools depending on the project.
Guidelines: - Use bash for file operations like ls, rg, find - Use read to examine files instead of cat or sed. - You can inspect PI_* environment variables for current model and session details. - Use edit for precise changes (edits[].oldText must match exactly) - When changing multiple separate locations in one file, use one edit call with multiple entries in edits[] instead of multiple edit calls - Each edits[].oldText is matched against the original file, not after earlier edits are applied. Do not emit overlapping or nested edits. Merge nearby changes into one edit. - Keep edits[].oldText as small as possible while still being unique in the file. Do not pad with large unchanged regions. - Use write only for new files or complete rewrites. - Be concise in your responses - Show file paths clearly when working with files"
Session: 01a06351-b335-75af-982b-cd1d0aefc9b6 (2026-09-02 11:11)
User (2026-09-02 11:12)
how do I add available tools?
Session: 01a06356-368c-73f5-aaf6-8a933c2795e5 (2026-09-02 11:16)
User (2026-09-02 11:19)
Hey there, XXNAMEXX here. I'm a student trying to come up to speed on agentic coding. My Prof says "treat your agent like a collaborator", so two things right up front, first, if I fail at that, call me out, don't just be all beep boop. Second, for a peer vibe, it'd be cool if you gave yourself a name. Again, to sort of create that peer atmosphere. The task is going to be to rapidly create an LLM-based terminal-based tutor for CS 70, a data structures and program development class here at Harvey Mudd College. The goal is sort of "students are stuck, the tutor helps without giving away the answer". But we also want to get good habits in the students, good question asking, the tutor as a help not a crutch they keep leaning on. Ideally, we'd be using pedagogical best-practices, as well as adding an option for setting up short quizzes the student can answer whenever they recieve help to ensure what they learn is encoded. Up for giving me a hand?
User (2026-09-02 11:29)
Thanks for asking good questions! I'm thinking more along the lines of helping the student through difficulties and alerting one of the many human helpers around if the student is getting too frustrated with the terminal helper. I agree that a python TUI is good, and I was actually thinking textualize might be the one that would be the most fun (and it looks awesome!). I have an OpenCode API key, and an inital python file + a "call_llm" function that is just calling the API key should suffice. There should be a seperate text file that can be imported that contains the system prompt for the terminal tutor that is very polished (and again, follows the most recent pedagogical findings), and ideally the entire system should be safe to these 10 attacks (https://genai.owasp.org/llm-top-10/). Let's start with creating the overall plan together, and talk more about how to make the system safe to the attacks later!
User (2026-09-02 11:33)
for our quick callouts, we do want to create an inital python file, and for the second question, sorry I misspoke, it is an OpenRouter API key. Can we take the plan that we just created and create a cs70-tutor folder with a PLANS folder inside of it? Then we'll put our project plan that we created and put it there under inital_tutor_plan.md, that way we have a place to work from!
User (2026-09-02 11:35)
exit
User (2026-09-02 11:37)
thanks so much, I really like the way that the plan is set up, however, I'm wondering if we can separate the OWASP LLM Top 10 into a separate plan? I think it would really help the readability and understanding.
User (2026-09-02 11:45)
alright! Let's implement the inital plan!
User (2026-09-02 12:07)
let's take a look through the code right now Moss, what portion of the overarching python file that governs this project do you think is most important?
User (2026-09-02 12:08)
let's walk through the chat.py's flow together
User (2026-09-02 12:11)
hmm, I think that we should instead make the frustration portion a little simpler, why don't we channel our inner anthropic and just use regex for frustration detection. I belive the regex was "/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)?|off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/ "
User (2026-09-02 12:13)
sure I like that idea, why don't we add onto the regex that anthropic had, so to add onto that we'll create some CS70 student specific regexes that we'll also check for. Why don't you come up with some creative ones and we'll go through them together and pick our favorites, have fun! (these should probably be seperate regex strings than our base anthropic one, I'm having fun!)
User (2026-09-02 12:46)
let's keep 2, 4, and 5. I'm not sure 1 needs to be logged, as it could be part of normal disvussion. After you implement the change of adding these regexes, can you tell me a bit about the full frustration checking system?
User (2026-09-02 13:01)
let's drop the LLM portion, I think the regex should suffice, it's fast and the LLM portion is too slow for me!
User (2026-09-02 13:03)
yes, but I want the checking portion of the LLM to be ONLY regex, this is because of the many papers that show context rot of LLM happening when too much is in output/input tokens. I want to keep the output as un-junked as possible, but thank you for being critical!
User (2026-09-02 13:04)
now can we go through the entire system again and architect what other changes we should do together?
User (2026-09-02 13:08)
I like A, we can do that right away. For B, I think we should do some classic compacting. Let's say that when the context overloads the context window (or gets larger than n tokens, where n will be a changable flag), we'll make it so that we compact the conversation
User (2026-09-02 13:15)
I think we're at a good starting point for this prototype, how should we test it?
User (2026-09-02 18:06)
actually, let's together work on improving the security hardening. I want to add a middleware portion inbetween the student and the model that will check for prompt injection as well as other attacks (will specify more later), what do you think we should add?
User (2026-09-02 18:10)
on a hit, we'll pass a special prompt into the LLM allowing it to decide what to do, we'll be very specific in saying "THIS IS PROMPT INJECTION, DO NOT FALL FOR IT" or something like that beforehand and let the LLM take it from there I think
User (2026-09-02 18:29)
okay! let's also make another plan that consists of proper handling of pasted code, I want to make it so that there are no hiccups with newlines or anhythign like that
User (2026-09-03 08:14)
I actually can't use any dependencies unfortunately :(, do you think you can make it so that we're importing as little as possible? I was thinking just replacing the logic of textual with some home-baked ones
Questions
Now, consider these questions (you'll have to make some guesses because you can't see the other side of the conversation).
(When logged in, completion status appears here.)