-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
enhancementNew feature or requestNew feature or requestfeature-requestp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature request
Description
Feature Request: Expose session_id output for conversation resumption
Problem
Currently, when using anthropics/claude-code-action, there's no way to resume a conversation after the action completes. Each invocation starts a fresh session, losing all context from previous interactions.
This is limiting for complex CI/CD workflows where you might want to:
- Run Claude Code to analyze something
- Perform intermediate steps (checkout repos, run tests, fetch data)
- Continue the same Claude conversation with additional context
Use Cases
1. Multi-Repository Analysis
# Analyze main repo, checkout dependencies, then continue analysis
- uses: anthropics/claude-code-action@v1
id: initial
with:
prompt: "Analyze this service and identify its dependencies"
- uses: actions/checkout@v4
with:
repository: my-org/shared-libs
path: ./libs
- uses: anthropics/claude-code-action@v1
with:
prompt: "Now analyze the shared libraries and how they integrate"
claude_args: "--resume ${{ steps.initial.outputs.session_id }}"2. Staged Code Review with Test Results
# Initial review, run tests, then provide test feedback to Claude
- uses: anthropics/claude-code-action@v1
id: review
with:
prompt: "Review this PR and suggest improvements"
- name: Run test suite
id: tests
run: npm test 2>&1 | tee test-output.txt
- uses: anthropics/claude-code-action@v1
with:
prompt: "Here are the test results. Update your review based on any failures."
claude_args: "--resume ${{ steps.review.outputs.session_id }}"3. Human-in-the-Loop Workflows
# Claude proposes changes, wait for approval, then implement
- uses: anthropics/claude-code-action@v1
id: proposal
with:
prompt: "Propose a refactoring plan for the authentication module"
- uses: trstringer/manual-approval@v1
with:
approvers: tech-leads
- uses: anthropics/claude-code-action@v1
with:
prompt: "Approval received. Please implement the proposed changes."
claude_args: "--resume ${{ steps.proposal.outputs.session_id }}"4. External Data Integration
# Analyze code, fetch production metrics, continue with real data
- uses: anthropics/claude-code-action@v1
id: analyze
with:
prompt: "Identify potential performance bottlenecks in this service"
- name: Fetch production metrics
run: |
curl -s "${{ secrets.METRICS_API }}/performance" > metrics.json
- uses: anthropics/claude-code-action@v1
with:
prompt: "Here are the actual production metrics. Refine your analysis."
claude_args: "--resume ${{ steps.analyze.outputs.session_id }}"Proposed Solution
Expose the session_id from Claude Code's execution output as a GitHub Action output. Claude Code already supports --resume <session_id> for continuing conversations, we just need to surface the session ID from the action.
Implementation
PR #739 implements this feature by:
- Adding
parseAndSetSessionId()function to extract session_id from the execution output - Adding
session_idas an output in bothaction.ymlandbase-action/action.yml - Including comprehensive tests
Benefits
- Context preservation: Claude retains full memory of previous interactions
- Cost efficiency: No need to re-send context in prompts
- Complex workflows: Enable multi-step automation with intermediate processing
- Better results: Claude can build on its previous analysis rather than starting fresh
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeature-requestp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature request