Getting Started with Claude CLI
Understand how Claude works
Claude works inside the directory where it is launched.
For example:
If you start Claude from this folder, it can inspect and work with files inside that project.
If you instead launch Claude inside:
Claude will work with that project instead.
Because of this, it is recommended to always change into the correct project directory before starting Claude.
Example:
Start Claude
Launch the interactive interface:
Claude opens an interactive chat inside your terminal.
You can now ask it questions such as:
Explain this project.
What files are most important?
How do I start this application?
Find potential bugs.
Improve this code.
Update my documentation.
Run a single prompt
If you don't want the interactive interface, you can execute a single request.
Example:
Another example:
This is useful for automation and scripting.
Create a new project
Create a project folder:
Then launch Claude:
You can ask:
Create a Flask web application.
or
Build a simple Node.js REST API.
Claude will propose the required files and code.
Work with existing projects
Navigate to your project:
Start Claude:
Examples:
- Explain this project.
- Summarize the folder structure.
- Find dead code.
- Improve performance.
- Refactor this application.
- Update dependencies.
- Review my Docker configuration.
- Explain this error.
Claude understands the current directory structure and can work across multiple files.
Common tasks
Claude is particularly useful for:
Explaining Code
Finding Bugs
Writing Documentation
Reviewing Code
Creating Files
Refactoring
Learning
Work safely
Claude may request permission before:
- Editing files
- Running commands
- Installing packages
- Removing files
Always review proposed actions before approving them.
Using Git before making large changes is strongly recommended.
Review everything before committing.
Update Claude Code
Update to the newest version:
Verify:
Sign out
Disconnect Claude from your account:
Verify:
Useful commands
Check version:
Authentication status:
Interactive mode:
Single prompt:
Display help:
Best practices
For the best experience:
- Launch Claude inside the correct project directory.
- Use Git before making significant changes.
- Review all generated code before deploying it.
- Keep Claude updated.
- Avoid running Claude as the
rootuser unless necessary. - Break large requests into smaller tasks for better results.
- Let Claude inspect your project before asking it to make changes.
Conclusion
Claude Code brings Anthropic's AI directly into your Linux terminal, allowing you to work faster without leaving your development environment. Whether you're creating a new application, debugging an existing project, writing documentation, or learning how unfamiliar code works, Claude can significantly improve your development workflow.
For the safest experience, always work inside a Git repository, review every proposed change, and keep your projects backed up before making large modifications.