Skip to content

Claude Code authorization is not created in previously initialized projects with another provider #129

@ilyv

Description

@ilyv

When running the npx magnitude command in a previously initialized project with another provider, the claudeCode.json credentials file is not saved.
When I updated to the latest version and tried to use Claude Code, I got stuck on the authorization step. As a workaround, I ran the magnitude init, which successfully set up the authorization.

Environment

llm: {
    provider: "claude-code",
    options: {
      model: "claude-sonnet-4-20250514"
    },
  }

Steps to Reproduce

  1. Ensure .magnitude/credentials/claudeCode.json file doesn't exist.
  2. Run the Magnitude command: npx magnitude ...
  3. On the Anthropic callback page, copy the provided authorization code.
  4. Paste the authorization code into the terminal prompt.

Actual Result

  • Terminal process remains awaiting input after code is pasted.
  • claudeCode.json file is not created in the .magnitude/credentials/ directory.

Expected Result

Access and refresh tokens should be successfully saved in claudeCode.json after authorization code is submitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions