Prompt Engineering for Coding
Last updated 2026-08-01What's new
- **Claude Code (Anthropic's AI coding assistant)** helps teams edit code, run commands, and follow project rules, making it easier to work together safely and efficiently.
- **Agent SDK (a toolkit for custom agents)** and **Claude API (a tool for custom apps)** let teams build their own automation and apps, choosing the right tool for the job.
- **Shared settings, hooks (automatic checks), and permissions** help teams work faster and safer, like giving a new hire a handbook, clear rules, and the right tools for the job.
- **Project memory (like a team handbook in Claude.md)** keeps everyone on the same page, while **skills and sub-agents (specialist tools)** help with specific tasks, making teamwork smoother.
- Chat GPT Voice 2.0 (a voice feature for the Chat GPT app) now lets you talk to an AI assistant (called an agent) in real time, like having a conversation with a person.
- The new version can do multiple tasks at once, like organizing files, doing research, and creating a website, all while you're working on your computer or phone.
- It can also explain things on websites you're visiting, like how to use Firecrawl (a tool that helps gather information from websites), making it easier to understand and use new tools.
- The assistant can be moved around your screen and used on any app or website, making it a handy helper for various tasks.
- AI tools (computer programs that can learn and make decisions) often struggle with physical data like videos, sensor info, or robot telemetry, but new research shows adding specific tools and context can help.
- To make AI work better with messy, unstructured data, we need to give it a way to "see," "touch," and remember important data, not just a "brain" (the AI's learning part).
- Researchers found that using Pydantic (a tool that helps organize data) in Python (a programming language) can simplify working with complex data, avoiding the need for separate databases and programming languages.
- A new open-source project called Data Chain with data harness (a tool that helps AI understand and work with data) lets users analyze physical data like videos more efficiently, using AI to answer questions quickly without manually sorting through files.
- **Claude Code** (AI coding assistant) and **Fable** (new AI tool) have significantly improved, reducing the need for constant monitoring and speeding up tasks like video editing and software development.
- **Product managers** (people who plan new features) now focus more on deciding what to build, as AI tools like **Claude Code** have drastically shortened the time from idea to implementation.
- **Rewriting code** (updating existing code) is now encouraged, as AI tools help ensure the new code is accurate and well-tested, making it easier to improve and experiment with different implementations.
- Enable notification sounds in Cloud Code (a tool that helps you write and manage code in the cloud) to avoid missing important prompts, by adjusting settings in the .cloud folder (a hidden folder in your home directory that stores Cloud Code settings).
- Use the "agent push notify enabled" setting in Cloud Code to get pinged on your mobile phone when it needs your input, speeding up your workflow.
- Create a custom allow list in Cloud Code by running "/fewer permission prompt" to automatically approve common, safe commands based on your history, reducing the need to manually approve each one.
- Set up deny rules in Cloud Code to prevent it from automatically approving sensitive actions, like reading environment files (which contain API keys and other secrets) or pushing to GitHub (a platform for version control and collaboration).
- New AI models like Fable 5 (a smart AI assistant) and GPT 5.6 do too much, so you need to simplify your requests to avoid overwhelming them.
- To get the best results, tell the AI what you want to achieve, who it's for, and what "done" looks like, without giving step-by-step instructions.
- Use a "fence" to prevent the AI from doing extra, unasked tasks by setting clear boundaries in your requests.
- Fable 5 will soon cost extra to use, so save it for complex tasks that need high-quality results.
- Claude design 2.0 (a tool for creating websites, apps, and more using AI) now uses credits more efficiently, so you won't run out as quickly.
- You can now access Claude design within the Claude desktop app (a program you download to use Claude on your computer), making it easier to use.
- Claude design can create presentations, taking inspiration from images you provide, and even includes speaker notes for each slide.
- You can export your designs to various platforms like PowerPoint, PDF, Miro (a collaborative online whiteboard), and Figma (a web-based design tool).
Key points
What it is
- Prompt engineering for coding is writing clear, specific instructions to get better results from an AI model, like asking for a specific TypeScript function instead of a vague request.
- It involves techniques like giving the AI a role, clear instructions, examples, and constraints to improve output quality.
- Context engineering is designing the full environment an AI works in, giving it memory, tools, and self-checking abilities.
- Evaluation is measuring output quality and adjusting prompts based on that measurement.
How to use it
- Start by stating intent, constraints, acceptance criteria, and file locations upfront for specificity.
- Use a fixed pattern: draft a prompt, build data, call the AI, score results, then repeat.
- For complex tasks, define the job, what good looks like, and the process, then use a plan mode first.
- Treat prompt changes like application changes: make a controlled edit, test it, and keep the evidence.
Watch out for
- Don't treat the AI like a search engine; guide the process instead of just fixing results.
- Resist patching issues; treat every failure as a system bug and improve prompts to prevent recurrence.
- Don't repeat coding standards every session; use an "always on" instructions file for team rules.
- Never assume the AI's plan is optimal; use a code review agent to catch logical faults.
Tools named
- Claude (an AI assistant for coding tasks), code graders (scripts that catch mechanical failures), model graders (AI that scales flexible review), code review agent (a separate tool checking the AI’s work)
Lesson 1: What is Prompt Engineering for Coding and why it matters
Prompt engineering for coding is the practice of writing clear, specific instructions to get better output from an AI model. Instead of saying "write me a function," you might say "write me a TypeScript function that validates email addresses using rejects, returns a boolean, and handles edge cases like plus signs and subdomains." This precision matters because AI models, left to themselves, tend to give average answers.
The core techniques include giving the model a role, providing clear instructions, defining the end state, offering examples, and telling it what to avoid. You can also include project structure, existing patterns, and constraints as context. More context generally produces better results. Breaking complex tasks into steps, rather than trying to do everything in one massive prompt, also helps.
However, prompt engineering alone is becoming less important as models improve. The next layer is "context engineering" (designing the full environment an AI works in). This means giving an AI agent memory, tools, permissions, and a way to check its own work. Systems fail more often because of missing context than because of bad prompts.
Additionally, evaluation matters. You measure output quality, then adjust your prompt based on that measurement. Use system prompts (instructions defining behavior and role) for rules, and provide examples separately for extra information.
The real skill shift is from typing prompts to designing systems: little AI employees with goals, context, and self-checking ability. That is where lasting value lies.
Sources
- 2026-06-15 — Learn These 6 AI Skills Now (Before AI Replaces You)
- 2026-05-07 — Agent Optimization with Pydantic AI GEPA, Evals, Feedback Loops Samuel Colvin, Pydantic
- 2026-05-10 — How we solved Context Management in Agents Sally-Ann Delucia
- 2026-06-17 — ChatGPT & Claude Are Built to Give You the Average Answer
- 2026-06-25 — Learn AI Is Bad Advice. Learn This Instead
- 2026-01-29 — From Coder to Orchestrator The Developer Role Shift Nobody's Talking About
- 2025-12-26 — AI Skill That Pays in 2026 Systems
- 2026-05-22 — Fast Models Need Slow Developers Sarah Chieng, Cerebras
- 2026-02-02 — AI Coders Scored 17% Lower—Here's What They Did Wrong
- 2026-06-20 — Claude Certified Architect Prerequisite Building with the Claude API Part 8 Prompt Engineering
- 2026-05-22 — How To Build An App With Claude Code (No Experience Required)
- 2026-01-07 — I Built a New AI System in 3 Hours (and got paid $1650)
- 2025-12-10 — How I'd Learn n8n if I had to Start Over in 2026
- 2026-05-30 — Google Remy, Grok 5, Mythos 1, New Atlas Robot, ASI and More AI News This Month!
Lesson 2: How to use Prompt Engineering for Coding: step-by-step
To use prompt engineering (crafting clear instructions for AI) for coding with Claude, start by stating four things upfront: intent (what you want), constraints (what Claude shouldn’t do), acceptance criteria (how you’ll know it worked), and file locations (where to look). This specificity often succeeds on the first attempt.
For example, instead of “write a script,” say: “Generate a Python script to parse a CSV file. Constraints: use only standard library, no external imports. Acceptance criteria: output rows as JSON. File: save to `/scripts/parser.py`.” Then give Claude something to verify against, like a test case.
Claude writes prompts for Claude—if you’re unsure how to prompt, ask it to write the prompt. Treat prompt changes like application changes: make a controlled edit, test it, and keep the evidence. For complex tasks, define the job, define what good looks like, and define the process. Use a plan mode first to analyze, then implement. Delegate tasks rather than guide line by line.
The fixed pattern is simple: draft a prompt, build data, call Claude, score results, then repeat. Use code graders (scripts that catch mechanical failures) and model graders (AI that scales flexible review). Before implementing, decide what quality means—format, output type, or behavior. This workflow turns a successful experiment into a component you can trust in an application.
Sources
- 2026-03-19 — This Free Claude Code Plugin Replaced My Entire Content Team
- 2026-05-03 — Context Is the New Code Patrick Debois, Tessl
- 2026-05-07 — Agent Optimization with Pydantic AI GEPA, Evals, Feedback Loops Samuel Colvin, Pydantic
- 2026-06-05 — Claude Certified Architect Prerequisite Claude API Part 5 Prompt Eval to Running the Eval
- 2026-06-09 — Claude Certified Architect Prerequisite Building with the Claude API Part 6 Model Based Grading
- 2026-04-14 — How to Build 247 Claude Agents. Easy.
- 2026-02-09 — Don't Use Claude Code Like ChatGPT—Use It Like This Instead
- 2026-06-14 — Unlock 97 of Claude In Under 10 Minutes (Insane Results)
- 2026-05-10 — How we solved Context Management in Agents Sally-Ann Delucia
- 2026-01-25 — Agentic Workflows Just Changed AI Automation Forever! (Claude Code)
- 2026-06-01 — 3 AMAZING Claude Code Dynamic Workflows (Opus 4.8)
- 2026-04-11 — Seedance 2.0 + Claude Code Creates $10k Websites in Minutes
- 2026-01-22 — Claude Code → GSD → n8n in (One Shot)
- 2026-06-20 — Claude Certified Architect Prerequisite Building with the Claude API Part 8 Prompt Engineering
- 2026-04-20 — 9 Opus 4.7 Changes That Broke Your Claude Code!
Lesson 3: Best practices and pitfalls
A common pitfall in prompt engineering for coding is treating the AI like a search engine instead of a collaborator. Beginners often ask for a vague feature, then repeatedly correct the output. A best practice is to shift your mindset: instead of checking if Claude did the right thing, you should verify if it is doing the right work. This means guiding the process, not just fixing results.
When an issue arises, resist the urge to only patch it. A more effective approach is to treat every failure as a system bug (a flaw in your process or instructions). Use the mistake to improve your prompts so the problem doesn't happen again. You can also enforce correct behavior by using a state machine (a predefined sequence of steps) to force the AI to follow a specific workflow, rather than letting it decide whether to deviate.
A major mistake is repeating your coding standards every session. Instead, use an "always on" instructions file that tells Claude your team's rules for commit messages, feedback structure, and style once. This avoids re-explaining each time. Also, never assume the AI's plan is optimal. If you are not an expert software engineer, bring in a second review by using a code review agent (a separate tool checking the AI’s work) to catch logical faults before you accept the output. Finally, ask Claude to explain what it just wrote. Code can look intimidating, but understanding it is the key to catching mistakes early.
Sources
- 2026-06-18 — How to Build Effective Claude Code Agents in 2026
- 2026-02-02 — I Tested All 10 of Claude Code's Creator Tips 2026
- 2026-06-09 — Claude Fable 5 just dropped and I'm speechless...
- 2026-02-22 — 🚀Get The Most Out of Your Claude Code Terminal!
- 2026-05-28 — Anthropic Doesnt Want You To Know This About Claude Code
- 2026-05-30 — How I deleted 95 of my agent skills and got better results Nick Nisi, WorkOS
- 2026-06-05 — How Anthropic Teams ACTUALLY use Claude Code day to day (for non-engineers)
- 2026-03-03 — The One Skill AI Can't Replace -- Are You Developing It
- 2026-04-16 — Claude Opus 4.7 Just Dropped... Or Did It Really
- 2026-06-05 — I Updated grill-me And Solved Claude Code
- 2026-06-06 — The Top 10 Claude Code Plugins to 10x Your Next Project (June '26)
- 2026-05-21 — Create Your Own Personal Claude AI System (That Makes Your Work EASY)
- 2026-05-27 — The AI Skill I Rely On Daily Priscila Andre de Oliveira, Sentry