Table of Contents

Class ClaudeCliService

Namespace
SunamoAI
Assembly
SunamoAI.dll

Service for calling Claude CLI (claude.cmd) with retry logic and rate limit handling.

public class ClaudeCliService
Inheritance
ClaudeCliService
Inherited Members
Extension Methods

Constructors

ClaudeCliService(ILogger, bool, bool)

Initializes a new instance of the ClaudeCliService class.

public ClaudeCliService(ILogger logger, bool isVerboseLoggingEnabled = false, bool isDetailedLoggingEnabled = false)

Parameters

logger ILogger

Logger instance for logging operations.

isVerboseLoggingEnabled bool

Whether verbose logging is enabled for debugging.

isDetailedLoggingEnabled bool

Whether detailed logging is enabled for CLI calls.

Methods

CallClaudeCli(string, int)

Calls Claude CLI with a prompt and returns the response. Includes automatic retry logic for rate limit errors (up to 3 retries with 65-second waits).

public Task<string?> CallClaudeCli(string prompt, int retryCount = 0)

Parameters

prompt string

The prompt to send to Claude.

retryCount int

Internal retry counter (starts at 0).

Returns

Task<string>

Claude's response text, or null if the call failed.