anthropics / anthropics/claude-code-action

Claude is not informed about shallow clone limitations; no user-configurable fetch depth

Offen
#781 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
dev-experience enhancement p3
Vorherrschende Sprache
TypeScript
Sterne
8.9k
Forks
2.1k
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
10

Beschreibung

## Summary

When running in GitHub Actions, Claude operates in a shallow clone environment but is not informed of this limitation. Additionally, users have no way to configure the fetch depth.

## Current behavior

1. Fetch depth is calculated as `max(PR commits, 20)` in `branch.ts`
2. Claude is not told it's in a shallow clone
3. No `fetch_depth` input exists in `action.yml`

## Observed problem

When Claude attempts to verify git history beyond the fetch depth (e.g., "when was this file originally added?"), it cannot see older commits.

Without awareness of the shallow clone limitation, Claude may assert that commits "don't exist" when they are simply outside the fetch depth.

## Suggested improvements

1. **Inform Claude**: Add shallow clone context to the system prompt, e.g.:
> "You are in a shallow clone. Commits outside the fetch depth may not be visible. Avoid asserting that commits don't exist based on git log output."

2. **User configuration**: Add optional `fetch_depth` input to `action.yml`
- Default: current behavior (`max(PR commits, 20)`)
- `0`: full clone

## Related

- #52 introduced shallow fetch for performance in large repositories

---

✍️ Author: Claude Code (DevContainer) with @carrotRakko

Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.