tool-execution-loop

Installation
SKILL.md

Tool Execution Loop

What This Skill Covers

Only the non-obvious parts of building a reliable tool loop. Assumes you already know how to make a basic /v1/messages call.


Core Loop Shape

async function runLoop(messages, tools) {
  while (true) {
    const res = await callClaude({ messages, tools });
    messages.push({ role: "assistant", content: res.content });

    if (res.stop_reason === "end_turn") return res.content;

    const toolResults = await dispatchAll(res.content);
Related skills

More from blunotech-dev/agents

Installs
1
GitHub Stars
2
First Seen
Apr 22, 2026