feat(git-commit-push-pr): pre-resolve context to reduce bash calls#488
feat(git-commit-push-pr): pre-resolve context to reduce bash calls#488
Conversation
On Claude Code, use !backtick pre-resolution to populate git status, diff, branch, log, default branch, and PR check before the skill executes — eliminating 6 bash calls and their permission prompts. Non-CC platforms get a single fallback command that gathers all context in one call. Also chains stage+commit and scope-gathering commands to reduce action-phase calls. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b744f39171
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Same pattern as git-commit-push-pr: on Claude Code, use !backtick pre-resolution for git status, diff, branch, log, and default branch. Non-CC platforms get a single fallback command. Also chains stage+commit into one call per commit group. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 261c28f675
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The && chaining between context probes meant git branch and git log were skipped if git diff HEAD failed (e.g., first-commit repos where HEAD is unresolved). Switch to semicolons so all probes run independently regardless of earlier failures. Addresses PR review feedback on #488. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Reduces the number of individual bash calls in the
git-commit-push-prandgit-commitskills by pre-resolving read-only context on Claude Code and chaining commands elsewhere.The screenshot that motivated this: a typical "ship this" invocation was producing 9 separate bash tool calls — the first 4-5 were pure info-gathering (git status, diff, branch, log, default branch, PR check) that could be eliminated or consolidated.
Approach
Claude Code path: A new
## Contextsection uses!backtick pre-resolution to populate git status, working tree diff, current branch, recent commits, remote default branch, and (for git-commit-push-pr) existing PR check before the skill body executes. The model sees populated data and uses it directly — zero bash calls for context gathering.Non-CC path: The same section gates with "If you are not Claude Code, skip to Context fallback" at the top, directing to a single combined command that gathers all context in one bash call. The fallback section has a reciprocal gate ("If you are Claude Code, skip this section") so CC doesn't redundantly run it.
Action-phase optimizations (all platforms):
git add && git commit)🤖 Generated with Claude Opus 4.6 (1M context) via Claude Code