shark-loop

Enforce OS-level per-turn timeouts for AI coding agent loops.

12|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/keugenek/shark --skill shark-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shark-loop
Source: https://github.com/keugenek/shark/tree/main/commands/shark-loop
Command: npx skills add https://github.com/keugenek/shark --skill shark-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of AI coding agent loops blocking indefinitely on slow tool calls, which wastes compute and delays task completion by enforcing a hard time limit for every agent turn.

Core Features & Use Cases

  • Shark Pattern Compliance: Enforces the core Shark Pattern rule that no agent turn exceeds a configurable time limit, keeping the main agent reasoning without waiting for slow operations.
  • Flexible Configuration: Lets you set custom maximum loop counts and per-turn timeout durations via simple command arguments to match your task's complexity.
  • Use Case: When running long-running coding tasks like code generation, debugging, or test execution with supported LLM agents, this Skill ensures the agent never stalls, keeping runtime efficient and predictable.

Quick Start

Use the shark-loop skill to run your coding agent task with a 25-second per-turn timeout and 50 maximum loops to prevent blocking on slow operations.

Frequently Asked Questions about shark-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent my AI coding agent from blocking indefinitely on slow tool calls?

To prevent AI coding agent loops from blocking indefinitely, you can enforce hard OS-level timeouts per agent turn. This stops slow operations from stalling the agent and wasting compute during long-running coding tasks.

What is the Shark Pattern for coding agents and why is per-turn timeout enforcement needed?

The Shark Pattern for coding agents requires that no agent turn exceeds a configurable time limit. Per-turn timeout enforcement keeps the main agent reasoning efficiently without waiting for slow operations to finish.

Does the per-turn timeout enforcer work with Claude Code, Codex, and Gemini CLI?

Yes, the per-turn timeout enforcer works with Claude Code, Codex, and Gemini CLI. It applies hard OS-level timeouts across all supported LLM agent CLI tools for coding, debugging, and automation tasks.

How do I configure maximum loop counts and timeout durations for an AI agent loop?

You configure maximum loop counts and per-turn timeout durations for an AI agent loop by passing simple command arguments. For example, you can set a 25-second timeout and 50 maximum loops to control runtime.

What are the limitations of using OS-level timeouts for long-running coding agent tasks?

A limitation of using OS-level timeouts for coding agent tasks is that any operation exceeding the configured per-turn time limit is hard-stopped. This ensures the loop continues but may interrupt incomplete tool calls, requiring recovery.