claude-code
Claude code basics
CLI options
claude -p <prompt>: runs a one-off promptclaude --model=<model>: runs claude with a specific model. Here are the different values you can pass for the--modelparameter:sonnetopushaiku
claude --continue: continue off from the last sessionclaude --resume: resume a specific session.
Keyboard shortcuts

Switching modes
- auto accept mode: TO enter auto accept mode for edits, press
shift + tabkeyboard shortcut - plan mode: TO enter plan mode, press
shift + tabtwice
Output
- tasks: to view the tasks and todos claude has set, press the
ctrl + tshortcut - verbose output: to set verbose output for claude, press the
ctrl + oshortcut
Slash options
When inside a conversation with claude code, you have access to these special slash commands:
/model <model>: change the model mid convo to one ofhaiku,sonnet, oropus/compact: compacts previous conversation history into a summary. Useful when you've now moved on to a different task./clear: clears the conversation history/init: reads the current codebase and based off that, creates aCLAUDE.mdfile/context: visualize the current context and how much of it is taken up./status: shows current token and session info/review: performs a code review/security-review: performs a code review that searches for security flaws./install-github-app: allows you to add claude as a collaborator to a github repoi so you can assign it issues and to pull requests/insights: shows you how well you used claude code in a session
Chat techniques
Managing context
Hit the esc key twice to stop a response while Claude is generating. Then you can start a user query by prefixing with a # to start a memory which claude code will remember during the conversation.
Also use these slash commands to manage memory:
/clear: clears the conversation history/compact: compacts previous conversation history into a summary. Useful when you've now moved on to a different task.
Forcing thinking
To force thinking, you can use these keywords in your prompt:
- "think": reasoning up to 4000 tokens
- "think harder": reasoning up to 10000 tokens