What is Claude Code?
Claude Code is a terminal-based agentic coding tool developed by Anthropic that integrates directly with the Claude AI model family. It allows developers to interact with Claude in their terminal to perform coding tasks, such as exploring codebases, editing files, and managing Git. Claude Code is designed to be a powerful, flexible, and customizable tool for coding workflows.
Install
Install npm
# download nvm :
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# install Node.js :
nvm install 22
# Node.js version:
node -v # "v22.18.0"
nvm current # "v22.18.0"
# npm version:
npm -v # 10.9.3
Install Claude Code
# Install Claude Code CLI
npm install -g @anthropic-ai/claude-code
claude --version # version
Account creation and payment
Type of use
Plan | Monthly fee | Main target | Spec |
Claude Max | $200 | Indivisuals, Small team | Unlimited all chat and upload features including code - 20x the usage compared to Pro |
Claude Max | $100 | Indivisuals, Small team | Unlimited all chat and upload features including code - 5x the usage compared to Pro |
Claude Pro | $20 |
Indivisuals | |
Console (Token payment) | usage based | Enterprise | Token-based fees, team/role management, similar to the GPT series |
Payment
- Click 'Try Claude'
- Enter your email address and password → Create an account
- Enter card at payment stage
First run, OAuth authentication
cd ~/my-project
claude
/login
- When the browser opens, Anthropic permission request → Authorize
- If you see the message Logged in as you@email.com in the terminal, it is successful.
After running the /status
command:
Jetbrain Plugin
You can find Claude Code by searching for Plugins.
You can check the diff of Claude Code's code manipulation.
Representative workflow
Code Description
> what does the payment processing system do?
> find where user permissions are checked
> explain how the caching layer works
Automating Git-related tasks
> commit my changes
> create a pr
> which commit added tests for markdown back in December?
> rebase on main and resolve any merge conflicts
Modify some code
> add input validation to the signup form
> refactor the logger to use the new API
> fix the race condition in the worker queue
Write a test
> run tests for the auth module and fix failures
> find and fix security vulnerabilities
> explain why this test is failing
How to Use Extended Thinking Mode
- First, explain the task to Claude and ask him to gather context from the project.
- Afterwards, prompt them to think more deeply and produce results using the expression "think hard"
> think about how we should architect the new payment service
> think hard about the edge cases in our authentication flow
Claude Project Memory
Memory type
Claude supports two main memory types
- User memory (
~/.claude/CLAUDE.md
)- Personal coding preferences, custom shortcut definitions, etc.
- Project memory (
./CLAUDE.md
)- Project architecture and coding standards that need to be shared across the team.
- The key point is that user memory is not managed by git, while project memory is.
- Management is done via the
/memory
command or direct file editing.
Working process
- The Claude code recursively searches memory. It currently reads all distinct
CLAUDE.md
orCLAUDE.local.md
files, starting from the carpet workspace (cwd
) and ending with the elevator (/
). - Example
- For example, when claude is executed from
./claude-code-test/utils/
, the entire memory of./claude-code-test/CLAUDE.md
and./claude-code-test/utils/CLAUDE.md
is loaded. -
claude-code-test/ ├── CLAUDE.md ├── README.md ├── test.py └── utils/ (claude 실행 위치) ├── CLAUDE.md ├── __init__.py └── simple_utils.py
- Conversely, when the execution location is
claude-code-test/
,./CLAUDE.md
in that directory is loaded and, when necessary, the memory of./claude-code-test/utils/CLAUDE.md
is loaded.
- For example, when claude is executed from
- Summation
Area Key Memory Type (1) Project memory ./CLAUDE.md
: Defines rules and workflows shared by the team.
(2) User memory ~/.claude/CLAUDE.md: Defines personal preferred rules.Memory navigation rules Recursively loads all CLAUDE.md
andCLAUDE.local.md
files from the execution directory (cwd
) up to the project root (/
).CLAUDE.md
files in subfolders are included only when reading files in those folders.Add memory quickly If you start the prompt in the terminal with #
, a dialog box will appear asking, “Where do you want to store this sentence in memory?”Edit directly Running the /memory
command during a session opens the memory file in the default editor for editing and organizing.
A Complete Guide to Setting Claude Code Permissions
Claude Code prompts the user for permission when performing critical tasks, such as executing shell commands, modifying files, or accessing external APIs.
This can be configured in one of four ways
- Real-time permission mode
- View/edit permissions during a session (edit local project)
claude
>/allowed-tools
- Edit the
settings.json
file - Temporarily granting permissions via CLI
claude —-allowed-tools “…”
Real-time authorization method (default)
When Claude tries to do something, it asks:
"Can I run npm install?"
- Allow: Run only once
- Always allow: Added to the allow list (can be run automatically)
- Deny: Not run
This response internally updates the configuration.
View/edit permissions during a session
Entering /allowed-tools
in the Claude dialog box will display a list of currently allowed tools. You can add or remove them directly here.
Edit the Settings.json
file
Create a settings.json
file for the project or for all users.
Path
~/.claude/settings.json
(Treated as personal user settings).claude/settings.local.json
(Included in .gitignore and not shared).claude/settings.json
(Shared as a project file within the team)
Example
See supported commands
{
"permissions": {
"allow": [
"Bash(npm run lint)",
"Bash(npm run test:*)",
"Read(~/.zshrc)"
],
"deny": [
"Bash(curl *)"
]
}
}
- Fields
allow
: Actions to automatically allowdeny
: Actions to unconditionally deny
- Commands
Bash(...)
: Shell commandsRead(...)
/Edit(...)
: File reading/writing
Temporary permission using CLI method
# Allow only specific tools
claude --allowedTools "Bash(npm run dev),WebFetch(domain:example.com)"
# Certain commands are rejected
claude --disallowedTools "Bash(rm -rf *)"
If the conversation session is long
Use the built-in summary prompt
- Create a file (.md) containing a summary of the conversation history
/compact summarize and create xxx_history.md
- Open a new claude session:
claude
-
Based on the information in @xxx_history.md, please analyze the current status of our conversation and identify key topics, decisions, and unresolved issues.
(optional) Use custom prompts
- Download the custom summary prompt and save it as
compact_custom_prompt.md
. - If the conversation history in interactive mode is long, use the prompt above to save the summarized content as an .md file.
@compact_custom_prompt.md summarize and create xxx_history.md
- Open the file in a new session and continue the task.
claude
-
Based on the information in @xxx_history.md, please analyze the current status of our conversation and identify the key topics, decisions, and unresolved issues.
General workflow management
Shift-Tab Mode
Claude Code allows you to select different work modes using Shift-Tab. There are three modes:
- Plan Mode: Claude describes the plan and waits for approval before executing the task.
- Auto Accept Mode: Claude automatically accepts all proposed tasks.
- Normal Mode: This is the default mode, requiring approval for each task.
Revert to previous command
There are two ways to revert to a previous command or state in Claude Code:
Using the ESC key
- Pressing the
ESC
key displays a list of previous chats. - Press the
ESC
key again to select a previous chat.
Note: Reverting to a previous state using this method will delete the history (future history) after the current state. The result will be undone, but you will not be able to return to the future.
Use Git commits.
A safer approach is to ask Claude Code to commit every time you make a change. This allows you to seamlessly switch between previous and current versions using Git.
# prompt
> Please commit these changes with a descriptive message before proceeding
This method allows you to safely revert to a previous state if something goes wrong while working, and even roll back to a future version if necessary.
Thanks for reading. If you found this helpful, please like and share. 😄