Claude Code
What is Claude Code?
Claude Code is an AI-powered coding assistant designed to help developers write, understand, and improve code more efficiently. Built on Anthropic's Claude models, it provides interactive coding support directly within your development workflow. Claude Code can generate code, explain existing logic, refactor functions, create tests, and assist with debugging through natural-language interactions. It is commonly used to accelerate development, improve code quality, and support engineers in navigating complex codebases.
Key features:
Intelligent Code Generation Produces high-quality code snippets, functions, and modules based on natural-language prompts, helping developers move faster.
Code Explanation & Understanding Provides clear explanations of complex code blocks, libraries, or architectural patterns to improve comprehension and onboarding.
Refactoring & Optimization Suggests cleaner, more efficient, or more idiomatic implementations while preserving existing functionality.
Automated Test Creation Generates unit tests, integration tests, and edge-case scenarios to improve code reliability and coverage.
Debugging Assistance Helps identify potential bugs, logic issues, or problematic patterns and proposes fixes.
Documentation Support Creates or updates documentation, docstrings, READMEs, and comments directly from code.
Multi-Language Support Works across a wide range of programming languages, adapting to ecosystem conventions and best practices.
Context-Aware Development Uses project context files, codebase structure, and error logs to deliver highly relevant responses.
Interactive Cooperative Workflow Works like a coding partner. Developers can iterate, review, and refine code through conversational interactions.
nexos.ai now exposes an endpoint compatible with the Anthropic Messages API, so Claude Code talks to the gateway directly. You no longer need a local proxy or the Claude Code Router. To connect your nexos.ai API and Claude Code, follow these steps:
1. Install Claude Code
macOS, Linux, WSL:
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell:
Or install it with npm:
2. Connect Claude Code to nexos.ai
Instead of logging in with Anthropic directly, point Claude Code at the nexos.ai gateway. This is done with a few environment variables.
Requirements:
Use
https://api.nexos.aias the base URL. Claude Code appends/v1/messagesautomatically.Provide your API key as the auth token.
Important: Explicitly blank out the Anthropic API key to avoid conflicts.
Add these lines to your shell profile such as ~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish:
After saving, restart your terminal so the changes take effect.
Do not put these values in a project-level .env file. The native Claude Code installer does not read standard .env files.
3. Clear any cached Anthropic login
If you were previously logged in to Claude Code with an Anthropic account, run /logout once to remove the cached session. Then quit and relaunch claude. A leftover cached login together with ANTHROPIC_AUTH_TOKEN can cause confusing model-not-found errors on startup.
If you have never logged in to Claude Code with Anthropic, skip this step.
4. Start your session
You are now connected. Every prompt is routed through nexos.ai.
5. Verify
Run /status inside Claude Code to confirm the connection:
Configuring models
Claude Code uses several environment variables to decide which model to use for each task. Point each role at any model available in your nexos.ai workspace. Use either the model UUID or model name.
ANTHROPIC_DEFAULT_OPUS_MODEL
Model used for Opus-class tasks such as complex reasoning
ANTHROPIC_DEFAULT_SONNET_MODEL
Model used for Sonnet-class tasks such as general coding
ANTHROPIC_DEFAULT_HAIKU_MODEL
Model used for Haiku-class tasks such as quick completions
CLAUDE_CODE_SUBAGENT_MODEL
Model used for sub-agent tasks spawned by Claude Code
Add these to the same shell profile where you set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Claude Code is optimized for Anthropic models and may not behave correctly with other providers.
Troubleshooting
Model-not-found errors: Usually this is a credential conflict. If you have a cached Anthropic OAuth login, run
/logout, then quit and relaunchclaude. If your shell still has a realANTHROPIC_API_KEYset,/logoutwill not help. Make sureANTHROPIC_API_KEY=""is set as shown above and restart your terminal. Verify with/status.Auth errors: Ensure
ANTHROPIC_API_KEYis set to an empty string"". If it is unset, Claude Code may fall back to authenticating against Anthropic's servers.Context length errors: Break the task into smaller chunks or start a new session.
Last updated

