Skip to content

Latest commit

 

History

History
136 lines (85 loc) · 4.98 KB

File metadata and controls

136 lines (85 loc) · 4.98 KB

Claude Code Set-up

← Previous: Introduction | Home | Next: Send Pictures to Claude →

If life were easy - you'd just have to run

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

If the command fails because of permissions, you just need to get ChatGPT to help you out - do NOT run sudo app install - give ChatGPT this page for reference:

https://docs.anthropic.com/en/docs/claude-code/getting-started

If you're on either Mac or Linux, it's pretty much that easy. You just need to add NodeJS to path, and ensure you add everything else to Path, run any errors through ChatGPT

Eventually when you write "claude" it'll open up Claude code and work inside whatever directory you're currently in.

On Windows, as usual, it's more complicated - but with WSL making things easier for us, we can just run:

If WSL is not installed yet:

Step 1: Install WSL (using PowerShell)

Open PowerShell as Administrator and run:

wsl --install Ubuntu

This will:

  • Enable the necessary components
  • Download and install the default Ubuntu distro
  • Set WSL2 as the default

Step 2: Restart your PC (if prompted)

Step 3: Launch WSL

After rebooting, open a terminal and type:

wsl

The first time, it will complete the Ubuntu setup and ask you to create a UNIX username and password.

Once this command works, run:

wsl -d Ubuntu

This will install Ubuntu

Now we're inside Ubuntu - let's run dir to see where we are:

dir

You'll notice you're inside your main user folder for your windows computer

Now try run:

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

You'll like get an error, feed the error to ChatGPT - you will have to:

  • Install NodeJS if it's not installed
  • Make sure all dependencies are globally installed and the global nodeJS folder is set to path

Keep running through all the errors, this is the same for Mac, until npm install claude code works.

Once this command works:

claude

and you're inside claude code, write /login and login through your Anthropic account or the API

Now - let's tell Claude to make its own settings file with the custom settings from Anthropic themselves to make Claude code faster - the alternative to this is whenever it has a lot of tasks to do at the same time, press escape, and write "Please spin up multiple sub agents to implement this"

"Claude please add these instructions to a global file that you will always use when coding

<prompt_to_add>
For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
</prompt_to_add>

Here are some instructions from Anthropic on how to do this:

CLAUDE.md imports

CLAUDE.md files can import additional files using @path/to/import syntax. The following example imports 3 files:

See @README for project overview and @package.json for available npm commands for this project.  
# Additional Instructions - git workflow @docs/git-instructions.md 

Both relative and absolute paths are allowed. In particular, importing files in user's home dir is a convenient way for your team members to provide individual instructions that are not checked into the repository. Previously CLAUDE.local.md served a similar purpose, but is now deprecated in favor of imports since they work better across multiple git worktrees.

# Individual Preferences - @~/.claude/my-project-instructions.md 

To avoid potential collisions, imports are not evaluated inside markdown code spans and code blocks.

This code span will not be treated as an import: `@anthropic-ai/claude-code` 

Imported files can recursively import additional files, with a max-depth of 5 hops. You can see what memory files are loaded by running /memory command.

You can add any other system instructions at any time

Now ensure you have GitHub set up - you are basically running Linux on your windows so it has access to all of all your files

Clone any GitHub repo or make any nexts project or localwp project on your computer and feed that directory to Claude code.

You can do this by changing directory (cd) into your new directory inside Linux WSL and then running Claude.

There are only really two things to note here:

  • every time you implement a new feature push to GitHub when it's working - I personally push to new branches and have many branches and can revert back to any branch whenever I want
  • The other thing is context window - Claude code can code beyond the 200k context - by running /compact or just using their auto compact feature. I suggest running /compact manually instead of waiting for Claude Code to do it, as it will reward hack in order to get tasks done if it's approaching the context window.

Image 1 Image 2


← Previous: Introduction | Home | Next: Send Pictures to Claude →