Claude Code is a terminal-first coding agent from Anthropic. It reads your codebase, edits files, runs commands, and can connect to Anthropic-compatible backends instead of only using Anthropic’s default API. This guide covers Claude Code CLI setup, slash commands, custom skills, and how to route requests through Novita AI.
If you need databases, browsers, or other external tools, pair this with the Claude MCP configuration guide.
Key Takeaways
- Claude Code is a command-line agent, not just a prompt box.
/compact,/resume,/permissions, and/modelare session commands, while-pand--resumeare CLI flags.- Custom slash commands now live as skills, so
.claude/skills/and.claude/commands/both matter. - Novita AI can serve as the Anthropic-compatible backend through
ANTHROPIC_BASE_URL. - Claude Code fits both IDE-style workflows and automated agent runs.
What is Claude Code?
Claude Code is Anthropic’s agentic coding tool. The CLI runs in your terminal, but the same agent also appears in the desktop app, browser interface, and editor integrations.
The CLI is the most flexible surface. It follows Unix conventions, so you can pipe files into it, run it non-interactively with -p, and wire it into scripts or CI. Configuration lives in CLAUDE.md, .claude/settings.json, and environment variables, which makes it a strong fit for repeatable coding workflows.
Under the hood, Claude Code sends requests to an Anthropic-compatible API endpoint. By default that endpoint is Anthropic’s own service, but you can redirect it to Novita AI’s LLM API with a single environment variable.
Claude Code Setup
Installation
Install the CLI with Node.js 18 or later:
npm install -g @anthropic-ai/claude-code
First Run
Launch Claude Code in a project directory:
cd your-project
claude
On first use, Claude Code prompts you to log in. After authentication, it reads your project and waits for instructions.
Project Setup
Run /init in any new repository to generate a starter CLAUDE.md file. Claude Code reads CLAUDE.md at the start of every session, so it’s the right place for coding standards, preferred libraries, architecture notes, and review checklists.
/init
After /init, use /memory to edit the file or enable auto-memory, which saves observations Claude makes about your project across sessions.
CLI Commands Reference
| Command | Description |
|---|---|
claude | Start an interactive session in the current directory |
claude "query" | Start a session with an initial prompt |
claude -p "query" | Run a query and exit |
cat file | claude -p "query" | Pipe content into a query |
claude -c | Continue the most recent session in the current directory |
claude -r "name" "query" | Resume a session by name or ID |
claude update | Update to the latest version |
claude install stable | Install or reinstall the stable binary |
claude auth login | Sign in to your Anthropic account |
claude auth login --console | Sign in with API key billing instead of a subscription |
claude auth status | Show authentication status |
claude mcp | Configure MCP servers |
claude doctor | Show install and settings diagnostics |
CLI Flags Reference
| Flag | What it does |
|---|---|
-p, --print | Non-interactive mode; print response and exit |
-c, --continue | Load the most recent conversation |
-r, --resume | Resume a session by ID or name |
--model | Set the model for this session |
--permission-mode | Start in a permission mode |
--add-dir | Grant file access to an additional directory |
--system-prompt | Replace the system prompt entirely |
--append-system-prompt | Append to the default system prompt |
--max-turns | Limit agentic turns in -p mode |
--max-budget-usd | Cap API spend in -p mode |
--output-format | Output format for -p mode: text, json, stream-json |
--bg | Start as a background agent, return immediately |
--worktree, -w | Start in an isolated git worktree |
--bare | Skip auto-discovery of hooks, skills, plugins, and MCP for faster scripted calls |
--verbose | Show full turn-by-turn output |
--mcp-config | Load MCP servers from a JSON file |
--effort | Set reasoning effort |
The --print + --output-format json combination is the standard pattern for scripting. For CI pipelines with budget constraints, combine it with --max-budget-usd and --max-turns.
Slash Commands Documentation
Slash commands run inside an active session. Type / to see everything available, or / followed by letters to filter. Commands only work at the start of a message.
Session and Context Management
| Command | Purpose |
|---|---|
/clear | Start a new conversation; previous session stays in /resume |
/compact | Summarize the conversation to free context window space |
/context | Visualize context usage and see optimization suggestions |
/resume | Reopen a previous session by name or from a picker |
/branch | Fork the conversation to try a different direction |
/rewind | Roll code and conversation back to a checkpoint |
Project Setup
| Command | Purpose |
|---|---|
/init | Generate a starter CLAUDE.md for the project |
/memory | Edit CLAUDE.md files and manage auto-memory |
/mcp | Manage MCP server connections interactively |
/agents | Configure subagent settings |
/permissions | Set allow, ask, and deny rules for tools |
/hooks | View hook configurations |
Development Workflow
| Command | Purpose |
|---|---|
/plan | Enter plan mode before a large change |
/model | Switch the active model |
/effort | Adjust reasoning effort level |
/diff | Open the interactive diff viewer |
/code-review [--fix] | Review the current diff; --fix applies findings |
/security-review | Deep security pass on pending changes |
/batch <instruction> | Decompose a large change and run it in parallel worktrees |
/background | Detach the session to run as a background agent |
Utilities
| Command | Purpose |
|---|---|
/help | Show available commands |
/doctor | Diagnose install and settings issues |
/usage | Show session cost and plan usage |
/export | Export the conversation as plain text |
/config | Open settings or set a value directly |
/skills | List available skills |
Custom Slash Commands
Custom slash commands now live as skills. Existing .claude/commands/ files still work, but .claude/skills/ is the preferred format.
How to Create a Custom Command
Create a directory under .claude/skills/ (project-level) or ~/.claude/skills/ (personal):
mkdir -p .claude/skills/review-pr
Create a SKILL.md file inside that directory:
---
description: Review an open GitHub PR for security issues and test coverage gaps.
---
## Instructions
Review the pull request with these priorities:
1. Identify security vulnerabilities.
2. Check test coverage for new code paths.
3. Flag missing error handling at system boundaries.
This creates a /review-pr command you can invoke directly:
/review-pr
Claude also loads the skill automatically when you ask something that matches the description.
Skill Locations and Priority
~/.claude/skills/ → personal, all projects
.claude/skills/ → this project only
Custom commands in .claude/commands/ still work. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy.
Using Novita AI as the LLM Backend
Claude Code routes API traffic through ANTHROPIC_BASE_URL. Setting it to Novita AI’s Anthropic-compatible endpoint gives you access to Novita models without changing the Claude Code workflow.
Get Your Novita AI API Key
Sign up for a Novita AI account to receive free trial credits. Then open the Key Management page, click Create New Key, and copy the key immediately.
Set Environment Variables
On Mac and Linux:
export ANTHROPIC_BASE_URL="https://api.novita.ai/anthropic"
export ANTHROPIC_AUTH_TOKEN="<Your Novita API Key>"
export ANTHROPIC_MODEL="moonshotai/kimi-k2-instruct"
export ANTHROPIC_SMALL_FAST_MODEL="moonshotai/kimi-k2-instruct"
On Windows (Command Prompt):
set ANTHROPIC_BASE_URL=https://api.novita.ai/anthropic
set ANTHROPIC_AUTH_TOKEN=<Your Novita API Key>
set ANTHROPIC_MODEL=moonshotai/kimi-k2-instruct
set ANTHROPIC_SMALL_FAST_MODEL=moonshotai/kimi-k2-instruct
ANTHROPIC_SMALL_FAST_MODEL controls the lightweight model Claude Code uses for fast internal tasks like file lookups and quick summaries.
Start Claude Code
cd your-project
claude
For scripting and CI, the same approach applies:
cat logs.txt | claude -p "find any error patterns" --output-format json
Novita AI’s LLM API supports the Anthropic messages format, including tool use, structured outputs, and streaming, so Claude Code works without modification.
Agent Sandbox for Isolated Execution
If you’re building automated pipelines on top of Claude Code, Novita AI’s Agent Sandbox gives you isolated execution for agent runs, which is useful for CI workflows and multi-step coding jobs.
Claude Code as an IDE Tool
Claude Code is often described as “an IDE” because it sits inside your existing workflow instead of replacing it. More precisely, it is an agent layer that works with your terminal, editor, and project context.
VS Code and Cursor
Install the Claude Code extension from the VS Code Marketplace or from the Cursor marketplace. After installing, open the Command Palette, type “Claude Code”, and select Open in New Tab.
The VS Code integration adds inline diff review, file mentions, plan review before edits, and conversation history directly in the editor panel. You can also use Claude Code in the integrated terminal alongside the extension.
JetBrains
Install the Claude Code plugin from the JetBrains Marketplace and restart your IDE. It provides interactive diff viewing and selection context sharing in IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs.
Desktop App and Web
The Claude Code desktop app lets you review diffs visually and run multiple sessions side by side. The web interface at claude.ai/code runs sessions in the browser with no local setup.
FAQ
What is ANTHROPIC_BASE_URL and why does it matter?
ANTHROPIC_BASE_URL tells Claude Code which API endpoint to send requests to. The default is Anthropic’s API. Setting it to https://api.novita.ai/anthropic routes traffic to Novita AI’s Anthropic-compatible endpoint.
What is the difference between CLI flags and slash commands?
CLI flags are set when you launch claude from your shell. Slash commands run inside an active session and change behavior mid-conversation.
Can I use Claude Code without a Claude subscription?
Yes. claude auth login --console signs you in with Anthropic Console API key billing. If you route to Novita AI via ANTHROPIC_BASE_URL, you only need a Novita AI account.
How do custom slash commands differ from CLAUDE.md?
CLAUDE.md loads at the start of every session and stays in context. Skills load only when invoked, so use CLAUDE.md for always-on project facts and skills for repeatable procedures.
Does Claude Code work in CI?
Yes. Use claude -p "query" --output-format json for non-interactive mode. Add --max-budget-usd to cap spend and --max-turns to bound execution time.
Novita AI is an AI cloud platform that offers developers an easy way to deploy AI models using our simple API, while also providing affordable and reliable GPU cloud for building and scaling.
