Repository navigation
Closed
Description
General Goal of the Epic
To create an automated system that monitors GitHub issues, uses Anthropic's Claude Code to generate solutions, and automates the Git workflow including PR creation.
Current Stage (Issue 16 of N) - Future Enhancement Investigation
This issue focuses on investigating the potential benefits and feasibility of using the Claude Code SDK (if and when it matures beyond CLI wrapping for Node.js/Python) for more granular control and sophisticated interaction patterns compared to the current CLI-based approach. (Refers to Proposal Section 6.7)
- What's being done in this issue:
- Research the current state and capabilities of any available Claude Code SDKs (especially for Node.js or Python).
- Identify potential advantages of an SDK approach (e.g., stateful conversations, easier implementation of self-correction loops, dynamic prompt adjustments).
- Outline how an SDK-based integration might differ from the current CLI wrapper (`src/claude/claudeService.js`) and what refactoring it would entail.
- Assess if an SDK would better support features like the "inner loop" of testing and self-correction (Issue 13).
- What's been done (up to $PREVIOUS_ISSUE_15_ID_PLACEHOLDER): Core workflow, various enhancements including pre-PR checks, monitoring, and rollout strategy have been outlined. The current system relies on invoking the Claude Code CLI.
- What's remaining (for the epic): Implementation of this and other advanced features, full operationalization, and continuous improvement.
Task Details
1. Research Claude Code SDK Availability and Features (Sec 6.7, Ref 24)
- Objective: Determine if a suitable SDK exists that offers advantages over CLI interaction for a server-side automated workflow.
- Tasks:
- Check Anthropic's official documentation and GitHub repositories for any publicly available Claude Code SDKs for Node.js or Python that are designed for server-side (non-interactive) use.
- Evaluate SDK features:
- Authentication mechanisms (especially for Claude Max plans without direct API keys, if different from CLI).
- Support for non-interactive, programmatic conversations.
- Control over context provisioning (beyond `CLAUDE.md` and basic prompts).
- Ability to manage Claude's tools and permissions programmatically.
- Streaming responses, error handling, and metadata access (e.g., token counts).
- Compare SDK capabilities with the current CLI wrapper approach.
2. Identify Advantages of an SDK for This System
- Stateful Interactions: Could an SDK simplify managing multi-turn conversations if needed for complex issue resolution or the self-correction loop?
- Self-Correction Loop (Issue 13): Would an SDK make it easier to stream test results back to Claude, manage the state of the correction attempts, and adjust prompts dynamically within a single "session"?
- Dynamic Prompt Adjustments: Could intermediate outputs from Claude (via SDK) be used to more easily adjust subsequent parts of the prompt or control flow?
- Granular Control: Does the SDK offer finer-grained control over Claude's execution parameters than CLI flags?
3. Outline Potential Refactoring of Claude Interaction Logic
- If a suitable SDK is identified:
- Sketch out how `src/claude/claudeService.js` would change.
- How would authentication be handled with the SDK?
- How would prompts and context (like `CLAUDE.md`, slash commands, RAG results) be passed?
- How would Claude's execution be managed and its output (code changes, logs, errors) be retrieved programmatically?
4. Assess SDK Suitability for Advanced Features
- Revisit the designs for:
- Automated Pre-PR Checks / Inner Loop (Issue 13)
- Optimizing Context (MCP/RAG) (Issue 10)
- Would an SDK simplify or enhance the implementation of these features?
Acceptance Criteria
- A research document summarizing the findings on Claude Code SDKs (availability, features, authentication for server-side use with Max plans).
- A comparative analysis of SDK vs. CLI approach for this project's needs.
- A high-level plan for potential refactoring if an SDK proves beneficial and viable.
- An assessment of SDK impact on implementing features like the self-correction loop.
Metadata
Metadata
Assignees
Labels
No labels
Activity
integry commentedon May 24, 2025
Focus Areas for SDK Investigation
auth.json, or does it offer a service account mechanism or a way to use Max plan benefits programmatically via a token that's not a standard API key? This is a critical question.--allowedTools,--disallowedTools) and the equivalent of--dangerously-skip-permissions? Is it more granular or secure via SDK?Initial Action:
Ref: Proposal Sec 2.3 mentions "The current SDK already leverages CLI options for non-interactive use and output formatting." (Ref 24 from proposal). This suggests the "SDK" might indeed be a wrapper around the CLI. Clarify if a lower-level programmatic interface exists or is planned.
feat(ai): I fixed F3. A delayed observer of an earlier queue occurren…