Fails to write CLAUDE.md when using a third-party API provider
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: 3rd-party API provider via
ANTHROPIC_BASE_URL - Claude CLI version: - Operating System: - Terminal: \#\# Bug Description
The Claude CLI fails to write the CLAUDE.md file to the project directory when configured to use a third-party API provider via the ANTHROPIC_BASE_URL environment variable. The tool correctly analyzes the project and outputs the markdown to the console, even claiming the file has been written, but no file is created.
Steps to Reproduce
- Configure the CLI to use a third-party API provider by setting the
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENenvironment variables. - Navigate to a project directory.
- Run the
claudecommand, for example:
``shell``
ANTHROPIC_BASE_URL=<your-3rd-party-provider-url> ANTHROPIC_AUTH_TOKEN=<your-key> claude
- Observe the output in the terminal as Claude analyzes the project.
- Check the project's root directory for a
CLAUDE.mdfile.
Expected Behavior
- A
CLAUDE.mdfile containing the project analysis should be created in the root of the project directory. - Tool information like
Read(..), Bash(..), Write(...)
Actual Behavior
- Claude analyzes the project, outputs the entire markdown content to the standard output, and claims that
CLAUDE.mdwas written. However, the file is not present in the project directory. - No Tool using information printed. Only analysis text
Additional Context
Everything works as expected when authenticating directly with claude.ai and running /init. The issue appears to be specific to using a custom base URL for the API endpoint.
I also tried explicitly instructing Claude to write the analysis to CLAUDE.md during the interaction, but this did not resolve the issue.
Looks like the internal tool using are not correctly invoked
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗