Difference between revisions of "Claude code"

From Logic Wiki
Jump to: navigation, search
Line 61: Line 61:
 
* Create and Save the API Key.  
 
* Create and Save the API Key.  
 
* click '''install manually''' to go to [https://context7.com/docs/resources/all-clients#claude-code https://context7.com/docs/resources/all-clients#claude-code]
 
* click '''install manually''' to go to [https://context7.com/docs/resources/all-clients#claude-code https://context7.com/docs/resources/all-clients#claude-code]
* select server (Client didn't work for me)
+
* select server (Client didn't work for me maybe in bash mode it works)  
 
* replace API KEY with yours
 
* replace API KEY with yours
 
* exit and restart Claude
 
* exit and restart Claude
Line 93: Line 93:
 
/frontend-design improve the look and feel of this app. Make it modern and polished
 
/frontend-design improve the look and feel of this app. Make it modern and polished
 
</pre>
 
</pre>
 +
== Checkpointing ==
 +
It's like git commits.
 +
/rewind
 +
Go to the previous step you want to rewind and select a restore strategy.
 +
 +
It only tracks within the Claude tool. It doesn't track bash changes.It only works in the current session
 +
== Subagents ==
 +
Subagents work as an agent and send the summary to main agent.
 +
/agents
 +
it shows all agents including default ones. Also it shows '''Create new agent''' link. Click to follow wizard.
 +
 +
In the description step write it like :
 +
<pre>
 +
help me review my code, identify issues and suggest improvements for readability, maintainability, performance and best practices.
 +
</pre>
 +
 +
Select the tools assigned to this agent.
 +
 +
Select models and colour.
 +
 +
To edit or delete run /agents command and select the agent.
 +
=== using a subagent ===
 +
use the code-reviewer subagent to review my code
 +
'''ctrl + b''' to run in the background
 +
 +
to see background tasks
 +
/tasks
 +
 +
= Project Planning and Setup =
 +
== Defining the Project Scope ==
 +
create a '''project-scope.md''' file
 +
<pre>
 +
## Problem
 +
We receive hundreds of support emails daily. Our agents manually read, classify and respond to each ticket - which is slow and leads to impersonal, canned responses.
 +
 +
## Solution
 +
Build a ticket management system that uses AI to automatically classify, respond to and route support tickets - delivering faster, more personalized responses to students while freeing up agentsfor complex  issues.
 +
## Features
 +
 +
- Receive support emails and create tickets
 +
- Auto generate human-friendly responses using a knowledge base
 +
- Ticket list with filtering and sorting
 +
- Ticket detail view
 +
- AI-powered ticket classification
 +
- AI Summaries
 +
- AI-suggested replies
 +
- User management (admin only)
 +
- Dashboard to view and manage all tickets
 +
</pre>
 +
== Clarifying the Requirements ==
 +
In Claude
 +
Read @project-scope.md. Review it and ask me clarifying questions. Help me find gaps or things I haven't through through.
 +
answer the questions and
 +
update the project scope document with these changes
 +
== Defining the MVP ==
 +
Review the scope to prepare MVP for the version 1.0.0
 +
== Choosing the Tech Stack ==
 +
Suggest a tech stack for this project
 +
it asks if we want it to add the tech stack  to the project scope document.
 +
use the database sessions for authentication and store this in '''tech-stack.md'''
 +
== Creating an implementation plan ==
 +
create an implementation plan. Break the project into small tasks and group them into phases
 +
Review the plan (implementation-plan.md) add, edit, delete or re-order the steps
 +
== Setup ==
 +
create a full-stack project with express, react, typescript and bun. use context7 for up-to-date docs.
 +
 +
create the project memory file claude.md. add context7 to fetxh up-to-date documentation.

Revision as of 14:40, 18 April 2026


Course : Mosh Claude Code Course

Alternatives of Claude Code : CoPilot, Cursor, Windsurf

Installation

Choose the right installation for the OS from https://code.claude.com/docs

Using Claude Code

Upgrade to pro plan to use it in VS Code

Some commands

Open VS and open terminal inside of VS.

claude
/login 

to remember last session

claude --resume 
/terminal-setup

it installs Shift+enter to write multi line commands

Ctrl + L clear the command

To mention a file start the name with @ sign

commit 

it creates a git add and git commit with a meaningful commit message

/init Creates CLAUDE.md file

Plan Mode / Accept Edits On

Plan mode is to add a new feature. It plans the feature and waits for user to confirm it.

Shift + tab in claude prompt switches the modes.

Managing context window

to see the context usage

/context

Compacy / Clear the context

/compact
/clear

Tracking cost

/usage

Model Context Protocol (MCP)

MCP Servers give Claude access to external services.

it consist on two parts Client and Server like

Agent -> MCP Client -> MCP Server -> Github

Each MCP adds token to prompts. Use only necessary ones.

To see MCP servers

/mcp

to add or delete mcp servers

claude mcp add ....
claude mcp remove <SERVER_NAME>

Context 7

It's a MCP which gets the latest versions and the documentation

Skills

Skills are instructions that teach Claude how to do things

To see the skills enter the command below

/skills

To run the skill ie:deploy

/deploy

Creating Skill

in the accept edit mode write a prompt like :

 create a custom skill called deploy. When deploying, we should run all tests first, build the production bundle and push to the staging area.
  • it creates a file at .claude/skills/deploy.md
  • move it to .claude/skills/deploy/SKILL.md
  • review and fix necessary steps.
  • exit and restart Claude

Adding Skills

The marketplace for skills is : [1]. Search the skill and install it with npx or whatever you want.

In the first time it installs skills library and select the skill and Claude Code. Install it project or global and select symlink.

Exit and restart to activate it.

If we add frontend-design skill. run it like :

/frontend-design improve the look and feel of this app. Make it modern and polished

Checkpointing

It's like git commits.

/rewind

Go to the previous step you want to rewind and select a restore strategy.

It only tracks within the Claude tool. It doesn't track bash changes.It only works in the current session

Subagents

Subagents work as an agent and send the summary to main agent.

/agents

it shows all agents including default ones. Also it shows Create new agent link. Click to follow wizard.

In the description step write it like :

help me review my code, identify issues and suggest improvements for readability, maintainability, performance and best practices. 

Select the tools assigned to this agent.

Select models and colour.

To edit or delete run /agents command and select the agent.

using a subagent

use the code-reviewer subagent to review my code

ctrl + b to run in the background

to see background tasks

/tasks 

Project Planning and Setup

Defining the Project Scope

create a project-scope.md file

## Problem
We receive hundreds of support emails daily. Our agents manually read, classify and respond to each ticket - which is slow and leads to impersonal, canned responses.

## Solution
Build a ticket management system that uses AI to automatically classify, respond to and route support tickets - delivering faster, more personalized responses to students while freeing up agentsfor complex  issues.
## Features

- Receive support emails and create tickets
- Auto generate human-friendly responses using a knowledge base 
- Ticket list with filtering and sorting
- Ticket detail view
- AI-powered ticket classification
- AI Summaries
- AI-suggested replies
- User management (admin only)
- Dashboard to view and manage all tickets

Clarifying the Requirements

In Claude

Read @project-scope.md. Review it and ask me clarifying questions. Help me find gaps or things I haven't through through.

answer the questions and

update the project scope document with these changes

Defining the MVP

Review the scope to prepare MVP for the version 1.0.0

Choosing the Tech Stack

Suggest a tech stack for this project

it asks if we want it to add the tech stack to the project scope document.

use the database sessions for authentication and store this in tech-stack.md

Creating an implementation plan

create an implementation plan. Break the project into small tasks and group them into phases

Review the plan (implementation-plan.md) add, edit, delete or re-order the steps

Setup

create a full-stack project with express, react, typescript and bun. use context7 for up-to-date docs.
create the project memory file claude.md. add context7 to fetxh up-to-date documentation.