0% found this document useful (0 votes)
30 views4 pages

Claude Code Notes

The document outlines the functionalities of Claude, a coding assistant that manages project rules through a claude.md file, generates code from natural language instructions, and assists with bug detection and code review. It details various prompting techniques, project initialization commands, and the types of claude.md files used at different levels. Additionally, it describes tools and commands available within Claude for enhancing coding tasks and project management.

Uploaded by

Himanshu Jain
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Claude Code Notes

The document outlines the functionalities of Claude, a coding assistant that manages project rules through a claude.md file, generates code from natural language instructions, and assists with bug detection and code review. It details various prompting techniques, project initialization commands, and the types of claude.md files used at different levels. Additionally, it describes tools and commands available within Claude for enhancing coding tasks and project management.

Uploaded by

Himanshu Jain
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Claude Code Notes

Session 2

A. [Link]
 Used to manage policies and define rules within a project.
 Organizations can set rules (e.g., restrict editing of sensitive files like credentials,
configuration files).
 Claude starts in a project directory and looks for a [Link] file.
 Custom rules can be defined such as:
 • Use free format for all new programs
 • Avoid specific options (e.g., ctl-opt dftactgrp *NO)
 • Use camelCase for variable names
 Claude can generate the [Link] file automatically.

B. Natural Language to Code


 Claude can generate complete programs from structured English instructions.

1. Example:

 Use table 'custmst' with fields: custId (packed 7), custName (char 50), custBal (packed
11:2)
 Read customers where custBal > 1000
 Print id, name, and balance to printer file (QSYSPRT)
 Generated code should always be reviewed.
 Claude cannot directly compile code but can assist with languages like Python.

C. Prompt Specifics
 Provide clear and structured prompts for better results.
 Use pseudo-code style prompts.
 Can log SQLSTATE errors with date and time.
 Claude can be asked to return specific outputs.

D. Prompt Techniques
2. Few-shot prompting: Provide example code as a template.
3. Chain-of-thought prompting:

 • Provide pseudo code


 • Ask Claude to explain approach
 • Confirm logic
 • Then generate final code
 Both techniques can be combined.

E. Fixed to Free Format


 Convert code between fixed and free formats.

F. Bug Detection & Code Review


 Claude can scan code for bugs.
 Can integrate with tools like Jira and Git using MCP.

Session 3

Git & Planning


 Claude can create Git branches.
 Can prepare implementation plans and attach them to Jira tasks.

Project Initialization
 Use 'claude' command to run Claude code.
 Run 'init' before starting a project:
 • Scans codebase
 • Creates summary
 • Writes summary to [Link]
 • This file is included in every request

UI Gen
 AI-powered React component generator.
 Uses Claude AI to generate components with Tailwind CSS.
 Provides real-time preview and editing.

Types of [Link] Files


4. Project level ([Link])

 • Generated via init


 • Committed to source control
 • Shared with team

5. Local level ([Link])

 • Not shared
 • Contains personal configurations
6. Global level (~/.claude/[Link])

 • Used across all projects on a machine

Commands & Shortcuts


 # → Save instructions into memory (project/local/global)
 @ + file path → Select file(s)
 Shift + Tab (twice) → Enable plan mode
 Think/Plan mode uses more tokens
 Stay → Commit changes to Git
 Esc + Esc → Rewind conversation
 Esc → Interrupt Claude response
 Compact → Summarize chat while preserving key info

Additional Commands

/clear
 Completely removes chat history.

Custom Commands
 Inside .claude directory, create a commands folder.
 Inside this folder, create files named after commands.
 Define what the command should do inside these files.
 Commands are executed from the Claude terminal.

Parameters in Commands
 Commands can accept parameters.
 Define parameters using $Arguments in .md file.

Example
 Write test cases using arguments:
 • Task 1
 • Task 2
 • Task 3

Command Format
 /command-name parameter

Coding Assistant & Tools with Claude Code


 Coding Assistant uses tools to gather context, plan tasks, and execute actions.
 Language models cannot directly read files.
 Coding assistant enhances prompts and uses tools to perform actions like
reading/writing files or making requests.
 Claude models (Opus, Sonnet, Haiku) are capable of completing complex tasks.

Tools with Claude Code


 Agent → Launch a sub-agent to handle a task
 Bash → Run shell commands
 Edit → Edit a file
 Glob → Find files using patterns
 Grep → Search file contents
 LS → List files and directories
 MultiEdit → Make multiple edits simultaneously
 NotebookEdit → Edit Jupyter notebook cells
 NotebookRead → Read notebook cells
 Read → Read a file
 TodoRead → Read to-do list items
 TodoWrite → Update to-do list
 WebFetch → Fetch data from a URL
 WebSearch → Search the web
 Write → Write to a file

You might also like