SShortSingh.
Back to feed

PreToolUse or PostToolUse? Where to Put a Check in the Claude Agent SDK

0
·5 views

If an agent can trigger a business action, the most important design question is where each check runs. In the Claude Agent SDK, hooks give you two points around every tool call. Only one of them can stop the action. A check that must prevent a side effect belongs in PreToolUse. It runs before the tool executes and returns a decision.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Deepfake Detection API: Adding Image and Video Verification to Your Platform

If your platform accepts user-uploaded images or video, synthetic media is already in your pipeline. Profile photos, ID selfies during onboarding, product listing images, UGC clips submitted to a newsroom, video testimonials. Some fraction of that is generated or manipulated, and the fraction is growing. This guide covers adding detection using the DeepfakeDetector.ai API: getting a key, scanning an image, handling video asynchronously, parsing the response defensively, and, the part most guides skip, designing your product around a result that is a probability rather than a fact. What the API

0
ProgrammingDEV Community ·

Five Stop Conditions Every Production Claude Tool Loop Needs

A demo agent loop runs until the model says it is done. A production loop cannot work that way. Each tool call is a request to change something, and your code, not the model, decides when the loop stops. Claude returns a structured tool-use block: a tool name and arguments. Before anything runs, the application checks five things: Schema: the arguments have the right shape.

0
ProgrammingDEV Community ·

Field Break: an open-weight AI that tells you to close the screen

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass. I built Field Break, a deliberately small AI tool whose success condition is that you stop using it. You tell it four things: how many minutes you have; your energy level; what kind of outdoor space is nearby; one constraint, such as “stay close to home” or “no car”. It returns one micro-adventure that can start almost immediately, plus a final instruction telling you when to lock the screen. That last part is the product idea.