FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Claude's agentic loop explained: stopReason, tool_use, and the pattern behind every AI agent
How-ToProgramming Languages

Claude's agentic loop explained: stopReason, tool_use, and the pattern behind every AI agent

via Dev.to PythonAj4h ago

If you've tried building an AI agent with Claude and Bedrock, you've hit stopReason . Maybe you ignored it, maybe you cargo-culted the pattern from a tutorial. Either way — here's what's actually happening and why it matters for production systems. TL;DR stopReason: "tool_use" → execute the tool, append result, loop again stopReason: "end_turn" → agent is done, return the response Always append the assistant message before tool results Never use text content checks as your stop condition Why this pattern exists Claude on Bedrock doesn't magically "know" to use tools. You have to implement the loop that lets it. The model's job is to reason about your task and signal what it needs — your code's job is to listen to that signal and respond correctly. The signal is stopReason . Everything else follows from there. The loop, step by step 1. Send message + tool definitions to Claude 2. Read stopReason from response 3a. If "tool_use" → run the tool → append result → go to step 1 3b. If "end_tu

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
2 views

Related Articles

How To Track Entity Changes With EF Core | Audit Logging
How-To

How To Track Entity Changes With EF Core | Audit Logging

Medium Programming • 5h ago

How To Apply Global Filters With EF Core Query Filters
How-To

How To Apply Global Filters With EF Core Query Filters

Medium Programming • 5h ago

For Amazon's Fire Phone to succeed, it'll need to fix its app store problem first
How-To

For Amazon's Fire Phone to succeed, it'll need to fix its app store problem first

ZDNet • 5h ago

How to share your location on Android quickly: 5 easy ways - including by text
How-To

How to share your location on Android quickly: 5 easy ways - including by text

ZDNet • 6h ago

How-To

3 Mistakes Beginner Developers Make Every Year

Medium Programming • 7h ago

Discover More Articles