Getting Started with Claude Code: Environment Setup, Switching to Domestic Models, and Git Workflow Explained

A hands-on Claude Code guide: setup, switching to domestic models, and mastering conversational Git workflows.
This guide walks developers through getting started with Claude Code—from CLI installation and switching to domestic models like DeepSeek via CC Switch, to conversational Git operations, multi-branch management, and automated bug fixing—helping them quickly grasp AI-assisted engineering workflows.
From a Command-Line Tool to an Engineering Collaborator
The popularity of Claude Code needs no further introduction—more and more developers are integrating it into their daily workflows. However, many people's understanding of it remains stuck at the stage of "a command-line chat tool that can write code," which actually underestimates its current capabilities.
According to a hands-on tutorial shared by a Bilibili content creator, the earliest version of Claude Code only offered a command-line form, with its main functions being analyzing project code, understanding file relationships, and offering modification suggestions. Through continuous iteration, today's Claude Code has undergone a qualitative transformation—evolving from an assistant tool for programming scenarios into a genuine development collaborator.
This transformation manifests across three dimensions:
- Enhanced context awareness: Previously it could only understand individual files, but now it can directly analyze an entire project structure and answer complex questions about code architecture and module relationships.
- Engineering orientation: No longer limited to writing code, it now supports automated testing, implementing SDD (Spec-Driven Development), and consolidating team expertise through customized Skills.
- Multi-role collaboration: Through multi-agent orchestration, it can simultaneously drive multiple roles such as product, development, testing, and operations, covering the complete software development lifecycle.

In other words, a developer's core work is shifting toward "setting goals, defining constraints, making judgments, and controlling aesthetics," while repetitive labor such as execution, analysis, comparison, and fixing is increasingly being handed over to AI.
What Real Pain Points Can Claude Code Solve
For different types of developers, Claude Code offers value with different emphases.
Programming Beginners: Quickly Understanding Unfamiliar Codebases
The most common difficulty beginners face is being unable to understand complex open-source project code, or having no idea where to start when encountering production errors. Claude Code can not only explain obscure code line by line, but also discover legacy bugs, pinpoint performance bottlenecks, and proactively fix them, significantly lowering the barrier to understanding unfamiliar codebases.
Independent Developers: Completing the Full-Stack Development Chain Solo
In the past, the time cost of full-stack front-end and back-end development was extremely high. With Claude Code's multi-agent orchestration capabilities, a single person can efficiently complete the entire chain from requirements to implementation, while automatically generating test cases and refactoring messy code.
Team Collaboration: Unifying Standards and Boosting Overall Efficiency
The pain points in team scenarios are even more typical: inconsistent code styles, slow onboarding for newcomers, and time-consuming code reviews. Claude Code can unify development standards through the CLAUDE.md configuration file, consolidate architecture documentation and compliance-checking logic with Skills, and even build dedicated Skills to analyze Issues and perform code reviews. Work that previously required extensive automation build plugins can now all be front-loaded and automated.
Environment Setup: CLI Installation and Switching to Domestic Models
Claude Code currently comes in three main forms: a Web version, a CLI command-line version, and plugin versions integrated into VS Code and PyCharm/IDEA. For daily development, using editor plugins is more efficient, but it's still worthwhile to master the basic CLI commands.
CLI Installation Steps
The installation itself requires just a single command. Mac, Linux, and WSL environments use the corresponding shell installation script, while Windows uses the irm command. After installation, run claude -v to check the version number and confirm success (the version demonstrated in the tutorial is 2.1.207).
Note: Installing via NPM requires setting up the Node.js environment beforehand (the Node version in the tutorial is 22.2.0). For a first-time installation, it's recommended to use the official one-click script rather than NPM, as it offers better stability. If you encounter network issues, you can switch to a domestic mirror source to speed up the download.
Switching to Domestic Large Models Using CC Switch
Due to network reasons, accessing Claude Code's official models in China faces obstacles. The tutorial recommends using the open-source tool CC Switch (recommended version 3.16.x) to quickly switch to domestic large models, supporting mainstream models such as DeepSeek V4, Kimi, and Tongyi Qianwen.
The configuration process is as follows:
- Download CC Switch (for Windows, the portable version is recommended; be careful to distinguish between ARM and AMD64 architectures)
- Open the interface, click "+" to add a model, select DeepSeek or another, and enter the API key
- Enable the corresponding model and check "Local Routing" in the settings
- Restart Claude Code for the changes to take effect
After switching, enter the slash command /model in the conversation to confirm the model currently in use. There is no essential difference in user experience between domestic models and official models—only a slight gap in performance—but they win out with stable access.
Git Workflow: Managing Code Like a Conversation
One of Claude Code's most practical capabilities is making Git operations as simple as everyday conversation. Developers don't need to memorize cumbersome Git commands—they only need to describe their needs in natural language.

Conversational Git Basic Operations
Through natural-language conversation, you can have Claude Code complete a full Git chain: creating a project, creating a new branch, pulling a remote repository, moving files, and committing and pushing code. The tutorial demonstrates a complete scenario—having it create a personal tech blog project, then automatically invoking Git commands to push it to GitHub. Throughout the entire process, the author "didn't change a single line of code, nor manually typed a single Git command."
Multi-Branch Management and Automated Bug Fixing
More advanced usage is reflected in multi-branch development and automated bug fixing. The author demonstrated the following workflow:
- Create a
devbranch and implement three different sorting algorithms within it - Claude Code automatically completes the coding and then runs the tests (all 12 tests pass)
- Automatically commit and push to the corresponding branch
In the bug-fixing phase, Claude Code supports two modes: one where the developer points out a known problem for it to locate and fix; and another where it autonomously scans the project, discovers potential issues, and outputs an Issue document. After the author had it scan the code, it automatically sorted out multiple types of defects such as "correctness issues, documentation-implementation mismatches, and design portability issues," then completed the loop with a single instruction: Refer to issue.md, fix all problems, then commit and push.

Claude Code's Standard Problem-Handling Workflow
Whether it's a feature modification or a bug fix, Claude Code follows a standard workflow: locate relevant files → understand the context and root cause → present the modification plan → wait for user approval → execute. If tests exist in the project, it will also automatically run them to verify the fix. Users can approve modifications one by one, or choose to accept them all.
Two Sets of Commands: Internal and External
Claude Code's commands fall into two categories, used for different scenarios.
External Commands (Executed Directly in the Terminal)
claude -p: Headless mode—executes a prompt once, e.g.,claude -p "分析下test目录项目结构"outputs the result directly to the console without entering a conversation windowclaude -c/--continue: Resume the previous conversation; the most frequently used in daily workclaude -r/--resume: View the history conversation list and select one to resumeclaude commit: Invoke Git commands to commit code
Internal Slash Commands (Used Within the Conversation Window)
/help: Query all available commands/clear: Clear the current conversation history and start a fresh session/model: Switch or view the currently used model/login,/resume, etc.
It's worth mentioning that there's no need to memorize these commands by rote—simply ask conversationally, "Which command should I use to resume a conversation?" and Claude Code will give you the accurate answer. This itself is a demonstration of its role as an intelligent collaborator.
Conclusion
Claude Code has evolved from a mere programming assistant tool into a full-process development collaborator covering code analysis, multi-agent collaboration, Git engineering, and automated testing and fixing. For developers in China, switching to domestic large models such as DeepSeek via CC Switch is a pragmatic solution for bypassing network restrictions. Mastering its modification workflow and its internal and external command systems is the crucial first step from beginner to proficiency. Later, combining this with enterprise-level project practice (such as Java admin management systems, Python intelligent customer service, etc.) becomes the true touchstone for testing AI engineering-oriented programming capabilities.
Related articles

From Chat to Agent: Automating Your Entire Business Workflow with AI Agents
Veteran AI practitioner Remy breaks down the leap from chat models to AI agents: how agents work, the three pillars of context, tools, and skills, MCP connections, and hands-on architecture to make you a 100x employee.

Understand Anything: The AI Skill That Turns Code into Interactive Knowledge Graphs
Understand Anything is a high-star open-source GitHub skill that runs static analysis on any codebase and generates interactive knowledge graphs. It supports Claude Code, Cursor, Copilot and other agents, letting engineers ask questions in natural language with path references.

Kimi K3 Released: How a 2.8 Trillion Parameter Open Model Reshapes AI Cost-Effectiveness
Moonshot AI unveils Kimi K3: a 2.8 trillion parameter, 1M context, natively multimodal open model. With KDA architecture and ultra-low cost, it rivals GPT-5.6 and Fable 5, redefining AI cost-effectiveness.