How to bypass new user login onboarding when initially launching Claude Code using other LLM models?


The latest version of Claude Code (April 2026 version, such as 2.1.9x series) has strengthened the onboarding check during first launch, making it difficult to bypass solely through environment variables or CC-Switch writing to settings.json. This is because Claude Code prioritizes checking the hasCompletedOnboarding flag in the ~/.claude.json file during startup. If this file does not exist or the field is false, it will force the onboarding process (requiring login to the official account or completing initial setup), even if you have configured other ANTHROPIC_BASE_URL and Key in ~/.claude/settings.json, which will be ignored or processed later (the latest CC-Switch bypass configuration no longer works).

The most effective method is to use Node.js in the CLI with the following one-click setup command:
node --eval "
const fs = require('fs');
const path = require('path');
const homeDir = require('os').homedir();
const filePath = path.join(homeDir, '.claude.json');
let config = {};
if (fs.existsSync(filePath)) {
config = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
}
config.hasCompletedOnboarding = true;
fs.writeFileSync(filePath, JSON.stringify(config, null, 2), 'utf-8');
console.log('hasCompletedOnboarding set to true');
"
After executing, restart your terminal and then try running Claude again to enter directly.
View Original
post-image
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pin