common-workflows.md +105 −102
28 </Step>28 </Step>
29 29
30 <Step title="Ask for a high-level overview">30 <Step title="Ask for a high-level overview">
3131 ``` ```text theme={null}
3232 > give me an overview of this codebase give me an overview of this codebase
33 ```33 ```
34 </Step>34 </Step>
35 35
36 <Step title="Dive deeper into specific components">36 <Step title="Dive deeper into specific components">
3737 ``` ```text theme={null}
3838 > explain the main architecture patterns used here explain the main architecture patterns used here
39 ```39 ```
40 40
4141 ``` ```text theme={null}
4242 > what are the key data models? what are the key data models?
43 ```43 ```
44 44
4545 ``` ```text theme={null}
4646 > how is authentication handled? how is authentication handled?
47 ```47 ```
48 </Step>48 </Step>
49</Steps>49</Steps>
62 62
63<Steps>63<Steps>
64 <Step title="Ask Claude to find relevant files">64 <Step title="Ask Claude to find relevant files">
6565 ``` ```text theme={null}
6666 > find the files that handle user authentication find the files that handle user authentication
67 ```67 ```
68 </Step>68 </Step>
69 69
70 <Step title="Get context on how components interact">70 <Step title="Get context on how components interact">
7171 ``` ```text theme={null}
7272 > how do these authentication files work together? how do these authentication files work together?
73 ```73 ```
74 </Step>74 </Step>
75 75
76 <Step title="Understand the execution flow">76 <Step title="Understand the execution flow">
7777 ``` ```text theme={null}
7878 > trace the login process from front-end to database trace the login process from front-end to database
79 ```79 ```
80 </Step>80 </Step>
81</Steps>81</Steps>
96 96
97<Steps>97<Steps>
98 <Step title="Share the error with Claude">98 <Step title="Share the error with Claude">
9999 ``` ```text theme={null}
100100 > I'm seeing an error when I run npm test I'm seeing an error when I run npm test
101 ```101 ```
102 </Step>102 </Step>
103 103
104 <Step title="Ask for fix recommendations">104 <Step title="Ask for fix recommendations">
105105 ``` ```text theme={null}
106106 > suggest a few ways to fix the @ts-ignore in user.ts suggest a few ways to fix the @ts-ignore in user.ts
107 ```107 ```
108 </Step>108 </Step>
109 109
110 <Step title="Apply the fix">110 <Step title="Apply the fix">
111111 ``` ```text theme={null}
112112 > update user.ts to add the null check you suggested update user.ts to add the null check you suggested
113 ```113 ```
114 </Step>114 </Step>
115</Steps>115</Steps>
130 130
131<Steps>131<Steps>
132 <Step title="Identify legacy code for refactoring">132 <Step title="Identify legacy code for refactoring">
133133 ``` ```text theme={null}
134134 > find deprecated API usage in our codebase find deprecated API usage in our codebase
135 ```135 ```
136 </Step>136 </Step>
137 137
138 <Step title="Get refactoring recommendations">138 <Step title="Get refactoring recommendations">
139139 ``` ```text theme={null}
140140 > suggest how to refactor utils.js to use modern JavaScript features suggest how to refactor utils.js to use modern JavaScript features
141 ```141 ```
142 </Step>142 </Step>
143 143
144 <Step title="Apply the changes safely">144 <Step title="Apply the changes safely">
145145 ``` ```text theme={null}
146146 > refactor utils.js to use ES2024 features while maintaining the same behavior refactor utils.js to use ES2024 features while maintaining the same behavior
147 ```147 ```
148 </Step>148 </Step>
149 149
150 <Step title="Verify the refactoring">150 <Step title="Verify the refactoring">
151151 ``` ```text theme={null}
152152 > run tests for the refactored code run tests for the refactored code
153 ```153 ```
154 </Step>154 </Step>
155</Steps>155</Steps>
170 170
171<Steps>171<Steps>
172 <Step title="View available subagents">172 <Step title="View available subagents">
173173 ``` ```text theme={null}
174174 > /agents /agents
175 ```175 ```
176 176
177 This shows all available subagents and lets you create new ones.177 This shows all available subagents and lets you create new ones.
180 <Step title="Use subagents automatically">180 <Step title="Use subagents automatically">
181 Claude Code automatically delegates appropriate tasks to specialized subagents:181 Claude Code automatically delegates appropriate tasks to specialized subagents:
182 182
183183 ``` ```text theme={null}
184184 > review my recent code changes for security issues review my recent code changes for security issues
185 ```185 ```
186 186
187187 ``` ```text theme={null}
188188 > run all tests and fix any failures run all tests and fix any failures
189 ```189 ```
190 </Step>190 </Step>
191 191
192 <Step title="Explicitly request specific subagents">192 <Step title="Explicitly request specific subagents">
193193 ``` ```text theme={null}
194194 > use the code-reviewer subagent to check the auth module use the code-reviewer subagent to check the auth module
195 ```195 ```
196 196
197197 ``` ```text theme={null}
198198 > have the debugger subagent investigate why users can't log in have the debugger subagent investigate why users can't log in
199 ```199 ```
200 </Step>200 </Step>
201 201
202 <Step title="Create custom subagents for your workflow">202 <Step title="Create custom subagents for your workflow">
203203 ``` ```text theme={null}
204204 > /agents /agents
205 ```205 ```
206 206
207 Then select "Create New subagent" and follow the prompts to define:207 Then select "Create New subagent" and follow the prompts to define:
264claude --permission-mode plan264claude --permission-mode plan
265```265```
266 266
267267``````text theme={null}
268268> I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
269```269```
270 270
271Claude analyzes the current implementation and create a comprehensive plan. Refine with follow-ups:271Claude analyzes the current implementation and create a comprehensive plan. Refine with follow-ups:
272 272
273```text theme={null}
274What about backward compatibility?
273```275```
274276> What about backward compatibility?
275277> How should we handle database migration?```text theme={null}
278How should we handle database migration?
276```279```
277 280
278<Tip>Press `Ctrl+G` to open the plan in your default text editor, where you can edit it directly before Claude proceeds.</Tip>281<Tip>Press `Ctrl+G` to open the plan in your default text editor, where you can edit it directly before Claude proceeds.</Tip>
298 301
299<Steps>302<Steps>
300 <Step title="Identify untested code">303 <Step title="Identify untested code">
301304 ``` ```text theme={null}
302305 > find functions in NotificationsService.swift that are not covered by tests find functions in NotificationsService.swift that are not covered by tests
303 ```306 ```
304 </Step>307 </Step>
305 308
306 <Step title="Generate test scaffolding">309 <Step title="Generate test scaffolding">
307310 ``` ```text theme={null}
308311 > add tests for the notification service add tests for the notification service
309 ```312 ```
310 </Step>313 </Step>
311 314
312 <Step title="Add meaningful test cases">315 <Step title="Add meaningful test cases">
313316 ``` ```text theme={null}
314317 > add test cases for edge conditions in the notification service add test cases for edge conditions in the notification service
315 ```318 ```
316 </Step>319 </Step>
317 320
318 <Step title="Run and verify tests">321 <Step title="Run and verify tests">
319322 ``` ```text theme={null}
320323 > run the new tests and fix any failures run the new tests and fix any failures
321 ```324 ```
322 </Step>325 </Step>
323</Steps>326</Steps>
334 337
335<Steps>338<Steps>
336 <Step title="Summarize your changes">339 <Step title="Summarize your changes">
337340 ``` ```text theme={null}
338341 > summarize the changes I've made to the authentication module summarize the changes I've made to the authentication module
339 ```342 ```
340 </Step>343 </Step>
341 344
342 <Step title="Generate a pull request">345 <Step title="Generate a pull request">
343346 ``` ```text theme={null}
344347 > create a pr create a pr
345 ```348 ```
346 </Step>349 </Step>
347 350
348 <Step title="Review and refine">351 <Step title="Review and refine">
349352 ``` ```text theme={null}
350353 > enhance the PR description with more context about the security improvements enhance the PR description with more context about the security improvements
351 ```354 ```
352 </Step>355 </Step>
353</Steps>356</Steps>
364 367
365<Steps>368<Steps>
366 <Step title="Identify undocumented code">369 <Step title="Identify undocumented code">
367370 ``` ```text theme={null}
368371 > find functions without proper JSDoc comments in the auth module find functions without proper JSDoc comments in the auth module
369 ```372 ```
370 </Step>373 </Step>
371 374
372 <Step title="Generate documentation">375 <Step title="Generate documentation">
373376 ``` ```text theme={null}
374377 > add JSDoc comments to the undocumented functions in auth.js add JSDoc comments to the undocumented functions in auth.js
375 ```378 ```
376 </Step>379 </Step>
377 380
378 <Step title="Review and enhance">381 <Step title="Review and enhance">
379382 ``` ```text theme={null}
380383 > improve the generated documentation with more context and examples improve the generated documentation with more context and examples
381 ```384 ```
382 </Step>385 </Step>
383 386
384 <Step title="Verify documentation">387 <Step title="Verify documentation">
385388 ``` ```text theme={null}
386389 > check if the documentation follows our project standards check if the documentation follows our project standards
387 ```390 ```
388 </Step>391 </Step>
389</Steps>392</Steps>
412 </Step>415 </Step>
413 416
414 <Step title="Ask Claude to analyze the image">417 <Step title="Ask Claude to analyze the image">
415418 ``` ```text theme={null}
416419 > What does this image show? What does this image show?
417 ```420 ```
418 421
419422 ``` ```text theme={null}
420423 > Describe the UI elements in this screenshot Describe the UI elements in this screenshot
421 ```424 ```
422 425
423426 ``` ```text theme={null}
424427 > Are there any problematic elements in this diagram? Are there any problematic elements in this diagram?
425 ```428 ```
426 </Step>429 </Step>
427 430
428 <Step title="Use images for context">431 <Step title="Use images for context">
429432 ``` ```text theme={null}
430433 > Here's a screenshot of the error. What's causing it? Here's a screenshot of the error. What's causing it?
431 ```434 ```
432 435
433436 ``` ```text theme={null}
434437 > This is our current database schema. How should we modify it for the new feature? This is our current database schema. How should we modify it for the new feature?
435 ```438 ```
436 </Step>439 </Step>
437 440
438 <Step title="Get code suggestions from visual content">441 <Step title="Get code suggestions from visual content">
439442 ``` ```text theme={null}
440443 > Generate CSS to match this design mockup Generate CSS to match this design mockup
441 ```444 ```
442 445
443446 ``` ```text theme={null}
444447 > What HTML structure would recreate this component? What HTML structure would recreate this component?
445 ```448 ```
446 </Step>449 </Step>
447</Steps>450</Steps>
464 467
465<Steps>468<Steps>
466 <Step title="Reference a single file">469 <Step title="Reference a single file">
467470 ``` ```text theme={null}
468471 > Explain the logic in @src/utils/auth.js Explain the logic in @src/utils/auth.js
469 ```472 ```
470 473
471 This includes the full content of the file in the conversation.474 This includes the full content of the file in the conversation.
472 </Step>475 </Step>
473 476
474 <Step title="Reference a directory">477 <Step title="Reference a directory">
475478 ``` ```text theme={null}
476479 > What's the structure of @src/components? What's the structure of @src/components?
477 ```480 ```
478 481
479 This provides a directory listing with file information.482 This provides a directory listing with file information.
480 </Step>483 </Step>
481 484
482 <Step title="Reference MCP resources">485 <Step title="Reference MCP resources">
483486 ``` ```text theme={null}
484487 > Show me the data from @github:repos/owner/repo/issues Show me the data from @github:repos/owner/repo/issues
485 ```488 ```
486 489
487 This fetches data from connected MCP servers using the format @server:resource. See [MCP resources](/en/mcp#use-mcp-resources) for details.490 This fetches data from connected MCP servers using the format @server:resource. See [MCP resources](/en/mcp#use-mcp-resources) for details.
561 <Step title="Name the current session">564 <Step title="Name the current session">
562 Use `/rename` during a session to give it a memorable name:565 Use `/rename` during a session to give it a memorable name:
563 566
564567 ``` ```text theme={null}
565568 > /rename auth-refactor /rename auth-refactor
566 ```569 ```
567 570
568 You can also rename any session from the picker: run `/resume`, navigate to a session, and press `R`.571 You can also rename any session from the picker: run `/resume`, navigate to a session, and press `R`.
577 580
578 Or from inside an active session:581 Or from inside an active session:
579 582
580583 ``` ```text theme={null}
581584 > /resume auth-refactor /resume auth-refactor
582 ```585 ```
583 </Step>586 </Step>
584</Steps>587</Steps>
859 862
860### Example questions863### Example questions
861 864
862865``````text theme={null}
863866> can Claude Code create pull requests?can Claude Code create pull requests?
864```867```
865 868
866869``````text theme={null}
867870> how does Claude Code handle permissions?how does Claude Code handle permissions?
868```871```
869 872
870873``````text theme={null}
871874> what skills are available?what skills are available?
872```875```
873 876
874877``````text theme={null}
875878> how do I use MCP with Claude Code?how do I use MCP with Claude Code?
876```879```
877 880
878881``````text theme={null}
879882> how do I configure Claude Code for Amazon Bedrock?how do I configure Claude Code for Amazon Bedrock?
880```883```
881 884
882885``````text theme={null}
883886> what are the limitations of Claude Code?what are the limitations of Claude Code?
884```887```
885 888
886<Note>889<Note>