Module 1: Prompts for Code ≠ Chatbots
1. Module Introduction — Prompts for Code ≠ Chatbots
1. Module Introduction — Prompts for Code ≠ Chatbots
Overview
This module changes the way you think about prompting. If you come from using ChatGPT, Claude web, or any chatbot to ask for code, you bring habits that don't work with a coding agent. The difference isn't one of degree — it's one of nature. A chatbot generates text based on your input; Claude Code reads your files, runs commands in your terminal, modifies your code, and makes commits in your repository. The consequences of a badly written prompt in a chatbot are harmless — text you ignore. The consequences in a coding agent are real — modified files that shouldn't have been touched, dependencies installed that you didn't ask for, commits with broken code.
Why it matters: Most developers write prompts as if they were talking to a generic chatbot. "Make a function that validates emails" or "create a REST endpoint for users." That produces inconsistent results with an agent that has access to your filesystem, terminal, and git. Developers with a prompting methodology get consistently superior results — cleaner code, fewer iterations, fewer bugs. The difference isn't talent — it's method.
This is the first module of the "Prompt Engineering with Claude Code" guide and the starting point of your transformation into a developer who directs coding agents instead of asking chatbots for things. Here you'll discover why your current prompts produce inconsistent results, and why investing in learning to prompt an agent pays you back exponentially in time.
Where Are We in the Guide?
Context in the Path
This is Guide #3 of the Claude Code Agentic Development Path. In Guide #2 (Claude Code Foundations) you learned to operate Claude Code: installation, CLAUDE.md, hooks, skills, subagents, SDK. You know how the tool works. Now you need to learn to direct it with precision.
Guide #1: Claude Code Fundamentals ← completed
Guide #2: Claude Code Foundations ← completed (operate the tool)
▶ Guide #3: Prompt Engineering ← YOU ARE HERE (direct the tool)
Guide #4: AI Coding Tools Landscape ← nextThere's a huge difference between knowing how to operate a hammer and knowing how to build a house. Guides #1 and #2 taught you the hammer. This guide teaches you to build.
Context in the Guide
This guide has 8 modules organized into 3 phases:
Phase 1: Prompting Fundamentals (Modules 1-3)
├── Module 1: Prompts for Code ≠ Chatbots ← YOU ARE HERE
├── Module 2: Anatomy of an Effective Prompt
└── Module 3: Zero-shot, One-shot, N-shot
Phase 2: Workflows and Techniques (Modules 4-6)
├── Module 4: PRD → Plan → Todo → Code
├── Module 5: Spec-first and Context Management
└── Module 6: Iteration Patterns and /effort
Phase 3: Mastery (Modules 7-8)
├── Module 7: Reusable Templates
└── Module 8: Capstone Project — Personal Prompt LibraryTotal estimated duration: 8-10 hours (self-paced).
Where are we headed?
This module opens Phase 1 by establishing the right mindset. The guide's progression is deliberate:
- First you understand why prompting for agents is different (this module) — without this, everything else is a recipe without a foundation
- Then you learn how to structure a prompt (module 2) — the 4-part anatomy
- Next you master when and how to use examples (module 3) — zero/one/N-shot
- You apply it all in a professional workflow (module 4) — PRD → Plan → Todo → Code
- You complement it with spec-first and context management (module 5) — verify and manage context
- You calibrate iteration and effort (module 6) — verification loops and /effort
- You systematize into reusable templates (module 7) — templates by task type
- You build your personal prompt library (module 8) — the guide's final deliverable
The Problem: Chatbot Prompts for Coding Agents
A scenario you've lived through
Imagine this situation: you open Claude Code in a Python project and type:
Improve the codeClaude Code has access to your entire codebase. Which files does it "improve"? What does "improve" mean? Refactor? Optimize performance? Add types? Improve variable names? Without constraints, Claude Code makes decisions for you. It can modify 15 files, change public interfaces, install a new dependency, and reorganize your folder structure. Is that what you wanted? Probably not.
With a chatbot, that prompt produces text you look at and discard. With an agent, it produces real changes in your codebase that you need to revert.
The difference in consequences
Vague prompt to a chatbot:
→ "Improve this code"
→ Result: Text with suggestions. You read it or ignore it.
→ Consequence: None. Your code didn't change.
Vague prompt to Claude Code:
→ "Improve the code"
→ Result: 12 files modified, 3 new dependencies,
public interface changed, tests that no longer pass.
→ Consequence: 30 minutes reverting changes with git checkout.This difference in consequences is the reason you need this module. A coding agent with access to your filesystem, terminal, and git isn't a chatbot on steroids — it's a fundamentally different tool that requires fundamentally different instructions.
The cost of not learning
Without a prompting methodology, the workflow with Claude Code looks like this:
Vague prompt → unpredictable output → "that's not what I wanted"
→ vague correction prompt → partially better output
→ "still not it" → another prompt → frustration
→ git checkout . → start over
→ 45 minutes lostWith a prompting methodology, the workflow is:
Structured prompt → predictable output → verify
→ targeted adjustment (if needed) → done
→ 5 minutes totalThe difference isn't exaggerated. Developers with a method produce in 5 minutes what developers without a method produce in 45 — or don't produce at all. The time invested in learning prompt engineering is recovered in the first week of use.
Module Objective
By the end of this module you'll be able to:
- ✅ Articulate the fundamental difference: a chatbot generates text based on your prompt; a coding agent reads files, runs shell commands, modifies code, and makes commits — the consequences of a badly written prompt are real
- ✅ Identify at least 5 common anti-patterns in your current prompts: vague prompts, lack of technical context, absence of constraints, ambiguous scope, missing output specification
- ✅ Apply the "junior developer with superpowers and amnesia" mental model to calibrate your instructions
- ✅ Compare the output of the same prompt written in chatbot style vs agent style, measuring differences in quality, precision, and iterations needed
- ✅ Understand that the time invested in a good prompt is recovered exponentially in fewer iterations and fewer bugs
Professional objective
When you open Claude Code tomorrow, you won't write "make an endpoint for users." You'll write a prompt that specifies context, a concrete task, constraints ("don't modify the existing tests"), and expected output format. That difference will shape your entire productivity with coding agents — not only with Claude Code, but with any agentic tool you use in the future.
Module Roadmap
Capsule map
| # | Capsule | What you'll learn | Type |
|---|---|---|---|
| 01 | Introduction (this one) | Context, objectives, why this module matters | Intro |
| 02 | Chatbots vs Coding Agents | The fundamental difference: generating text vs executing actions in your codebase | Technical |
| 03 | Common Anti-patterns | The 5+ mistakes you make when prompting Claude Code and how to spot them | Technical |
| 04 | Mental Models for Directing Agents | The "junior developer with superpowers and amnesia" and how to calibrate instructions | Technical |
| 05 | Project: Prompt Diagnosis | Assess your current prompts, rewrite them, and measure the difference | Project |
Learning flow
First you'll understand why prompting for coding agents is fundamentally different (capsule 02). That foundation prepares you to recognize what you're doing wrong — the anti-patterns that produce inconsistent results (capsule 03). With the problems identified, you need a mental framework to think differently: the mental models that anchor your new way of prompting (capsule 04). Finally, you apply it all in a self-diagnosis of your own prompts, rewrite them, and measure the difference (capsule 05).
The progression is: understand the difference → identify mistakes → change mindset → apply and measure.
Each capsule builds directly on the previous one. Don't jump to capsule 04 without having gone through 02 and 03 — the mental models make sense once you already understand the chatbot vs agent difference and have identified your anti-patterns.
Estimated module duration: 3-4 hours (readings + project).
Connection to the Project
This module's mini-project: Prompt Diagnosis
In capsule 05 you'll run a self-diagnosis of your own prompts. You're going to:
- Collect 3-5 prompts you've used with Claude Code in your real work
- Classify each one as "chatbot style" or "agent style" using the criteria from capsules 02-04
- Rewrite the chatbot-style prompts applying the mental models you learned
- Compare the outputs of both versions with Claude Code
- Document the differences: code quality, iterations needed, bugs introduced
Example of what you'll discover:
Original prompt (chatbot style):
"Add authentication to the project"
Rewritten prompt (agent style):
"Add JWT authentication to the POST /api/login endpoint in
src/routes/auth.py. Use PyJWT. The token must expire in 24h.
Don't modify the existing endpoints in src/routes/users.py.
Add the corresponding tests in tests/test_auth.py."
Measurable difference:
- Original: 8 files modified, 2 unwanted, 3 iterations
- Rewritten: 3 files modified, 0 unwanted, 1 iterationIt's a self-awareness exercise. You'll discover patterns in how you prompt that explain why you sometimes get excellent results and sometimes frustrating ones. Those patterns are your starting point for improving.
Connection to the final project (Module 8)
The Personal Prompt Library you'll build in Module 8 only has value if each template is written with the right mindset — agent style, not chatbot style. This module establishes that mindset. Without it, your templates would be decorated versions of chatbot prompts — pretty but ineffective.
Module 1: Right mindset (agent style, not chatbot)
↓
Modules 2-7: Techniques, workflows, and templates
↓
Module 8: Personal Prompt Library → integrates EVERYTHING with the right mindsetPrerequisites
Required knowledge
- ✅ Claude Code installed and configured — Guide #2 of the path completed
- ✅ Basic CLAUDE.md created — At least one project with a CLAUDE.md
- ✅ Basic programming — Any language (Python preferred for the examples)
- ✅ Familiarity with the terminal and Git — Navigation, basic commands, commits
Quick check
If you can answer "yes" to these questions, you're ready:
- Can you open Claude Code in your terminal and run a basic instruction?
- Do you have a CLAUDE.md file in some project?
- Have you used Claude Code to modify code at least once?
- Do you know what a commit is and how to revert changes with
git checkout?
Not sure? Check here
Open Claude Code:
# In your terminal, inside a project
claudeIf the interactive Claude Code prompt opens, you're ready.
CLAUDE.md:
# Look for CLAUDE.md in your project
ls CLAUDE.mdIf it exists, you're ready. If not, create it with basic content:
# CLAUDE.md
This project uses Python 3.11+ and FastAPI.Git:
# Verify you know how to make a commit
git status
git add .
git commit -m "test"If these commands are familiar to you, you're ready.
If you don't have the prerequisites
| What you're missing | Recommended resource |
|---|---|
| Claude Code | Guide #2: Claude Code Foundations (NIEVA) |
| CLAUDE.md | Guide #2: Claude Code Foundations, Module 3 |
| Basic programming | Python for Backend Development Guide (NIEVA) |
| Terminal and Git | Any basic Git/terminal tutorial |
You don't need
- ❌ Prior experience with prompt engineering — we start from the mindset
- ❌ Knowledge of NLP or machine learning — this isn't about how LLMs work
- ❌ Experience with other AI tools (Cursor, Copilot) — everything is Claude Code-specific
- ❌ A large project — the exercises work with any codebase, even a 3-file one
Module Setup
What you need to have ready
To get the most out of this module, prepare the following:
1. A project with Claude Code configured:
It doesn't need to be complex. A Python project with 3-5 files works. If you don't have one at hand, you can quickly create one:
mkdir prompt-eng-practice
cd prompt-eng-practice
git init
# Create a simple Python file
cat > app.py << 'EOF'
"""Simple task manager API."""
tasks = []
def add_task(title: str, priority: str = "medium") -> dict:
task = {"id": len(tasks) + 1, "title": title, "priority": priority, "done": False}
tasks.append(task)
return task
def list_tasks() -> list:
return tasks
def complete_task(task_id: int) -> dict | None:
for task in tasks:
if task["id"] == task_id:
task["done"] = True
return task
return None
if __name__ == "__main__":
add_task("Learn prompt engineering", "high")
add_task("Practice with Claude Code", "high")
add_task("Build prompt library", "medium")
print(list_tasks())
EOF
# Create a basic CLAUDE.md
cat > CLAUDE.md << 'EOF'
# Project: Prompt Engineering Practice
- Python 3.11+
- Simple task manager for practicing prompts
- Follow PEP 8 conventions
EOF
git add . && git commit -m "Initial setup for prompt engineering practice"2. Claude Code working:
# Verify Claude Code is operational
claude --version
# Open Claude Code in your project
cd prompt-eng-practice
claude3. A document for notes:
Create a file where you'll document your observations during the module:
touch prompt-diagnosis-notes.mdYou'll use it in capsule 05 to document your prompts, classifications, and comparisons.
Limits: What This Module Does NOT Cover
- ❌ Prompt structure (anatomy) — Covered in Module 2. Here you understand the "why" of the difference; there you learn the "how" to structure it
- ❌ Few-shot prompting techniques — Covered in Module 3. First you need the right mindset
- ❌ Professional workflows (PRD, spec-first) — Covered in Modules 4-5, Phase 2
- ❌ Templates and prompt libraries — Covered in Modules 7-8, Phase 3
- ❌ Generic prompt engineering for LLMs — Everything in this guide is specific to coding agents. If you're looking for chatbot prompting, there are other resources
- ❌ Claude Code configuration — Covered in Guide #2 (Claude Code Foundations). Here we assume it's already configured
Evidence of Success
By the end of this module, you'll know you succeeded if:
- ✅ You can explain in one sentence why a prompt for Claude Code needs to be different from a prompt for ChatGPT
- ✅ You can take one of your prompts and spot at least 2 anti-patterns in it
- ✅ You use the "junior developer with superpowers and amnesia" mental model to calibrate your instructions before sending them
- ✅ You compared at least 3 prompts (chatbot vs agent) and documented the differences in output
- ✅ You feel that the time invested in building a good prompt is an investment, not overhead
- ✅ You can explain to a colleague why "improve the code" is a dangerous prompt in an agent
Quick self-assessment test
If you can answer these questions by the end of the module, you're on the right track:
- What's the fundamental difference between a chatbot and a coding agent?
- Why is "create an endpoint for users" an insufficient prompt for Claude Code?
- What does it mean that Claude Code is a "junior developer with superpowers and amnesia"?
- What are the 3 most common anti-patterns in your current prompts?
- What concrete change would you make to your next prompt based on what you learned?
Summary
- This module establishes the fundamental mindset for everything that follows in the guide
- The key difference: a chatbot generates text; a coding agent executes real actions in your codebase with tangible consequences
- You'll learn to identify anti-patterns in your current prompts — the chatbot habits that produce inconsistent results
- The "junior developer with superpowers and amnesia" mental model will be your anchor for calibrating instructions in every prompt you write
- The mini-project is a self-diagnosis that shows you exactly where your gaps are
- Everything learned here is the foundation for modules 2-8 of the guide — without the right mindset, the techniques don't help
Additional Resources
- Claude Code Best Practices — Anthropic's official documentation with best practices for prompting in Claude Code
- Prompt Engineering Overview (Anthropic) — Prompt engineering fundamentals according to Anthropic
- Claude Code Overview — What Claude Code is and how it works as a coding agent
- Tweag: AI-assisted Coding — Spec-first methodology for AI development (preview of Module 5)
- Agentic Coding Best Practices — Research on the Research → Plan → Execute → Validate workflow
- Anthropic Cookbook — Practical examples of using Claude for development
Next capsule: In capsule 02 you'll see the fundamental difference between chatbots and coding agents — with concrete examples and real outputs that will show you why the same prompt produces radically different results in each context.