liveBook · Manning

Chain-of-thought prompting

As explained in Vibe Engineering

Chain-of-thought prompting is a technique in which a language model generates intermediate reasoning steps before producing its final answer.

Chain-of-thought prompting asks a language model to produce intermediate reasoning before its final answer. It turns a direct request into a structured task: decompose the problem, inspect dependencies, adapt decisions, and then act. The technique can improve correctness on complex work, but newer reasoning models often perform this deliberation internally, so explicit step-by-step instructions are now a useful hint rather than a guaranteed switch. section 3.6.1 section 6.3

Use chain-of-thought as an engineering control rather than an instruction to trust unverified explanations:

  • Give the model grounding tools such as tests, compilers, or MCP servers, and audit the visible reasoning trace. section 3.6.1
  • For coding changes, require analysis of the current logic and dependencies, identification of old API calls, and a search for relevant examples before implementation. section 3.6.1
  • Treat “let’s think step by step” as a low-cost reliability aid, then validate its effect with a benchmark instead of assuming it works universally. section 6.3

From direct coding action to a staged plan

Instead of only asking to refactor process_payment for the StripeV3 client, prompt for analysis of existing logic, dependency checks, identification of legacy API calls, and relevant context before changing code. In text-to-SQL work, step-by-step prompting is tested alongside schema descriptions, column descriptions, and recent queries using the BIRD dataset. section 3.6.1 section 6.3

Figure 3.12 Cline drafting plan of the execution.

Review the execution-plan figure alongside the human-approval figure to inspect how deliberation becomes an auditable agent workflow. section 3.6.1

How Vibe Engineering covers it

How deep it goes
Explains staged reasoning, tool grounding, and visible-trace auditing, while noting that modern models increasingly reason internally.
Examples
Uses a StripeV3 payment refactor and BIRD text-to-SQL benchmarking with schema, column, and query context.
What you can do after
Apply it via structured prompts, grounding tools, visible plans, and benchmark-based validation.
How it connects
Ties chain-of-thought to context anchoring, chain-of-verification, retrieval-augmented generation, context compaction, and MCP.

Also explained in

Compare how 29 books explain chain-of-thought prompting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.