# Stanford CS193T Thinking with AI | Autumn 2026 | Core Prompting

## Executive summary

This lecture provides advanced prompting techniques for treating AI as a capable, but fallible, junior team member. Key strategies include defining detailed Scope-of-Work (SOW) prompts, using the 'Interview Me' pattern to gather requirements, and implementing 'grounding' by providing concrete data to reduce hallucinations. The session emphasizes the need for 'observability'—making the AI's internal process visible—and careful 'context management' to prevent 'context rot' and maintain resource efficiency (tokens/energy).

## Key takeaways

- Adopt the 'Good Manager' Mindset: When delegating tasks to AI, adopt the qualities of a good manager: provide clear upfront expectations, define the division of tasks, establish clear acceptance criteria, and specify the 'who, what, when, where, how, and why' of the task. (Timestamp: 1288)
- Use Grounding for Accuracy: To ensure the AI adopts your writing style or operates on accurate data, provide concrete examples or documents (grounding). This leverages the model's statistical power on your specific data, which is more effective than merely describing the desired style. (Timestamp: 1725)
- Prioritize Observability over Assertion: When trust and accuracy are critical, do not ask the LLM 'How certain are you?' Instead, demand evidence and citations. Techniques like asking the AI to echo back a summary of requirements (Scope of Work) or to show its 'thinking steps' increase observability into the black box process. (Timestamp: 2300)
- Manage Context to Prevent Rot: For new topics, always start a new chat to prevent 'context rot'—the dilution of focus and unnecessary token consumption from irrelevant past conversations. For recurring topics, a dedicated chat can maintain continuity while minimizing noise. (Timestamp: 3300)

## Technical details

- System Prompt: An invisible set of instructions inserted by the AI vendor (e.g., Anthropic's Claude) into the context window at the start of every conversation. These prompts define the model's core behavior, constraints, and style, and are a key example of transparency in responsible AI. (Timestamp: 1100)
- Context Window Management: The entire history of the conversation (user prompt + AI response) fed into the LLM for each prediction. Managing this resource is critical; excessive or irrelevant history leads to 'context rot' and inefficient token usage. (Timestamp: 3300)
- Chain of Thought (CoT): The formal technical name for internal iteration, where the model simulates multiple instances of itself talking to each other before generating a final answer. This process is computationally more expensive but significantly improves reasoning quality. (Timestamp: 2550)
- Primacy and Recency Bias: The tendency of transformer attention models to focus most heavily on the very first (system prompt) and very last (most recent prompt) pieces of information in the context window, potentially causing information in the middle to be overlooked ('lost in the middle'). (Timestamp: 3600)

## Practical implications

- Treat AI interactions like engineering requirements gathering: define the goal, the audience, and the acceptance criteria upfront.
- When debugging or refining AI output, always ask for the process (e.g., 'show your thinking steps') rather than just the result.
- For long-term projects, use the 'prompt postmortem' pattern to distill the entire conversation into a single, standalone prompt for future reuse, saving tokens and time.
- Be mindful of resource consumption (tokens/energy) by choosing the appropriate model and effort settings for the complexity of the task.

## Topics

Core Prompting Skills, AI Trust and Observability, Context Management, Resource Efficiency, AI Ethics and Bias, Stanford AI Playground, Claude Sonnet 5, Anthropic System Prompts

Source: https://www.youtube.com/watch?v=Qhf1mp74tbk
