Claude Code operates directly in your terminal, understanding your project context and taking real actions. No need to manually add files to context - Claude will explore your codebase as needed.

Understand unfamiliar code

> what does the payment processing system do?
> find where user permissions are checked
> explain how the caching layer works

Automate Git operations

> commit my changes
> create a pr
> which commit added tests for markdown back in December?
> rebase on main and resolve any merge conflicts

Edit code intelligently

> add input validation to the signup form
> refactor the logger to use the new API
> fix the race condition in the worker queue

Test and debug your code

> run tests for the auth module and fix failures
> find and fix security vulnerabilities
> explain why this test is failing

Encourage deeper thinking

For complex problems, explicitly ask Claude to think more deeply:

> think about how we should architect the new payment service
> think hard about the edge cases in our authentication flow

Claude Code will show when Claude (3.7 Sonnet) is using extended thinking. You can proactively prompt Claude to “think” or “think deeply” for more planning-intensive tasks. We suggest that you first tell Claude about your task and let it gather context from your project. Then, ask it to “think” to create a plan.

Claude will think more based on the words you use. For example, “think hard” will trigger more extended thinking than saying “think” alone.

For more tips, see Extended thinking tips.

Automate CI and infra workflows

Claude Code comes with a non-interactive mode for headless execution. This is especially useful for running Claude Code in non-interactive contexts like scripts, pipelines, and Github Actions.

Use --print (-p) to run Claude in non-interactive mode. In this mode, you can set the ANTHROPIC_API_KEY environment variable to provide a custom API key.

Non-interactive mode is especially useful when you pre-configure the set of commands Claude is allowed to use:

export ANTHROPIC_API_KEY=sk_...
claude -p "update the README with the latest changes" --allowedTools "Bash(git diff:*)" "Bash(git log:*)" Write --disallowedTools ...

Was this page helpful?