This guide to getting better results from Claude Code is for developers starting with Claude Code and for those who use it every day. The ten tips below, first published in April 2026, come from a Hacker News thread. Added sections show how to do the same things in the current Claude Code, quoting Anthropic's pages and Git's documentation, read November 18, 2026. Anthropic's overview page calls it "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools". The Claude Help Center says "Claude Code ships frequently." The Gnar Company is a Claude Select Services Partner in Anthropic’s Claude Partner Network.
How to Use Claude Code: Install It, Open a Project and Start a Session#
To use Claude Code, install it with the command for your operating system, open a terminal in your project folder, type claude and sign in. Claude Code then opens an interactive session where you ask Claude about your code, and it reads files, edits them and runs commands. Whether it asks you first depends on the permission mode. Anthropic's quickstart and setup page, read November 18, 2026, each cover the steps. The Gnar Company's AI training page says one client, GSC Enterprises, "already had Claude Code but no shared way to use it" before Gnar ran an Immerse training cohort for its five engineers. The GSC case study says "The cohort worked in Claude Code from the terminal and VS Code, with Claude Desktop alongside".
| Step | What Anthropic's docs say |
|---|---|
| Install | Run the install command for your system, then check it with claude --version. |
| Open | In your project folder, type claude. |
| Sign in | Log in on first use with a Claude Pro, Max, Ultra, Team or Enterprise account, a Claude Console account or a supported cloud provider. |
| IDE | Install the Claude Code extension in VS Code, or the plugin for JetBrains IDEs. |
| Extend | Connect MCP servers, and add custom slash commands as skills. |
| Approve | Answer any permission prompts. Press Shift+Tab to change the permission mode. |
How do you install Claude Code?#
On macOS, Linux and WSL, run curl -fsSL https://claude.ai/install.sh | bash. In Windows PowerShell, run irm https://claude.ai/install.ps1 | iex. The quickstart says: "To install Claude Code, open a terminal and run the command for your system." The same page also lists brew install --cask claude-code for Homebrew and winget install Anthropic.ClaudeCode for WinGet.
The setup page lists these operating system versions: macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+ and Alpine Linux 3.19+. To confirm the install, run claude --version. The quickstart says "A working installation prints a version number."
How do you open Claude Code in a project folder?#
Open a terminal in your project folder and type claude. The setup page says to "open a terminal in the project you want to work in and start Claude Code", and then "Claude Code opens an interactive session in your terminal." From there, ask Claude a question about the code, such as "what does this project do?"
What should you ask Claude Code first?#
Ask Claude a plain question about your project, then a small change. After "what does this project do?", the quickstart says "Claude will analyze your files and provide a summary." It adds: "Claude Code reads your project files as needed. You don't have to manually add context."
| What you want | A prompt the quickstart gives |
|---|---|
| Understand a project | "what technologies does this project use?" |
| Find your way around | "explain the folder structure" |
| Make a first change | "add a hello world function to the main file" |
| Use Git | "what files have I changed?" |
| Add to an existing form | "add input validation to the user registration form" |
| Write tests | "write unit tests for the calculator functions" |
For the first change, the quickstart says "Claude Code finds the appropriate file and shows you the change." Its tip is to "Talk to Claude like you would a helpful colleague."
Which Claude Code commands do you use every day?#
You start, continue and resume sessions with the claude command, and run slash commands inside a session. The quickstart calls these "the most important commands for daily use, grouped by where you run them."
| Command | What the quickstart says it does |
|---|---|
claude | "Start interactive mode" |
claude "task" | "Start interactive mode with an initial prompt" |
claude -p "query" | "Run one-off query, then exit" |
claude -c | "Continue most recent conversation in current directory" |
claude -r | "Resume a previous conversation" |
/help | "Show available commands" |
/exit or Ctrl+D twice | "Exit Claude Code" |
Its beginner tips say to "Type / to see the commands and skills available to you" and to "Press Shift+Tab to cycle permission modes". On being specific, it contrasts "fix the bug" with "fix the login bug where users see a blank screen after entering wrong credentials", which matches tip 1 in this post.
How do you sign in to Claude Code?#
You sign in the first time you start it. The quickstart says "Claude Code prompts you to log in on first use." It lists "Claude Pro, Max, Ultra, Team, or Enterprise" and "Claude Console (API access with pre-paid credits)" as account types. If you pay for a Pro, Max or Ultra plan, the Claude Help Center says to "log in with the same credentials you use for Claude."
One catch applies if the ANTHROPIC_API_KEY variable is set. The same Help Center article says: "If you have an ANTHROPIC_API_KEY environment variable set on your system, Claude Code will use this API key for authentication instead of your Claude subscription (Pro, Max, Ultra, Team, or Enterprise plans), resulting in API usage charges rather than using your subscription's included usage." The quickstart says Claude Code asks first: "If you've set the ANTHROPIC_API_KEY environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt."
Can you use Claude Code in VS Code?#
Yes. The VS Code page describes how to "Install and configure the Claude Code extension for VS Code." It says "The VS Code extension provides a native graphical interface for Claude Code, integrated directly into your IDE." On accounts, it says "any paid Claude subscription (Pro, Max, Ultra, Team, or Enterprise) or a Claude Console account works, and no API key is required." VS Code is short for Visual Studio Code. The overview page also lists "A plugin for IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs with interactive diff viewing and selection context sharing."
What are MCP servers and custom slash commands in Claude Code?#
MCP servers connect Claude Code to your tools and data, and custom slash commands are now written as skills. MCP stands for the Model Context Protocol. The MCP page calls it "an open source standard for AI-tool integrations" and says "MCP servers give Claude Code access to your tools, databases, and APIs." It documents claude mcp add --transport http <name> <url> for adding a remote server.
Custom slash commands now live inside skills. The skills page says "Custom commands have been merged into skills. Your existing .claude/commands/ files keep working." It also says "Create a SKILL.md file with instructions, and Claude adds it to its toolkit." Gnar's GSC case study says "MCP connectors for Snowflake, Atlassian, Microsoft 365, and GitHub brought GSC's real systems into the loop."
What does the Claude Code permission system ask on first use?#
On Claude Code v2.1.283 or later, a new interactive terminal or VS Code session starts in auto mode when auto mode is available, and there a second model reviews actions instead of asking you. The permission modes page says "With Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions." In auto mode, it says, "a second model, the classifier, reviews actions instead of you". When auto mode isn't available to the session, the same page says "Claude Code starts the session in Manual instead." The permissions page says "Claude Code uses a tiered permission system to balance power and safety." In Manual mode, the permission modes page says "Claude Code stops and asks you before most actions that edit files, run shell commands, or reach the network." The same page says "acceptEdits mode lets Claude create and edit files in your working directory without prompting."
The quickstart tells you what to do at the prompt: "If it asks before making the change, select Yes to approve." Anthropic's page on how Claude Code works describes the agentic loop this way: "When you give Claude a task, it works through three phases: gather context, take action, and verify results." It says "With tools, Claude can act: read your code, edit files, run commands, search the web, and interact with external services."
1. Break Tasks Into Small, Focused Subtasks#
The single most common piece of advice in the thread: stop giving Claude large, open-ended instructions. Instead, frontload your planning work and scope each task to something that can be bounded by a single commit.
Think of it like writing good tickets. "Refactor the auth system" is a bad task. "Extract the token refresh logic into a standalone function with these inputs and outputs" is a good one. The narrower the scope, the higher the quality.
2. Use Plan Mode With Multiple Rounds#
Before letting Claude write a single line of code, run through several back-and-forth rounds in plan mode. Ask it to outline its approach, poke holes in the plan, and iterate until you're confident in the direction.
This catches architectural mistakes early, when they're cheap to fix, instead of after Claude has written 200 lines down the wrong path.
How do you use Claude Code plan mode today?#
Press Shift+Tab until plan mode shows, or start one prompt with /plan, to enter plan mode in Claude Code. Anthropic's permission modes page says "Plan mode tells Claude to research and propose changes without making them." Tip 2 says to "run through several back-and-forth rounds in plan mode".
| What you want | What Anthropic's permission modes page says |
|---|---|
| Enter plan mode | "Enter plan mode by pressing Shift+Tab or prefixing a single prompt with /plan." |
| Start a session in it | "You can also start in plan mode from the CLI": claude --permission-mode plan |
| Plan another round | "No, keep planning: stay in plan mode and tell Claude what to change." |
| Edit the plan yourself | "Press Ctrl+G to open the proposed plan in your default text editor and edit it directly before Claude proceeds." |
The page also says "Except in interactive terminal sessions with bypass permissions available, edits stay blocked until you approve the plan." The permissions page warns "In bypassPermissions mode, Claude Code skips permission prompts, including for writes to protected paths such as .git and .claude."
The Claude Help Center's power user tips page has the heading "Start complex tasks in plan mode". It gives this flow: "enter plan mode → refine the plan → switch to auto-accept edits → Claude executes." It adds: "Have one Claude write a plan, then spin up a second Claude to review it as a staff engineer." Auto-accept edits and auto mode are separate modes. On auto mode, the Claude Code guide says "Claude works without stopping for routine approvals".
3. Watch for "The Simplest Fix Is…"#
This phrase (and its cousins like "let's just do this instead" or "I've been burning too many tokens") is a red flag. When Claude reaches for a shortcut, it's usually about to suggest a hack that papers over the real problem.
When you see it, intervene immediately. Push back and ask for the correct, thorough solution. Don't accept the easy out.
4. Don't Let It Self-Verify: Use Separate Review Passes#
Claude can't reliably check its own work. If you ask it to review code it just wrote, it'll almost always tell you it looks great.
A better approach: use a second model, a separate review agent, or simply a fresh context window to evaluate the output. The separation between "writer" and "reviewer" matters as much here as it does on a human team.
Which Claude Code tools give you a separate Claude review?#
Claude Code has a /code-review command, a read-only subagent and a second session that can each review work they did not write. Tip 4 asks for a reviewer apart from the writer because the separation between "writer" and "reviewer" matters as much here as it does on a human team.
| Option | What Anthropic's pages say |
|---|---|
| /code-review | "/code-review reviews the diff in a fresh subagent that never saw your conversation." The /code-review page adds "/review is an alias of /code-review." |
| A read-only subagent | "Give a custom subagent in .claude/agents/ only tools: Read, Grep, Glob. Now it's a reviewer that can't edit anything" |
| A second session | "A second session is also the easiest independent reviewer you can get." It adds: "Same idea as /code-review, with you carrying the messages." |
| @claude review on GitHub | "someone with write access to the repository can comment @claude review on a pull request to start a review". Code Review is the GitHub pull request service, and its page lists its plans as "Team and Enterprise". The /code-review command runs in your own session. |
The Code Review page says "A review never approves or blocks the pull request, so the decision to merge stays with your team." The /code-review page says "The command works on any plan." The Code Review page says "Code Review chooses the Claude models that reviews run on".
The subagents page says "Create and use specialized AI subagents in Claude Code for task-specific workflows and improved context management." It lists "The task produces verbose output you don't need in your main context" as a reason to use one. Its example prompt is "Use a subagent to run the test suite and report only the failing tests with their error messages".
The Claude Code guide adds a caution: "A reviewer that's asked to find problems will always find something." It also says to "ask Claude for evidence: the command it ran and its output, or the screenshot".
The Gnar Company's GSC Enterprises case study says "GSC runs an independent code review agent against every pull request." It adds "Better up-front specification and tighter context discipline raised the quality of generated code before it reached review."
5. Set Effort to Max#
Running /effort max at the start of a session enables deeper reasoning. Several commenters reported that this single change resolved quality issues they'd been experiencing.
Some also recommended disabling adaptive thinking (CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1) to force fixed reasoning budgets instead of letting the model decide how hard to think. Worth experimenting with, though results vary.
How do you set the effort level in Claude Code today?#
Run /effort followed by a level name, such as /effort max, to set the effort level. Anthropic's model configuration page, read November 18, 2026, says "max is the deepest reasoning level. Unless you set it through the CLAUDE_CODE_EFFORT_LEVEL environment variable, Claude Code applies max to the current session only." The same page warns that max "may show diminishing returns and is prone to overthinking, so test before adopting it broadly".
| Where | What Anthropic's docs say |
|---|---|
| /effort | "run /effort with no arguments to open an interactive slider, /effort followed by a level name to set it directly, or /effort auto to clear your saved level for the active model" |
| CLAUDE_ | Max applies to "the current session only" "Unless you set it through the CLAUDE_CODE_EFFORT_LEVEL environment variable". |
| Settings files (modelSettings, effortLevel) | "max isn't accepted as a level in either key" |
Tip 5 also mentions disabling adaptive thinking. Anthropic's environment variables page, read November 18, 2026, says "Set to 1 to disable adaptive reasoning on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by MAX_THINKING_TOKENS. Has no effect on Fable models, Sonnet 5 and later, Haiku 5.5, or Opus 4.7 and later, which always use adaptive reasoning". The tip itself says "Worth experimenting with, though results vary."
6. Throw Away Context When It Gets Stuck#
If Claude keeps reverting to a bad approach even after you've corrected it multiple times, don't keep arguing. The context is poisoned. Start a fresh session, restate the problem cleanly, and try again.
This is counterintuitive (it feels like you're losing progress) but experienced users consistently reported that a clean context produces better results than a long, contentious one.
Which commands start over or roll back Claude Code sessions?#
The /clear command starts a new conversation with empty context. The /compact command summarizes the conversation, and /rewind rolls the conversation or code back to an earlier point. Tip 6 says "Start a fresh session, restate the problem cleanly, and try again." Anthropic's Claude Code guide says "after two failed corrections run /clear and write a better prompt instead of a third".
| Command | What the commands reference says |
|---|---|
| /clear | "Start a new conversation with empty context." The page lists "Aliases: /reset, /new" |
| /compact | "Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary." |
| /rewind | "Rewind the conversation and/or code to a previous point, or summarize from a selected message." |
| /btw | "Use /btw for a side question that shouldn't add to the conversation history." |
The Claude Code guide gives this example of a focus: "/compact keep the API changes and the test commands". The context window page gives another: "/compact focus on the auth bug fix".
The context window page says "Claude Code compacts automatically as you approach the limit, so a full context window doesn't end your session." The How Claude Code works page says "Since sessions are tied to directories, you can run parallel Claude sessions by using git worktrees".
The checkpointing page says "Run /rewind, or press Esc twice when the prompt input is empty, to open the rewind menu." It also names a limit: "A file that only Bash commands changed isn't tracked and stays as it is. To revert it, use version control, such as Git." Anthropic's costs page adds: "If Claude starts heading the wrong direction, press Escape to stop immediately."
7. Be Super Explicit in CLAUDE.md#
Your project's CLAUDE.md file is where you set guardrails. The developers getting the best results are writing detailed, opinionated instructions in these files: things like "Do not suggest quick hacks or incomplete solutions" and "Always produce a full implementation plan before writing code."
Yes, these files are getting long. That's fine. Think of CLAUDE.md as your team's coding standards document, except the new hire actually reads it every time.
Where does CLAUDE.md go in a project?#
A project's file goes at ./CLAUDE.md or ./.claude/CLAUDE.md. Anthropic's memory page says "CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session." Tip 7 says "Your project's CLAUDE.md file is where you set guardrails." On length, the memory page says to "target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence."
| File | What Anthropic's memory page says it is for |
|---|---|
| ~/ | "Personal preferences for all projects" |
| ./ | "Team-shared instructions for the project" |
| ./ | "Personal project-specific preferences; add to .gitignore" |
The commands reference describes /init as "Initialize project with a CLAUDE.md guide." It describes /memory as a way to "Edit CLAUDE.md files, enable or disable auto memory, and view auto memory entries".
When a long session compacts, the context window page lists "Project-root CLAUDE.md and unscoped rules" as "Re-injected from disk". It lists "System prompt and output style" with the note "Both still apply".
8. Turn Off the Extended Context Window for Complex Coding#
One surprising finding: disabling the 1M extended context window brought code quality back to roughly previous levels for some users. The theory is that the extended context introduces noise that degrades the model's focus on the code that actually matters.
If you're seeing quality dips on complex tasks, this is worth testing as a variable.
How do you turn off the 1M context window today?#
Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 in your shell or in a settings file. Anthropic's model configuration page, read November 18, 2026, says "To keep sessions at a 200K window, set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 in your shell or in a settings file."
9. Do Architecture and Code Reviews Yourself#
Treat Claude like a fast but junior engineer. That means you still own architecture decisions, you still review the code, and you still catch corner cases.
The developers who reported the best outcomes were the ones who enforced work-plan design upfront, called out edge cases proactively, resolved ambiguity before Claude had to guess, and demanded written specs. The tool is at its best when the human stays in the loop on design.
How do you get a written spec from Claude Code before it builds?#
Ask Claude Code to interview you, then have it write the spec to a file. Anthropic's Claude Code guide gives this prompt: "Interview me until you could write the spec, then write it to SPEC.md." Tip 9 says the best outcomes came from developers who "demanded written specs".
The page then says "Once SPEC.md exists, start a fresh session to build from it, so the build begins with a clean context and a written definition of done." To hand Claude the file, it says "A file: type @ and the path to include the file contents in your message."
10. Use Pre-Commit Hooks as Constraints#
Since Claude can't reliably self-correct, automated checks before code is committed act as a safety net. Linting, type checking, test runs: anything you can enforce mechanically, you should.
Pre-commit hooks turn your quality standards into hard constraints rather than suggestions. Claude will often fix issues surfaced by these hooks on the next pass, which is far more reliable than asking it to "make sure the code is correct."
How do Git pre-commit hooks and Claude Code hooks differ?#
A Git pre-commit hook runs when you make a commit. A Claude Code hook runs at points in Claude's own loop, such as when Claude tries to stop. Tip 10 says "Pre-commit hooks turn your quality standards into hard constraints rather than suggestions." Anthropic's hooks guide says "Use hooks to enforce project rules, automate repetitive tasks, and integrate Claude Code with your existing tools."
| Question | Git pre-commit hook, from Git's githooks page | Claude Code hook, from Anthropic's pages |
|---|---|---|
| When it runs | "is invoked before obtaining the proposed commit log message and making a commit" | "before or after a tool call, when Claude tries to stop, when a session starts, and so on" (Claude Code guide) |
| How it blocks | "Exiting with a non-zero status from this script causes the git commit command to abort before creating a commit." | A PreToolUse hook runs "Before a tool call executes. Can block it" (hooks guide). For a Stop hook, "Exit code 2 is what blocks the stop." (Claude Code guide) |
| Where it lives | "By default the hooks directory is $GIT_DIR/hooks" | The hooks guide lists .claude/ |
The githooks page says the pre-commit hook "can be bypassed with the --no-verify option".
The hooks guide shows a PreToolUse hook on Bash that "runs a script that exits 2 to deny when the command contains rm -rf". The permissions page says "Permissions control which tools Claude Code can use and which files or domains it can access." The Claude Code guide says ".claude/settings.json and the hooks in it belong to the repo. Once you commit them, they apply to everyone who works in the repo. Its deny rules apply right away." It adds that its allow rules wait "until each person accepts the trust dialog for that folder, and workspace trust also decides when its hooks start running on their machine."
The memory page says "If the instruction is something that must run at a specific point, such as before every commit or after each file edit, write it as a hook instead." The hooks guide's file protection example says "The script checks the target file path against a list of protected patterns and exits with code 2 to block the edit."
The Claude Code guide has a section titled "Give Claude a check to run". It says "Claude stops when the work looks done." It also lists a question to ask before leaving a task running on its own: "Can it check its own work? The test suite, a Stop hook, some kind of review step." It says "The Stop hook version of the typecheck rule is a few lines in .claude/settings.json. Exit code 2 is what blocks the stop."
{
"hooks": {
"Stop": [
{
"hooks": [
{ "type": "command", "command": "pnpm tsc --noEmit 1>&2 || exit 2" }
]
}
]
}
}This example runs the TypeScript compiler through pnpm, so a project without them changes the command. The page also says "If the hook blocks eight stops in a row with no tool call between them, Claude Code overrides the next block and ends the turn."
The meta-lesson from the thread is simple: Claude Code is a powerful tool, but it's not autonomous. The developers getting the most out of it are the ones who treat it as a collaborator that needs clear direction, firm boundaries, and regular oversight, not a magic box you throw problems into.
The better your process, the better Claude's output. That's not a limitation. It's just how tools work.


