Claude Code

Prompt Engineering for Coding

Last updated 2026-08-01

What's new

2026-08-01
  • **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.
2026-07-31
  • 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.
2026-07-22
  • 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.
2026-07-16
  • **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.
2026-07-10
  • 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).
2026-07-07
  • 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.
2026-07-01
  • 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

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

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