- Preface i
-
1 What an Agentic Coding Harness Is 2
- 1.1 The Moment Coding Tools Stopped Being Just Assistants 2
- 1.2 Why ``AI Coding Tool'' Is Too Vague 3
- 1.3 The Developer Tooling Spectrum 4
- 1.4 Static Autocomplete: Prediction Without Agency 5
- 1.5 Chat Assistants: Reasoning Without Direct Execution 5
- 1.6 Inline Chat and IDE Assistants: Context-Aware Help 7
- 1.7 Agentic Coding Harnesses: The Model Gets Hands 8
- 1.8 A Precise Definition of an Agentic Coding Harness 8
- 1.9 The Four Capabilities of a True Harness 9
- 1.10 Capability 1: Autonomous File-System Read and Write 9
- 1.11 Capability 2: Shell Command Execution 11
- 1.12 Capability 3: Recursive Self-Correction 11
- 1.13 Capability 4: Tool Registration and Tool Schemas 12
- 1.14 Human-in-the-Loop vs. Human-on-the-Loop 13
- 1.15 Why Harnesses Need More Permissions Than Chat 14
- 1.16 What Harnesses Still Cannot Safely Do 15
- 1.17 Tool Calls as the Boundary Between Text and Action 15
- 1.18 Walkthrough: Adding Input Validation with a Harness 16
- 1.19 Comparing the Same Task Across Tool Categories 18
- 1.20 How to Classify Any New AI Coding Tool 20
- 1.21 Common Misconceptions About Coding Agents 20
- 1.22 Hands-On Lab: First Agentic Session 21
- 1.23 Interview Questions 23
- 1.24 Chapter Summary 24
- 1.25 What Comes Next 25
-
2 The Agent Loop 26
- 2.1 The Loop Behind the Illusion 27
- 2.2 Why Harnesses Are Easier to Debug Once You See the Loop 27
- 2.3 A Tiny Tool-Call Round Trip 29
- 2.4 The Five Phases of the Agent Loop 30
- 2.5 Phase 1: Perception 31
- 2.6 Phase 2: Planning 32
- 2.7 Phase 3: Execution 33
- 2.8 Phase 4: Observation 34
- 2.9 Phase 5: Termination 35
- 2.10 Correction: The Loop Learns From Its Own Tool Output 35
- 2.11 Tool Calls as Structured Intent 36
- 2.12 What the Harness, Not the Model, Actually Executes 37
- 2.13 How Context Is Rebuilt on Every Turn 38
- 2.14 Turn Limits, Token Budgets, and Timeouts 39
- 2.15 Permission Denials as Loop Events 39
- 2.16 Failed Commands and Error Re-Injection 40
- 2.17 Clean Termination vs. Stalled Termination 41
- 2.18 The Loop in Pseudocode 42
- 2.19 Walkthrough: A Docstring Task From Start to Finish 44
- 2.20 Reading Agent Logs 47
- 2.21 Diagnosing Common Loop Failures 48
- 2.22 How Different Harnesses Expose the Loop 49
- 2.23 Hands-On Lab: Trace a Real Agent Loop 50
- 2.24 Interview Questions 51
- 2.25 Chapter Summary 53
- 2.26 What Comes Next 54
-
3 Anatomy of a Harness 55
- 3.1 From Loop Behavior to Harness Architecture 55
- 3.2 The Five Components Every Harness Needs 56
- 3.3 Why Anatomy Matters When Agents Misbehave 58
- 3.4 Component 1: The System Prompt 58
- 3.5 System Prompt Layering: Built-In, Global, Project, Session 59
- 3.6 Global Instruction Files 61
- 3.7 Project-Level Instruction Files: AGENTS.md and CLAUDE.md 62
- 3.8 What Belongs in Project Instructions 63
- 3.9 What Does Not Belong in Project Instructions 64
- 3.10 Component 2: Tool Definitions 64
- 3.11 Tool Schemas, Parameters, and Descriptions 65
- 3.12 Built-In Tools vs. Registered Tools 66
- 3.13 MCP as a Tool-Registration Layer 67
- 3.14 Component 3: The Context and State Manager 68
- 3.15 How a Harness Decides What the Model Sees 68
- 3.16 Conversation History, File Contents, Repo Maps, and Summaries 69
- 3.17 Context Drift and Context Pollution 70
- 3.18 Component 4: The Permission Gate 71
- 3.19 Approval, Denial, Confirmation, and Auditability 72
- 3.20 Component 5: The LLM Client 73
- 3.21 Provider APIs, Local Endpoints, and Model Routing 74
- 3.22 Mapping Configuration Files to Harness Components 75
- 3.23 Troubleshooting by Component 77
- 3.24 Hands-On Lab: Build Your First Harness Anatomy Map 79
- 3.25 Interview Questions 80
- 3.26 Chapter Summary 82
- 3.27 What Comes Next 83
-
4 The Model Context Protocol (MCP) 85
- 4.1 Why Harnesses Need External Tools 85
- 4.2 The Problem MCP Solves 86
- 4.3 MCP in One Sentence 87
- 4.4 Clients, Servers, Tools, and Results 88
- 4.5 How MCP Fits Into the Agent Loop 89
- 4.6 Tool Discovery: How the Harness Learns What Exists 90
- 4.7 Tool Schemas: How Capabilities Become Callable 91
- 4.8 Tool Calls: From Model Intent to Server Request 92
- 4.9 Tool Results: Observations Returned to the Loop 93
- 4.10 Transport Option 1: stdio 94
- 4.11 Transport Option 2: Streamable HTTP 95
- 4.12 Choosing stdio vs. Streamable HTTP 96
- 4.13 Registering a Fictional MCP Server 98
- 4.14 Building a Minimal Python MCP Server 99
- 4.15 Validating Tool Inputs 100
- 4.16 Returning Useful Tool Results 101
- 4.17 Error Handling and Recovery 102
- 4.18 Security: Every Tool Is a Capability 103
- 4.19 Authentication and Authorization for Networked MCP 104
- 4.20 Logging and Auditability 105
- 4.21 Common MCP Failure Modes 106
- 4.22 Hands-On Lab: Build a Tiny todo_mcp_server 107
- 4.23 Interview Questions 108
- 4.24 Chapter Summary 110
- 4.25 Further Reading 112
- 4.26 What Comes Next 112
-
5 Context & Cache Management 113
- 5.1 When Good Agent Sessions Go Stale 114
- 5.2 What ``Context'' Means in a Coding Harness 114
- 5.3 The Context Window Is a Budget, Not a Filing Cabinet 115
- 5.4 What Enters the Context on Each Turn 116
- 5.5 How Context Grows During an Agent Loop 117
- 5.6 Input Tokens, Output Tokens, and Tool Results 119
- 5.7 Why More Context Is Not Always Better 120
- 5.8 Context Pollution: When Observations Become Noise 121
- 5.9 Prompt Caching: Paying Less for Stable Prefixes 122
- 5.10 What Caching Does Not Solve 123
- 5.11 Compaction: Compressing the Session State 123
- 5.12 What Compaction Can Lose 124
- 5.13 Clearing and Restarting Sessions 125
- 5.14 Repo Maps and Symbol-Level Context 126
- 5.15 Full Files vs. Snippets vs. Summaries 127
- 5.16 MCP Results and Context Pressure 129
- 5.17 Task Scoping as the Primary Cost Control 129
- 5.18 Estimating Token Growth Before You Run 130
- 5.19 Cost Formulas Without Hardcoded Prices 131
- 5.20 Local Models and Smaller Context Windows 133
- 5.21 Walkthrough: Rescuing a Drifting Session 133
- 5.22 Context Hygiene Checklist 135
- 5.23 Hands-On Lab: Measure Context Growth 137
- 5.24 Interview Questions 138
- 5.25 Chapter Summary 140
- 5.26 Further Reading 141
- 5.27 What Comes Next 142
-
6 Tool Design & Safety 143
- 6.1 Tools Turn Text Into Effects 144
- 6.2 Why Tool Design Is a Safety Problem 145
- 6.3 The Standard Built-In Tool Set 146
- 6.4 File Read Tools 147
- 6.5 Preventing Path Traversal 148
- 6.6 File Write and Edit Tools 150
- 6.7 Diffs, Atomic Writes, and Reviewability 151
- 6.8 Search Tools and Their Failure Modes 152
- 6.9 Shell Execution: The Sharpest Tool 152
- 6.10 Dangerous Command Patterns 153
- 6.11 Test Runner Tools as Safer Shell Alternatives 154
- 6.12 Web Fetch and Network-Aware Tools 156
- 6.13 MCP Tools as Capability Surfaces 156
- 6.14 Permission Gates: Allow, Confirm, Deny 157
- 6.15 Pattern-Based Command Policies 159
- 6.16 Path-Based Permission Rules 160
- 6.17 Session Decisions and Audit Logs 161
- 6.18 Sandboxing Beyond Permission Prompts 162
- 6.19 Read-Only Workspaces and Writable Scratch Areas 163
- 6.20 Prompt Injection Through Repository Content 163
- 6.21 Linguistic Defenses vs. Hard Boundaries 165
- 6.22 Least-Privilege Tool Design 166
- 6.23 Returning Safe and Useful Tool Results 167
- 6.24 Walkthrough: Blocking a Risky Cleanup Command 167
- 6.25 Tool Safety Checklist 169
- 6.26 Hands-On Lab: Test a Permission Policy 169
- 6.27 Interview Questions 171
- 6.28 Chapter Summary 173
- 6.29 Further Reading 174
- 6.30 What Comes Next 175
-
7 Claude Code Deep Dive 177
- 7.1 Why Claude Code Gets the First Deep Dive 177
- 7.2 Claude Code Through the Harness Anatomy 178
- 7.3 Installation and First Run, Without Overfitting to Today's Syntax 180
- 7.4 Working Inside a Repository 181
- 7.5 Instruction Layers: Global, Project, and Session 182
- 7.6 Writing a Safe Project Instruction File 183
- 7.7 The Core Claude Code Workflow 184
- 7.8 File Reads, Diffs, and Reviewable Edits 185
- 7.9 Shell Commands and Permission Prompts 187
- 7.10 Configuring Safe Command Behavior 187
- 7.11 Slash Commands as Repeatable Workflows 188
- 7.12 Custom Commands for Team Conventions 190
- 7.13 Hooks as Quality Gates 190
- 7.14 Hook Design: Useful, Small, and Observable 194
- 7.15 MCP Integration in Claude Code 195
- 7.16 Context Management in Long Sessions 196
- 7.17 Clear, Compact, Restart, and Handoff Notes 197
- 7.18 Workflow 1: Small Bug Fix 198
- 7.19 Workflow 2: Test-First Change 199
- 7.20 Workflow 3: Code Review and Safety Audit 200
- 7.21 Walkthrough: Adding CLI Argument Validation 201
- 7.22 Where Claude Code Fits Best 202
- 7.23 Where Claude Code Is Not the Best Fit 203
- 7.24 Claude Code Safety Checklist 204
- 7.25 Hands-On Lab: Build a Safe Claude Code Workflow 206
- 7.26 Interview Questions 207
- 7.27 Chapter Summary 209
- 7.28 Further Reading 210
- 7.29 What Comes Next 211
-
8 Aider Deep Dive 212
- 8.1 Why Aider Deserves Its Own Deep Dive 213
- 8.2 Aider Through the Harness Anatomy 213
- 8.3 Installation and First Run, Without Overfitting to Today's Syntax 215
- 8.4 Aider's Center of Gravity: Repo Maps and Git 216
- 8.5 Working Inside a Git Repository 217
- 8.6 The Repo Map: Structural Context Without Full Files 217
- 8.7 What Repo Maps Are Good At 218
- 8.8 What Repo Maps Cannot Replace 220
- 8.9 Selecting Files for the Conversation 221
- 8.10 Keeping the File Set Small Enough to Reason About 222
- 8.11 Git as a Safety Net 223
- 8.12 Auto-Commit, Diff Review, and Undo 224
- 8.13 Edit Formats and Patch Reliability 225
- 8.14 When Edits Fail to Apply 226
- 8.15 Architect Mode: Planning and Editing as Separate Roles 227
- 8.16 Configuration With .aider.conf.yml 228
- 8.17 Model Selection and Provider Flexibility 229
- 8.18 Local Models With Aider 230
- 8.19 Workflow 1: Small Targeted Edit 231
- 8.20 Workflow 2: Repo-Map-Assisted Refactor 231
- 8.21 Workflow 3: Test-Driven Bug Fix 232
- 8.22 Walkthrough: Adding Type Hints and Docstrings 233
- 8.23 Where Aider Fits Best 235
- 8.24 Where Aider Is Not the Best Fit 236
- 8.25 Aider Safety Checklist 237
- 8.26 Hands-On Lab: Compare Repo Map Editing 238
- 8.27 Interview Questions 239
- 8.28 Chapter Summary 241
- 8.29 Further Reading 242
- 8.30 What Comes Next 243
-
9 OpenCode, Goose, and Codex 244
- 9.1 Opening Scene: Three Agents, Same Bug, Different Loops 245
- 9.2 Why This Chapter Is Not a Product Ranking 246
- 9.3 The Anatomy Lens Returns 247
- 9.4 OpenCode's Center of Gravity 248
- 9.5 OpenCode Through the Five Comparison Questions 249
- 9.6 A Conceptual OpenCode Workflow 250
- 9.7 Where OpenCode Fits Well 251
- 9.8 Where OpenCode Is a Poor Fit 252
- 9.9 Goose's Center of Gravity 252
- 9.10 Goose Through the Five Comparison Questions 253
- 9.11 A Conceptual Goose Workflow 255
- 9.12 Goose as Automation Surface, Not Only Coding Surface 256
- 9.13 Where Goose Fits Well 257
- 9.14 Where Goose Is a Poor Fit 258
- 9.15 Codex's Center of Gravity 258
- 9.16 Codex Through the Five Comparison Questions 259
- 9.17 A Conceptual Codex Workflow 261
- 9.18 Codex and the Delegated-Task Loop 262
- 9.19 Where Codex Fits Well 264
- 9.20 Where Codex Is a Poor Fit 264
- 9.21 Same Bug, Three Harness Loops 265
- 9.22 Comparison Table: Centers of Gravity 266
- 9.23 Comparison Table: Derived Dimensions 267
- 9.24 Permission and Tool-Surface Differences 267
- 9.25 Runtime Placement: Local, Remote, and Hybrid 268
- 9.26 Configuration and Reproducibility 269
- 9.27 Reviewability as the Deciding Factor 270
- 9.28 Choosing a Harness by Task Shape 271
- 9.29 A Small Field Guide for Mixed-Tool Teams 272
- 9.30 Safety Checklist 273
- 9.31 Lab 9: Compare Three Harness Loops on One Bounded Change 274
- 9.32 Interview Questions 275
- 9.33 Chapter Summary 277
- 9.34 Further Reading 278
- 9.35 What Comes Next 278
-
10 Running Harnesses on Local Models 280
- 10.1 Opening Scene: The Same Harness, a Different Model Boundary 281
- 10.2 What ``Local Model'' Means in a Harness 282
- 10.3 Why Local Models Matter for Agentic Coding 283
- 10.4 Why Local Models Do Not Solve Everything 284
- 10.5 The Harness Comparison Questions With a Local Model 284
- 10.6 Local Inference Engines: Conceptual Landscape 285
- 10.7 Model Formats, Quantization, and Hardware in Practical Terms 286
- 10.8 A Conceptual Local Endpoint 287
- 10.9 Local Models and Repository Context 288
- 10.10 Local Models and Tool Use 289
- 10.11 Local Models and Structured Output 290
- 10.12 Local Models and Coding Tasks 291
- 10.13 Task Routing: Local, Hosted, or Hybrid 292
- 10.14 The Hybrid Harness Pattern 293
- 10.15 Privacy Boundaries and Mistaken Assumptions 294
- 10.16 Cost Boundaries and Mistaken Assumptions 295
- 10.17 Latency and Developer Experience 296
- 10.18 Evaluation: The Missing Discipline 297
- 10.19 A Small Local-Model Evaluation Suite 297
- 10.20 Failure Modes of Local Models in Coding Harnesses 299
- 10.21 Designing Prompts for Local Models 300
- 10.22 Context Compression and Local Models 301
- 10.23 Local Models in Claude Code, Aider, OpenCode, Goose, and Codex-Like Workflows 302
- 10.24 Configuration Examples 303
- 10.25 Security Checklist for Local Model Use 303
- 10.26 Same Task, Three Model Placements 305
- 10.27 Decision Table: When to Use Local Models 305
- 10.28 Operational Habits 307
- 10.29 Lab 10: Build a Local-Model Routing Plan 308
- 10.30 Interview Questions 309
- 10.31 Chapter Summary 311
- 10.32 Further Reading 311
- 10.33 What Comes Next 312
-
11 Workspace Configuration & AGENTS.md Files 313
- 11.1 When the Agent Does Not Know the Project 314
- 11.2 Project Instructions as a Repository Contract 314
- 11.3 Global Instructions vs. Project Instructions 315
- 11.4 Session Prompts Are Not Project Configuration 317
- 11.5 The Anatomy of a Good AGENTS.md 318
- 11.6 Project Purpose and Scope 319
- 11.7 Repository Layout Without Oversharing 320
- 11.8 Build, Test, Lint, and Format Commands 321
- 11.9 Coding Conventions That Agents Can Follow 322
- 11.10 Generated Files and Source-of-Truth Rules 322
- 11.11 Dependency and Package-Management Rules 323
- 11.12 Security Constraints and Secret Boundaries 324
- 11.13 Forbidden, Confirmed, and Safe Operations 325
- 11.14 Completion Checklists 326
- 11.15 What Not to Put in Project Instructions 327
- 11.16 Keeping Instructions Short Enough to Stay Useful 328
- 11.17 Configuration Across Different Harnesses 329
- 11.18 Claude-Style Project Instructions 330
- 11.19 Aider Configuration and File Selection 331
- 11.20 OpenCode, Goose, and Codex Configuration Concepts 332
- 11.21 Local-Model Notes in Project Configuration 333
- 11.22 Before and After: Rewriting a Weak AGENTS.md 334
- 11.23 Walkthrough: Teaching sample_cli Its Own Rules 336
- 11.24 Testing Whether the Harness Follows Instructions 337
- 11.25 Maintaining Project Instructions Over Time 339
- 11.26 Workspace Configuration Checklist 340
- 11.27 Hands-On Lab: Write and Test an AGENTS.md 341
- 11.28 Interview Questions 342
- 11.29 Chapter Summary 344
- 11.30 Further Reading 345
- 11.31 What Comes Next 345
-
12 Choosing a Harness Per Task 346
- 12.1 The Wrong Harness for the Right Task 346
- 12.2 Harness Selection Is Task Selection 347
- 12.3 The Six-Step Selection Model 348
- 12.4 Step 1: Classify the Task 350
- 12.5 Step 2: Estimate Scope and Context Pressure 351
- 12.6 Step 3: Identify Required Capabilities 352
- 12.7 Step 4: Choose Permission Posture 353
- 12.8 Step 5: Choose Local, Cloud, or Hybrid 354
- 12.9 Step 6: Define Verification Before Starting 354
- 12.10 Task Category 1: Small Bug Fix 355
- 12.11 Task Category 2: Test-First Change 356
- 12.12 Task Category 3: Large Refactor 357
- 12.13 Task Category 4: Greenfield Feature 358
- 12.14 Task Category 5: Documentation Update 359
- 12.15 Task Category 6: Code Review 360
- 12.16 Task Category 7: Security Audit 361
- 12.17 Task Category 8: Dependency Upgrade 362
- 12.18 Task Category 9: CI Repair Loop 363
- 12.19 Task Category 10: Low-Cost Local Batch Work 364
- 12.20 Claude Code Fit 365
- 12.21 Aider Fit 366
- 12.22 OpenCode Fit 366
- 12.23 Goose Fit 367
- 12.24 Codex Fit 368
- 12.25 Local Model Fit 368
- 12.26 Cloud Model Fit 369
- 12.27 Permission Postures by Task Risk 369
- 12.28 Decision Tree: Pick the Harness 371
- 12.29 Scenario Walkthroughs 373
- 12.30 Common Selection Mistakes 375
- 12.31 Hands-On Lab: Build Your Harness Decision Matrix 376
- 12.32 Interview Questions 377
- 12.33 Chapter Summary 378
- 12.34 What Comes Next 379
-
13 Cost, Speed, and Capability (Cloud vs. Local) 380
- 13.1 The Cheapest Model Is Not Always the Cheapest Workflow 381
- 13.2 Why Agentic Loops Cost Differently Than Chat 382
- 13.3 The Unit of Analysis: The Whole Task 382
- 13.4 Cloud Cost Components 383
- 13.5 Input, Output, Cache-Read, and Cache-Write Tokens 384
- 13.6 Turns, Retries, and Tool-Result Growth 385
- 13.7 Prompt Caching and Its Limits 386
- 13.8 Local Cost Components 387
- 13.9 Hardware Amortization Without Hardware Hype 389
- 13.10 Electricity, Maintenance, and Setup Time 390
- 13.11 Human Time as a Real Cost 390
- 13.12 Speed: Latency, Throughput, and Tool Time 391
- 13.13 Why Round Trips Matter in Agent Loops 393
- 13.14 Capability: Reliability Under Tool Use 393
- 13.15 Structured Output and Tool-Calling Failure Rates 394
- 13.16 Context Length and Capability Degradation 395
- 13.17 Privacy and Data Boundaries 395
- 13.18 Why Local Does Not Automatically Mean Safe 396
- 13.19 Cloud Cost Formula 396
- 13.20 Local Cost Formula 397
- 13.21 Break-Even Formula 398
- 13.22 Retry-Adjusted Cost 400
- 13.23 Human-Time-Adjusted Cost 401
- 13.24 Worked Example 1: Documentation Update 402
- 13.25 Worked Example 2: Focused Bug Fix 403
- 13.26 Worked Example 3: Large Refactor 403
- 13.27 Worked Example 4: Read-Only Security Audit 404
- 13.28 Worked Example 5: Repetitive Local Batch Task 405
- 13.29 Hybrid Routing Strategies 406
- 13.30 Routing by Task Shape, Risk, and Verification 408
- 13.31 Common Cost Mistakes 408
- 13.32 Hands-On Lab: Build a Cost and Capability Worksheet 409
- 13.33 Interview Questions 411
- 13.34 Chapter Summary 413
- 13.35 Further Reading 414
- 13.36 What Comes Next 414
-
14 Multi-Harness Workflows 415
- 14.1 One Harness Does Not Have to Do Everything 416
- 14.2 What a Multi-Harness Workflow Is 417
- 14.3 When Multi-Harness Workflows Help 417
- 14.4 When They Add Unnecessary Complexity 418
- 14.5 The Phase Model: Plan, Edit, Verify, Audit, Review 419
- 14.6 Handoff Artifacts 420
- 14.7 Context Handoff Without Context Pollution 422
- 14.8 Git as Shared Workflow Memory 423
- 14.9 Keeping Review Boundaries Clean 423
- 14.10 Workflow 1: Plan With Claude Code, Edit With Aider 424
- 14.11 Workflow 2: Read-Only Local Audit, Cloud Fix 426
- 14.12 Workflow 3: Aider Refactor, Claude Code Review 427
- 14.13 Workflow 4: Local Documentation Sweep, Cloud Final Review 428
- 14.14 Workflow 5: CI Repair Loop With Strict Limits 428
- 14.15 Workflow 6: Sandboxed Dependency Upgrade 430
- 14.16 Workflow 7: Shared MCP Validation Tool 431
- 14.17 Designing Safe Handoff Notes 432
- 14.18 Designing Plan Files That Another Harness Can Execute 433
- 14.19 Avoiding Cross-Tool Drift 434
- 14.20 Avoiding Duplicate Work 435
- 14.21 Avoiding Permission Escalation 436
- 14.22 Multi-Harness Security Checklist 437
- 14.23 Walkthrough: Refactoring task_tracker With Two Harnesses 438
- 14.24 Common Multi-Harness Mistakes 442
- 14.25 Hands-On Lab: Design a Two-Harness Workflow 443
- 14.26 Interview Questions 445
- 14.27 Chapter Summary 447
- 14.28 What Comes Next 448
-
15 Build Your Own Minimal Harness 450
- 15.1 Why Build a Harness Yourself? 451
- 15.2 The Minimal Harness Feature Set 451
- 15.3 The Target Architecture 452
- 15.4 What This Teaching Harness Will Not Do 454
- 15.5 Representing Tool Definitions 455
- 15.6 Designing a Stable Tool Result Shape 456
- 15.7 Building the LLM Client Boundary 458
- 15.8 Using a Fake Client for Deterministic Tests 459
- 15.9 Safe Path Resolution 461
- 15.10 Implementing read_file 462
- 15.11 Implementing a Conservative Test Runner 463
- 15.12 Why Generic Shell Access Is Dangerous 465
- 15.13 Implementing the Permission Gate 466
- 15.14 Classifying Commands as Allow, Confirm, or Deny 467
- 15.15 Building the Context for Each Turn 469
- 15.16 Dispatching Tool Calls 470
- 15.17 Re-Injecting Tool Results as Observations 472
- 15.18 Termination Conditions 473
- 15.19 The Main Loop in Code 474
- 15.20 Walkthrough: Fixing parse_count in sample_cli 476
- 15.21 Testing the Harness 478
- 15.22 What Commercial Harnesses Add 481
- 15.23 Where This Minimal Harness Is Unsafe 483
- 15.24 How to Extend It Safely 483
- 15.25 Hands-On Lab: Build the Minimal Harness 484
- 15.26 Interview Questions 486
- 15.27 Chapter Summary 488
- 15.28 Further Reading 489
- 15.29 What Comes Next 489
-
16 Staying Current in a Fast-Moving Ecosystem 491
- 16.1 The Ecosystem Will Keep Moving 492
- 16.2 What Changes Fast and What Changes Slowly 492
- 16.3 Durable Concepts From This Book 493
- 16.4 Version-Sensitive Surfaces 494
- 16.5 Release Notes Are Not Enough 496
- 16.6 The Harness Update Checklist 497
- 16.7 Evaluating a New Harness 499
- 16.8 Evaluating a New Model 501
- 16.9 Evaluating Local-Model Improvements 503
- 16.10 Evaluating MCP and Tooling Changes 504
- 16.11 Evaluating Permission and Sandbox Changes 505
- 16.12 Maintaining Workspace Instructions 506
- 16.13 Maintaining Cost and Routing Rules 507
- 16.14 Maintaining Benchmark Tasks 508
- 16.15 Building a Small Evaluation Suite 510
- 16.16 Upgrade, Wait, or Roll Back 511
- 16.17 Solo Developer Workflow 512
- 16.18 Team Workflow 513
- 16.19 Security Review Cadence 514
- 16.20 Decision Records for Tooling Changes 516
- 16.21 Common Ways Teams Drift 516
- 16.22 A Practical Adoption Scorecard 518
- 16.23 Hands-On Lab: Evaluate a Harness Update 520
- 16.24 Interview Questions 522
- 16.25 Final Synthesis 524
- Conclusion 526
- References 528
Agentic Coding Harnesses, Compared & Explained
Master Claude Code, Aider, OpenCode, Goose, and Codex — Then Run Them Locally
A vendor-neutral, mechanism-level field guide to operating and extending agentic coding harnesses (547 manuscript pages).
Minimum price
$19.99
$29.99
You pay
Author earns
About
About the Book
Coding agents now run autonomously on your behalf, searching a repository, editing files, running commands and tests, and correcting their own errors. Tools such as Claude Code, Aider, OpenCode, Goose, and Codex look very different on the surface, yet all are described with the same few words.
Agentic Coding Harnesses, Compared & Explained looks underneath. Its premise is that the intelligence lives in the model but the agency lives in the harness, the program that turns the model's requests into real actions and decides when to stop. The book follows the agent loop turn by turn, takes a harness apart into its components, and covers the infrastructure they share: the Model Context Protocol, context and cache management, and tool design and safety.
It then applies that lens to specific tools, with deep dives on Claude Code and Aider and a survey of OpenCode, Goose, and Codex, and moves on to practice: running harnesses on local models, writing project instruction files, choosing a harness per task, weighing cost against capability, and combining several harnesses in one workflow.
The book closes by building a minimal harness in Python against a scripted fake model, and by showing how to evaluate new tools as the ecosystem keeps moving. The chapters are vendor-neutral, use fictional projects, and treat specific commands and settings as conceptual sketches to verify against current documentation.
Categories
Featured in our articles on
Feedback
Bundles
Bundles that include this book
- Pricing
$34.99
Minimum priceBought separately$59.98Suggested price$44.99
- Pricing
$99.99
Minimum priceBought separately$179.94Suggested price$129.99
Author
About the Author
Yohan is a Senior Full-Stack Software Engineer with extensive experience delivering scalable, end-to-end software solutions across web, enterprise, and cloud-based environments. He specializes in architecting robust platforms, modernizing legacy systems, driving cloud transformation efforts, and building integration-heavy applications that support critical business workflows. He is recognized for translating complex requirements into reliable, maintainable, and high-value solutions across industries such as insurance, cybersecurity, and professional services.
Known for combining strong technical execution with a practical business mindset, he has contributed to projects from concept and design through production delivery and long-term support. His experience includes collaborating with cross-functional teams, improving development workflows, solving complex technical challenges, and helping organizations deliver dependable software products that adapt to changing business needs. He brings a balanced approach to engineering that values quality, efficiency, and continuous improvement.
Website: https://www.imabit.com
Contents
Table of Contents
Get the free sample chapters
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

