anthropics / anthropics/claude-code
[BUG] Claude cloud sessions cannot git push to any repository
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
What's wrong?
A Claude cloud session's git-credential proxy has an empty authorized-repository set by default, and nothing available to the user or the session changes that — not a fresh PAT, not a fresh session, not a fresh project. Every git push from inside a cloud session fails at the proxy layer before the request reaches GitHub, regardless of token validity or GitHub-side permissions. git clone with the same token succeeds every time; only git push is blocked, which confirms the token itself is valid and the failure is not a GitHub permissions issue.
Tested and ruled out as causes:
Token scope — tried a PAT scoped to a single repo, and separately a PAT with access to all repos on the account. Same failure both times.
Repo age/familiarity — tried a brand-new repo (created that day) and an older, established repo the account has used for months. Same failure both times, each naming the correct repo as "not in this session's authorized repository set."
Session freshness — tried an already-running session, and separately a session started fresh specifically to test this. Same failure.
Project freshness — tried an existing Claude project, and separately a brand-new project created specifically to test this. Same failure.
GitHub-side configuration — the account's GitHub authorization is a plain OAuth authorization, not a GitHub App installation with a repo picker. Installed a fresh GitHub App with all-repo access — no effect. Regenerated PATs multiple times — no effect.
Claude account settings — searched thoroughly for any GitHub-repo-authorization toggle in account settings — found nothing that controls this.
MCP connectors — checked the connector registry for a GitHub MCP connector — none available/installed.
Four separate push attempts across at least three separate sessions (including one session and one project both created fresh specifically to test this), against two different repositories, all failed with the identical error message.
### What Should Happen?
What should happen?
A Claude cloud session should be able to push commits to a GitHub repository the user has authorized it to access via a valid PAT (or another supported credential method), at least for repos the user explicitly provides working push-capable credentials for. Right now git push is non-functional from Claude cloud sessions for this account, not intermittently but consistently — it has never once succeeded.
### Error Messages/Logs
```shell
Error messages/logs
remote: access denied by the git proxy: / is not in this session's
authorized repository set, so the proxy will not inject a credential for it. To fix,
add the repository to the session's sources.
fatal: unable to access 'https://github.com//.git/': The requested URL
returned error: 403
Repos this was reproduced against: jonathanarthur-ops/probus-produce-shop and jonathanarthur-ops/probus-produce-website. The error names whichever repo was being pushed to, correctly — so the proxy has correctly identified the repo, and is refusing it anyway.
```
### Steps to Reproduce
Steps to reproduce
In a Claude cloud session, generate a fresh GitHub fine-grained PAT (Contents: Read+write), scoped to a specific repo.
git clone https://x-access-token:@github.com//.git — succeeds.
Make a trivial change (e.g. append a one-line comment to README.md), commit it.
git push origin HEAD
Push fails immediately with the error above.
Repeat from a newly created Claude project and a newly created session — same result. Repeat against a different, older/established repo, optionally with a PAT scoped to all repos rather than one — same result.
### Claude Model
Sonnet (default)
### Is this a regression?
I don't know
### Last Working Version
_No response_
### Claude Code Version
2.1.260 (Claude Code)
### Platform
Anthropic API
### Operating System
Windows
### Terminal/Shell
Windows Terminal
### Additional Information
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the git-credential proxy and the session source or authorized-repository handling. Reproduce the failure with the provided PAT, repositories, and git push sequence, then compare it with the successful clone. Done means an authorized repository can receive a push from a cloud session without the proxy rejecting it as outside the session's authorized set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github
- Domain
- authentication, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100