Fails to write CLAUDE.md when using a third-party API provider

Resolved 💬 1 comment Opened Aug 30, 2025 by aztack Closed Aug 30, 2025

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

  1. Configure the CLI to use a third-party API provider by setting the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN environment variables.
  2. Navigate to a project directory.
  3. Run the claude command, for example:

``shell
ANTHROPIC_BASE_URL=<your-3rd-party-provider-url> ANTHROPIC_AUTH_TOKEN=<your-key> claude
``

  1. Observe the output in the terminal as Claude analyzes the project.
  2. Check the project's root directory for a CLAUDE.md file.

Expected Behavior

  • A CLAUDE.md file 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.md was 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

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗