### Install and Install claude-auto-retry Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Install the tool globally using npm and then run the install command to set it up. This is the initial setup required for the tool to function. ```bash npm i -g claude-auto-retry claude-auto-retry install ``` -------------------------------- ### Print Version Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Prints the installed version of the tool. Use this to verify the installation and check for updates. ```bash claude-auto-retry version # Print version ``` -------------------------------- ### Install Shell Wrapper and Tmux Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Installs the shell wrapper and tmux. Use this command to set up the tool on your system. ```bash claude-auto-retry install # Install shell wrapper + tmux ``` -------------------------------- ### Development Setup for Claude Auto Retry Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Clones the repository, installs dependencies, and links the package locally for testing. ```bash git clone https://github.com/cheapestinference/claude-auto-retry.git cd claude-auto-retry npm test # Run all 128 tests npm link # Install locally for testing ``` -------------------------------- ### Example Log Entries Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Illustrates the format of log entries, including timestamps, log levels, and messages related to monitor activity and rate limiting. ```log [2026-03-18 15:00:05] [INFO] Monitor started for pane %3 (claude PID: 12345) [2026-03-18 15:32:10] [INFO] Rate limit detected: "5-hour limit reached - resets 3pm". Waiting 3547s... [2026-03-18 16:01:10] [INFO] Sent retry message (attempt 1) ``` -------------------------------- ### Install StopFailure Hook for Claude Code Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Installs the StopFailure hook into the default configuration directory or a specified path. This hook precisely triggers on API errors, enabling event-driven detection without scraping. ```sh claude-auto-retry install-hook # into $CLAUDE_CONFIG_DIR or ~/.claude ``` ```sh claude-auto-retry install-hook /path/to/config # repeat per CLAUDE_CONFIG_DIR you use ``` -------------------------------- ### Run All Tests Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Executes all 128 tests for the project. ```bash npm test ``` -------------------------------- ### Run Single Test File Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Executes tests from a specific file using Node.js test runner. ```bash node --test test/patterns.test.js ``` -------------------------------- ### Tail Today's Log File Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Tails today's log file in real-time. Use this to monitor ongoing activity and troubleshoot issues. ```bash claude-auto-retry logs # Tail today's log file in real-time ``` -------------------------------- ### StopFailure Hook and Daemon Interaction Diagram Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/DESIGN-NOTES.md Illustrates the interaction between the StopFailure hook, which writes a marker, and the daemon, which reads the marker to perform retries. ```text StopFailure hook ──writes marker (error_type, session_id, transcript_path)──▶ daemon │ maps session_id/pane ──▶ tmux send-keys ◀──┘ ``` -------------------------------- ### Show Monitor Activity and Last Log Entries Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Displays the current monitor activity and the most recent log entries. Useful for checking the tool's status. ```bash claude-auto-retry status # Show monitor activity + last log entries ``` -------------------------------- ### Configure API Overload Backoff Strategy Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Define parameters for exponential backoff on sustained API overload, including enabled status, detection patterns, and wait times. ```json { "overload": { "enabled": true, "patterns": ["API Error:\s*(429|500|502|503|504|529)\", "overloaded_error", "temporarily limiting requests"], "backoffSeconds": [30, 60, 120, 240, 300], "steadyStateSeconds": 300, "jitterPct": 15, "maxTotalWaitMinutes": 120, "retryMessage": "Continue where you left off.", "relaunchOnExit": false, "relaunchCommand": "claude --continue" } } ``` -------------------------------- ### Execute Command with Automatic Retries and JSON Output Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Executes a command, buffers output, and retries transparently if rate-limited. Designed for scripted or piped usage with tools like jq. ```bash # This just works — retries transparently if rate-limited claude -p "Generate a JSON schema" | jq . ``` -------------------------------- ### Run Tests in Watch Mode Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Executes tests and automatically re-runs them when files change. ```bash node --test --watch test/ ``` -------------------------------- ### Configure Standard Rate Limit Retries Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Set maximum retries, polling intervals, and custom patterns for detecting rate limits in a JSON configuration file. ```json { "maxRetries": 5, "pollIntervalSeconds": 5, "marginSeconds": 60, "fallbackWaitHours": 5, "retryMessage": "Continue where you left off. The previous attempt was rate limited.", "customPatterns": ["my custom pattern"] } ``` -------------------------------- ### Uninstall Shell Wrapper Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Removes the shell wrapper. Use this command to uninstall the tool. ```bash claude-auto-retry uninstall # Remove shell wrapper ``` -------------------------------- ### StopFailure Hook Input Payload Structure Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/DESIGN-NOTES.md Shows the structure of the JSON payload received by the StopFailure hook, including error details and the last assistant message. ```javascript hookInput = { hook_event_name: "StopFailure", error, error_details, last_assistant_message } ``` -------------------------------- ### Uninstall Claude Auto Retry Source: https://github.com/cheapestinference/claude-auto-retry/blob/master/README.md Removes the shell function and global npm package for claude-auto-retry. ```bash claude-auto-retry uninstall npm uninstall -g claude-auto-retry ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.