Claude Code의 강력한 기능을 활용하여 개발 워크플로우에서 편집, 검색, 테스트, 자동화를 수행할 수 있습니다.
Claude Code는 터미널에서 직접 동작하며, 프로젝트 컨텍스트를 이해하고 실제 작업을 수행합니다. 별도로 파일을 컨텍스트에 추가할 필요 없이 Claude가 코드베이스를 자동으로 탐색합니다.
익숙하지 않은 코드 이해하기
> what does the payment processing system do?
> find where user permissions are checked
> explain how the caching layer works
Git 작업 자동화
> commit my changes
> create a pr
> which commit added tests for markdown back in December?
> rebase on main and resolve any merge conflicts
지능적으로 코드 편집하기
> add input validation to the signup form
> refactor the logger to use the new API
> fix the race condition in the worker queue
코드 테스트 및 디버깅
> run tests for the auth module and fix failures
> find and fix security vulnerabilities
> explain why this test is failing
더 깊은 사고 유도하기
복잡한 문제의 경우, Claude에게 더 깊이 생각하도록 명시적으로 요청하세요:
> think about how we should architect the new payment service
> think hard about the edge cases in our authentication flow
Claude Code는 모델이 확장된 사고(extended thinking)를 사용할 때 이를 표시합니다. 더 많은 계획이 필요한 작업에는 "think" 또는 "think deeply"와 같이 명령하여 Claude가 더 깊이 사고하도록 유도할 수 있습니다. 먼저 작업에 대해 설명하고 Claude가 프로젝트에서 컨텍스트를 수집하도록 한 뒤, "think" 명령으로 계획을 세우게 하세요.
Claude는 사용자가 입력한 단어에 따라 더 많이 사고합니다. 예를 들어, "think hard"는 단순히 "think"라고 입력하는 것보다 더 확장된 사고를 유발합니다.
더 많은 팁은 확장 사고 팁(Extended thinking tips)에서 확인할 수 있습니다.
CI 및 인프라 워크플로우 자동화
Claude Code는 비대화형(헤드리스) 실행을 위한 모드를 제공합니다. 이 모드는 스크립트, 파이프라인, Github Actions 등 비대화형 환경에서 Claude Code를 실행할 때 유용합니다.
--print
(-p
) 옵션을 사용하여 Claude를 비대화형 모드로 실행할 수 있습니다. 이 모드에서는 ANTHROPIC_API_KEY
환경 변수를 설정하여 커스텀 API 키를 제공할 수 있습니다.
비대화형 모드는 Claude가 사용할 수 있는 명령어 집합을 미리 구성할 때 특히 유용합니다:
export ANTHROPIC_API_KEY=sk_...
claude -p "update the README with the latest changes" --allowedTools "Bash(git diff:*)" "Bash(git log:*)" Write --disallowedTools ...