Getting Started with Claude Code: A Practical Guide to Environment Setup and Git Workflow Automation

A practical guide to setting up Claude Code and automating Git workflows for AI-assisted development.
This article systematically covers Claude Code's core capabilities and environment setup, including CLI installation, switching to domestic large models, project analysis, Git workflow automation, and automated bug fixing—helping developers with zero background quickly master AI-assisted programming.
Claude Code (hereafter referred to as CC) has evolved from a simple command-line code analysis tool into an AI engineering collaborator capable of spanning the entire workflow—from requirements to development, testing, and deployment. Based on hands-on tutorial content from a Bilibili creator, this article systematically covers CC's core capabilities, environment setup methods, and the most commonly used Git workflow automation practices in enterprise-level projects, helping developers with zero background get up to speed quickly.
From Code Assistant to Engineering Collaborator
Claude Code started out as merely a command-line dialogue tool used to analyze project code, understand file relationships, and offer modification suggestions. With rapid version iterations, today's CC has fully strengthened its capabilities and is vastly different from its early form.
The most notable changes manifest in three dimensions:
- Context awareness: Upgraded from understanding a single file to analyzing the entire project structure. You can directly ask architecture-level questions and receive thorough analysis.
- Engineering orientation: No longer limited to writing code, it can implement complete engineering workflows such as SDD (Spec-Driven Development), automated testing, and code review.
- Customizability: Through the Skill mechanism, developers can distill their real-world work experience into reusable skill modules.

In other words, CC is transforming from a tool geared toward programming scenarios into a genuine work partner. Human responsibilities focus on establishing goals, setting constraints, and making judgments, while the AI handles execution analysis, comparing options, and eliminating repetitive labor. For independent developers, CC can significantly reduce the time cost of frontend and backend development. Through multi-Agent orchestration, it can even play multiple roles—product, development, testing, operations—within the same project.
The Value of Claude Code for Team Collaboration
For teams, CC's core value lies in unifying standards and reducing communication costs. Common pain points in team development—inconsistent code styles, slow onboarding for newcomers, experienced developers being interrupted by repetitive questions, time-consuming code reviews—can all be effectively alleviated with CC.
With the CLAUDE.md configuration file, teams can enforce development standards across all members. Through custom Skills, you can specifically analyze Issues, check code compliance, and perform Code Reviews. Even when a project lacks documentation, CC can quickly analyze the entire codebase to help newcomers grasp the full picture of the project. Tasks that previously required installing numerous automated build plugins can now be handed off to the AI.
Claude Code Environment Setup: Installation and Switching to Domestic Models
CC currently comes in three main versions: a Web version used directly in the browser, a command-line CLI version, and a plugin version integrated into IDEs like VS Code and PyCharm. For day-to-day enterprise development, the IDE plugin version offers the best experience, but mastering the basic CLI commands is still highly necessary, because the visual interface essentially calls the underlying commands as well.
Installing the Claude Code CLI
The CLI installation is very simple—a single command does the job. For Mac, Linux, and WSL environments, use the corresponding shell installation command; Windows uses a dedicated command. After installation, run claude -v to check the version number—if it displays correctly, the installation was successful.
The prerequisite for installation is setting up the Node.js environment. You need to first download and install Node.js and run node -v to confirm. If you encounter network issues during installation, it's recommended to switch to a domestic npm mirror source, which will significantly boost download speeds.

Switching to a Domestic Large Model
Due to network restrictions, CC's official models have limited accessibility in China. In practice, it's recommended to switch to a domestic large model for a more stable experience. The tutorial recommends using the open-source tool CC Switch for quick switching.
The specific process is as follows:
- Download the version for your architecture from the GitHub Release page (Windows users can choose the portable version to extract and use directly, or opt for the MSI installer)
- Open the CC Switch interface, click the plus button to add a model configuration, select a domestic model such as DeepSeek, Kimi, or Tongyi Qianwen, and enter the API key
- Enable local routing in the settings, then restart CC for it to take effect
After switching, you can confirm the currently used model via the model option in the window. Although domestic models have some performance gap compared to the official models, their advantage is stability, which is more than sufficient for most development scenarios.
Hands-On Practice: Project Analysis and Basic Dialogue
When using Claude Code to develop enterprise-level projects, the first step is usually to have it analyze the project structure. Simply switch to the project directory and enter "Help me analyze the project," and CC will lay out the project type (such as a Vue frontend admin management system), the various functional modules, and file relationships. This is especially useful for newcomers who have just joined or developers encountering a project for the first time.
For basic code writing, such as "Implement a bubble sort algorithm in Python," CC will automatically complete the code and include tests. You can also add follow-up requirements on top of this, such as "Help me add a more complete test file," and it will modify based on the original file.
CC's Modification Workflow
Every modification CC performs follows a fixed process:
Locate relevant files → Display modification content → Wait for user approval and confirmation → Execute modification
Users can approve items one by one or choose to accept all. Understanding this workflow is an important prerequisite for using CC efficiently.
Git Workflow Automation in Practice
One of Claude Code's most practical capabilities is making Git operations as natural as everyday conversation. Developers no longer need to memorize cumbersome Git commands—they simply express their intent in natural language.
From Creating a Project to Pushing Code
Here is a demonstration of a complete Git automation workflow:
- Ask CC to "Create a personal tech blog project, implemented with HTML+CSS+JS"
- Pull a remote repository through dialogue: "Help me pull the Test project from GitHub"
- "Move the local files to the Test project and commit and push the code"
Throughout the process, CC automatically invokes the corresponding Git commands, requiring no user intervention with the underlying operations.

You can also query the commit history, such as "Query how many Commits the Test project has, and display each Commit's description in a table." You can also create a new branch for feature development, such as "First create a dev branch, implement three different sorting algorithms in it, then commit and push." CC will first create the branch, write the code, run automated tests, and finally automatically commit and push to the corresponding branch.
Automated Bug Discovery and Fixing
Going further, CC can achieve a closed loop of automated bug discovery and fixing:
- Discovering issues: Ask CC to "Analyze what issues exist in the dev branch code and output them to issue.md." CC will autonomously identify problems and organize them into a document, covering correctness issues, discrepancies between documentation and implementation, portability issues, and more.
- Fixing issues: Then ask it to "Refer to issue.md, fix all issues, and commit and push," and it will complete the entire fixing process—without you having to manually change a single line of code.
CC's problem-handling logic is: Understand context → Analyze code logic → Locate the root cause → Provide a solution → Automatically run tests to verify the fix. This process is essentially a form of automated code review practice.
Claude Code Common Commands Quick Reference
CC commands fall into two categories: external terminal commands and in-dialogue slash commands.
External terminal commands:
| Command | Description |
|---|---|
claude -v | Check the current version number |
claude -c | Resume the last conversation (most commonly used) |
claude -r | Display the history list of conversations to select and resume |
claude -p "task description" | Headless mode, directly executes a single task and outputs the result |
claude commit | Directly invoke Git to commit code |
claude update | Update to the latest version |

In-dialogue slash commands:
/login, /resume, /clear, and others are commonly used slash commands, among which /clear is used to clear the current conversation record and start a fresh session.
It's worth noting that if you're unsure how to use a certain command, you can directly ask CC through dialogue (e.g., "Which command should I use to resume a conversation"), and it will give you the answer directly, without needing to consult the official documentation.
Conclusion
The value of Claude Code lies not in replacing developers, but in freeing them from tedious repetitive labor. From environment setup and project analysis to full automation of the Git workflow, CC already has the capability to become a "genuine work partner."
For teams and independent developers looking to improve engineering efficiency, mastering CC's core usage and workflows will become a key skill in the AI era. More advanced capabilities down the road—such as multi-Agent collaboration, MCP service integration, and Skill customization—can further unlock its potential in enterprise-level scenarios.
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.