Getting Started

Claude Code क्या है? Installation से पहले Use तक Complete Guide

Claude Code install और use करने की beginner-friendly guide। आज ही इस terminal-based AI coding assistant के साथ शुरुआत करें।

Claude Code क्या है

Claude Code, Anthropic द्वारा बनाया गया एक terminal-based AI coding assistant है। VS Code extensions के विपरीत, यह एक CLI tool के रूप में run होता है — और यही इसकी defining feature है। यह आपके पूरे codebase को समझता है और एक ही जगह से files edit कर सकता है, नई files बना सकता है, commands run कर सकता है, और Git operations handle कर सकता है।

क्योंकि यह किसी specific editor पर depend नहीं करता, आप इसे किसी भी development environment में use कर सकते हैं।

Installation

Prerequisites

  • Node.js 18 या उससे बाद का version installed हो
  • एक Anthropic account (Max plan या API access)

npm से Install करें

npm install -g @anthropic-ai/claude-code

Install होने के बाद, verify करें:

claude --version

पहली बार Authentication

पहली बार launch करने पर authentication ज़रूरी है।

claude

यह command run करने पर आपका browser खुलेगा और Anthropic account से authenticate करेगा। Authentication complete होने के बाद, आप terminal पर वापस आ जाएंगे और शुरू करने के लिए तैयार होंगे।

Basic Usage

Interactive Mode

अपने project की root directory में बस claude type करें और interactive session शुरू करें।

cd my-project
claude

Session के अंदर, natural language में instructions दे सकते हैं:

> Explain the structure of this project
> Add a validation function to src/utils/helper.ts
> Run the tests and make sure they pass

One-Shot Mode

Interactive session शुरू किए बिना single command run करने के लिए -p flag use करें:

claude -p "Check the dependencies in package.json and list any unused ones"

Piping Input

stdin के through Claude Code में data pipe भी कर सकते हैं:

cat error.log | claude -p "Analyze this error log and suggest a fix"
git diff | claude -p "Review this diff"

Useful Slash Commands

Session के दौरान use कर सकते हैं ये handy slash commands:

CommandDescription
/helpHelp दिखाएं
/clearConversation history clear करें
/compactConversation को summarize और compress करें
/initCLAUDE.md file generate करें
/costCurrent session का token usage दिखाएं

सबसे पहले Try करने वाली चीज़ें

1. अपना Project समझें

> Explain the architecture of this project

Claude Code सभी files read करता है और आपको structural overview देता है।

2. CLAUDE.md Generate करें

> /init

यह automatically एक configuration file generate करता है जो Claude Code को आपके project की rules और coding conventions बताती है।

3. Bug Fix करें

> Run npm test, find the failing tests, and fix them

Claude Code पूरा flow handle करता है — tests run करना, errors identify करना, और code patch करना।

Permission Settings

चूंकि Claude Code files edit कर सकता है और commands run कर सकता है, यह हर action पर confirmation पूछता है। Trusted commands को settings में pre-approve कर सकते हैं:

// .claude/settings.json
{
  "permissions": {
    "allow": [
      "Read",
      "Bash(npm test)",
      "Bash(npm run lint)"
    ]
  }
}

Conclusion

Claude Code install करना आसान है और आपको सीधे terminal से AI coding assistant के साथ काम करने देता है। किसी project directory में claude run करके शुरू करें और code explanations या refactoring try करें। आने वाले articles में, हम other AI tools से comparison और advanced workflows cover करेंगे।

#Claude Code #installation #getting started #setup #AI dev tools