Skip to content

Latest commit

 

History

History
52 lines (27 loc) · 6.09 KB

File metadata and controls

52 lines (27 loc) · 6.09 KB

Introduction

← Home | Next: Claude Code Set-up →

Claude Code is without a doubt the most powerful AI coding dev I've ever used - it's not even close. It's like having a postgraduate student at your command.

It is purely in the terminal. So if you do not know what you are doing inside the terminal, you may be better off using Claude Desktop.

HOWEVER - If you just think of Claude Code as something that develops inside whichever folder its in - you don't have to actually worry about what it's doing.

In order to use Claude Code you need to install it, the create a new folder, the run "claude" - you can then think of this as a fresh instance to develop inside.

One thing to note is that all conversations with Claude Code are new conversations unless you run claude --continue, claude --resume, or unless you have a claude.md file with a history of the project inside it. You can pass this history by passing the claude.md file through GitHub.

Finally, MCPs are PROJECT-specific, NOT user-specific, so after installing an MCP, if you start a new Claude Code instance in a new folder, you will have to run the MCP install commands again.

This is where I would suggest most people actually work on stuff. It has a bit of a learning curve, but if you're willing to put the time and effort into learning how to do things here, you're setting yourself up for future success.

With Claude Code, you need to understand a few basic concepts:

Each Claude Code instance is a new project, based off the folder you're inside. It creates a .claude folder and stores things like memory for that project, and anything else. This means if you cd into a new directory, even if it's just one level down, into a folder that you created with GitHub, then you are talking to a completely new instance of Claude Code and must run /init.

/init is the command you need to run at the start of every project. Once you've run it once, you should run it every few hours, in order for it to keep up with the progress you've made on the project so far.

Use .md files - This is essential. When you plan something and then you tell Claude Code to implement it, it will only remember its full implementation plan up to the first /compact. Once it runs a compact, it has essentially started a new context window, and has no memory of the previous conversation (except the init file) - If you instead get it to make an implementation.md file and then get it to continue updating the .md file with where it's up to so far, it will continuously understand at what point in the project/implementation it is.

Run /compact manually when it's at around 10% left. This is to stop it from "reward hacking" - I have noticed that when it runs /compact itself when it's only partway through a task, it will reward hack the rest of the task and it will state that it's finished, when it's not. This is the WORST part about using Claude Code, so manually running /compact seems to really help it not reward hack as much.

Run /memory

Project memory should already be filled in from when you ran /init. However, if you're starting a brand new project - tell it what you want in plan mode, then tell it to add it to Claude.md so that it knows what it's working on - even as a new project, with no base.

User memory - put things that affect how Claude Code works here, and improves on how it works.

put system instructions in here, some suggestions are things like: Write production ready code only without placeholders, never hardcode tests or hardcode console logs to give the impression that something is working when it's not. These are also good to add if you want, which helps it improve its tool use, and is taken from the official Anthropic YouTube Channel.

Use plan mode when you want to either add a new feature, or do something quite hefty. As mentioned before, ensure to get it to create a .md file (name doesn't matter) and then store the name of the file, as well as keep an up to date to-do list on what it's currently working on.

For bug fixing, have it run its own tests, read the output from Docker so that it can understand what the error is. Be aware, that sometimes the error is not in the logs that I just mentioned. If no error is found, that normally means a) there's a general issue with the execution of the JavaScript and therefore it's not running (and therefore doesn't show errors) or b) it's an error on the browser side, which means Claude can't find the error. In this case, you will have to right click inspect the webpage in order to see the error. Feed this error to Claude.

Do all your coding ETC. on docker until it's production ready. Don't make the mistake I made of launching too early. If you do decide to launch early, then make sure you have a CI:CD pipeline - meaning you have a local host dev, a staging website, and production. Make changes to everything locally then push them to dev and test them there, once you're sure they're working on Dev, it should be safe to push to production - this is discussed more in the next chapters.

I don't use Context7 MCP - I found it doesn't work that well. Instead - I tell it to research all of the latest official documentation first for anything mentioned in my prompt, and to do thorough research of all needed pages containing information that pertains to the task at hand. Tell it not to just read one or two pages, but to scrape all relevant pages of documentation, and include REAL code snippets pertaining to the tasks that need to be performed. You can also look for things called llms.txt

An llm.txt file is a file on AI and other documentation websites. Basically what it is is it's a summary of all the things your AI needs to know in order to code whatever it is coding. For example, you can use the anthropic llm.txt https://docs.anthropic.com/llms.txt - in order to feed all relevant documentation to Claude Code. Tell it to scrape it itself. This is a really good tip for speeding up building of apps.

Introduction Image 1 Introduction Image 2


← Home | Next: Claude Code Set-up →