SpyBara
Go Premium Account
2026
7 Jan 2026, 18:02
12 May 2026, 16:02 12 May 2026, 14:59 12 May 2026, 01:59 12 May 2026, 00:01 11 May 2026, 23:00 11 May 2026, 21:57 11 May 2026, 20:02 11 May 2026, 18:59 11 May 2026, 18:00 11 May 2026, 15:00 10 May 2026, 23:03 10 May 2026, 17:00 10 May 2026, 04:02 9 May 2026, 04:57 9 May 2026, 04:01 9 May 2026, 03:01 8 May 2026, 22:00 8 May 2026, 19:00 8 May 2026, 18:00 8 May 2026, 16:57 8 May 2026, 07:02 8 May 2026, 06:02 8 May 2026, 03:01 8 May 2026, 02:03 8 May 2026, 01:02 8 May 2026, 00:02 7 May 2026, 22:59 7 May 2026, 21:57 7 May 2026, 17:08 5 May 2026, 23:00 5 May 2026, 21:00 5 May 2026, 17:00 5 May 2026, 15:59 5 May 2026, 14:57 5 May 2026, 00:02 4 May 2026, 22:58 4 May 2026, 22:01 4 May 2026, 18:58 4 May 2026, 15:35 4 May 2026, 06:55 4 May 2026, 04:18 2 May 2026, 18:14 2 May 2026, 04:05 2 May 2026, 00:19 1 May 2026, 18:19 1 May 2026, 04:22 1 May 2026, 00:20 29 Apr 2026, 21:21 29 Apr 2026, 15:36 29 Apr 2026, 09:39 29 Apr 2026, 04:11 29 Apr 2026, 00:20 28 Apr 2026, 21:21 28 Apr 2026, 18:28 28 Apr 2026, 15:45 28 Apr 2026, 06:49 27 Apr 2026, 21:20 27 Apr 2026, 18:23 26 Apr 2026, 04:08 25 Apr 2026, 21:10 24 Apr 2026, 18:11 24 Apr 2026, 06:34 24 Apr 2026, 00:17 23 Apr 2026, 18:19 23 Apr 2026, 04:04 23 Apr 2026, 00:17 22 Apr 2026, 21:15 22 Apr 2026, 04:00 22 Apr 2026, 00:13 21 Apr 2026, 21:14 21 Apr 2026, 09:30 21 Apr 2026, 04:01 20 Apr 2026, 21:14 20 Apr 2026, 18:16 18 Apr 2026, 18:09 18 Apr 2026, 00:13 17 Apr 2026, 21:13 17 Apr 2026, 18:14 17 Apr 2026, 00:15 16 Apr 2026, 21:13 16 Apr 2026, 18:21 16 Apr 2026, 15:30 16 Apr 2026, 04:02 16 Apr 2026, 00:16 15 Apr 2026, 18:20 15 Apr 2026, 15:24 15 Apr 2026, 09:29 15 Apr 2026, 04:00 14 Apr 2026, 21:14 14 Apr 2026, 18:21 14 Apr 2026, 06:32 14 Apr 2026, 04:00 14 Apr 2026, 00:16 13 Apr 2026, 21:14 13 Apr 2026, 18:21 11 Apr 2026, 00:11 10 Apr 2026, 21:09 10 Apr 2026, 18:13 10 Apr 2026, 06:32 10 Apr 2026, 00:12 9 Apr 2026, 21:14 9 Apr 2026, 18:17 9 Apr 2026, 15:29 9 Apr 2026, 03:55 9 Apr 2026, 00:09 8 Apr 2026, 21:13 8 Apr 2026, 18:21 8 Apr 2026, 15:27 8 Apr 2026, 00:12 7 Apr 2026, 21:14 4 Apr 2026, 18:05 4 Apr 2026, 03:46 4 Apr 2026, 00:09 3 Apr 2026, 21:07 3 Apr 2026, 18:08 3 Apr 2026, 03:54 3 Apr 2026, 00:11 2 Apr 2026, 21:08 2 Apr 2026, 18:12 2 Apr 2026, 09:19 2 Apr 2026, 06:21 2 Apr 2026, 03:53 1 Apr 2026, 21:12 1 Apr 2026, 18:13 1 Apr 2026, 04:00 1 Apr 2026, 00:11 31 Mar 2026, 21:09 31 Mar 2026, 06:24 31 Mar 2026, 03:56 31 Mar 2026, 00:11 30 Mar 2026, 21:13 30 Mar 2026, 18:15 28 Mar 2026, 18:04 28 Mar 2026, 15:06 27 Mar 2026, 21:09 27 Mar 2026, 18:14 27 Mar 2026, 15:15 27 Mar 2026, 06:21 27 Mar 2026, 03:56 27 Mar 2026, 00:10 26 Mar 2026, 21:07 26 Mar 2026, 18:16 26 Mar 2026, 15:25 26 Mar 2026, 06:21 26 Mar 2026, 03:55 26 Mar 2026, 00:10 25 Mar 2026, 21:08 25 Mar 2026, 18:15 25 Mar 2026, 06:18 25 Mar 2026, 03:47 25 Mar 2026, 00:08 24 Mar 2026, 18:15 24 Mar 2026, 00:07 23 Mar 2026, 21:08 23 Mar 2026, 18:13 23 Mar 2026, 00:09 22 Mar 2026, 18:04 22 Mar 2026, 00:07 21 Mar 2026, 18:03 21 Mar 2026, 00:07 20 Mar 2026, 21:05 20 Mar 2026, 18:08 20 Mar 2026, 15:13 20 Mar 2026, 03:45 20 Mar 2026, 00:08 19 Mar 2026, 06:17 19 Mar 2026, 00:08 18 Mar 2026, 18:16 18 Mar 2026, 12:11 18 Mar 2026, 09:15 18 Mar 2026, 03:50 18 Mar 2026, 00:09 17 Mar 2026, 21:10 17 Mar 2026, 18:15 17 Mar 2026, 03:46 17 Mar 2026, 00:08 16 Mar 2026, 21:10 16 Mar 2026, 18:15 14 Mar 2026, 03:44 14 Mar 2026, 00:08 13 Mar 2026, 21:07 13 Mar 2026, 18:07 13 Mar 2026, 06:12 12 Mar 2026, 21:07 12 Mar 2026, 18:12 12 Mar 2026, 00:07 11 Mar 2026, 03:43 11 Mar 2026, 00:05 10 Mar 2026, 03:43 10 Mar 2026, 00:05 9 Mar 2026, 21:06 7 Mar 2026, 03:37 7 Mar 2026, 00:07 6 Mar 2026, 06:10 6 Mar 2026, 03:44 6 Mar 2026, 00:12 5 Mar 2026, 06:12 5 Mar 2026, 03:45 5 Mar 2026, 00:07 4 Mar 2026, 21:06 4 Mar 2026, 18:09 4 Mar 2026, 09:09 1 Mar 2026, 06:10 1 Mar 2026, 03:49 28 Feb 2026, 21:01 28 Feb 2026, 00:05 27 Feb 2026, 21:05 27 Feb 2026, 18:07 27 Feb 2026, 09:11 27 Feb 2026, 06:13 27 Feb 2026, 00:08 26 Feb 2026, 21:08 26 Feb 2026, 18:12 26 Feb 2026, 09:14 26 Feb 2026, 06:17 26 Feb 2026, 00:07 25 Feb 2026, 03:47 25 Feb 2026, 00:09 24 Feb 2026, 21:08 24 Feb 2026, 18:15 23 Feb 2026, 21:13 21 Feb 2026, 18:03 21 Feb 2026, 06:08 20 Feb 2026, 21:03 20 Feb 2026, 06:14 20 Feb 2026, 00:07 19 Feb 2026, 21:06 19 Feb 2026, 03:48 19 Feb 2026, 00:08 18 Feb 2026, 03:48 17 Feb 2026, 21:08 17 Feb 2026, 00:08 16 Feb 2026, 21:05 14 Feb 2026, 03:44 13 Feb 2026, 21:09 12 Feb 2026, 00:06 11 Feb 2026, 21:10 11 Feb 2026, 00:11 10 Feb 2026, 21:13 10 Feb 2026, 03:56 10 Feb 2026, 00:11 9 Feb 2026, 15:17 9 Feb 2026, 00:08 7 Feb 2026, 21:05 7 Feb 2026, 18:03 7 Feb 2026, 03:43 6 Feb 2026, 21:06 6 Feb 2026, 00:05 5 Feb 2026, 21:06 5 Feb 2026, 18:13 5 Feb 2026, 03:46 5 Feb 2026, 00:07 4 Feb 2026, 21:07 4 Feb 2026, 18:11 4 Feb 2026, 03:45 4 Feb 2026, 00:06 3 Feb 2026, 21:08 3 Feb 2026, 18:14 3 Feb 2026, 09:10 3 Feb 2026, 03:46 1 Feb 2026, 21:03 1 Feb 2026, 18:02 31 Jan 2026, 03:42 31 Jan 2026, 00:06 30 Jan 2026, 18:07 30 Jan 2026, 00:06 29 Jan 2026, 21:03 28 Jan 2026, 15:06 28 Jan 2026, 03:30 28 Jan 2026, 00:05 27 Jan 2026, 21:01 27 Jan 2026, 18:03 27 Jan 2026, 06:02 26 Jan 2026, 21:03 25 Jan 2026, 03:34 24 Jan 2026, 03:29 23 Jan 2026, 21:01 23 Jan 2026, 18:02 23 Jan 2026, 00:05 22 Jan 2026, 21:03 22 Jan 2026, 15:05 22 Jan 2026, 03:31 22 Jan 2026, 00:05 21 Jan 2026, 21:05 21 Jan 2026, 06:02 21 Jan 2026, 03:30 21 Jan 2026, 00:05 20 Jan 2026, 21:03 20 Jan 2026, 18:03 20 Jan 2026, 15:05 20 Jan 2026, 03:30 19 Jan 2026, 21:01 19 Jan 2026, 00:05 16 Jan 2026, 21:01 16 Jan 2026, 18:02 16 Jan 2026, 15:02 16 Jan 2026, 00:05 14 Jan 2026, 06:02 14 Jan 2026, 00:05 12 Jan 2026, 21:02 12 Jan 2026, 18:02 12 Jan 2026, 00:05 11 Jan 2026, 18:02 11 Jan 2026, 03:31 11 Jan 2026, 00:06 10 Jan 2026, 21:01 10 Jan 2026, 03:29 10 Jan 2026, 00:04 9 Jan 2026, 21:01 9 Jan 2026, 00:04 8 Jan 2026, 21:02 8 Jan 2026, 06:02 8 Jan 2026, 03:29 8 Jan 2026, 00:05 7 Jan 2026, 21:01 7 Jan 2026, 18:02 7 Jan 2026, 09:05 7 Jan 2026, 06:02 7 Jan 2026, 03:30 7 Jan 2026, 00:04 6 Jan 2026, 21:01 6 Jan 2026, 03:29 6 Jan 2026, 00:05 3 Jan 2026, 18:02 27 Dec 2025, 06:02 27 Dec 2025, 03:28 23 Dec 2025, 18:02 20 Dec 2025, 00:04 19 Dec 2025, 21:01 19 Dec 2025, 18:02 19 Dec 2025, 00:05 18 Dec 2025, 21:01 18 Dec 2025, 18:02 18 Dec 2025, 15:02 17 Dec 2025, 15:02 17 Dec 2025, 03:27 16 Dec 2025, 21:01 16 Dec 2025, 18:02 16 Dec 2025, 00:05 15 Dec 2025, 21:01 15 Dec 2025, 18:02 13 Dec 2025, 06:02 12 Dec 2025, 21:01 12 Dec 2025, 00:05 11 Dec 2025, 21:02 11 Dec 2025, 18:01 11 Dec 2025, 06:02 10 Dec 2025, 09:03 9 Dec 2025, 18:01 9 Dec 2025, 06:02 9 Dec 2025, 03:25 8 Dec 2025, 21:01 8 Dec 2025, 06:02 8 Dec 2025, 00:05 6 Dec 2025, 18:02 5 Dec 2025, 00:04 4 Dec 2025, 21:02 4 Dec 2025, 18:02 4 Dec 2025, 06:02 4 Dec 2025, 03:26 3 Dec 2025, 00:04 2 Dec 2025, 21:01 2 Dec 2025, 00:04 1 Dec 2025, 03:31 27 Nov 2025, 06:02 27 Nov 2025, 03:20 26 Nov 2025, 00:04 25 Nov 2025, 03:22 24 Nov 2025, 21:01 21 Nov 2025, 00:04 20 Nov 2025, 18:02 20 Nov 2025, 06:02 20 Nov 2025, 03:20 19 Nov 2025, 03:21 19 Nov 2025, 00:05 18 Nov 2025, 18:02 18 Nov 2025, 09:02 18 Nov 2025, 03:21 17 Nov 2025, 03:24 17 Nov 2025, 00:04 16 Nov 2025, 00:04 14 Nov 2025, 21:26 6 Nov 2025, 18:02 6 Nov 2025, 15:02 6 Nov 2025, 12:02 6 Nov 2025, 06:01 6 Nov 2025, 03:22 4 Nov 2025, 18:02 4 Nov 2025, 03:19 4 Nov 2025, 00:04 3 Nov 2025, 21:01 3 Nov 2025, 12:03 3 Nov 2025, 09:02 3 Nov 2025, 06:02 3 Nov 2025, 03:24 3 Nov 2025, 00:04 2 Nov 2025, 18:01 2 Nov 2025, 12:02 2 Nov 2025, 09:01 1 Nov 2025, 21:01 31 Oct 2025, 00:04 30 Oct 2025, 18:02 29 Oct 2025, 21:02 28 Oct 2025, 18:02 27 Oct 2025, 18:02 24 Oct 2025, 21:01 23 Oct 2025, 21:02 23 Oct 2025, 09:02 23 Oct 2025, 06:02 23 Oct 2025, 00:04 21 Oct 2025, 00:04 20 Oct 2025, 21:02 20 Oct 2025, 15:12 20 Oct 2025, 00:05 17 Oct 2025, 18:01 17 Oct 2025, 12:03 16 Oct 2025, 18:02 16 Oct 2025, 00:05 15 Oct 2025, 18:02 13 Oct 2025, 21:01 12 Oct 2025, 18:01
21 Jan 2026, 21:05
12 May 2026, 16:02 12 May 2026, 14:59 12 May 2026, 01:59 12 May 2026, 00:01 11 May 2026, 23:00 11 May 2026, 21:57 11 May 2026, 20:02 11 May 2026, 18:59 11 May 2026, 18:00 11 May 2026, 15:00 10 May 2026, 23:03 10 May 2026, 17:00 10 May 2026, 04:02 9 May 2026, 04:57 9 May 2026, 04:01 9 May 2026, 03:01 8 May 2026, 22:00 8 May 2026, 19:00 8 May 2026, 18:00 8 May 2026, 16:57 8 May 2026, 07:02 8 May 2026, 06:02 8 May 2026, 03:01 8 May 2026, 02:03 8 May 2026, 01:02 8 May 2026, 00:02 7 May 2026, 22:59 7 May 2026, 21:57 7 May 2026, 17:08 5 May 2026, 23:00 5 May 2026, 21:00 5 May 2026, 17:00 5 May 2026, 15:59 5 May 2026, 14:57 5 May 2026, 00:02 4 May 2026, 22:58 4 May 2026, 22:01 4 May 2026, 18:58 4 May 2026, 15:35 4 May 2026, 06:55 4 May 2026, 04:18 2 May 2026, 18:14 2 May 2026, 04:05 2 May 2026, 00:19 1 May 2026, 18:19 1 May 2026, 04:22 1 May 2026, 00:20 29 Apr 2026, 21:21 29 Apr 2026, 15:36 29 Apr 2026, 09:39 29 Apr 2026, 04:11 29 Apr 2026, 00:20 28 Apr 2026, 21:21 28 Apr 2026, 18:28 28 Apr 2026, 15:45 28 Apr 2026, 06:49 27 Apr 2026, 21:20 27 Apr 2026, 18:23 26 Apr 2026, 04:08 25 Apr 2026, 21:10 24 Apr 2026, 18:11 24 Apr 2026, 06:34 24 Apr 2026, 00:17 23 Apr 2026, 18:19 23 Apr 2026, 04:04 23 Apr 2026, 00:17 22 Apr 2026, 21:15 22 Apr 2026, 04:00 22 Apr 2026, 00:13 21 Apr 2026, 21:14 21 Apr 2026, 09:30 21 Apr 2026, 04:01 20 Apr 2026, 21:14 20 Apr 2026, 18:16 18 Apr 2026, 18:09 18 Apr 2026, 00:13 17 Apr 2026, 21:13 17 Apr 2026, 18:14 17 Apr 2026, 00:15 16 Apr 2026, 21:13 16 Apr 2026, 18:21 16 Apr 2026, 15:30 16 Apr 2026, 04:02 16 Apr 2026, 00:16 15 Apr 2026, 18:20 15 Apr 2026, 15:24 15 Apr 2026, 09:29 15 Apr 2026, 04:00 14 Apr 2026, 21:14 14 Apr 2026, 18:21 14 Apr 2026, 06:32 14 Apr 2026, 04:00 14 Apr 2026, 00:16 13 Apr 2026, 21:14 13 Apr 2026, 18:21 11 Apr 2026, 00:11 10 Apr 2026, 21:09 10 Apr 2026, 18:13 10 Apr 2026, 06:32 10 Apr 2026, 00:12 9 Apr 2026, 21:14 9 Apr 2026, 18:17 9 Apr 2026, 15:29 9 Apr 2026, 03:55 9 Apr 2026, 00:09 8 Apr 2026, 21:13 8 Apr 2026, 18:21 8 Apr 2026, 15:27 8 Apr 2026, 00:12 7 Apr 2026, 21:14 4 Apr 2026, 18:05 4 Apr 2026, 03:46 4 Apr 2026, 00:09 3 Apr 2026, 21:07 3 Apr 2026, 18:08 3 Apr 2026, 03:54 3 Apr 2026, 00:11 2 Apr 2026, 21:08 2 Apr 2026, 18:12 2 Apr 2026, 09:19 2 Apr 2026, 06:21 2 Apr 2026, 03:53 1 Apr 2026, 21:12 1 Apr 2026, 18:13 1 Apr 2026, 04:00 1 Apr 2026, 00:11 31 Mar 2026, 21:09 31 Mar 2026, 06:24 31 Mar 2026, 03:56 31 Mar 2026, 00:11 30 Mar 2026, 21:13 30 Mar 2026, 18:15 28 Mar 2026, 18:04 28 Mar 2026, 15:06 27 Mar 2026, 21:09 27 Mar 2026, 18:14 27 Mar 2026, 15:15 27 Mar 2026, 06:21 27 Mar 2026, 03:56 27 Mar 2026, 00:10 26 Mar 2026, 21:07 26 Mar 2026, 18:16 26 Mar 2026, 15:25 26 Mar 2026, 06:21 26 Mar 2026, 03:55 26 Mar 2026, 00:10 25 Mar 2026, 21:08 25 Mar 2026, 18:15 25 Mar 2026, 06:18 25 Mar 2026, 03:47 25 Mar 2026, 00:08 24 Mar 2026, 18:15 24 Mar 2026, 00:07 23 Mar 2026, 21:08 23 Mar 2026, 18:13 23 Mar 2026, 00:09 22 Mar 2026, 18:04 22 Mar 2026, 00:07 21 Mar 2026, 18:03 21 Mar 2026, 00:07 20 Mar 2026, 21:05 20 Mar 2026, 18:08 20 Mar 2026, 15:13 20 Mar 2026, 03:45 20 Mar 2026, 00:08 19 Mar 2026, 06:17 19 Mar 2026, 00:08 18 Mar 2026, 18:16 18 Mar 2026, 12:11 18 Mar 2026, 09:15 18 Mar 2026, 03:50 18 Mar 2026, 00:09 17 Mar 2026, 21:10 17 Mar 2026, 18:15 17 Mar 2026, 03:46 17 Mar 2026, 00:08 16 Mar 2026, 21:10 16 Mar 2026, 18:15 14 Mar 2026, 03:44 14 Mar 2026, 00:08 13 Mar 2026, 21:07 13 Mar 2026, 18:07 13 Mar 2026, 06:12 12 Mar 2026, 21:07 12 Mar 2026, 18:12 12 Mar 2026, 00:07 11 Mar 2026, 03:43 11 Mar 2026, 00:05 10 Mar 2026, 03:43 10 Mar 2026, 00:05 9 Mar 2026, 21:06 7 Mar 2026, 03:37 7 Mar 2026, 00:07 6 Mar 2026, 06:10 6 Mar 2026, 03:44 6 Mar 2026, 00:12 5 Mar 2026, 06:12 5 Mar 2026, 03:45 5 Mar 2026, 00:07 4 Mar 2026, 21:06 4 Mar 2026, 18:09 4 Mar 2026, 09:09 1 Mar 2026, 06:10 1 Mar 2026, 03:49 28 Feb 2026, 21:01 28 Feb 2026, 00:05 27 Feb 2026, 21:05 27 Feb 2026, 18:07 27 Feb 2026, 09:11 27 Feb 2026, 06:13 27 Feb 2026, 00:08 26 Feb 2026, 21:08 26 Feb 2026, 18:12 26 Feb 2026, 09:14 26 Feb 2026, 06:17 26 Feb 2026, 00:07 25 Feb 2026, 03:47 25 Feb 2026, 00:09 24 Feb 2026, 21:08 24 Feb 2026, 18:15 23 Feb 2026, 21:13 21 Feb 2026, 18:03 21 Feb 2026, 06:08 20 Feb 2026, 21:03 20 Feb 2026, 06:14 20 Feb 2026, 00:07 19 Feb 2026, 21:06 19 Feb 2026, 03:48 19 Feb 2026, 00:08 18 Feb 2026, 03:48 17 Feb 2026, 21:08 17 Feb 2026, 00:08 16 Feb 2026, 21:05 14 Feb 2026, 03:44 13 Feb 2026, 21:09 12 Feb 2026, 00:06 11 Feb 2026, 21:10 11 Feb 2026, 00:11 10 Feb 2026, 21:13 10 Feb 2026, 03:56 10 Feb 2026, 00:11 9 Feb 2026, 15:17 9 Feb 2026, 00:08 7 Feb 2026, 21:05 7 Feb 2026, 18:03 7 Feb 2026, 03:43 6 Feb 2026, 21:06 6 Feb 2026, 00:05 5 Feb 2026, 21:06 5 Feb 2026, 18:13 5 Feb 2026, 03:46 5 Feb 2026, 00:07 4 Feb 2026, 21:07 4 Feb 2026, 18:11 4 Feb 2026, 03:45 4 Feb 2026, 00:06 3 Feb 2026, 21:08 3 Feb 2026, 18:14 3 Feb 2026, 09:10 3 Feb 2026, 03:46 1 Feb 2026, 21:03 1 Feb 2026, 18:02 31 Jan 2026, 03:42 31 Jan 2026, 00:06 30 Jan 2026, 18:07 30 Jan 2026, 00:06 29 Jan 2026, 21:03 28 Jan 2026, 15:06 28 Jan 2026, 03:30 28 Jan 2026, 00:05 27 Jan 2026, 21:01 27 Jan 2026, 18:03 27 Jan 2026, 06:02 26 Jan 2026, 21:03 25 Jan 2026, 03:34 24 Jan 2026, 03:29 23 Jan 2026, 21:01 23 Jan 2026, 18:02 23 Jan 2026, 00:05 22 Jan 2026, 21:03 22 Jan 2026, 15:05 22 Jan 2026, 03:31 22 Jan 2026, 00:05 21 Jan 2026, 21:05 21 Jan 2026, 06:02 21 Jan 2026, 03:30 21 Jan 2026, 00:05 20 Jan 2026, 21:03 20 Jan 2026, 18:03 20 Jan 2026, 15:05 20 Jan 2026, 03:30 19 Jan 2026, 21:01 19 Jan 2026, 00:05 16 Jan 2026, 21:01 16 Jan 2026, 18:02 16 Jan 2026, 15:02 16 Jan 2026, 00:05 14 Jan 2026, 06:02 14 Jan 2026, 00:05 12 Jan 2026, 21:02 12 Jan 2026, 18:02 12 Jan 2026, 00:05 11 Jan 2026, 18:02 11 Jan 2026, 03:31 11 Jan 2026, 00:06 10 Jan 2026, 21:01 10 Jan 2026, 03:29 10 Jan 2026, 00:04 9 Jan 2026, 21:01 9 Jan 2026, 00:04 8 Jan 2026, 21:02 8 Jan 2026, 06:02 8 Jan 2026, 03:29 8 Jan 2026, 00:05 7 Jan 2026, 21:01 7 Jan 2026, 18:02 7 Jan 2026, 09:05 7 Jan 2026, 06:02 7 Jan 2026, 03:30 7 Jan 2026, 00:04 6 Jan 2026, 21:01 6 Jan 2026, 03:29 6 Jan 2026, 00:05 3 Jan 2026, 18:02 27 Dec 2025, 06:02 27 Dec 2025, 03:28 23 Dec 2025, 18:02 20 Dec 2025, 00:04 19 Dec 2025, 21:01 19 Dec 2025, 18:02 19 Dec 2025, 00:05 18 Dec 2025, 21:01 18 Dec 2025, 18:02 18 Dec 2025, 15:02 17 Dec 2025, 15:02 17 Dec 2025, 03:27 16 Dec 2025, 21:01 16 Dec 2025, 18:02 16 Dec 2025, 00:05 15 Dec 2025, 21:01 15 Dec 2025, 18:02 13 Dec 2025, 06:02 12 Dec 2025, 21:01 12 Dec 2025, 00:05 11 Dec 2025, 21:02 11 Dec 2025, 18:01 11 Dec 2025, 06:02 10 Dec 2025, 09:03 9 Dec 2025, 18:01 9 Dec 2025, 06:02 9 Dec 2025, 03:25 8 Dec 2025, 21:01 8 Dec 2025, 06:02 8 Dec 2025, 00:05 6 Dec 2025, 18:02 5 Dec 2025, 00:04 4 Dec 2025, 21:02 4 Dec 2025, 18:02 4 Dec 2025, 06:02 4 Dec 2025, 03:26 3 Dec 2025, 00:04 2 Dec 2025, 21:01 2 Dec 2025, 00:04 1 Dec 2025, 03:31 27 Nov 2025, 06:02 27 Nov 2025, 03:20 26 Nov 2025, 00:04 25 Nov 2025, 03:22 24 Nov 2025, 21:01 21 Nov 2025, 00:04 20 Nov 2025, 18:02 20 Nov 2025, 06:02 20 Nov 2025, 03:20 19 Nov 2025, 03:21 19 Nov 2025, 00:05 18 Nov 2025, 18:02 18 Nov 2025, 09:02 18 Nov 2025, 03:21 17 Nov 2025, 03:24 17 Nov 2025, 00:04 16 Nov 2025, 00:04 14 Nov 2025, 21:26 6 Nov 2025, 18:02 6 Nov 2025, 15:02 6 Nov 2025, 12:02 6 Nov 2025, 06:01 6 Nov 2025, 03:22 4 Nov 2025, 18:02 4 Nov 2025, 03:19 4 Nov 2025, 00:04 3 Nov 2025, 21:01 3 Nov 2025, 12:03 3 Nov 2025, 09:02 3 Nov 2025, 06:02 3 Nov 2025, 03:24 3 Nov 2025, 00:04 2 Nov 2025, 18:01 2 Nov 2025, 12:02 2 Nov 2025, 09:01 1 Nov 2025, 21:01 31 Oct 2025, 00:04 30 Oct 2025, 18:02 29 Oct 2025, 21:02 28 Oct 2025, 18:02 27 Oct 2025, 18:02 24 Oct 2025, 21:01 23 Oct 2025, 21:02 23 Oct 2025, 09:02 23 Oct 2025, 06:02 23 Oct 2025, 00:04 21 Oct 2025, 00:04 20 Oct 2025, 21:02 20 Oct 2025, 15:12 20 Oct 2025, 00:05 17 Oct 2025, 18:01 17 Oct 2025, 12:03 16 Oct 2025, 18:02 16 Oct 2025, 00:05 15 Oct 2025, 18:02 13 Oct 2025, 21:01 12 Oct 2025, 18:01
Sat 3 18:02 Tue 6 00:05 Tue 6 03:29 Tue 6 21:01 Wed 7 00:04 Wed 7 03:30 Wed 7 06:02 Wed 7 09:05 Wed 7 18:02 Wed 7 21:01 Thu 8 00:05 Thu 8 03:29 Thu 8 06:02 Thu 8 21:02 Fri 9 00:04 Fri 9 21:01 Sat 10 00:04 Sat 10 03:29 Sat 10 21:01 Sun 11 00:06 Sun 11 03:31 Sun 11 18:02 Mon 12 00:05 Mon 12 18:02 Mon 12 21:02 Wed 14 00:05 Wed 14 06:02 Fri 16 00:05 Fri 16 15:02 Fri 16 18:02 Fri 16 21:01 Mon 19 00:05 Mon 19 21:01 Tue 20 03:30 Tue 20 15:05 Tue 20 18:03 Tue 20 21:03 Wed 21 00:05 Wed 21 03:30 Wed 21 06:02 Wed 21 21:05 Thu 22 00:05 Thu 22 03:31 Thu 22 15:05 Thu 22 21:03 Fri 23 00:05 Fri 23 18:02 Fri 23 21:01 Sat 24 03:29 Sun 25 03:34 Mon 26 21:03 Tue 27 06:02 Tue 27 18:03 Tue 27 21:01 Wed 28 00:05 Wed 28 03:30 Wed 28 15:06 Thu 29 21:03 Fri 30 00:06 Fri 30 18:07 Sat 31 00:06 Sat 31 03:42
Details

209 We recommend creating a dedicated AWS account for Claude Code to simplify cost tracking and access control.209 We recommend creating a dedicated AWS account for Claude Code to simplify cost tracking and access control.

210</Note>210</Note>

211 211 

212## AWS Guardrails

213 

214[Amazon Bedrock Guardrails](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html) let you implement content filtering for Claude Code. Create a Guardrail in the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock/), publish a version, then add the Guardrail headers to your [settings file](/en/settings). Enable Cross-Region inference on your Guardrail if you're using cross-region inference profiles.

215 

216Example configuration:

217 

218```json theme={null}

219{

220 "env": {

221 "ANTHROPIC_CUSTOM_HEADERS": "X-Amzn-Bedrock-GuardrailIdentifier: your-guardrail-id\nX-Amzn-Bedrock-GuardrailVersion: 1"

222 }

223}

224```

225 

212## Troubleshooting226## Troubleshooting

213 227 

214If you encounter region issues:228If you encounter region issues:

Details

61## See also61## See also

62 62 

63* [Interactive mode](/en/interactive-mode) - Keyboard shortcuts and session controls63* [Interactive mode](/en/interactive-mode) - Keyboard shortcuts and session controls

64* [Slash commands](/en/slash-commands) - Accessing checkpoints using `/rewind`64* [Built-in commands](/en/interactive-mode#built-in-commands) - Accessing checkpoints using `/rewind`

65* [CLI reference](/en/cli-reference) - Command-line options65* [CLI reference](/en/cli-reference) - Command-line options

66 66 

67 67 

chrome.md +3 −3

Details

28 28 

29* [Google Chrome](https://www.google.com/chrome/) browser29* [Google Chrome](https://www.google.com/chrome/) browser

30* [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) version 1.0.36 or higher30* [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) version 1.0.36 or higher

31* [Claude Code CLI](/en/quickstart#step-1:-install-claude-code) version 2.0.73 or higher31* [Claude Code CLI](/en/quickstart#step-1-install-claude-code) version 2.0.73 or higher

32* A paid Claude plan (Pro, Team, or Enterprise)32* A paid Claude plan (Pro, Team, or Enterprise)

33 33 

34## How the integration works34## How the integration works


47 47 

48<Steps>48<Steps>

49 <Step title="Update Claude Code">49 <Step title="Update Claude Code">

50 Chrome integration requires a recent version of Claude Code. If you installed using the [native installer](/en/quickstart#step-1:-install-claude-code), updates happen automatically. Otherwise, run:50 Chrome integration requires a recent version of Claude Code. If you installed using the [native installer](/en/quickstart#step-1-install-claude-code), updates happen automatically. Otherwise, run:

51 51 

52 ```bash theme={null}52 ```bash theme={null}

53 claude update53 claude update


67 </Step>67 </Step>

68</Steps>68</Steps>

69 69 

70You can also enable Chrome integration from within an existing session using the `/chrome` slash command.70You can also enable Chrome integration from within an existing session using the `/chrome` command.

71 71 

72## Try it out72## Try it out

73 73 

Details

16* **Repositories not on your local machine**: Work on code you don't have checked out locally16* **Repositories not on your local machine**: Work on code you don't have checked out locally

17* **Backend changes**: Where Claude Code can write tests and then write code to pass those tests17* **Backend changes**: Where Claude Code can write tests and then write code to pass those tests

18 18 

19Claude Code is also available on the Claude iOS app. This is perfect for:19Claude Code is also available on the Claude iOS app for kicking off tasks on the go and monitoring work in progress.

20 20 

21* **On the go**: Kick off tasks while commuting or away from laptop21You can move between local and remote development: [send tasks from your terminal to run on the web](#from-terminal-to-web) with the `&` prefix, or [teleport web sessions back to your terminal](#from-web-to-terminal) to continue locally.

22* **Monitoring**: Watch the trajectory and steer the agent's work

23 

24Developers can also move Claude Code sessions from the Claude app to their terminal to continue tasks locally.

25 22 

26## Who can use Claude Code on the web?23## Who can use Claude Code on the web?

27 24 


54 51 

55## Moving tasks between web and terminal52## Moving tasks between web and terminal

56 53 

54You can start tasks on the web and continue them in your terminal, or send tasks from your terminal to run on the web. Web sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude iOS app.

55 

56<Note>

57 Session handoff is one-way: you can pull web sessions into your terminal, but you can't push an existing terminal session to the web. The [`&` prefix](#from-terminal-to-web) creates a *new* web session with your current conversation context.

58</Note>

59 

60### From terminal to web

61 

62Start a message with `&` inside Claude Code to send a task to run on the web:

63 

64```

65& Fix the authentication bug in src/auth/login.ts

66```

67 

68This creates a new web session on claude.ai with your current conversation context. The task runs in the cloud while you continue working locally. Use `/tasks` to check progress, or open the session on claude.ai or the Claude iOS app to interact directly. From there you can steer Claude, provide feedback, or answer questions just like any other conversation.

69 

70You can also start a web session directly from the command line:

71 

72```bash theme={null}

73claude --remote "Fix the authentication bug in src/auth/login.ts"

74```

75 

76#### Tips for background tasks

77 

78**Plan locally, execute remotely**: For complex tasks, start Claude in plan mode to collaborate on the approach before sending work to the web:

79 

80```bash theme={null}

81claude --permission-mode plan

82```

83 

84In plan mode, Claude can only read files and explore the codebase. Once you're satisfied with the plan, send it to the web for autonomous execution:

85 

86```

87& Execute the migration plan we discussed

88```

89 

90This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud.

91 

92**Run tasks in parallel**: Each `&` command creates its own web session that runs independently. You can kick off multiple tasks and they'll all run simultaneously in separate sessions:

93 

94```

95& Fix the flaky test in auth.spec.ts

96& Update the API documentation

97& Refactor the logger to use structured output

98```

99 

100Monitor all sessions with `/tasks`. When a session completes, you can create a PR from the web interface or [teleport](#from-web-to-terminal) the session to your terminal to continue working.

101 

57### From web to terminal102### From web to terminal

58 103 

59After starting a task on the web:104There are several ways to pull a web session into your terminal:

105 

106* **Using `/teleport`**: From within Claude Code, run `/teleport` (or `/tp`) to see an interactive picker of your web sessions. If you have uncommitted changes, you'll be prompted to stash them first.

107* **Using `--teleport`**: From the command line, run `claude --teleport` for an interactive session picker, or `claude --teleport <session-id>` to resume a specific session directly.

108* **From `/tasks`**: Run `/tasks` to see your background sessions, then press `t` to teleport into one

109* **From the web interface**: Click "Open in CLI" to copy a command you can paste into your terminal

60 110 

611. Click the "Open in CLI" button111When you teleport a session, Claude verifies you're in the correct repository, fetches and checks out the branch from the remote session, and loads the full conversation history into your terminal.

622. Paste and run the command in your terminal in a checkout of the repo112 

633. Any existing local changes will be stashed, and the remote session will be loaded113#### Requirements for teleporting

644. Continue working locally114 

115Teleport checks these requirements before resuming a session. If any requirement isn't met, you'll see an error or be prompted to resolve the issue.

116 

117| Requirement | Details |

118| ------------------ | ---------------------------------------------------------------------------------------------------------------------- |

119| Clean git state | Your working directory must have no uncommitted changes. Teleport prompts you to stash changes if needed. |

120| Correct repository | You must run `--teleport` from a checkout of the same repository, not a fork. |

121| Branch available | The branch from the web session must have been pushed to the remote. Teleport automatically fetches and checks it out. |

122| Same account | You must be authenticated to the same Claude.ai account used in the web session. |

65 123 

66## Cloud environment124## Cloud environment

67 125 


127 185 

128**To update an existing environment:** Select the current environment, to the right of the environment name, and select the settings button. This will open a dialog where you can update the environment name, network access, and environment variables.186**To update an existing environment:** Select the current environment, to the right of the environment name, and select the settings button. This will open a dialog where you can update the environment name, network access, and environment variables.

129 187 

188**To select your default environment from the terminal:** If you have multiple environments configured, run `/remote-env` to choose which one to use when starting web sessions from your terminal with `&` or `--remote`. With a single environment, this command shows your current configuration.

189 

130<Note>190<Note>

131 Environment variables must be specified as key-value pairs, in [`.env` format](https://www.dotenv.org/). For example:191 Environment variables must be specified as key-value pairs, in [`.env` format](https://www.dotenv.org/). For example:

132 192 


256* ghcr.io316* ghcr.io

257* mcr.microsoft.com317* mcr.microsoft.com

258* \*.data.mcr.microsoft.com318* \*.data.mcr.microsoft.com

319* public.ecr.aws

259 320 

260#### Cloud Platforms321#### Cloud Platforms

261 322 


276* dot.net337* dot.net

277* visualstudio.com338* visualstudio.com

278* dev.azure.com339* dev.azure.com

340* \*.amazonaws.com

341* \*.api.aws

279* oracle.com342* oracle.com

280* [www.oracle.com](http://www.oracle.com)343* [www.oracle.com](http://www.oracle.com)

281* java.com344* java.com

cli-reference.md +24 −18

Details

21Customize Claude Code's behavior with these command-line flags:21Customize Claude Code's behavior with these command-line flags:

22 22 

23| Flag | Description | Example |23| Flag | Description | Example |

24| :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------- |24| :------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- |

25| `--add-dir` | Add additional working directories for Claude to access (validates each path exists as a directory) | `claude --add-dir ../apps ../lib` |25| `--add-dir` | Add additional working directories for Claude to access (validates each path exists as a directory) | `claude --add-dir ../apps ../lib` |

26| `--agent` | Specify an agent for the current session (overrides the `agent` setting) | `claude --agent my-custom-agent` |26| `--agent` | Specify an agent for the current session (overrides the `agent` setting) | `claude --agent my-custom-agent` |

27| `--agents` | Define custom [subagents](/en/sub-agents) dynamically via JSON (see below for format) | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |27| `--agents` | Define custom [subagents](/en/sub-agents) dynamically via JSON (see below for format) | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |

28| `--allowedTools` | Tools that execute without prompting for permission. To restrict which tools are available, use `--tools` instead | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |28| `--allow-dangerously-skip-permissions` | Enable permission bypassing as an option without immediately activating it. Allows composing with `--permission-mode` (use with caution) | `claude --permission-mode plan --allow-dangerously-skip-permissions` |

29| `--allowedTools` | Tools that execute without prompting for permission. See [permission rule syntax](/en/settings#permission-rule-syntax) for pattern matching. To restrict which tools are available, use `--tools` instead | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |

29| `--append-system-prompt` | Append custom text to the end of the default system prompt (works in both interactive and print modes) | `claude --append-system-prompt "Always use TypeScript"` |30| `--append-system-prompt` | Append custom text to the end of the default system prompt (works in both interactive and print modes) | `claude --append-system-prompt "Always use TypeScript"` |

31| `--append-system-prompt-file` | Load additional system prompt text from a file and append to the default prompt (print mode only) | `claude -p --append-system-prompt-file ./extra-rules.txt "query"` |

30| `--betas` | Beta headers to include in API requests (API key users only) | `claude --betas interleaved-thinking` |32| `--betas` | Beta headers to include in API requests (API key users only) | `claude --betas interleaved-thinking` |

31| `--chrome` | Enable [Chrome browser integration](/en/chrome) for web automation and testing | `claude --chrome` |33| `--chrome` | Enable [Chrome browser integration](/en/chrome) for web automation and testing | `claude --chrome` |

32| `--continue`, `-c` | Load the most recent conversation in the current directory | `claude --continue` |34| `--continue`, `-c` | Load the most recent conversation in the current directory | `claude --continue` |

33| `--dangerously-skip-permissions` | Skip permission prompts (use with caution) | `claude --dangerously-skip-permissions` |35| `--dangerously-skip-permissions` | Skip all permission prompts (use with caution) | `claude --dangerously-skip-permissions` |

34| `--debug` | Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`) | `claude --debug "api,mcp"` |36| `--debug` | Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`) | `claude --debug "api,mcp"` |

37| `--disable-slash-commands` | Disable all skills and slash commands for this session | `claude --disable-slash-commands` |

35| `--disallowedTools` | Tools that are removed from the model's context and cannot be used | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |38| `--disallowedTools` | Tools that are removed from the model's context and cannot be used | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |

36| `--enable-lsp-logging` | Enable verbose LSP logging for debugging language server issues. Logs are written to `~/.claude/debug/` | `claude --enable-lsp-logging` |

37| `--fallback-model` | Enable automatic fallback to specified model when default model is overloaded (print mode only) | `claude -p --fallback-model sonnet "query"` |39| `--fallback-model` | Enable automatic fallback to specified model when default model is overloaded (print mode only) | `claude -p --fallback-model sonnet "query"` |

38| `--fork-session` | When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`) | `claude --resume abc123 --fork-session` |40| `--fork-session` | When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`) | `claude --resume abc123 --fork-session` |

39| `--ide` | Automatically connect to IDE on startup if exactly one valid IDE is available | `claude --ide` |41| `--ide` | Automatically connect to IDE on startup if exactly one valid IDE is available | `claude --ide` |

42| `--init` | Run [Setup hooks](/en/hooks#setup) and start interactive mode | `claude --init` |

43| `--init-only` | Run [Setup hooks](/en/hooks#setup) and exit (no interactive session) | `claude --init-only` |

40| `--include-partial-messages` | Include partial streaming events in output (requires `--print` and `--output-format=stream-json`) | `claude -p --output-format stream-json --include-partial-messages "query"` |44| `--include-partial-messages` | Include partial streaming events in output (requires `--print` and `--output-format=stream-json`) | `claude -p --output-format stream-json --include-partial-messages "query"` |

41| `--input-format` | Specify input format for print mode (options: `text`, `stream-json`) | `claude -p --output-format json --input-format stream-json` |45| `--input-format` | Specify input format for print mode (options: `text`, `stream-json`) | `claude -p --output-format json --input-format stream-json` |

42| `--json-schema` | Get validated JSON output matching a JSON Schema after agent completes its workflow (print mode only, see [Agent SDK Structured Outputs](https://docs.claude.com/en/docs/agent-sdk/structured-outputs)) | `claude -p --json-schema '{"type":"object","properties":{...}}' "query"` |46| `--json-schema` | Get validated JSON output matching a JSON Schema after agent completes its workflow (print mode only, see [Agent SDK Structured Outputs](https://docs.claude.com/en/docs/agent-sdk/structured-outputs)) | `claude -p --json-schema '{"type":"object","properties":{...}}' "query"` |

43| `--max-turns` | Limit the number of agentic turns in non-interactive mode | `claude -p --max-turns 3 "query"` |47| `--maintenance` | Run [Setup hooks](/en/hooks#setup) with maintenance trigger and exit | `claude --maintenance` |

48| `--max-budget-usd` | Maximum dollar amount to spend on API calls before stopping (print mode only) | `claude -p --max-budget-usd 5.00 "query"` |

49| `--max-turns` | Limit the number of agentic turns (print mode only). Exits with an error when the limit is reached. No limit by default | `claude -p --max-turns 3 "query"` |

44| `--mcp-config` | Load MCP servers from JSON files or strings (space-separated) | `claude --mcp-config ./mcp.json` |50| `--mcp-config` | Load MCP servers from JSON files or strings (space-separated) | `claude --mcp-config ./mcp.json` |

45| `--model` | Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name | `claude --model claude-sonnet-4-5-20250929` |51| `--model` | Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name | `claude --model claude-sonnet-4-5-20250929` |

46| `--no-chrome` | Disable [Chrome browser integration](/en/chrome) for this session | `claude --no-chrome` |52| `--no-chrome` | Disable [Chrome browser integration](/en/chrome) for this session | `claude --no-chrome` |

53| `--no-session-persistence` | Disable session persistence so sessions are not saved to disk and cannot be resumed (print mode only) | `claude -p --no-session-persistence "query"` |

47| `--output-format` | Specify output format for print mode (options: `text`, `json`, `stream-json`) | `claude -p "query" --output-format json` |54| `--output-format` | Specify output format for print mode (options: `text`, `json`, `stream-json`) | `claude -p "query" --output-format json` |

48| `--permission-mode` | Begin in a specified [permission mode](/en/iam#permission-modes) | `claude --permission-mode plan` |55| `--permission-mode` | Begin in a specified [permission mode](/en/iam#permission-modes) | `claude --permission-mode plan` |

49| `--permission-prompt-tool` | Specify an MCP tool to handle permission prompts in non-interactive mode | `claude -p --permission-prompt-tool mcp_auth_tool "query"` |56| `--permission-prompt-tool` | Specify an MCP tool to handle permission prompts in non-interactive mode | `claude -p --permission-prompt-tool mcp_auth_tool "query"` |

50| `--plugin-dir` | Load plugins from directories for this session only (repeatable) | `claude --plugin-dir ./my-plugins` |57| `--plugin-dir` | Load plugins from directories for this session only (repeatable) | `claude --plugin-dir ./my-plugins` |

51| `--print`, `-p` | Print response without interactive mode (see [SDK documentation](https://docs.claude.com/en/docs/agent-sdk) for programmatic usage details) | `claude -p "query"` |58| `--print`, `-p` | Print response without interactive mode (see [SDK documentation](https://docs.claude.com/en/docs/agent-sdk) for programmatic usage details) | `claude -p "query"` |

59| `--remote` | Create a new [web session](/en/claude-code-on-the-web) on claude.ai with the provided task description | `claude --remote "Fix the login bug"` |

52| `--resume`, `-r` | Resume a specific session by ID or name, or show an interactive picker to choose a session | `claude --resume auth-refactor` |60| `--resume`, `-r` | Resume a specific session by ID or name, or show an interactive picker to choose a session | `claude --resume auth-refactor` |

53| `--session-id` | Use a specific session ID for the conversation (must be a valid UUID) | `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` |61| `--session-id` | Use a specific session ID for the conversation (must be a valid UUID) | `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` |

54| `--setting-sources` | Comma-separated list of setting sources to load (`user`, `project`, `local`) | `claude --setting-sources user,project` |62| `--setting-sources` | Comma-separated list of setting sources to load (`user`, `project`, `local`) | `claude --setting-sources user,project` |


56| `--strict-mcp-config` | Only use MCP servers from `--mcp-config`, ignoring all other MCP configurations | `claude --strict-mcp-config --mcp-config ./mcp.json` |64| `--strict-mcp-config` | Only use MCP servers from `--mcp-config`, ignoring all other MCP configurations | `claude --strict-mcp-config --mcp-config ./mcp.json` |

57| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes) | `claude --system-prompt "You are a Python expert"` |65| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes) | `claude --system-prompt "You are a Python expert"` |

58| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |66| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |

59| `--tools` | Specify the list of available tools from the built-in set (use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"`) | `claude -p --tools "Bash,Edit,Read" "query"` |67| `--teleport` | Resume a [web session](/en/claude-code-on-the-web) in your local terminal | `claude --teleport` |

68| `--tools` | Restrict which built-in tools Claude can use (works in both interactive and print modes). Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"` | `claude --tools "Bash,Edit,Read"` |

60| `--verbose` | Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) | `claude --verbose` |69| `--verbose` | Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) | `claude --verbose` |

61| `--version`, `-v` | Output the version number | `claude -v` |70| `--version`, `-v` | Output the version number | `claude -v` |

62 71 


97 106 

98### System prompt flags107### System prompt flags

99 108 

100Claude Code provides three flags for customizing the system prompt, each serving a different purpose:109Claude Code provides four flags for customizing the system prompt, each serving a different purpose:

101 110 

102| Flag | Behavior | Modes | Use Case |111| Flag | Behavior | Modes | Use Case |

103| :----------------------- | :--------------------------------- | :------------------ | :------------------------------------------------------------------- |112| :---------------------------- | :------------------------------------------ | :------------------ | :------------------------------------------------------------------- |

104| `--system-prompt` | **Replaces** entire default prompt | Interactive + Print | Complete control over Claude's behavior and instructions |113| `--system-prompt` | **Replaces** entire default prompt | Interactive + Print | Complete control over Claude's behavior and instructions |

105| `--system-prompt-file` | **Replaces** with file contents | Print only | Load prompts from files for reproducibility and version control |114| `--system-prompt-file` | **Replaces** with file contents | Print only | Load prompts from files for reproducibility and version control |

106| `--append-system-prompt` | **Appends** to default prompt | Interactive + Print | Add specific instructions while keeping default Claude Code behavior |115| `--append-system-prompt` | **Appends** to default prompt | Interactive + Print | Add specific instructions while keeping default Claude Code behavior |

116| `--append-system-prompt-file` | **Appends** file contents to default prompt | Print only | Load additional instructions from files while keeping defaults |

107 117 

108**When to use each:**118**When to use each:**

109 119 


122 claude --append-system-prompt "Always use TypeScript and include JSDoc comments"132 claude --append-system-prompt "Always use TypeScript and include JSDoc comments"

123 ```133 ```

124 134 

125<Note>135* **`--append-system-prompt-file`**: Use when you want to append instructions from a file while keeping Claude Code's defaults. Useful for version-controlled additions.

126 `--system-prompt` and `--system-prompt-file` are mutually exclusive. You cannot use both flags simultaneously.136 ```bash theme={null}

127</Note>137 claude -p --append-system-prompt-file ./prompts/style-rules.txt "Review this PR"

138 ```

128 139 

129<Tip>140`--system-prompt` and `--system-prompt-file` are mutually exclusive. The append flags can be used together with either replacement flag.

130 For most use cases, `--append-system-prompt` is recommended as it preserves Claude Code's built-in capabilities while adding your custom requirements. Use `--system-prompt` or `--system-prompt-file` only when you need complete control over the system prompt.

131</Tip>

132 141 

133For detailed information about print mode (`-p`) including output formats,142For most use cases, `--append-system-prompt` or `--append-system-prompt-file` is recommended as they preserve Claude Code's built-in capabilities while adding your custom requirements. Use `--system-prompt` or `--system-prompt-file` only when you need complete control over the system prompt.

134streaming, verbose logging, and programmatic usage, see the

135[SDK documentation](https://docs.claude.com/en/docs/agent-sdk).

136 143 

137## See also144## See also

138 145 

139* [Chrome extension](/en/chrome) - Browser automation and web testing146* [Chrome extension](/en/chrome) - Browser automation and web testing

140* [Interactive mode](/en/interactive-mode) - Shortcuts, input modes, and interactive features147* [Interactive mode](/en/interactive-mode) - Shortcuts, input modes, and interactive features

141* [Slash commands](/en/slash-commands) - Interactive session commands

142* [Quickstart guide](/en/quickstart) - Getting started with Claude Code148* [Quickstart guide](/en/quickstart) - Getting started with Claude Code

143* [Common workflows](/en/common-workflows) - Advanced workflows and patterns149* [Common workflows](/en/common-workflows) - Advanced workflows and patterns

144* [Settings](/en/settings) - Configuration options150* [Settings](/en/settings) - Configuration options

common-workflows.md +121 −140

Details

1# Common workflows1# Common workflows

2 2 

3> Learn about common workflows with Claude Code.3> Step-by-step guides for exploring codebases, fixing bugs, refactoring, testing, and other everyday tasks with Claude Code.

4 4 

5Each task in this document includes clear instructions, example commands, and best practices to help you get the most from Claude Code.5This page covers practical workflows for everyday development: exploring unfamiliar code, debugging, refactoring, writing tests, creating PRs, and managing sessions. Each section includes example prompts you can adapt to your own projects.

6 6 

7## Understand new codebases7## Understand new codebases

8 8 


219 219 

220***220***

221 221 

222## Create custom skills and commands

223 

224Skills extend Claude's capabilities with reusable prompts and workflows. Create a skill once, then invoke it with `/skill-name` or let Claude use it automatically when relevant.

225 

226For the full reference, see the [Skills documentation](/en/skills).

227 

228### Create a skill Claude can use automatically

229 

230This skill teaches Claude how to analyze code performance. Because it has a description and no restrictions, Claude can load it automatically when you ask about optimization.

231 

232<Steps>

233 <Step title="Create a skills directory in your project">

234 ```bash theme={null}

235 mkdir -p .claude/skills/optimize

236 ```

237 </Step>

238 

239 <Step title="Create a SKILL.md file with frontmatter and instructions">

240 Create `.claude/skills/optimize/SKILL.md` with the following content:

241 

242 ```markdown .claude/skills/optimize/SKILL.md theme={null}

243 ---

244 name: optimize

245 description: Analyze code performance and suggest optimizations

246 ---

247 

248 Analyze the performance of this code and suggest three specific optimizations.

249 ```

250 </Step>

251 

252 <Step title="Use your custom skill">

253 Claude uses it automatically when relevant, or you can invoke it directly:

254 

255 ```

256 /optimize src/utils/parser.js

257 ```

258 </Step>

259</Steps>

260 

261### Create a skill for manual invocation

262 

263This skill runs tests and shows coverage. The `disable-model-invocation: true` field means Claude can't invoke it automatically—only you can trigger it with `/test-coverage`.

264 

265<Steps>

266 <Step title="Create a skill file">

267 Create `.claude/commands/test-coverage.md` with the following content:

268 

269 ```markdown .claude/commands/test-coverage.md theme={null}

270 ---

271 description: Run tests with coverage report

272 disable-model-invocation: true

273 ---

274 

275 Run the test suite with coverage enabled and summarize the results.

276 ```

277 </Step>

278 

279 <Step title="Use your skill">

280 ```

281 /test-coverage

282 ```

283 </Step>

284</Steps>

285 

286<Tip>

287 Skills can be scoped to a project, personal directory, or organization. They can also accept arguments with `$ARGUMENTS`. See the [Skills documentation](/en/skills) for details.

288</Tip>

289 

290***

291 

222## Use Plan Mode for safe code analysis292## Use Plan Mode for safe code analysis

223 293 

224Plan Mode instructs Claude to create a plan by analyzing the codebase with read-only operations, perfect for exploring codebases, planning complex changes, or reviewing code safely.294Plan Mode instructs Claude to create a plan by analyzing the codebase with read-only operations, perfect for exploring codebases, planning complex changes, or reviewing code safely. In Plan Mode, Claude uses [`AskUserQuestion`](/en/settings#tools-available-to-claude) to gather requirements and clarify your goals before proposing a plan.

225 295 

226### When to use Plan Mode296### When to use Plan Mode

227 297 


283 353 

284See [settings documentation](/en/settings#available-settings) for more configuration options.354See [settings documentation](/en/settings#available-settings) for more configuration options.

285 355 

356## Let Claude interview you

357 

358For large features, start with a minimal spec and let Claude interview you to fill in the details:

359 

360```

361> Interview me about this feature before you start: user notification system

362```

363 

364```

365> Help me think through the requirements for authentication by asking questions

366```

367 

368```

369> Ask me clarifying questions to build out this spec: payment processing

370```

371 

372Claude uses the [`AskUserQuestion`](/en/settings#tools-available-to-claude) tool to ask you multiple-choice questions for gathering requirements, clarifying ambiguity, and understanding your preferences before writing any code. This collaborative approach produces better specs than trying to anticipate every requirement upfront.

373 

374<Tip>

375 When you select "Type something" to provide a custom answer, press **Ctrl+G** to open your default text editor for longer responses.

376</Tip>

377 

378This behavior is most active in Plan Mode. To encourage it in other modes, add guidance to your `CLAUDE.md` file:

379 

380```markdown theme={null}

381Always ask clarifying questions when there are multiple valid approaches to a task.

382```

383 

384<Note>

385 If you're building applications with the Agent SDK and want to surface clarifying questions to your users programmatically, see [Handle approvals and user input](https://platform.claude.com/docs/en/agent-sdk/user-input#handle-clarifying-questions).

386</Note>

387 

286***388***

287 389 

288## Work with tests390## Work with tests


454 * Include screenshots of errors, UI designs, or diagrams for better context556 * Include screenshots of errors, UI designs, or diagrams for better context

455 * You can work with multiple images in a conversation557 * You can work with multiple images in a conversation

456 * Image analysis works with diagrams, screenshots, mockups, and more558 * Image analysis works with diagrams, screenshots, mockups, and more

559 * When Claude references images (for example, `[Image #1]`), `Cmd+Click` (Mac) or `Ctrl+Click` (Windows/Linux) the link to open the image in your default viewer

457</Tip>560</Tip>

458 561 

459***562***


501 604 

502## Use extended thinking (thinking mode)605## Use extended thinking (thinking mode)

503 606 

504[Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) reserves a portion of the total output token budget for Claude to reason through complex problems step-by-step. This reasoning is visible in verbose mode, which you can toggle on with `Ctrl+O`.607[Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) is enabled by default, reserving a portion of the output token budget (up to 31,999 tokens) for Claude to reason through complex problems step-by-step. This reasoning is visible in verbose mode, which you can toggle on with `Ctrl+O`.

505 608 

506Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches. It provides more space for exploring multiple solutions, analyzing edge cases, and self-correcting mistakes.609Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches. It provides more space for exploring multiple solutions, analyzing edge cases, and self-correcting mistakes.

507 610 

508<Note>611<Note>

509 Sonnet 4.5 and Opus 4.5 have thinking enabled by default. All other models have thinking disabled by default. Use `/model` to view or switch your current model.612 Phrases like "think", "think hard", "ultrathink", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.

510</Note>613</Note>

511 614 

512You can configure thinking mode for Claude Code in two ways:615### Configure thinking mode

513 

514| Scope | How to enable | Details |

515| --------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |

516| **Global default** | Use `/config` to toggle thinking mode on | Sets your default across all projects.<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |

517| **Environment variable override** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | When set, applies a custom token budget to all requests, overriding your thinking mode configuration. Example: `export MAX_THINKING_TOKENS=1024` |

518 

519### Per-request thinking with `ultrathink`

520 

521You can include `ultrathink` as a keyword in your message to enable thinking for a single request:

522 

523```

524> ultrathink: design a caching layer for our API

525```

526 

527Note that `ultrathink` both allocates the thinking budget AND semantically signals to Claude to reason more thoroughly, which may result in deeper thinking than necessary for your task.

528 616 

529The `ultrathink` keyword only works when `MAX_THINKING_TOKENS` is not set. When `MAX_THINKING_TOKENS` is configured, it takes priority and controls the thinking budget for all requests.617Thinking is enabled by default, but you can adjust or disable it.

530 618 

531Other phrases like "think", "think hard", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.619| Scope | How to configure | Details |

620| ---------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |

621| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off for the current session. May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |

622| **Global default** | Use `/config` to toggle thinking mode | Sets your default across all projects.<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |

623| **Limit token budget** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | Limit the thinking budget to a specific number of tokens. Example: `export MAX_THINKING_TOKENS=10000` |

532 624 

533To view Claude's thinking process, press `Ctrl+O` to toggle verbose mode and see the internal reasoning displayed as gray italic text.625To view Claude's thinking process, press `Ctrl+O` to toggle verbose mode and see the internal reasoning displayed as gray italic text.

534 626 

535See the [token budget section below](#how-extended-thinking-token-budgets-work) for detailed budget information and cost implications.

536 

537### How extended thinking token budgets work627### How extended thinking token budgets work

538 628 

539Extended thinking uses a **token budget** that controls how much internal reasoning Claude can perform before responding.629Extended thinking uses a **token budget** that controls how much internal reasoning Claude can perform before responding.


546 636 

547Token budgets for thinking mode:637Token budgets for thinking mode:

548 638 

549* When thinking is **enabled** (via `/config` or `ultrathink`), Claude can use up to **31,999 tokens** from your output budget for internal reasoning639* When thinking is **enabled**, Claude can use up to **31,999 tokens** from your output budget for internal reasoning

550* When thinking is **disabled**, Claude uses **0 tokens** for thinking640* When thinking is **disabled** (via toggle or `/config`), Claude uses **0 tokens** for thinking

551 641 

552**Custom token budgets:**642**Limit the thinking budget:**

553 643 

554* You can set a custom thinking token budget using the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables)644* Use the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) to cap the thinking budget

555* This takes highest priority and overrides the default 31,999 token budget645* When set, this value limits the maximum tokens Claude can use for thinking

556* See the [extended thinking documentation](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for valid token ranges646* See the [extended thinking documentation](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for valid token ranges

557 647 

558<Warning>648<Warning>


806 896 

807***897***

808 898 

809## Create custom slash commands

810 

811Claude Code supports custom slash commands that you can create to quickly execute specific prompts or tasks.

812 

813For more details, see the [Slash commands](/en/slash-commands) reference page.

814 

815### Create project-specific commands

816 

817Suppose you want to create reusable slash commands for your project that all team members can use.

818 

819<Steps>

820 <Step title="Create a commands directory in your project">

821 ```bash theme={null}

822 mkdir -p .claude/commands

823 ```

824 </Step>

825 

826 <Step title="Create a Markdown file for each command">

827 ```bash theme={null}

828 echo "Analyze the performance of this code and suggest three specific optimizations:" > .claude/commands/optimize.md

829 ```

830 </Step>

831 

832 <Step title="Use your custom command in Claude Code">

833 ```

834 > /optimize

835 ```

836 </Step>

837</Steps>

838 

839<Tip>

840 Tips:

841 

842 * Command names are derived from the filename (for example, `optimize.md` becomes `/optimize`)

843 * You can organize commands in subdirectories (for example, `.claude/commands/frontend/component.md` creates `/component` with "(project:frontend)" shown in the description)

844 * Project commands are available to everyone who clones the repository

845 * The Markdown file content becomes the prompt sent to Claude when the command is invoked

846</Tip>

847 

848### Add command arguments with \$ARGUMENTS

849 

850Suppose you want to create flexible slash commands that can accept additional input from users.

851 

852<Steps>

853 <Step title="Create a command file with the $ARGUMENTS placeholder">

854 ```bash theme={null}

855 echo 'Find and fix issue #$ARGUMENTS. Follow these steps: 1.

856 Understand the issue described in the ticket 2. Locate the relevant code in

857 our codebase 3. Implement a solution that addresses the root cause 4. Add

858 appropriate tests 5. Prepare a concise PR description' >

859 .claude/commands/fix-issue.md

860 ```

861 </Step>

862 

863 <Step title="Use the command with an issue number">

864 In your Claude session, use the command with arguments.

865 

866 ```

867 > /fix-issue 123

868 ```

869 

870 This replaces \$ARGUMENTS with "123" in the prompt.

871 </Step>

872</Steps>

873 

874<Tip>

875 Tips:

876 

877 * The \$ARGUMENTS placeholder is replaced with any text that follows the command

878 * You can position \$ARGUMENTS anywhere in your command template

879 * Other useful applications: generating test cases for specific functions, creating documentation for components, reviewing code in particular files, or translating content to specified languages

880</Tip>

881 

882### Create personal slash commands

883 

884Suppose you want to create personal slash commands that work across all your projects.

885 

886<Steps>

887 <Step title="Create a commands directory in your home folder">

888 ```bash theme={null}

889 mkdir -p ~/.claude/commands

890 ```

891 </Step>

892 

893 <Step title="Create a Markdown file for each command">

894 ```bash theme={null}

895 echo "Review this code for security vulnerabilities, focusing on:" >

896 ~/.claude/commands/security-review.md

897 ```

898 </Step>

899 

900 <Step title="Use your personal custom command">

901 ```

902 > /security-review

903 ```

904 </Step>

905</Steps>

906 

907<Tip>

908 Tips:

909 

910 * Personal commands show "(user)" in their description when listed with `/help`

911 * Personal commands are only available to you and not shared with your team

912 * Personal commands work across all your projects

913 * You can use these for consistent workflows across different codebases

914</Tip>

915 

916***

917 

918## Ask Claude about its capabilities899## Ask Claude about its capabilities

919 900 

920Claude has built-in access to its documentation and can answer questions about its own features and limitations.901Claude has built-in access to its documentation and can answer questions about its own features and limitations.


930```911```

931 912 

932```913```

933> what slash commands are available?914> what skills are available?

934```915```

935 916 

936```917```

costs.md +103 −56

Details

1# Manage costs effectively1# Manage costs effectively

2 2 

3> Learn how to track and optimize token usage and costs when using Claude Code.3> Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.

4 4 

5Claude Code consumes tokens for each interaction. The average cost is \$6 per developer per day, with daily costs remaining below \$12 for 90% of users.5Claude Code consumes tokens for each interaction. Costs vary based on codebase size, query complexity, and conversation length. The average cost is \$6 per developer per day, with daily costs remaining below \$12 for 90% of users.

6 6 

7For team usage, Claude Code charges by API token consumption. On average, Claude Code costs \~\$100-200/developer per month with Sonnet 4.5 though there is large variance depending on how many instances users are running and whether they're using it in automation.7For team usage, Claude Code charges by API token consumption. On average, Claude Code costs \~\$100-200/developer per month with Sonnet 4.5 though there is large variance depending on how many instances users are running and whether they're using it in automation.

8 8 

9This page covers how to [track your costs](#track-your-costs), [manage costs for teams](#managing-costs-for-teams), and [reduce token usage](#reduce-token-usage).

10 

9## Track your costs11## Track your costs

10 12 

11### Using the `/cost` command13### Using the `/cost` command

12 14 

13<Note>15<Note>

14 The `/cost` command is not intended for Claude Max and Pro subscribers.16 The `/cost` command shows API token usage and is intended for API users. Claude Max and Pro subscribers have usage included in their subscription, so `/cost` data isn't relevant for billing purposes. Subscribers can use `/stats` to view usage patterns.

15</Note>17</Note>

16 18 

17The `/cost` command provides detailed token usage statistics for your current session:19The `/cost` command provides detailed token usage statistics for your current session:


23Total code changes: 0 lines added, 0 lines removed25Total code changes: 0 lines added, 0 lines removed

24```26```

25 27 

26### Additional tracking options28## Managing costs for teams

27 29 

28Check [historical usage](https://support.claude.com/en/articles/9534590-cost-and-usage-reporting-in-console) in the Claude Console (requires Admin or Billing role) and set [workspace spend limits](https://support.claude.com/en/articles/9796807-creating-and-managing-workspaces) for the Claude Code workspace (requires Admin role).30When using Claude API, you can [set workspace spend limits](https://platform.claude.com/docs/en/build-with-claude/workspaces#workspace-limits) on the total Claude Code workspace spend. Admins can [view cost and usage reporting](https://platform.claude.com/docs/en/build-with-claude/workspaces#usage-and-cost-tracking) in the Console.

29 31 

30<Note>32<Note>

31 When you first authenticate Claude Code with your Claude Console account, a workspace called "Claude Code" is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace - it is exclusively for Claude Code authentication and usage.33 When you first authenticate Claude Code with your Claude Console account, a workspace called "Claude Code" is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.

32</Note>34</Note>

33 35 

34## Managing costs for teams36On Bedrock, Vertex, and Foundry, Claude Code does not send metrics from your cloud. To get cost metrics, several large enterprises reported using [LiteLLM](/en/llm-gateway#litellm-configuration), which is an open-source tool that helps companies [track spend by key](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend). This project is unaffiliated with Anthropic and we have not audited its security.

35 

36When using Claude API, you can limit the total Claude Code workspace spend. To configure, [follow these instructions](https://support.claude.com/en/articles/9796807-creating-and-managing-workspaces). Admins can view cost and usage reporting by [following these instructions](https://support.claude.com/en/articles/9534590-cost-and-usage-reporting-in-console).

37 

38On Bedrock and Vertex, Claude Code does not send metrics from your cloud. In order to get cost metrics, several large enterprises reported using [LiteLLM](/en/third-party-integrations#litellm), which is an open-source tool that helps companies [track spend by key](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend). This project is unaffiliated with Anthropic and we have not audited its security.

39 37 

40### Rate limit recommendations38### Rate limit recommendations

41 39 


60 58 

61## Reduce token usage59## Reduce token usage

62 60 

63* **Compact conversations:**61Token costs scale with context size: the more context Claude processes, the more tokens you use. Claude Code automatically optimizes costs through prompt caching (which reduces costs for repeated content like system prompts) and auto-compaction (which summarizes conversation history when approaching context limits).

64 62 

65 * Claude uses auto-compact by default when context exceeds 95% capacity63The following strategies help you keep context small and reduce per-message costs.

66 * Toggle auto-compact: Run `/config` and navigate to "Auto-compact enabled"

67 * Use `/compact` manually when context gets large

68 * Add custom instructions: `/compact Focus on code samples and API usage`

69 * Customize compaction by adding to CLAUDE.md:

70 64 

71 ```markdown theme={null}65### Manage context proactively

72 # Summary instructions

73 66 

74 When you are using compact, please focus on test output and code changes67Use `/cost` to check your current token usage, or [configure your status line](/en/statusline#context-window-usage) to display it continuously.

75 ```

76 68 

77* **Write specific queries:** Avoid vague requests that trigger unnecessary scanning69* **Clear between tasks**: Use `/clear` to start fresh when switching to unrelated work. Stale context wastes tokens on every subsequent message. Use `/rename` before clearing so you can easily find the session later, then `/resume` to return to it.

70* **Add custom compaction instructions**: `/compact Focus on code samples and API usage` tells Claude what to preserve during summarization.

78 71 

79* **Break down complex tasks:** Split large tasks into focused interactions72You can also customize compaction behavior in your CLAUDE.md:

80 73 

81* **Clear history between tasks:** Use `/clear` to reset context74```markdown theme={null}

75# Compact instructions

82 76 

83Costs can vary significantly based on:77When you are using compact, please focus on test output and code changes

78```

84 79 

85* Size of codebase being analyzed80### Choose the right model

86* Complexity of queries

87* Number of files being searched or modified

88* Length of conversation history

89* Frequency of compacting conversations

90 81 

91## Background token usage82Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning. Use `/model` to switch models mid-session, or set a default in `/config`. For simple subagent tasks, specify `model: haiku` in your [subagent configuration](/en/sub-agents#choose-a-model).

92 83 

93Claude Code uses tokens for some background functionality even when idle:84### Reduce MCP server overhead

94 85 

95* **Conversation summarization**: Background jobs that summarize previous conversations for the `claude --resume` feature86Each MCP server adds tool definitions to your context, even when idle. Run `/context` to see what's consuming space.

96* **Command processing**: Some commands like `/cost` may generate requests to check status

97 87 

98These background processes consume a small amount of tokens (typically under \$0.04 per session) even without active interaction.88* **Prefer CLI tools when available**: Tools like `gh`, `aws`, `gcloud`, and `sentry-cli` are more context-efficient than MCP servers because they don't add persistent tool definitions. Claude can run CLI commands directly without the overhead.

89* **Disable unused servers**: Run `/mcp` to see configured servers and disable any you're not actively using.

90* **Tool search is automatic**: When MCP tool descriptions exceed 10% of your context window, Claude Code automatically defers them and loads tools on-demand via [tool search](/en/mcp#scale-with-mcp-tool-search). Since deferred tools only enter context when actually used, a lower threshold means fewer idle tool definitions consuming space. Set a lower threshold with `ENABLE_TOOL_SEARCH=auto:<N>` (for example, `auto:5` triggers when tools exceed 5% of your context window).

99 91 

100## Tracking version changes and updates92### Offload processing to hooks and skills

101 93 

102### Current version information94Custom [hooks](/en/hooks) can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for `ERROR` and return only matching lines, reducing context from tens of thousands of tokens to hundreds.

103 95 

104To check your current Claude Code version and installation details:96A [skill](/en/skills) can give Claude domain knowledge so it doesn't have to explore. For example, a "codebase-overview" skill could describe your project's architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure.

105 97 

106```bash theme={null}98For example, this PreToolUse hook filters test output to show only failures:

107claude doctor

108```

109 99 

110This command shows your version, installation type, and system information.100<Tabs>

101 <Tab title="settings.json">

102 Add this to your [settings.json](/en/settings#settings-files) to run the hook before every Bash command:

111 103 

112### Understanding changes in Claude Code behavior104 ```json theme={null}

105 {

106 "hooks": {

107 "PreToolUse": [

108 {

109 "matcher": "Bash",

110 "hooks": [

111 {

112 "type": "command",

113 "command": "~/.claude/hooks/filter-test-output.sh"

114 }

115 ]

116 }

117 ]

118 }

119 }

120 ```

121 </Tab>

122 

123 <Tab title="filter-test-output.sh">

124 The hook calls this script, which checks if the command is a test runner and modifies it to show only failures:

125 

126 ```bash theme={null}

127 #!/bin/bash

128 input=$(cat)

129 cmd=$(echo "$input" | jq -r '.tool_input.command')

130 

131 # If running tests, filter to show only failures

132 if [[ "$cmd" =~ ^(npm test|pytest|go test) ]]; then

133 filtered_cmd="$cmd 2>&1 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100"

134 echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"updatedInput\":{\"command\":\"$filtered_cmd\"}}}"

135 else

136 echo "{}"

137 fi

138 ```

139 </Tab>

140</Tabs>

113 141 

114Claude Code regularly receives updates that may change how features work, including cost reporting:142### Move instructions from CLAUDE.md to skills

115 143 

116* **Version tracking**: Use `claude doctor` to see your current version144Your [CLAUDE.md](/en/memory) file is loaded into context at session start. If it contains detailed instructions for specific workflows (like PR reviews or database migrations), those tokens are present even when you're doing unrelated work. [Skills](/en/skills) load on-demand only when invoked, so moving specialized instructions into skills keeps your base context smaller. Aim to keep CLAUDE.md under \~500 lines by including only essentials.

117* **Behavior changes**: Features like `/cost` may display information differently across versions

118* **Documentation access**: Claude always has access to the latest documentation, which can help explain current feature behavior

119 145 

120### When cost reporting changes146### Adjust extended thinking

121 147 

122If you notice changes in how costs are displayed (such as the `/cost` command showing different information):148Extended thinking is enabled by default with a budget of 31,999 tokens because it significantly improves performance on complex planning and reasoning tasks. However, thinking tokens are billed as output tokens, so for simpler tasks where deep reasoning isn't needed, you can reduce costs by disabling it in `/config` or lowering the budget (for example, `MAX_THINKING_TOKENS=8000`).

123 149 

1241. **Verify your version**: Run `claude doctor` to confirm your current version150### Delegate verbose operations to subagents

1252. **Consult documentation**: Ask Claude directly about current feature behavior, as it has access to up-to-date documentation

1263. **Contact support**: For specific billing questions, contact Anthropic support through your Console account

127 151 

128<Note>152Running tests, fetching documentation, or processing log files can consume significant context. Delegate these to [subagents](/en/sub-agents#isolate-high-volume-operations) so the verbose output stays in the subagent's context while only a summary returns to your main conversation.

129 For team deployments, we recommend starting with a small pilot group to153 

130 establish usage patterns before wider rollout.154### Write specific prompts

131</Note>155 

156Vague requests like "improve this codebase" trigger broad scanning. Specific requests like "add input validation to the login function in auth.ts" let Claude work efficiently with minimal file reads.

157 

158### Work efficiently on complex tasks

159 

160For longer or more complex work, these habits help avoid wasted tokens from going down the wrong path:

161 

162* **Use plan mode for complex tasks**: Press Shift+Tab to enter [plan mode](/en/common-workflows#use-plan-mode-for-safe-code-analysis) before implementation. Claude explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong.

163* **Course-correct early**: If Claude starts heading the wrong direction, press Escape to stop immediately. Use `/rewind` or double-tap Escape to restore conversation and code to a previous checkpoint.

164* **Give verification targets**: Include test cases, paste screenshots, or define expected output in your prompt. When Claude can verify its own work, it catches issues before you need to request fixes.

165* **Test incrementally**: Write one file, test it, then continue. This catches issues early when they're cheap to fix.

166 

167## Background token usage

168 

169Claude Code uses tokens for some background functionality even when idle:

170 

171* **Conversation summarization**: Background jobs that summarize previous conversations for the `claude --resume` feature

172* **Command processing**: Some commands like `/cost` may generate requests to check status

173 

174These background processes consume a small amount of tokens (typically under \$0.04 per session) even without active interaction.

175 

176## Understanding changes in Claude Code behavior

177 

178Claude Code regularly receives updates that may change how features work, including cost reporting. Run `claude --version` to check your current version. For specific billing questions, contact Anthropic support through your [Console account](https://platform.claude.com/login). For team deployments, start with a small pilot group to establish usage patterns before wider rollout.

132 179 

133 180 

134---181---

desktop.md +20 −8

Details

8 8 

9The Claude desktop app provides a native interface for running multiple Claude Code sessions on your local machine and seamless integration with Claude Code on the web.9The Claude desktop app provides a native interface for running multiple Claude Code sessions on your local machine and seamless integration with Claude Code on the web.

10 10 

11## Features11## Installation

12 12 

13Claude Code on desktop provides:13Download the Claude desktop app for your platform:

14 14 

15* **Parallel local sessions with `git` worktrees**: Run multiple Claude Code sessions simultaneously in the same repository, each with its own isolated `git` worktree15<CardGroup cols={2}>

16* **Include files listed in your `.gitignore` in your worktrees**: Automatically copy files in your `.gitignore`, like `.env`, to new worktrees using `.worktreeinclude`16 <Card title="macOS" icon="apple" href="https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs">

17* **Launch Claude Code on the web**: Kick off secure cloud sessions directly from the desktop app17 Universal build for Intel and Apple Silicon

18 </Card>

18 19 

19## Installation20 <Card title="Windows" icon="windows" href="https://claude.ai/api/desktop/win32/x64/exe/latest/redirect?utm_source=claude_code&utm_medium=docs">

21 For x64 processors

22 </Card>

23</CardGroup>

20 24 

21Download and install the Claude Desktop app from [claude.ai/download](https://claude.ai/download)25For Windows ARM64, [download here](https://claude.ai/api/desktop/win32/arm64/exe/latest/redirect?utm_source=claude_code\&utm_medium=docs).

22 26 

23<Note>27<Note>

24 Local sessions are not available on Windows arm64 architectures.28 Local sessions are not available on Windows ARM64.

25</Note>29</Note>

26 30 

31## Features

32 

33Claude Code on desktop provides:

34 

35* **Parallel local sessions with `git` worktrees**: Run multiple Claude Code sessions simultaneously in the same repository, each with its own isolated `git` worktree

36* **Include files listed in your `.gitignore` in your worktrees**: Automatically copy files in your `.gitignore`, like `.env`, to new worktrees using `.worktreeinclude`

37* **Launch Claude Code on the web**: Kick off secure cloud sessions directly from the desktop app

38 

27## Using Git worktrees39## Using Git worktrees

28 40 

29Claude Code on desktop enables running multiple Claude Code sessions in the same repository using Git worktrees. Each session gets its own isolated worktree, allowing Claude to work on different tasks without conflicts. The default location for worktrees is `~/.claude-worktrees` but this can be configured in your settings on the Claude desktop app.41Claude Code on desktop enables running multiple Claude Code sessions in the same repository using Git worktrees. Each session gets its own isolated worktree, allowing Claude to work on different tasks without conflicts. The default location for worktrees is `~/.claude-worktrees` but this can be configured in your settings on the Claude desktop app.

Details

2 2 

3> Find and install plugins from marketplaces to extend Claude Code with new commands, agents, and capabilities.3> Find and install plugins from marketplaces to extend Claude Code with new commands, agents, and capabilities.

4 4 

5Plugins extend Claude Code with custom commands, agents, hooks, and MCP servers. Plugin marketplaces are catalogs that help you discover and install these extensions without building them yourself.5Plugins extend Claude Code with skills, agents, hooks, and MCP servers. Plugin marketplaces are catalogs that help you discover and install these extensions without building them yourself.

6 6 

7Looking to create and distribute your own marketplace? See [Create and distribute a plugin marketplace](/en/plugin-marketplaces).7Looking to create and distribute your own marketplace? See [Create and distribute a plugin marketplace](/en/plugin-marketplaces).

8 8 


210/plugin marketplace add ./path/to/marketplace.json210/plugin marketplace add ./path/to/marketplace.json

211```211```

212 212 

213Or add a remote `marketplace.json` file via URL:213### Add from remote URLs

214 

215Add a remote `marketplace.json` file via URL:

214 216 

215```shell theme={null}217```shell theme={null}

216/plugin marketplace add https://example.com/marketplace.json218/plugin marketplace add https://example.com/marketplace.json

217```219```

218 220 

221<Note>

222 URL-based marketplaces have some limitations compared to Git-based marketplaces. If you encounter "path not found" errors when installing plugins, see [Troubleshooting](/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces).

223</Note>

224 

219## Install plugins225## Install plugins

220 226 

221Once you've added marketplaces, you can install plugins directly (installs to user scope by default):227Once you've added marketplaces, you can install plugins directly (installs to user scope by default):


230* **Project scope**: install for all collaborators on this repository (adds to `.claude/settings.json`)236* **Project scope**: install for all collaborators on this repository (adds to `.claude/settings.json`)

231* **Local scope**: install for yourself in this repository only (not shared with collaborators)237* **Local scope**: install for yourself in this repository only (not shared with collaborators)

232 238 

233You may also see plugins with **managed** scope—these are installed by enterprise administrators via [managed settings](/en/settings#enterprise-managed-policy-settings) and cannot be modified.239You may also see plugins with **managed** scope—these are installed by administrators via [managed settings](/en/settings#settings-files) and cannot be modified.

234 240 

235Run `/plugin` and go to the **Installed** tab to see your plugins grouped by scope.241Run `/plugin` and go to the **Installed** tab to see your plugins grouped by scope.

236 242 


356* **Marketplace not loading**: Verify the URL is accessible and that `.claude-plugin/marketplace.json` exists at the path362* **Marketplace not loading**: Verify the URL is accessible and that `.claude-plugin/marketplace.json` exists at the path

357* **Plugin installation failures**: Check that plugin source URLs are accessible and repositories are public (or you have access)363* **Plugin installation failures**: Check that plugin source URLs are accessible and repositories are public (or you have access)

358* **Files not found after installation**: Plugins are copied to a cache, so paths referencing files outside the plugin directory won't work364* **Files not found after installation**: Plugins are copied to a cache, so paths referencing files outside the plugin directory won't work

359* **Plugin Skills not appearing**: Clear the cache with `rm -rf ~/.claude/plugins/cache`, restart Claude Code, and reinstall the plugin. See [Plugin Skills not appearing](/en/skills#plugin-skills-not-appearing-after-installation) for details.365* **Plugin skills not appearing**: Clear the cache with `rm -rf ~/.claude/plugins/cache`, restart Claude Code, and reinstall the plugin.

360 366 

361For detailed troubleshooting with solutions, see [Troubleshooting](/en/plugin-marketplaces#troubleshooting) in the marketplace guide. For debugging tools, see [Debugging and development tools](/en/plugins-reference#debugging-and-development-tools).367For detailed troubleshooting with solutions, see [Troubleshooting](/en/plugin-marketplaces#troubleshooting) in the marketplace guide. For debugging tools, see [Debugging and development tools](/en/plugins-reference#debugging-and-development-tools).

362 368 

363## Next steps369## Next steps

364 370 

365* **Build your own plugins**: See [Plugins](/en/plugins) to create custom commands, agents, and hooks371* **Build your own plugins**: See [Plugins](/en/plugins) to create skills, agents, and hooks

366* **Create a marketplace**: See [Create a plugin marketplace](/en/plugin-marketplaces) to distribute plugins to your team or community372* **Create a marketplace**: See [Create a plugin marketplace](/en/plugin-marketplaces) to distribute plugins to your team or community

367* **Technical reference**: See [Plugins reference](/en/plugins-reference) for complete specifications373* **Technical reference**: See [Plugins reference](/en/plugins-reference) for complete specifications

368 374 

features-overview.md +239 −0 added

Details

1# Extend Claude Code

2 

3> Understand when to use CLAUDE.md, Skills, subagents, hooks, MCP, and plugins.

4 

5Claude Code combines a model that reasons about your code with [built-in tools](/en/how-claude-code-works#tools) for file operations, search, execution, and web access. The built-in tools cover most coding tasks. This guide covers the extension layer: features you add to customize what Claude knows, connect it to external services, and automate workflows.

6 

7<Note>

8 For how the core agentic loop works, see [How Claude Code works](/en/how-claude-code-works).

9</Note>

10 

11**New to Claude Code?** Start with [CLAUDE.md](/en/memory) for project conventions. Add other extensions as you need them.

12 

13## Overview

14 

15Extensions plug into different parts of the agentic loop:

16 

17* **[CLAUDE.md](/en/memory)** adds persistent context Claude sees every session

18* **[Skills](/en/skills)** add reusable knowledge and invocable workflows

19* **[MCP](/en/mcp)** connects Claude to external services and tools

20* **[Subagents](/en/sub-agents)** run their own loops in isolated context, returning summaries

21* **[Hooks](/en/hooks)** run outside the loop entirely as deterministic scripts

22* **[Plugins](/en/plugins)** and **[marketplaces](/en/plugin-marketplaces)** package and distribute these features

23 

24[Skills](/en/skills) are the most flexible extension. A skill is a markdown file containing knowledge, workflows, or instructions. You can invoke skills with a slash command like `/deploy`, or Claude can load them automatically when relevant. Skills can run in your current conversation or in an isolated context via subagents.

25 

26## Match features to your goal

27 

28Features range from always-on context that Claude sees every session, to on-demand capabilities you or Claude can invoke, to background automation that runs on specific events. The table below shows what's available and when each one makes sense.

29 

30| Feature | What it does | When to use it | Example |

31| ------------- | ---------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- |

32| **CLAUDE.md** | Persistent context loaded every conversation | Project conventions, "always do X" rules | "Use pnpm, not npm. Run tests before committing." |

33| **Skill** | Instructions, knowledge, and workflows Claude can use | Reusable content, reference docs, repeatable tasks | `/review` runs your code review checklist; API docs skill with endpoint patterns |

34| **Subagent** | Isolated execution context that returns summarized results | Context isolation, parallel tasks, specialized workers | Research task that reads many files but returns only key findings |

35| **MCP** | Connect to external services | External data or actions | Query your database, post to Slack, control a browser |

36| **Hook** | Deterministic script that runs on events | Predictable automation, no LLM involved | Run ESLint after every file edit |

37 

38**[Plugins](/en/plugins)** are the packaging layer. A plugin bundles skills, hooks, subagents, and MCP servers into a single installable unit. Plugin skills are namespaced (like `/my-plugin:review`) so multiple plugins can coexist. Use plugins when you want to reuse the same setup across multiple repositories or distribute to others via a **[marketplace](/en/plugin-marketplaces)**.

39 

40### Compare similar features

41 

42Some features can seem similar. Here's how to tell them apart.

43 

44<Tabs>

45 <Tab title="Skill vs Subagent">

46 Skills and subagents solve different problems:

47 

48 * **Skills** are reusable content you can load into any context

49 * **Subagents** are isolated workers that run separately from your main conversation

50 

51 | Aspect | Skill | Subagent |

52 | --------------- | ---------------------------------------------- | ---------------------------------------------------------------- |

53 | **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |

54 | **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |

55 | **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |

56 

57 **Skills can be reference or action.** Reference skills provide knowledge Claude uses throughout your session (like your API style guide). Action skills tell Claude to do something specific (like `/deploy` that runs your deployment workflow).

58 

59 **Use a subagent** when you need context isolation. The subagent might read dozens of files or run extensive searches, but your main conversation only receives a summary. Custom subagents can have their own instructions and can preload skills.

60 

61 **They can combine.** A subagent can preload specific skills (`skills:` field). A skill can run in isolated context using `context: fork`. See [Skills](/en/skills) for details.

62 </Tab>

63 

64 <Tab title="CLAUDE.md vs Skill">

65 Both store instructions, but they load differently and serve different purposes.

66 

67 | Aspect | CLAUDE.md | Skill |

68 | ------------------------- | ---------------------------- | --------------------------------------- |

69 | **Loads** | Every session, automatically | On demand |

70 | **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |

71 | **Can trigger workflows** | No | Yes, with `/<name>` |

72 | **Best for** | "Always do X" rules | Reference material, invocable workflows |

73 

74 **Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.

75 

76 **Put it in a skill** if it's reference material Claude needs sometimes (API docs, style guides) or a workflow you trigger with `/<name>` (deploy, review, release).

77 

78 **Rule of thumb:** Keep CLAUDE.md under \~500 lines. If it's growing, move reference content to skills.

79 </Tab>

80 

81 <Tab title="MCP vs Skill">

82 MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.

83 

84 | Aspect | MCP | Skill |

85 | -------------- | ---------------------------------------------------- | ------------------------------------------------------- |

86 | **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |

87 | **Provides** | Tools and data access | Knowledge, workflows, reference material |

88 | **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |

89 

90 These solve different problems and work well together:

91 

92 **MCP** gives Claude the ability to interact with external systems. Without MCP, Claude can't query your database or post to Slack.

93 

94 **Skills** give Claude knowledge about how to use those tools effectively, plus workflows you can trigger with `/<name>`. A skill might include your team's database schema and query patterns, or a `/post-to-slack` workflow with your team's message formatting rules.

95 

96 Example: An MCP server connects Claude to your database. A skill teaches Claude your data model, common query patterns, and which tables to use for different tasks.

97 </Tab>

98</Tabs>

99 

100### Combine features

101 

102Each extension solves a different problem: CLAUDE.md handles always-on context, skills handle on-demand knowledge and workflows, MCP handles external connections, subagents handle isolation, and hooks handle automation. Real setups combine them based on your workflow.

103 

104For example, you might use CLAUDE.md for project conventions, a skill for your deployment workflow, MCP to connect to your database, and a hook to run linting after every edit. Each feature handles what it's best at.

105 

106| Pattern | How it works | Example |

107| ---------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |

108| **Skill + MCP** | MCP provides the connection; a skill teaches Claude how to use it well | MCP connects to your database, a skill documents your schema and query patterns |

109| **Skill + Subagent** | A skill spawns subagents for parallel work | `/review` skill kicks off security, performance, and style subagents that work in isolated context |

110| **CLAUDE.md + Skills** | CLAUDE.md holds always-on rules; skills hold reference material loaded on demand | CLAUDE.md says "follow our API conventions," a skill contains the full API style guide |

111| **Hook + MCP** | A hook triggers external actions through MCP | Post-edit hook sends a Slack notification when Claude modifies critical files |

112 

113## Understand context costs

114 

115Every feature you add consumes some of Claude's context. Too much can fill up your context window, but it can also add noise that makes Claude less effective; skills may not trigger correctly, or Claude may lose track of your conventions. Understanding these trade-offs helps you build an effective setup.

116 

117### Context cost by feature

118 

119Each feature has a different loading strategy and context cost:

120 

121| Feature | When it loads | What loads | Context cost |

122| --------------- | ------------------------- | --------------------------------------------- | -------------------------------------------- |

123| **CLAUDE.md** | Session start | Full content | Every request |

124| **Skills** | Session start + when used | Descriptions at start, full content when used | Low (descriptions every request)\* |

125| **MCP servers** | Session start | All tool definitions and schemas | Every request |

126| **Subagents** | When spawned | Fresh context with specified skills | Isolated from main session |

127| **Hooks** | On trigger | Nothing (runs externally) | Zero, unless hook returns additional context |

128 

129\*By default, skill descriptions load at session start so Claude can decide when to use them. Set `disable-model-invocation: true` in a skill's frontmatter to hide it from Claude entirely until you invoke it manually. This reduces context cost to zero for skills you only trigger yourself.

130 

131### Understand how features load

132 

133Each feature loads at different points in your session. The tabs below explain when each one loads and what goes into context.

134 

135<img src="https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=bd2e24b8e6a99b31ecfffb63f5b23bf5" alt="Context loading: CLAUDE.md and MCP load at session start and stay in every request. Skills load descriptions at start, full content on invocation. Subagents get isolated context. Hooks run externally." data-og-width="720" width="720" data-og-height="410" height="410" data-path="images/context-loading.svg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?w=280&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=aebaadd1f484f285dd9cb4e0ea6d49b9 280w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?w=560&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=030c9b46126d750de315612560082727 560w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?w=840&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=6c73f8b0389da4f3190843140c810fe9 840w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?w=1100&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=9844c55d08d2c386672447f2e8518669 1100w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?w=1650&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=21a9522d0e4bd10ced146aab850ede76 1650w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/context-loading.svg?w=2500&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=d318525915aee1a1a6a4215cfaa61fb9 2500w" />

136 

137<Tabs>

138 <Tab title="CLAUDE.md">

139 **When:** Session start

140 

141 **What loads:** Full content of all CLAUDE.md files (managed, user, and project levels).

142 

143 **Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How Claude looks up memories](/en/memory#how-claude-looks-up-memories) for details.

144 

145 <Tip>Keep CLAUDE.md under \~500 lines. Move reference material to skills, which load on-demand.</Tip>

146 </Tab>

147 

148 <Tab title="Skills">

149 Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Some are built-in; you can also create your own. Claude uses skills when appropriate, or you can invoke one directly.

150 

151 **When:** Depends on the skill's configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.

152 

153 **What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.

154 

155 **How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`. Skills with `disable-model-invocation: true` are invisible to Claude until you invoke them.

156 

157 **Context cost:** Low until used. User-only skills have zero cost until invoked.

158 

159 **In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills passed to a subagent are fully preloaded into its context at launch. Subagents don't inherit skills from the main session; you must specify them explicitly.

160 

161 <Tip>Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures only you trigger them.</Tip>

162 </Tab>

163 

164 <Tab title="MCP servers">

165 **When:** Session start.

166 

167 **What loads:** All tool definitions and JSON schemas from connected servers.

168 

169 **Context cost:** [Tool search](/en/mcp#scale-with-mcp-tool-search) (enabled by default) loads MCP tools up to 10% of context and defers the rest until needed.

170 

171 **Reliability note:** MCP connections can fail silently mid-session. If a server disconnects, its tools disappear without warning. Claude may try to use a tool that no longer exists. If you notice Claude failing to use an MCP tool it previously could access, check the connection with `/mcp`.

172 

173 <Tip>Run `/mcp` to see token costs per server. Disconnect servers you're not actively using.</Tip>

174 </Tab>

175 

176 <Tab title="Subagents">

177 **When:** On demand, when you or Claude spawns one for a task.

178 

179 **What loads:** Fresh, isolated context containing:

180 

181 * The system prompt (shared with parent for cache efficiency)

182 * Full content of skills listed in the agent's `skills:` field

183 * CLAUDE.md and git status (inherited from parent)

184 * Whatever context the lead agent passes in the prompt

185 

186 **Context cost:** Isolated from main session. Subagents don't inherit your conversation history or invoked skills.

187 

188 <Tip>Use subagents for work that doesn't need your full conversation context. Their isolation prevents bloating your main session.</Tip>

189 </Tab>

190 

191 <Tab title="Hooks">

192 **When:** On trigger. Hooks can run before or after tool executions, at session start, before compaction, and at other lifecycle events. See [Hooks](/en/hooks) for the full list.

193 

194 **What loads:** Nothing by default. Hooks run as external scripts.

195 

196 **Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.

197 

198 <Tip>Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.</Tip>

199 </Tab>

200</Tabs>

201 

202## Learn more

203 

204Each feature has its own guide with setup instructions, examples, and configuration options.

205 

206<CardGroup cols={2}>

207 <Card title="CLAUDE.md" icon="file-lines" href="/en/memory">

208 Store project context, conventions, and instructions

209 </Card>

210 

211 <Card title="Skills" icon="brain" href="/en/skills">

212 Give Claude domain expertise and reusable workflows

213 </Card>

214 

215 <Card title="Subagents" icon="users" href="/en/sub-agents">

216 Offload work to isolated context

217 </Card>

218 

219 <Card title="MCP" icon="plug" href="/en/mcp">

220 Connect Claude to external services

221 </Card>

222 

223 <Card title="Hooks" icon="bolt" href="/en/hooks">

224 Run scripts on Claude Code events

225 </Card>

226 

227 <Card title="Plugins" icon="puzzle-piece" href="/en/plugins">

228 Bundle and share feature sets

229 </Card>

230 

231 <Card title="Marketplaces" icon="store" href="/en/plugin-marketplaces">

232 Host and distribute plugin collections

233 </Card>

234</CardGroup>

235 

236 

237---

238 

239> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://code.claude.com/docs/llms.txt

Details

156 # Responds to @claude mentions in comments156 # Responds to @claude mentions in comments

157```157```

158 158 

159### Using slash commands159### Using skills

160 160 

161```yaml theme={null}161```yaml theme={null}

162name: Code Review162name: Code Review


266Key features:266Key features:

267 267 

268* **Unified prompt interface** - Use `prompt` for all instructions268* **Unified prompt interface** - Use `prompt` for all instructions

269* **Slash commands** - Pre-built prompts like `/review` or `/fix`269* **Commands** - Prebuilt prompts like `/review` or `/fix`

270* **CLI passthrough** - Any Claude Code CLI argument via `claude_args`270* **CLI passthrough** - Any Claude Code CLI argument via `claude_args`

271* **Flexible triggers** - Works with any GitHub event271* **Flexible triggers** - Works with any GitHub event

272 272 


624The Claude Code Action v1 uses a simplified configuration:624The Claude Code Action v1 uses a simplified configuration:

625 625 

626| Parameter | Description | Required |626| Parameter | Description | Required |

627| ------------------- | ----------------------------------------------- | -------- |627| ------------------- | ------------------------------------------------------ | -------- |

628| `prompt` | Instructions for Claude (text or slash command) | No\* |628| `prompt` | Instructions for Claude (text or skill like `/review`) | No\* |

629| `claude_args` | CLI arguments passed to Claude Code | No |629| `claude_args` | CLI arguments passed to Claude Code | No |

630| `anthropic_api_key` | Claude API key | Yes\*\* |630| `anthropic_api_key` | Claude API key | Yes\*\* |

631| `github_token` | GitHub token for API access | No |631| `github_token` | GitHub token for API access | No |

gitlab-ci-cd.md +5 −5

Details

77 before_script:77 before_script:

78 - apk update78 - apk update

79 - apk add --no-cache git curl bash79 - apk add --no-cache git curl bash

80 - npm install -g @anthropic-ai/claude-code80 - curl -fsSL https://claude.ai/install.sh | bash

81 script:81 script:

82 # Optional: start a GitLab MCP server if your setup provides one82 # Optional: start a GitLab MCP server if your setup provides one

83 - /bin/gitlab-mcp-server || true83 - /bin/gitlab-mcp-server || true


255 before_script:255 before_script:

256 - apk update256 - apk update

257 - apk add --no-cache git curl bash257 - apk add --no-cache git curl bash

258 - npm install -g @anthropic-ai/claude-code258 - curl -fsSL https://claude.ai/install.sh | bash

259 script:259 script:

260 - /bin/gitlab-mcp-server || true260 - /bin/gitlab-mcp-server || true

261 - >261 - >


289 before_script:289 before_script:

290 - apk add --no-cache bash curl jq git python3 py3-pip290 - apk add --no-cache bash curl jq git python3 py3-pip

291 - pip install --no-cache-dir awscli291 - pip install --no-cache-dir awscli

292 - npm install -g @anthropic-ai/claude-code292 - curl -fsSL https://claude.ai/install.sh | bash

293 # Exchange GitLab OIDC token for AWS credentials293 # Exchange GitLab OIDC token for AWS credentials

294 - export AWS_WEB_IDENTITY_TOKEN_FILE="${CI_JOB_JWT_FILE:-/tmp/oidc_token}"294 - export AWS_WEB_IDENTITY_TOKEN_FILE="${CI_JOB_JWT_FILE:-/tmp/oidc_token}"

295 - if [ -n "${CI_JOB_JWT_V2}" ]; then printf "%s" "$CI_JOB_JWT_V2" > "$AWS_WEB_IDENTITY_TOKEN_FILE"; fi295 - if [ -n "${CI_JOB_JWT_V2}" ]; then printf "%s" "$CI_JOB_JWT_V2" > "$AWS_WEB_IDENTITY_TOKEN_FILE"; fi


339 rules:339 rules:

340 - if: '$CI_PIPELINE_SOURCE == "web"'340 - if: '$CI_PIPELINE_SOURCE == "web"'

341 before_script:341 before_script:

342 - apt-get update && apt-get install -y git nodejs npm && apt-get clean342 - apt-get update && apt-get install -y git && apt-get clean

343 - npm install -g @anthropic-ai/claude-code343 - curl -fsSL https://claude.ai/install.sh | bash

344 # Authenticate to Google Cloud via WIF (no downloaded keys)344 # Authenticate to Google Cloud via WIF (no downloaded keys)

345 - >345 - >

346 gcloud auth login --cred-file=<(cat <<EOF346 gcloud auth login --cred-file=<(cat <<EOF

headless.md +3 −1

Details

91 --allowedTools "Bash(git diff:*),Bash(git log:*),Bash(git status:*),Bash(git commit:*)"91 --allowedTools "Bash(git diff:*),Bash(git log:*),Bash(git status:*),Bash(git commit:*)"

92```92```

93 93 

94The `--allowedTools` flag uses [permission rule syntax](/en/settings#permission-rule-syntax). The `:*` suffix enables prefix matching, so `Bash(git diff:*)` allows any command starting with `git diff`.

95 

94<Note>96<Note>

95 [Slash commands](/en/slash-commands) like `/commit` are only available in interactive mode. In `-p` mode, describe the task you want to accomplish instead.97 User-invoked [skills](/en/skills) like `/commit` and [built-in commands](/en/interactive-mode#built-in-commands) are only available in interactive mode. In `-p` mode, describe the task you want to accomplish instead.

96</Note>98</Note>

97 99 

98### Customize the system prompt100### Customize the system prompt

hooks.md +199 −22

Details

13* `~/.claude/settings.json` - User settings13* `~/.claude/settings.json` - User settings

14* `.claude/settings.json` - Project settings14* `.claude/settings.json` - Project settings

15* `.claude/settings.local.json` - Local project settings (not committed)15* `.claude/settings.local.json` - Local project settings (not committed)

16* Enterprise managed policy settings16* Managed policy settings

17 17 

18<Note>18<Note>

19 Enterprise administrators can use `allowManagedHooksOnly` to block user, project, and plugin hooks. See [Hook configuration](/en/settings#hook-configuration).19 Enterprise administrators can use `allowManagedHooksOnly` to block user, project, and plugin hooks. See [Hook configuration](/en/settings#hook-configuration).


53 * `prompt`: (For `type: "prompt"`) The prompt to send to the LLM for evaluation53 * `prompt`: (For `type: "prompt"`) The prompt to send to the LLM for evaluation

54 * `timeout`: (Optional) How long a hook should run, in seconds, before canceling that specific hook54 * `timeout`: (Optional) How long a hook should run, in seconds, before canceling that specific hook

55 55 

56For events like `UserPromptSubmit`, `Stop`, and `SubagentStop`56For events like `UserPromptSubmit`, `Stop`, `SubagentStop`, and `Setup`

57that don't use matchers, you can omit the matcher field:57that don't use matchers, you can omit the matcher field:

58 58 

59```json theme={null}59```json theme={null}


146 146 

147See the [plugin components reference](/en/plugins-reference#hooks) for details on creating plugin hooks.147See the [plugin components reference](/en/plugins-reference#hooks) for details on creating plugin hooks.

148 148 

149### Hooks in skills and agents

150 

151In addition to settings files and plugins, hooks can be defined directly in [skills](/en/skills) and [subagents](/en/sub-agents) using frontmatter. These hooks are scoped to the component's lifecycle and only run when that component is active.

152 

153**Supported events**: `PreToolUse`, `PostToolUse`, and `Stop`

154 

155**Example in a Skill**:

156 

157```yaml theme={null}

158---

159name: secure-operations

160description: Perform operations with security checks

161hooks:

162 PreToolUse:

163 - matcher: "Bash"

164 hooks:

165 - type: command

166 command: "./scripts/security-check.sh"

167---

168```

169 

170**Example in an agent**:

171 

172```yaml theme={null}

173---

174name: code-reviewer

175description: Review code changes

176hooks:

177 PostToolUse:

178 - matcher: "Edit|Write"

179 hooks:

180 - type: command

181 command: "./scripts/run-linter.sh"

182---

183```

184 

185Component-scoped hooks follow the same configuration format as settings-based hooks but are automatically cleaned up when the component finishes executing.

186 

187**Additional option for skills:**

188 

189* `once`: Set to `true` to run the hook only once per session. After the first successful execution, the hook is removed. Note: This option is currently only supported for skills, not for agents.

190 

149## Prompt-Based Hooks191## Prompt-Based Hooks

150 192 

151In addition to bash command hooks (`type: "command"`), Claude Code supports prompt-based hooks (`type: "prompt"`) that use an LLM to evaluate whether to allow or block an action. Prompt-based hooks are currently only supported for `Stop` and `SubagentStop` hooks, where they enable intelligent, context-aware decisions.193In addition to bash command hooks (`type: "command"`), Claude Code supports prompt-based hooks (`type: "prompt"`) that use an LLM to evaluate whether to allow or block an action. Prompt-based hooks are currently only supported for `Stop` and `SubagentStop` hooks, where they enable intelligent, context-aware decisions.


191 233 

192```json theme={null}234```json theme={null}

193{235{

194 "decision": "approve" | "block",236 "ok": true | false,

195 "reason": "Explanation for the decision",237 "reason": "Explanation for the decision"

196 "continue": false, // Optional: stops Claude entirely

197 "stopReason": "Message shown to user", // Optional: custom stop message

198 "systemMessage": "Warning or context" // Optional: shown to user

199}238}

200```239```

201 240 

202**Response fields:**241**Response fields:**

203 242 

204* `decision`: `"approve"` allows the action, `"block"` prevents it243* `ok`: `true` allows the action, `false` prevents it

205* `reason`: Explanation shown to Claude when decision is `"block"`244* `reason`: Required when `ok` is `false`. Explanation shown to Claude

206* `continue`: (Optional) If `false`, stops Claude's execution entirely

207* `stopReason`: (Optional) Message shown when `continue` is false

208* `systemMessage`: (Optional) Additional message shown to the user

209 245 

210### Supported hook events246### Supported hook events

211 247 


227 "hooks": [263 "hooks": [

228 {264 {

229 "type": "prompt",265 "type": "prompt",

230 "prompt": "You are evaluating whether Claude should stop working. Context: $ARGUMENTS\n\nAnalyze the conversation and determine if:\n1. All user-requested tasks are complete\n2. Any errors need to be addressed\n3. Follow-up work is needed\n\nRespond with JSON: {\"decision\": \"approve\" or \"block\", \"reason\": \"your explanation\"}",266 "prompt": "You are evaluating whether Claude should stop working. Context: $ARGUMENTS\n\nAnalyze the conversation and determine if:\n1. All user-requested tasks are complete\n2. Any errors need to be addressed\n3. Follow-up work is needed\n\nRespond with JSON: {\"ok\": true} to allow stopping, or {\"ok\": false, \"reason\": \"your explanation\"} to continue working.",

231 "timeout": 30267 "timeout": 30

232 }268 }

233 ]269 ]


247 "hooks": [283 "hooks": [

248 {284 {

249 "type": "prompt",285 "type": "prompt",

250 "prompt": "Evaluate if this subagent should stop. Input: $ARGUMENTS\n\nCheck if:\n- The subagent completed its assigned task\n- Any errors occurred that need fixing\n- Additional context gathering is needed\n\nReturn: {\"decision\": \"approve\" or \"block\", \"reason\": \"explanation\"}"286 "prompt": "Evaluate if this subagent should stop. Input: $ARGUMENTS\n\nCheck if:\n- The subagent completed its assigned task\n- Any errors occurred that need fixing\n- Additional context gathering is needed\n\nReturn: {\"ok\": true} to allow stopping, or {\"ok\": false, \"reason\": \"explanation\"} to continue."

251 }287 }

252 ]288 ]

253 }289 }


375* `manual` - Invoked from `/compact`411* `manual` - Invoked from `/compact`

376* `auto` - Invoked from auto-compact (due to full context window)412* `auto` - Invoked from auto-compact (due to full context window)

377 413 

414### Setup

415 

416Runs when Claude Code is invoked with repository setup and maintenance flags (`--init`, `--init-only`, or `--maintenance`). Use this hook for operations you don't want on every session—such as installing dependencies, running migrations, or periodic maintenance tasks.

417 

418<Note>

419 Use **Setup** hooks for one-time or occasional operations (dependency installation, migrations, cleanup). Use **SessionStart** hooks for things you want on every session (loading context, setting environment variables). Setup hooks require explicit flags because running them automatically would slow down every session start.

420</Note>

421 

422**Matchers:**

423 

424* `init` - Invoked from `--init` or `--init-only` flags

425* `maintenance` - Invoked from `--maintenance` flag

426 

427Setup hooks have access to the `CLAUDE_ENV_FILE` environment variable for persisting environment variables, similar to SessionStart hooks.

428 

378### SessionStart429### SessionStart

379 430 

380Runs when Claude Code starts a new session or resumes an existing session (which431Runs when Claude Code starts a new session or resumes an existing session (which

381currently does start a new session under the hood). Useful for loading in432currently does start a new session under the hood). Useful for loading development context like existing issues or recent changes to your codebase, or setting up environment variables.

382development context like existing issues or recent changes to your codebase, installing dependencies, or setting up environment variables.433 

434<Note>

435 For one-time operations like installing dependencies or running migrations, use [Setup hooks](#setup) instead. SessionStart runs on every session, so keep these hooks fast.

436</Note>

383 437 

384**Matchers:**438**Matchers:**

385 439 


466 520 

467### PreToolUse Input521### PreToolUse Input

468 522 

469The exact schema for `tool_input` depends on the tool.523The exact schema for `tool_input` depends on the tool. Here are examples for commonly hooked tools.

524 

525#### Bash tool

526 

527The Bash tool is the most commonly hooked tool for command validation:

528 

529```json theme={null}

530{

531 "session_id": "abc123",

532 "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",

533 "cwd": "/Users/...",

534 "permission_mode": "default",

535 "hook_event_name": "PreToolUse",

536 "tool_name": "Bash",

537 "tool_input": {

538 "command": "psql -c 'SELECT * FROM users'",

539 "description": "Query the users table",

540 "timeout": 120000

541 },

542 "tool_use_id": "toolu_01ABC123..."

543}

544```

545 

546| Field | Type | Description |

547| :------------------ | :------ | :-------------------------------------------- |

548| `command` | string | The shell command to execute |

549| `description` | string | Optional description of what the command does |

550| `timeout` | number | Optional timeout in milliseconds |

551| `run_in_background` | boolean | Whether to run the command in background |

552 

553#### Write tool

470 554 

471```json theme={null}555```json theme={null}

472{556{


484}568}

485```569```

486 570 

571| Field | Type | Description |

572| :---------- | :----- | :--------------------------------- |

573| `file_path` | string | Absolute path to the file to write |

574| `content` | string | Content to write to the file |

575 

576#### Edit tool

577 

578```json theme={null}

579{

580 "session_id": "abc123",

581 "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",

582 "cwd": "/Users/...",

583 "permission_mode": "default",

584 "hook_event_name": "PreToolUse",

585 "tool_name": "Edit",

586 "tool_input": {

587 "file_path": "/path/to/file.txt",

588 "old_string": "original text",

589 "new_string": "replacement text"

590 },

591 "tool_use_id": "toolu_01ABC123..."

592}

593```

594 

595| Field | Type | Description |

596| :------------ | :------ | :-------------------------------------------------- |

597| `file_path` | string | Absolute path to the file to edit |

598| `old_string` | string | Text to find and replace |

599| `new_string` | string | Replacement text |

600| `replace_all` | boolean | Whether to replace all occurrences (default: false) |

601 

602#### Read tool

603 

604```json theme={null}

605{

606 "session_id": "abc123",

607 "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",

608 "cwd": "/Users/...",

609 "permission_mode": "default",

610 "hook_event_name": "PreToolUse",

611 "tool_name": "Read",

612 "tool_input": {

613 "file_path": "/path/to/file.txt"

614 },

615 "tool_use_id": "toolu_01ABC123..."

616}

617```

618 

619| Field | Type | Description |

620| :---------- | :----- | :----------------------------------------- |

621| `file_path` | string | Absolute path to the file to read |

622| `offset` | number | Optional line number to start reading from |

623| `limit` | number | Optional number of lines to read |

624 

487### PostToolUse Input625### PostToolUse Input

488 626 

489The exact schema for `tool_input` and `tool_response` depends on the tool.627The exact schema for `tool_input` and `tool_response` depends on the tool.


567}705}

568```706```

569 707 

708### Setup Input

709 

710```json theme={null}

711{

712 "session_id": "abc123",

713 "transcript_path": "~/.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",

714 "cwd": "/Users/...",

715 "permission_mode": "default",

716 "hook_event_name": "Setup",

717 "trigger": "init"

718}

719```

720 

721The `trigger` field will be either `"init"` (from `--init` or `--init-only`) or `"maintenance"` (from `--maintenance`).

722 

570### SessionStart Input723### SessionStart Input

571 724 

572```json theme={null}725```json theme={null}


630| `Stop` | Blocks stoppage, shows stderr to Claude |783| `Stop` | Blocks stoppage, shows stderr to Claude |

631| `SubagentStop` | Blocks stoppage, shows stderr to Claude subagent |784| `SubagentStop` | Blocks stoppage, shows stderr to Claude subagent |

632| `PreCompact` | N/A, shows stderr to user only |785| `PreCompact` | N/A, shows stderr to user only |

786| `Setup` | N/A, shows stderr to user only |

633| `SessionStart` | N/A, shows stderr to user only |787| `SessionStart` | N/A, shows stderr to user only |

634| `SessionEnd` | N/A, shows stderr to user only |788| `SessionEnd` | N/A, shows stderr to user only |

635 789 


685 839 

686Additionally, hooks can modify tool inputs before execution using `updatedInput`:840Additionally, hooks can modify tool inputs before execution using `updatedInput`:

687 841 

688* `updatedInput` allows you to modify the tool's input parameters before the tool executes.842* `updatedInput` modifies the tool's input parameters before the tool executes

689* This is most useful with `"permissionDecision": "allow"` to modify and approve tool calls.843* Combine with `"permissionDecision": "allow"` to modify the input and auto-approve the tool call

844* Combine with `"permissionDecision": "ask"` to modify the input and show it to the user for confirmation

845 

846Hooks can also provide context to Claude using `additionalContext`:

847 

848* `"hookSpecificOutput.additionalContext"` adds a string to Claude's context before the tool executes.

690 849 

691```json theme={null}850```json theme={null}

692{851{

693 "hookSpecificOutput": {852 "hookSpecificOutput": {

694 "hookEventName": "PreToolUse",853 "hookEventName": "PreToolUse",

695 "permissionDecision": "allow"854 "permissionDecision": "allow",

696 "permissionDecisionReason": "My reason here",855 "permissionDecisionReason": "My reason here",

697 "updatedInput": {856 "updatedInput": {

698 "field_to_modify": "new value"857 "field_to_modify": "new value"

699 }858 },

859 "additionalContext": "Current environment: production. Proceed with caution."

700 }860 }

701}861}

702```862```


802}962}

803```963```

804 964 

965#### `Setup` Decision Control

966 

967`Setup` hooks allow you to load context and configure the environment during repository initialization or maintenance.

968 

969* `"hookSpecificOutput.additionalContext"` adds the string to the context.

970* Multiple hooks' `additionalContext` values are concatenated.

971* Setup hooks have access to `CLAUDE_ENV_FILE` for persisting environment variables.

972 

973```json theme={null}

974{

975 "hookSpecificOutput": {

976 "hookEventName": "Setup",

977 "additionalContext": "Repository initialized with custom configuration"

978 }

979}

980```

981 

805#### `SessionStart` Decision Control982#### `SessionStart` Decision Control

806 983 

807`SessionStart` hooks allow you to load in context at the start of a session.984`SessionStart` hooks allow you to load in context at the start of a session.


1077* **Output**:1254* **Output**:

1078 * PreToolUse/PermissionRequest/PostToolUse/Stop/SubagentStop: Progress shown in verbose mode (ctrl+o)1255 * PreToolUse/PermissionRequest/PostToolUse/Stop/SubagentStop: Progress shown in verbose mode (ctrl+o)

1079 * Notification/SessionEnd: Logged to debug only (`--debug`)1256 * Notification/SessionEnd: Logged to debug only (`--debug`)

1080 * UserPromptSubmit/SessionStart: stdout added as context for Claude1257 * UserPromptSubmit/SessionStart/Setup: stdout added as context for Claude

1081 1258 

1082## Debugging1259## Debugging

1083 1260 

hooks-guide.md +2 −1

Details

47* **Stop**: Runs when Claude Code finishes responding47* **Stop**: Runs when Claude Code finishes responding

48* **SubagentStop**: Runs when subagent tasks complete48* **SubagentStop**: Runs when subagent tasks complete

49* **PreCompact**: Runs before Claude Code is about to run a compact operation49* **PreCompact**: Runs before Claude Code is about to run a compact operation

50* **Setup**: Runs when Claude Code is invoked with `--init`, `--init-only`, or `--maintenance` flags

50* **SessionStart**: Runs when Claude Code starts a new session or resumes an existing session51* **SessionStart**: Runs when Claude Code starts a new session or resumes an existing session

51* **SessionEnd**: Runs when Claude Code session ends52* **SessionEnd**: Runs when Claude Code session ends

52 53 


64 65 

65### Step 1: Open hooks configuration66### Step 1: Open hooks configuration

66 67 

67Run the `/hooks` [slash command](/en/slash-commands) and select68Run the `/hooks` command and select

68the `PreToolUse` hook event.69the `PreToolUse` hook event.

69 70 

70`PreToolUse` hooks run before tool calls and can block them while providing71`PreToolUse` hooks run before tool calls and can block them while providing

how-claude-code-works.md +239 −0 added

Details

1# How Claude Code works

2 

3> Understand the agentic loop, built-in tools, and how Claude Code interacts with your project.

4 

5Claude Code is an agentic assistant that runs in your terminal. While it excels at coding, it can help with anything you can do from the command line: writing docs, running builds, searching files, researching topics, and more.

6 

7This guide covers the core architecture, built-in capabilities, and [tips for working effectively](#work-effectively-with-claude-code). For step-by-step walkthroughs, see [Common workflows](/en/common-workflows). For extensibility features like skills, MCP, and hooks, see [Extend Claude Code](/en/features-overview).

8 

9## The agentic loop

10 

11When you give Claude a task, it works through three phases: **gather context**, **take action**, and **verify results**. These phases blend together. Claude uses tools throughout, whether searching files to understand your code, editing to make changes, or running tests to check its work.

12 

13<img src="https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=e30acfc80d6ff01ec877dd19c7af58b2" alt="The agentic loop: Your prompt leads to Claude gathering context, taking action, verifying results, and repeating until task complete. You can interrupt at any point." data-og-width="720" width="720" data-og-height="280" height="280" data-path="images/agentic-loop.svg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?w=280&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=8620f6ebce761a1e8bbf7f0a0255cc15 280w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?w=560&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=7b46b5ff4454aa4a03725eee625b39a0 560w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?w=840&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=7fa0397bc37d147e3bf3bb6296c6477f 840w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?w=1100&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=73b2a7040c4c93821c4d5bbee9f4a2d4 1100w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?w=1650&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=17703cbeb6f59b40a00ab24f56d5f8f9 1650w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/agentic-loop.svg?w=2500&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=20dedb60b95d45a1bd60a0cccaf3e1ff 2500w" />

14 

15The loop adapts to what you ask. A question about your codebase might only need context gathering. A bug fix cycles through all three phases repeatedly. A refactor might involve extensive verification. Claude decides what each step requires based on what it learned from the previous step, chaining dozens of actions together and course-correcting along the way.

16 

17You're part of this loop too. You can interrupt at any point to steer Claude in a different direction, provide additional context, or ask it to try a different approach. Claude works autonomously but stays responsive to your input.

18 

19The agentic loop is powered by two components: [models](#models) that reason and [tools](#tools) that act. Claude Code serves as the **agentic harness** around Claude: it provides the tools, context management, and execution environment that turn a language model into a capable coding agent.

20 

21### Models

22 

23Claude Code uses Claude models to understand your code and reason about tasks. Claude can read code in any language, understand how components connect, and figure out what needs to change to accomplish your goal. For complex tasks, it breaks work into steps, executes them, and adjusts based on what it learns.

24 

25[Multiple models](/en/model-config) are available with different tradeoffs. Sonnet handles most coding tasks well. Opus provides stronger reasoning for complex architectural decisions. Switch with `/model` during a session or start with `claude --model <name>`.

26 

27When this guide says "Claude chooses" or "Claude decides," it's the model doing the reasoning.

28 

29### Tools

30 

31Tools are what make Claude Code agentic. Without tools, Claude can only respond with text. With tools, Claude can act: read your code, edit files, run commands, search the web, and interact with external services. Each tool use returns information that feeds back into the loop, informing Claude's next decision.

32 

33The built-in tools generally fall into four categories, each representing a different kind of agency.

34 

35| Category | What Claude can do |

36| ------------------- | ------------------------------------------------------------------- |

37| **File operations** | Read files, edit code, create new files, rename and reorganize |

38| **Search** | Find files by pattern, search content with regex, explore codebases |

39| **Execution** | Run shell commands, start servers, run tests, use git |

40| **Web** | Search the web, fetch documentation, look up error messages |

41 

42These are the primary capabilities. Claude also has tools for spawning subagents, asking you questions, and other orchestration tasks. See [Tools available to Claude](/en/settings#tools-available-to-claude) for the complete list.

43 

44Claude chooses which tools to use based on your prompt and what it learns along the way. When you say "fix the failing tests," Claude might:

45 

461. Run the test suite to see what's failing

472. Read the error output

483. Search for the relevant source files

494. Read those files to understand the code

505. Edit the files to fix the issue

516. Run the tests again to verify

52 

53Each tool use gives Claude new information that informs the next step. This is the agentic loop in action.

54 

55**Extending the base capabilities:** The built-in tools are the foundation. You can extend what Claude knows with [skills](/en/skills), connect to external services with [MCP](/en/mcp), automate workflows with [hooks](/en/hooks), and offload tasks to [subagents](/en/sub-agents). These extensions form a layer on top of the core agentic loop. See [Extend Claude Code](/en/features-overview) for guidance on choosing the right extension for your needs.

56 

57## What Claude can access

58 

59This guide focuses on the terminal. Claude Code also runs in [VS Code, JetBrains IDEs, and other environments](/en/ide-integrations).

60 

61When you run `claude` in a directory, Claude Code gains access to:

62 

63* **Your project.** Files in your directory and subdirectories, plus files elsewhere with your permission.

64* **Your terminal.** Any command you could run: build tools, git, package managers, system utilities, scripts. If you can do it from the command line, Claude can too.

65* **Your git state.** Current branch, uncommitted changes, and recent commit history.

66* **Your [CLAUDE.md](/en/memory).** A markdown file where you store project-specific instructions, conventions, and context that Claude should know every session.

67* **Extensions you configure.** [MCP servers](/en/mcp) for external services, [skills](/en/skills) for workflows, [subagents](/en/sub-agents) for delegated work, and [Claude in Chrome](/en/chrome) for browser interaction.

68 

69Because Claude sees your whole project, it can work across it. When you ask Claude to "fix the authentication bug," it searches for relevant files, reads multiple files to understand context, makes coordinated edits across them, runs tests to verify the fix, and commits the changes if you ask. This is different from inline code assistants that only see the current file.

70 

71## Work with sessions

72 

73Claude Code saves your conversation locally as you work. Each message, tool use, and result is stored, which enables [rewinding](#undo-changes-with-checkpoints), [resuming, and forking](#resume-or-fork-sessions) sessions. Before Claude makes code changes, it also snapshots the affected files so you can revert if needed.

74 

75**Sessions are ephemeral.** Unlike claude.ai, Claude Code has no persistent memory between sessions. Each new session starts fresh. Claude doesn't "learn" your preferences over time or remember what you worked on last week. If you want Claude to know something across sessions, put it in your [CLAUDE.md](/en/memory).

76 

77### Work across branches

78 

79Each Claude Code conversation is a session tied to your current directory. When you resume, you only see sessions from that directory.

80 

81Claude sees your current branch's files. When you switch branches, Claude sees the new branch's files, but your conversation history stays the same. Claude remembers what you discussed even after switching.

82 

83Since sessions are tied to directories, you can run parallel Claude sessions by using [git worktrees](/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees), which create separate directories for individual branches.

84 

85### Resume or fork sessions

86 

87When you resume a session with `claude --continue` or `claude --resume`, you pick up where you left off using the same session ID. New messages append to the existing conversation. Your full conversation history is restored, but session-scoped permissions are not. You'll need to re-approve those.

88 

89<img src="https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=f671b603cc856119c95475b9084ebfef" alt="Session continuity: resume continues the same session, fork creates a new branch with a new ID." data-og-width="560" width="560" data-og-height="280" height="280" data-path="images/session-continuity.svg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?w=280&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=bddf1f33d419a27d7427acdf06058804 280w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?w=560&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=417478eb9b86003b8eebaac058a8618a 560w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?w=840&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=1d89d26e2c0487f067d187c3fa5f7170 840w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?w=1100&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=8ea739a1f7860e4edbbcf74d444e37b2 1100w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?w=1650&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=9cb5095d6a8920f04c3b78d31a69c809 1650w, https://mintcdn.com/claude-code/ELkJZG54dIaeldDC/images/session-continuity.svg?w=2500&fit=max&auto=format&n=ELkJZG54dIaeldDC&q=85&s=d67e1744e4878813d20c6c3f39d9459d 2500w" />

90 

91To branch off and try a different approach without affecting the original session, use the `--fork-session` flag:

92 

93```bash theme={null}

94claude --continue --fork-session

95```

96 

97This creates a new session ID while preserving the conversation history up to that point. The original session remains unchanged. Like resume, forked sessions don't inherit session-scoped permissions.

98 

99**Same session in multiple terminals**: If you resume the same session in multiple terminals, both terminals write to the same session file. Messages from both get interleaved, like two people writing in the same notebook. Nothing corrupts, but the conversation becomes jumbled. Each terminal only sees its own messages during the session, but if you resume that session later, you'll see everything interleaved. For parallel work from the same starting point, use `--fork-session` to give each terminal its own clean session.

100 

101### The context window

102 

103Claude's context window holds your conversation history, file contents, command outputs, [CLAUDE.md](/en/memory), loaded skills, and system instructions. As you work, context fills up. Claude compacts automatically, but instructions from early in the conversation can get lost. Put persistent rules in CLAUDE.md, and run `/context` to see what's using space.

104 

105#### When context fills up

106 

107Claude Code manages context automatically as you approach the limit. It clears older tool outputs first, then summarizes the conversation if needed. Your requests and key code snippets are preserved; detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history.

108 

109To control what's preserved during compaction, add a "Compact Instructions" section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`).

110 

111Run `/context` to see what's using space. MCP servers add tool definitions to every request, so a few servers can consume significant context before you start working. Run `/mcp` to check per-server costs.

112 

113#### Manage context with skills and subagents

114 

115Beyond compaction, you can use other features to control what loads into context.

116 

117[Skills](/en/skills) load on demand. Claude sees skill descriptions at session start, but the full content only loads when a skill is used. For skills you invoke manually, set `disable-model-invocation: true` to keep descriptions out of context until you need them.

118 

119[Subagents](/en/sub-agents) get their own fresh context, completely separate from your main conversation. Their work doesn't bloat your context. When done, they return a summary. This isolation is why subagents help with long sessions.

120 

121See [context costs](/en/features-overview#understand-context-costs) for what each feature costs, and [reduce token usage](/en/costs#reduce-token-usage) for tips on managing context.

122 

123## Stay safe with checkpoints and permissions

124 

125Claude has two safety mechanisms: checkpoints let you undo file changes, and permissions control what Claude can do without asking.

126 

127### Undo changes with checkpoints

128 

129**Every file edit is reversible.** Before Claude edits any file, it snapshots the current contents. If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo.

130 

131Checkpoints are local to your session, separate from git. They only cover file changes. Actions that affect remote systems (databases, APIs, deployments) can't be checkpointed, which is why Claude asks before running commands with external side effects.

132 

133### Control what Claude can do

134 

135Press `Shift+Tab` to cycle through permission modes:

136 

137* **Default**: Claude asks before file edits and shell commands

138* **Auto-accept edits**: Claude edits files without asking, still asks for commands

139* **Plan mode**: Claude uses read-only tools only, creating a plan you can approve before execution

140 

141You can also allow specific commands in `.claude/settings.json` so Claude doesn't ask each time. This is useful for trusted commands like `npm test` or `git status`. Settings can be scoped from organization-wide policies down to personal preferences. See [Permissions](/en/iam) for details.

142 

143***

144 

145## Work effectively with Claude Code

146 

147These tips help you get better results from Claude Code.

148 

149### Ask Claude Code for help

150 

151Claude Code can teach you how to use it. Ask questions like "how do I set up hooks?" or "what's the best way to structure my CLAUDE.md?" and Claude will explain.

152 

153Built-in commands also guide you through setup:

154 

155* `/init` walks you through creating a CLAUDE.md for your project

156* `/agents` helps you configure custom subagents

157* `/doctor` diagnoses common issues with your installation

158 

159### It's a conversation

160 

161Claude Code is conversational. You don't need perfect prompts. Start with what you want, then refine:

162 

163```

164> Fix the login bug

165 

166[Claude investigates, tries something]

167 

168> That's not quite right. The issue is in the session handling.

169 

170[Claude adjusts approach]

171```

172 

173When the first attempt isn't right, you don't start over. You iterate.

174 

175#### Interrupt and steer

176 

177You can interrupt Claude at any point. If it's going down the wrong path, just type your correction and press Enter. Claude will stop what it's doing and adjust its approach based on your input. You don't have to wait for it to finish or start over.

178 

179### Be specific upfront

180 

181The more precise your initial prompt, the fewer corrections you'll need. Reference specific files, mention constraints, and point to example patterns.

182 

183```

184> The checkout flow is broken for users with expired cards.

185> Check src/payments/ for the issue, especially token refresh.

186> Write a failing test first, then fix it.

187```

188 

189Vague prompts like "fix the login bug" work, but you'll spend more time steering. Specific prompts like the above often succeed on the first attempt.

190 

191### Give Claude something to verify against

192 

193Claude performs better when it can check its own work. Include test cases, paste screenshots of expected UI, or define the output you want.

194 

195```

196> Implement validateEmail. Test cases: 'user@example.com' → true,

197> 'invalid' → false, 'user@.com' → false. Run the tests after.

198```

199 

200For visual work, paste a screenshot of the design and ask Claude to compare its implementation against it.

201 

202### Explore before implementing

203 

204For complex problems, separate research from coding. Use plan mode (`Shift+Tab` twice) to analyze the codebase first:

205 

206```

207> Read src/auth/ and understand how we handle sessions.

208> Then create a plan for adding OAuth support.

209```

210 

211Review the plan, refine it through conversation, then let Claude implement. This two-phase approach produces better results than jumping straight to code.

212 

213### Delegate, don't dictate

214 

215Think of delegating to a capable colleague. Give context and direction, then trust Claude to figure out the details:

216 

217```

218> The checkout flow is broken for users with expired cards.

219> The relevant code is in src/payments/. Can you investigate and fix it?

220```

221 

222You don't need to specify which files to read or what commands to run. Claude figures that out.

223 

224## What's next

225 

226<CardGroup cols={2}>

227 <Card title="Extend with features" icon="puzzle-piece" href="/en/features-overview">

228 Add Skills, MCP connections, and custom commands

229 </Card>

230 

231 <Card title="Common workflows" icon="graduation-cap" href="/en/common-workflows">

232 Step-by-step guides for typical tasks

233 </Card>

234</CardGroup>

235 

236 

237---

238 

239> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://code.claude.com/docs/llms.txt

iam.md +77 −31

Details

4 4 

5## Authentication methods5## Authentication methods

6 6 

7Setting up Claude Code requires access to Anthropic models. For teams, you can set up Claude Code access in one of four ways:7Setting up Claude Code requires access to Anthropic models. For teams, you can set up Claude Code access in one of these ways:

8 8 

9* Claude API via the Claude Console9* [Claude for Teams or Enterprise](/en/setup#for-teams-and-organizations) (recommended)

10* Amazon Bedrock10* [Claude Console with team billing](/en/setup#for-teams-and-organizations)

11* Microsoft Foundry11* [Amazon Bedrock](/en/amazon-bedrock)

12* Google Vertex AI12* [Google Vertex AI](/en/google-vertex-ai)

13* [Microsoft Foundry](/en/microsoft-foundry)

13 14 

14### Claude API authentication15### Claude for Teams or Enterprise (recommended)

15 16 

16**To set up Claude Code access for your team via Claude API:**17[Claude for Teams](https://claude.com/pricing#team-&-enterprise) and [Claude for Enterprise](https://anthropic.com/contact-sales) provide the best experience for organizations using Claude Code. Team members get access to both Claude Code and Claude on the web with centralized billing and team management.

18 

19* **Claude for Teams**: Self-service plan with collaboration features, admin tools, and billing management. Best for smaller teams.

20* **Claude for Enterprise**: Adds SSO, domain capture, role-based permissions, compliance API, and managed policy settings for organization-wide Claude Code configurations. Best for larger organizations with security and compliance requirements.

21 

22**To set up Claude Code access:**

23 

241. Subscribe to [Claude for Teams](https://claude.com/pricing#team-&-enterprise) or contact sales for [Claude for Enterprise](https://anthropic.com/contact-sales)

252. Invite team members from the admin dashboard

263. Team members install Claude Code and log in with their Claude.ai accounts

27 

28### Claude Console authentication

29 

30For organizations that prefer API-based billing, you can set up access through the Claude Console.

31 

32**To set up Claude Code access for your team via Claude Console:**

17 33 

181. Use your existing Claude Console account or create a new Claude Console account341. Use your existing Claude Console account or create a new Claude Console account

192. You can add users through either method below:352. You can add users through either method below:

20 * Bulk invite users from within the Console (Console -> Settings -> Members -> Invite)36 * Bulk invite users from within the Console (Console -> Settings -> Members -> Invite)

21 * [Set up SSO](https://support.claude.com/en/articles/10280258-setting-up-single-sign-on-on-the-api-console)37 * [Set up SSO](https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso)

223. When inviting users, they need one of the following roles:383. When inviting users, they need one of the following roles:

23 * "Claude Code" role means users can only create Claude Code API keys39 * "Claude Code" role means users can only create Claude Code API keys

24 * "Developer" role means users can create any kind of API key40 * "Developer" role means users can create any kind of API key


45Claude Code uses a tiered permission system to balance power and safety:61Claude Code uses a tiered permission system to balance power and safety:

46 62 

47| Tool Type | Example | Approval Required | "Yes, don't ask again" Behavior |63| Tool Type | Example | Approval Required | "Yes, don't ask again" Behavior |

48| :---------------- | :------------------- | :---------------- | :-------------------------------------------- |64| :---------------- | :--------------- | :---------------- | :-------------------------------------------- |

49| Read-only | File reads, LS, Grep | No | N/A |65| Read-only | File reads, Grep | No | N/A |

50| Bash Commands | Shell execution | Yes | Permanently per project directory and command |66| Bash Commands | Shell execution | Yes | Permanently per project directory and command |

51| File Modification | Edit/write files | Yes | Until session end |67| File Modification | Edit/write files | Yes | Until session end |

52 68 


54 70 

55You can view & manage Claude Code's tool permissions with `/permissions`. This UI lists all permission rules and the settings.json file they are sourced from.71You can view & manage Claude Code's tool permissions with `/permissions`. This UI lists all permission rules and the settings.json file they are sourced from.

56 72 

57* **Allow** rules will allow Claude Code to use the specified tool without further manual approval.73* **Allow** rules let Claude Code use the specified tool without manual approval.

58* **Ask** rules will ask the user for confirmation whenever Claude Code tries to use the specified tool. Ask rules take precedence over allow rules.74* **Ask** rules prompt for confirmation whenever Claude Code tries to use the specified tool.

59* **Deny** rules will prevent Claude Code from using the specified tool. Deny rules take precedence over allow and ask rules.75* **Deny** rules prevent Claude Code from using the specified tool.

76 

77Rules are evaluated in order: **deny → ask → allow**. The first matching rule wins, so deny rules always take precedence.

78 

60* **Additional directories** extend Claude's file access to directories beyond the initial working directory.79* **Additional directories** extend Claude's file access to directories beyond the initial working directory.

61* **Default mode** controls Claude's permission behavior when encountering new requests.80* **Default mode** controls Claude's permission behavior when encountering new requests.

62 81 

63Permission rules use the format: `Tool` or `Tool(optional-specifier)`82Permission rules use the format: `Tool` or `Tool(optional-specifier)`

64 83 

65A rule that is just the tool name matches any use of that tool. For example, adding `Bash` to the list of allow rules would allow Claude Code to use the Bash tool without requiring user approval.84A rule that is just the tool name matches any use of that tool. For example, adding `Bash` to the allow list allows Claude Code to use the Bash tool without requiring user approval. Note that `Bash(*)` does **not** match all Bash commands. Use `Bash` without parentheses to match all uses.

85 

86<Note>

87 For a quick reference on permission rule syntax including wildcards, see [Permission rule syntax](/en/settings#permission-rule-syntax) in the settings documentation.

88</Note>

66 89 

67#### Permission modes90#### Permission modes

68 91 


81By default, Claude has access to files in the directory where it was launched. You can extend this access:104By default, Claude has access to files in the directory where it was launched. You can extend this access:

82 105 

83* **During startup**: Use `--add-dir <path>` CLI argument106* **During startup**: Use `--add-dir <path>` CLI argument

84* **During session**: Use `/add-dir` slash command107* **During session**: Use `/add-dir` command

85* **Persistent configuration**: Add to `additionalDirectories` in [settings files](/en/settings#settings-files)108* **Persistent configuration**: Add to `additionalDirectories` in [settings files](/en/settings#settings-files)

86 109 

87Files in additional directories follow the same permission rules as the original working directory - they become readable without prompts, and file editing permissions follow the current permission mode.110Files in additional directories follow the same permission rules as the original working directory - they become readable without prompts, and file editing permissions follow the current permission mode.


92 115 

93**Bash**116**Bash**

94 117 

118Bash permission rules support both prefix matching with `:*` and wildcard matching with `*`:

119 

95* `Bash(npm run build)` Matches the exact Bash command `npm run build`120* `Bash(npm run build)` Matches the exact Bash command `npm run build`

96* `Bash(npm run test:*)` Matches Bash commands starting with `npm run test`121* `Bash(npm run test:*)` Matches Bash commands starting with `npm run test`

97* `Bash(curl http://site.com/:*)` Matches curl commands that start with exactly `curl http://site.com/`122* `Bash(npm *)` Matches any command starting with `npm ` (e.g., `npm install`, `npm run build`)

123* `Bash(* install)` Matches any command ending with ` install` (e.g., `npm install`, `yarn install`)

124* `Bash(git * main)` Matches commands like `git checkout main`, `git merge main`

125 

126The key difference between `:*` and `*`: the `:*` suffix enforces a word boundary, requiring the prefix to be followed by a space or end-of-string. For example, `Bash(ls:*)` matches `ls -la` but not `lsof`. In contrast, `Bash(ls*)` with a bare `*` matches both `ls -la` and `lsof` because `*` has no word boundary constraint.

98 127 

99<Tip>128<Tip>

100 Claude Code is aware of shell operators (like `&&`) so a prefix match rule like `Bash(safe-cmd:*)` won't give it permission to run the command `safe-cmd && other-cmd`129 Claude Code is aware of shell operators (like `&&`) so a prefix match rule like `Bash(safe-cmd:*)` won't give it permission to run the command `safe-cmd && other-cmd`


103<Warning>132<Warning>

104 Important limitations of Bash permission patterns:133 Important limitations of Bash permission patterns:

105 134 

106 1. This tool uses **prefix matches**, not regex or glob patterns135 1. The `:*` wildcard only works at the end of a pattern for prefix matching

107 2. The wildcard `:*` only works at the end of a pattern to match any continuation136 2. The `*` wildcard can appear at any position and matches any sequence of characters

108 3. Patterns like `Bash(curl http://github.com/:*)` can be bypassed in many ways:137 3. Patterns like `Bash(curl http://github.com/:*)` can be bypassed in many ways:

109 * Options before URL: `curl -X GET http://github.com/...` won't match138 * Options before URL: `curl -X GET http://github.com/...` won't match

110 * Different protocol: `curl https://github.com/...` won't match139 * Different protocol: `curl https://github.com/...` won't match


114 143 

115 For more reliable URL filtering, consider:144 For more reliable URL filtering, consider:

116 145 

117 * Using the WebFetch tool with `WebFetch(domain:github.com)` permission146 * **Restrict Bash network tools**: Use deny rules to block `curl`, `wget`, and similar commands, then use the WebFetch tool with `WebFetch(domain:github.com)` permission for allowed domains

147 * **Use PreToolUse hooks**: Implement a hook that validates URLs in Bash commands and blocks disallowed domains

118 * Instructing Claude Code about your allowed curl patterns via CLAUDE.md148 * Instructing Claude Code about your allowed curl patterns via CLAUDE.md

119 * Using hooks for custom permission validation149 

150 Note that using WebFetch alone does not prevent network access. If Bash is allowed, Claude can still use `curl`, `wget`, or other tools to reach any URL.

120</Warning>151</Warning>

121 152 

122**Read & Edit**153**Read & Edit**

123 154 

124`Edit` rules apply to all built-in tools that edit files. Claude will make a best-effort attempt to apply `Read` rules to all built-in tools that read files like Grep, Glob, and LS.155`Edit` rules apply to all built-in tools that edit files. Claude will make a best-effort attempt to apply `Read` rules to all built-in tools that read files like Grep and Glob.

125 156 

126Read & Edit rules both follow the [gitignore](https://git-scm.com/docs/gitignore) specification with four distinct pattern types:157Read & Edit rules both follow the [gitignore](https://git-scm.com/docs/gitignore) specification with four distinct pattern types:

127 158 


151* `mcp__puppeteer__*` Wildcard syntax that also matches all tools from the `puppeteer` server182* `mcp__puppeteer__*` Wildcard syntax that also matches all tools from the `puppeteer` server

152* `mcp__puppeteer__puppeteer_navigate` Matches the `puppeteer_navigate` tool provided by the `puppeteer` server183* `mcp__puppeteer__puppeteer_navigate` Matches the `puppeteer_navigate` tool provided by the `puppeteer` server

153 184 

185**Task (Subagents)**

186 

187Use `Task(AgentName)` rules to control which [subagents](/en/sub-agents) Claude can use:

188 

189* `Task(Explore)` Matches the Explore subagent

190* `Task(Plan)` Matches the Plan subagent

191* `Task(Verify)` Matches the Verify subagent

192 

193Add these rules to the `deny` array in your [settings](/en/settings#permission-settings) or use the `--disallowedTools` CLI flag to disable specific agents. For example, to disable the Explore agent:

194 

195```json theme={null}

196{

197 "permissions": {

198 "deny": ["Task(Explore)"]

199 }

200}

201```

202 

154### Additional permission control with hooks203### Additional permission control with hooks

155 204 

156[Claude Code hooks](/en/hooks-guide) provide a way to register custom shell commands to perform permission evaluation at runtime. When Claude Code makes a tool call, PreToolUse hooks run before the permission system runs, and the hook output can determine whether to approve or deny the tool call in place of the permission system.205[Claude Code hooks](/en/hooks-guide) provide a way to register custom shell commands to perform permission evaluation at runtime. When Claude Code makes a tool call, PreToolUse hooks run before the permission system runs, and the hook output can determine whether to approve or deny the tool call in place of the permission system.

157 206 

158### Enterprise managed settings207### Managed settings

159 

160For enterprise deployments of Claude Code, administrators can configure and distribute settings to their organization through the [Claude.ai admin console](https://claude.ai/admin-settings/claude-code). These settings are fetched automatically when users authenticate and cannot be overridden locally. This feature is available to Claude for Enterprise customers. If you don't see this option in your admin console, contact your Anthropic account team to have the feature enabled.

161 208 

162For organizations that prefer file-based policy distribution, Claude Code also supports `managed-settings.json` files that can be deployed to [system directories](/en/settings#settings-files). These policy files follow the same format as regular settings files and cannot be overridden by user or project settings.209For organizations that need centralized control over Claude Code configuration, administrators can deploy `managed-settings.json` files to [system directories](/en/settings#settings-files). These policy files follow the same format as regular settings files and cannot be overridden by user or project settings.

163 210 

164### Settings precedence211### Settings precedence

165 212 

166When multiple settings sources exist, they are applied in the following order (highest to lowest precedence):213When multiple settings sources exist, they are applied in the following order (highest to lowest precedence):

167 214 

1681. Managed settings (via Claude.ai admin console)2151. Managed settings (`managed-settings.json`)

1692. File-based managed settings (`managed-settings.json`)2162. Command line arguments

1703. Command line arguments2173. Local project settings (`.claude/settings.local.json`)

1714. Local project settings (`.claude/settings.local.json`)2184. Shared project settings (`.claude/settings.json`)

1725. Shared project settings (`.claude/settings.json`)2195. User settings (`~/.claude/settings.json`)

1736. User settings (`~/.claude/settings.json`)

174 220 

175This hierarchy ensures that organizational policies are always enforced while still allowing flexibility at the project and user levels where appropriate.221This hierarchy ensures that organizational policies are always enforced while still allowing flexibility at the project and user levels where appropriate.

176 222 

interactive-mode.md +112 −11

Details

5## Keyboard shortcuts5## Keyboard shortcuts

6 6 

7<Note>7<Note>

8 Keyboard shortcuts may vary by platform and terminal. Press `?` to see available shortcuts for your environment. For example, Option key combinations on macOS may require configuring your terminal to use Option as a meta/escape key.8 Keyboard shortcuts may vary by platform and terminal. Press `?` to see available shortcuts for your environment.

9 

10 **macOS users**: Option/Alt key shortcuts (`Alt+B`, `Alt+F`, `Alt+Y`, `Alt+M`, `Alt+P`) require configuring Option as Meta in your terminal:

11 

12 * **iTerm2**: Settings → Profiles → Keys → Set Left/Right Option key to "Esc+"

13 * **Terminal.app**: Settings → Profiles → Keyboard → Check "Use Option as Meta Key"

14 * **VS Code**: Settings → Profiles → Keys → Set Left/Right Option key to "Esc+"

15 

16 See [Terminal configuration](/en/terminal-config) for details.

9</Note>17</Note>

10 18 

11### General controls19### General controls

12 20 

13| Shortcut | Description | Context |21| Shortcut | Description | Context |

14| :-------------------------------------------- | :--------------------------------- | :---------------------------------------------------------- |22| :------------------------------------------------ | :--------------------------------- | :-------------------------------------------------------------------------------------------- |

15| `Ctrl+C` | Cancel current input or generation | Standard interrupt |23| `Ctrl+C` | Cancel current input or generation | Standard interrupt |

16| `Ctrl+D` | Exit Claude Code session | EOF signal |24| `Ctrl+D` | Exit Claude Code session | EOF signal |

25| `Ctrl+G` | Open in default text editor | Edit your prompt or custom response in your default text editor |

17| `Ctrl+L` | Clear terminal screen | Keeps conversation history |26| `Ctrl+L` | Clear terminal screen | Keeps conversation history |

18| `Ctrl+O` | Toggle verbose output | Shows detailed tool usage and execution |27| `Ctrl+O` | Toggle verbose output | Shows detailed tool usage and execution |

19| `Ctrl+R` | Reverse search command history | Search through previous commands interactively |28| `Ctrl+R` | Reverse search command history | Search through previous commands interactively |

20| `Ctrl+V` (macOS/Linux) or `Alt+V` (Windows) | Paste image from clipboard | Pastes an image or path to an image file |29| `Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows) | Paste image from clipboard | Pastes an image or path to an image file |

30| `Ctrl+B` | Background running tasks | Backgrounds bash commands and agents. Tmux users press twice |

31| `Left/Right arrows` | Cycle through dialog tabs | Navigate between tabs in permission dialogs and menus |

21| `Up/Down arrows` | Navigate command history | Recall previous inputs |32| `Up/Down arrows` | Navigate command history | Recall previous inputs |

22| `Esc` + `Esc` | Rewind the code/conversation | Restore the code and/or conversation to a previous point |33| `Esc` + `Esc` | Rewind the code/conversation | Restore the code and/or conversation to a previous point |

23| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode |34| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode |

24| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Switch models without clearing your prompt |35| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Switch models without clearing your prompt |

36| `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle extended thinking | Enable or disable extended thinking mode. Run `/terminal-setup` first to enable this shortcut |

37 

38### Text editing

39 

40| Shortcut | Description | Context |

41| :----------------------- | :--------------------------- | :------------------------------------------------------------------------------------------------------------ |

42| `Ctrl+K` | Delete to end of line | Stores deleted text for pasting |

43| `Ctrl+U` | Delete entire line | Stores deleted text for pasting |

44| `Ctrl+Y` | Paste deleted text | Paste text deleted with `Ctrl+K` or `Ctrl+U` |

45| `Alt+Y` (after `Ctrl+Y`) | Cycle paste history | After pasting, cycle through previously deleted text. Requires [Option as Meta](#keyboard-shortcuts) on macOS |

46| `Alt+B` | Move cursor back one word | Word navigation. Requires [Option as Meta](#keyboard-shortcuts) on macOS |

47| `Alt+F` | Move cursor forward one word | Word navigation. Requires [Option as Meta](#keyboard-shortcuts) on macOS |

48 

49### Theme and display

50 

51| Shortcut | Description | Context |

52| :------- | :----------------------------------------- | :----------------------------------------------------------------------------------------------------------- |

53| `Ctrl+T` | Toggle syntax highlighting for code blocks | Only works inside the `/theme` picker menu. Controls whether code in Claude's responses uses syntax coloring |

54 

55<Note>

56 Syntax highlighting is only available in the native build of Claude Code.

57</Note>

25 58 

26### Multiline input59### Multiline input

27 60 

28| Method | Shortcut | Context |61| Method | Shortcut | Context |

29| :--------------- | :------------- | :-------------------------------- |62| :--------------- | :------------- | :------------------------------------------------------ |

30| Quick escape | `\` + `Enter` | Works in all terminals |63| Quick escape | `\` + `Enter` | Works in all terminals |

31| macOS default | `Option+Enter` | Default on macOS |64| macOS default | `Option+Enter` | Default on macOS |

32| Terminal setup | `Shift+Enter` | After `/terminal-setup` |65| Shift+Enter | `Shift+Enter` | Works out of the box in iTerm2, WezTerm, Ghostty, Kitty |

33| Control sequence | `Ctrl+J` | Line feed character for multiline |66| Control sequence | `Ctrl+J` | Line feed character for multiline |

34| Paste mode | Paste directly | For code blocks, logs |67| Paste mode | Paste directly | For code blocks, logs |

35 68 

36<Tip>69<Tip>

37 Configure your preferred line break behavior in terminal settings. Run `/terminal-setup` to install Shift+Enter binding for iTerm2 and VS Code terminals.70 Shift+Enter works without configuration in iTerm2, WezTerm, Ghostty, and Kitty. For other terminals (VS Code, Alacritty, Zed, Warp), run `/terminal-setup` to install the binding.

38</Tip>71</Tip>

39 72 

40### Quick commands73### Quick commands

41 74 

42| Shortcut | Description | Notes |75| Shortcut | Description | Notes |

43| :----------- | :---------------- | :------------------------------------------------------------ |76| :----------- | :---------------- | :------------------------------------------------------------------- |

44| `/` at start | Slash command | See [slash commands](/en/slash-commands) |77| `/` at start | Command or skill | See [built-in commands](#built-in-commands) and [skills](/en/skills) |

45| `!` at start | Bash mode | Run commands directly and add execution output to the session |78| `!` at start | Bash mode | Run commands directly and add execution output to the session |

46| `@` | File path mention | Trigger file path autocomplete |79| `@` | File path mention | Trigger file path autocomplete |

47 80 

81## Built-in commands

82 

83Built-in commands are shortcuts for common actions. The table below covers commonly used commands but not all available options. Type `/` in Claude Code to see the full list, or type `/` followed by any letters to filter.

84 

85To create your own commands you can invoke with `/`, see [skills](/en/skills).

86 

87| Command | Purpose |

88| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |

89| `/clear` | Clear conversation history |

90| `/compact [instructions]` | Compact conversation with optional focus instructions |

91| `/config` | Open the Settings interface (Config tab) |

92| `/context` | Visualize current context usage as a colored grid |

93| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |

94| `/doctor` | Checks the health of your Claude Code installation |

95| `/exit` | Exit the REPL |

96| `/export [filename]` | Export the current conversation to a file or clipboard |

97| `/help` | Get usage help |

98| `/init` | Initialize project with `CLAUDE.md` guide |

99| `/mcp` | Manage MCP server connections and OAuth authentication |

100| `/memory` | Edit `CLAUDE.md` memory files |

101| `/model` | Select or change the AI model |

102| `/permissions` | View or update [permissions](/en/iam#configuring-permissions) |

103| `/plan` | Enter plan mode directly from the prompt |

104| `/rename <name>` | Rename the current session for easier identification |

105| `/resume [session]` | Resume a conversation by ID or name, or open the session picker |

106| `/rewind` | Rewind the conversation and/or code |

107| `/stats` | Visualize daily usage, session history, streaks, and model preferences |

108| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |

109| `/statusline` | Set up Claude Code's status line UI |

110| `/tasks` | List and manage background tasks |

111| `/teleport` | Resume a remote session from claude.ai (subscribers only) |

112| `/theme` | Change the color theme |

113| `/todos` | List current TODO items |

114| `/usage` | For subscription plans only: show plan usage limits and rate limit status |

115 

116### MCP prompts

117 

118MCP servers can expose prompts that appear as commands. These use the format `/mcp__<server>__<prompt>` and are dynamically discovered from connected servers. See [MCP prompts](/en/mcp#use-mcp-prompts-as-commands) for details.

119 

48## Vim editor mode120## Vim editor mode

49 121 

50Enable vim-style editing with `/vim` command or configure permanently via `/config`.122Enable vim-style editing with `/vim` command or configure permanently via `/config`.


64### Navigation (NORMAL mode)136### Navigation (NORMAL mode)

65 137 

66| Command | Action |138| Command | Action |

67| :-------------- | :------------------------ |139| :-------------- | :-------------------------------------------------- |

68| `h`/`j`/`k`/`l` | Move left/down/up/right |140| `h`/`j`/`k`/`l` | Move left/down/up/right |

69| `w` | Next word |141| `w` | Next word |

70| `e` | End of word |142| `e` | End of word |


74| `^` | First non-blank character |146| `^` | First non-blank character |

75| `gg` | Beginning of input |147| `gg` | Beginning of input |

76| `G` | End of input |148| `G` | End of input |

149| `f{char}` | Jump to next occurrence of character |

150| `F{char}` | Jump to previous occurrence of character |

151| `t{char}` | Jump to just before next occurrence of character |

152| `T{char}` | Jump to just after previous occurrence of character |

153| `;` | Repeat last f/F/t/T motion |

154| `,` | Repeat last f/F/t/T motion in reverse |

77 155 

78### Editing (NORMAL mode)156### Editing (NORMAL mode)

79 157 


86| `cc` | Change line |164| `cc` | Change line |

87| `C` | Change to end of line |165| `C` | Change to end of line |

88| `cw`/`ce`/`cb` | Change word/to end/back |166| `cw`/`ce`/`cb` | Change word/to end/back |

167| `yy`/`Y` | Yank (copy) line |

168| `yw`/`ye`/`yb` | Yank word/to end/back |

169| `p` | Paste after cursor |

170| `P` | Paste before cursor |

171| `>>` | Indent line |

172| `<<` | Dedent line |

173| `J` | Join lines |

89| `.` | Repeat last change |174| `.` | Repeat last change |

90 175 

176### Text objects (NORMAL mode)

177 

178Text objects work with operators like `d`, `c`, and `y`:

179 

180| Command | Action |

181| :-------- | :--------------------------------------- |

182| `iw`/`aw` | Inner/around word |

183| `iW`/`aW` | Inner/around WORD (whitespace-delimited) |

184| `i"`/`a"` | Inner/around double quotes |

185| `i'`/`a'` | Inner/around single quotes |

186| `i(`/`a(` | Inner/around parentheses |

187| `i[`/`a[` | Inner/around brackets |

188| `i{`/`a{` | Inner/around braces |

189 

91## Command history190## Command history

92 191 

93Claude Code maintains command history for the current session:192Claude Code maintains command history for the current session:


128 227 

129**Key features:**228**Key features:**

130 229 

131* Output is buffered and Claude can retrieve it using the BashOutput tool230* Output is buffered and Claude can retrieve it using the TaskOutput tool

132* Background tasks have unique IDs for tracking and output retrieval231* Background tasks have unique IDs for tracking and output retrieval

133* Background tasks are automatically cleaned up when Claude Code exits232* Background tasks are automatically cleaned up when Claude Code exits

134 233 

234To disable all background task functionality, set the `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` environment variable to `1`. See [Environment variables](/en/settings#environment-variables) for details.

235 

135**Common backgrounded commands:**236**Common backgrounded commands:**

136 237 

137* Build tools (webpack, vite, make)238* Build tools (webpack, vite, make)


161 262 

162## See also263## See also

163 264 

164* [Slash commands](/en/slash-commands) - Interactive session commands265* [Skills](/en/skills) - Custom prompts and workflows

165* [Checkpointing](/en/checkpointing) - Rewind Claude's edits and restore previous states266* [Checkpointing](/en/checkpointing) - Rewind Claude's edits and restore previous states

166* [CLI reference](/en/cli-reference) - Command-line flags and options267* [CLI reference](/en/cli-reference) - Command-line flags and options

167* [Settings](/en/settings) - Configuration options268* [Settings](/en/settings) - Configuration options

mcp.md +67 −7

Details

115/mcp115/mcp

116```116```

117 117 

118### Dynamic tool updates

119 

120Claude Code supports MCP `list_changed` notifications, allowing MCP servers to dynamically update their available tools, prompts, and resources without requiring you to disconnect and reconnect. When an MCP server sends a `list_changed` notification, Claude Code automatically refreshes the available capabilities from that server.

121 

118<Tip>122<Tip>

119 Tips:123 Tips:

120 124 


267 271 

268 * **User and local scope**: `~/.claude.json` (in the `mcpServers` field or under project paths)272 * **User and local scope**: `~/.claude.json` (in the `mcpServers` field or under project paths)

269 * **Project scope**: `.mcp.json` in your project root (checked into source control)273 * **Project scope**: `.mcp.json` in your project root (checked into source control)

270 * **Enterprise managed**: `managed-mcp.json` in system directories (see [Enterprise MCP configuration](#enterprise-mcp-configuration))274 * **Managed**: `managed-mcp.json` in system directories (see [Managed MCP configuration](#managed-mcp-configuration))

271</Note>275</Note>

272 276 

273### Scope hierarchy and precedence277### Scope hierarchy and precedence


593 * Resources can contain any type of content that the MCP server provides (text, JSON, structured data, etc.)597 * Resources can contain any type of content that the MCP server provides (text, JSON, structured data, etc.)

594</Tip>598</Tip>

595 599 

596## Use MCP prompts as slash commands600## Scale with MCP Tool Search

601 

602When you have many MCP servers configured, tool definitions can consume a significant portion of your context window. MCP Tool Search solves this by dynamically loading tools on-demand instead of preloading all of them.

603 

604### How it works

605 

606Claude Code automatically enables Tool Search when your MCP tool descriptions would consume more than 10% of the context window. You can [adjust this threshold](#configure-tool-search) or disable tool search entirely. When triggered:

607 

6081. MCP tools are deferred rather than loaded into context upfront

6092. Claude uses a search tool to discover relevant MCP tools when needed

6103. Only the tools Claude actually needs are loaded into context

6114. MCP tools continue to work exactly as before from your perspective

612 

613### For MCP server authors

614 

615If you're building an MCP server, the server instructions field becomes more useful with Tool Search enabled. Server instructions help Claude understand when to search for your tools, similar to how [skills](/en/skills) work.

616 

617Add clear, descriptive server instructions that explain:

618 

619* What category of tasks your tools handle

620* When Claude should search for your tools

621* Key capabilities your server provides

622 

623### Configure tool search

624 

625Tool search runs in auto mode by default, meaning it activates only when your MCP tool definitions exceed the context threshold. If you have few tools, they load normally without tool search. This feature requires models that support `tool_reference` blocks: Sonnet 4 and later, or Opus 4 and later. Haiku models do not support tool search.

626 

627Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable:

628 

629| Value | Behavior |

630| :--------- | :--------------------------------------------------------------------------------- |

631| `auto` | Activates when MCP tools exceed 10% of context (default) |

632| `auto:<N>` | Activates at custom threshold, where `<N>` is a percentage (e.g., `auto:5` for 5%) |

633| `true` | Always enabled |

634| `false` | Disabled, all MCP tools loaded upfront |

635 

636```bash theme={null}

637# Use a custom 5% threshold

638ENABLE_TOOL_SEARCH=auto:5 claude

639 

640# Disable tool search entirely

641ENABLE_TOOL_SEARCH=false claude

642```

643 

644Or set the value in your [settings.json `env` field](/en/settings#available-settings).

645 

646You can also disable the MCPSearch tool specifically using the `disallowedTools` setting:

647 

648```json theme={null}

649{

650 "permissions": {

651 "deny": ["MCPSearch"]

652 }

653}

654```

655 

656## Use MCP prompts as commands

597 657 

598MCP servers can expose prompts that become available as slash commands in Claude Code.658MCP servers can expose prompts that become available as commands in Claude Code.

599 659 

600### Execute MCP prompts660### Execute MCP prompts

601 661 


632 * Server and prompt names are normalized (spaces become underscores)692 * Server and prompt names are normalized (spaces become underscores)

633</Tip>693</Tip>

634 694 

635## Enterprise MCP configuration695## Managed MCP configuration

636 696 

637For organizations that need centralized control over MCP servers, Claude Code supports two enterprise configuration options:697For organizations that need centralized control over MCP servers, Claude Code supports two configuration options:

638 698 

6391. **Exclusive control with `managed-mcp.json`**: Deploy a fixed set of MCP servers that users cannot modify or extend6991. **Exclusive control with `managed-mcp.json`**: Deploy a fixed set of MCP servers that users cannot modify or extend

6402. **Policy-based control with allowlists/denylists**: Allow users to add their own servers, but restrict which ones are permitted7002. **Policy-based control with allowlists/denylists**: Allow users to add their own servers, but restrict which ones are permitted


852 912 

853#### Important notes913#### Important notes

854 914 

855* **Option 1 and Option 2 can be combined**: If `managed-mcp.json` exists, it has exclusive control and users cannot add servers. Allowlists/denylists still apply to the enterprise servers themselves.915* **Option 1 and Option 2 can be combined**: If `managed-mcp.json` exists, it has exclusive control and users cannot add servers. Allowlists/denylists still apply to the managed servers themselves.

856* **Denylist takes absolute precedence**: If a server matches a denylist entry (by name, command, or URL), it will be blocked even if it's on the allowlist916* **Denylist takes absolute precedence**: If a server matches a denylist entry (by name, command, or URL), it will be blocked even if it's on the allowlist

857* Name-based, command-based, and URL-based restrictions work together: a server passes if it matches **either** a name entry, a command entry, or a URL pattern (unless blocked by denylist)917* Name-based, command-based, and URL-based restrictions work together: a server passes if it matches **either** a name entry, a command entry, or a URL pattern (unless blocked by denylist)

858 918 

859<Note>919<Note>

860 **When using `managed-mcp.json`**: Users cannot add MCP servers through `claude mcp add` or configuration files. The `allowedMcpServers` and `deniedMcpServers` settings still apply to filter which enterprise servers are actually loaded.920 **When using `managed-mcp.json`**: Users cannot add MCP servers through `claude mcp add` or configuration files. The `allowedMcpServers` and `deniedMcpServers` settings still apply to filter which managed servers are actually loaded.

861</Note>921</Note>

862 922 

863 923 

memory.md +19 −11

Details

10 10 

11| Memory Type | Location | Purpose | Use Case Examples | Shared With |11| Memory Type | Location | Purpose | Use Case Examples | Shared With |

12| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------- |12| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------- |

13| **Enterprise policy** | • macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md`<br />• Linux: `/etc/claude-code/CLAUDE.md`<br />• Windows: `C:\Program Files\ClaudeCode\CLAUDE.md` | Organization-wide instructions managed by IT/DevOps | Company coding standards, security policies, compliance requirements | All users in organization |13| **Managed policy** | • macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md`<br />• Linux: `/etc/claude-code/CLAUDE.md`<br />• Windows: `C:\Program Files\ClaudeCode\CLAUDE.md` | Organization-wide instructions managed by IT/DevOps | Company coding standards, security policies, compliance requirements | All users in organization |

14| **Project memory** | `./CLAUDE.md` or `./.claude/CLAUDE.md` | Team-shared instructions for the project | Project architecture, coding standards, common workflows | Team members via source control |14| **Project memory** | `./CLAUDE.md` or `./.claude/CLAUDE.md` | Team-shared instructions for the project | Project architecture, coding standards, common workflows | Team members via source control |

15| **Project rules** | `./.claude/rules/*.md` | Modular, topic-specific project instructions | Language-specific guidelines, testing conventions, API standards | Team members via source control |15| **Project rules** | `./.claude/rules/*.md` | Modular, topic-specific project instructions | Language-specific guidelines, testing conventions, API standards | Team members via source control |

16| **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |16| **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |


56 56 

57## Directly edit memories with `/memory`57## Directly edit memories with `/memory`

58 58 

59Use the `/memory` slash command during a session to open any memory file in your system editor for more extensive additions or organization.59Use the `/memory` command during a session to open any memory file in your system editor for more extensive additions or organization.

60 60 

61## Set up project memory61## Set up project memory

62 62 


103 103 

104```markdown theme={null}104```markdown theme={null}

105---105---

106paths: src/api/**/*.ts106paths:

107 - "src/api/**/*.ts"

107---108---

108 109 

109# API Development Rules110# API Development Rules


126| `*.md` | Markdown files in the project root |127| `*.md` | Markdown files in the project root |

127| `src/components/*.tsx` | React components in a specific directory |128| `src/components/*.tsx` | React components in a specific directory |

128 129 

129You can use braces to match multiple patterns efficiently:130You can specify multiple patterns:

130 131 

131```markdown theme={null}132```markdown theme={null}

132---133---

133paths: src/**/*.{ts,tsx}134paths:

135 - "src/**/*.ts"

136 - "lib/**/*.ts"

137 - "tests/**/*.test.ts"

134---138---

135 

136# TypeScript/React Rules

137```139```

138 140 

139This expands to match both `src/**/*.ts` and `src/**/*.tsx`. You can also combine multiple patterns with commas:141Brace expansion is supported for matching multiple extensions or directories:

140 142 

141```markdown theme={null}143```markdown theme={null}

142---144---

143paths: {src,lib}/**/*.ts, tests/**/*.test.ts145paths:

146 - "src/**/*.{ts,tsx}"

147 - "{src,lib}/**/*.ts"

144---148---

149 

150# TypeScript/React Rules

145```151```

146 152 

153This expands `src/**/*.{ts,tsx}` to match both `.ts` and `.tsx` files.

154 

147### Subdirectories155### Subdirectories

148 156 

149Rules can be organized into subdirectories for better structure:157Rules can be organized into subdirectories for better structure:


198 206 

199## Organization-level memory management207## Organization-level memory management

200 208 

201Enterprise organizations can deploy centrally managed CLAUDE.md files that apply to all users.209Organizations can deploy centrally managed CLAUDE.md files that apply to all users.

202 210 

203To set up organization-level memory management:211To set up organization-level memory management:

204 212 

2051. Create the enterprise memory file at the **Enterprise policy** location shown in the [memory types table above](#determine-memory-type).2131. Create the managed memory file at the **Managed policy** location shown in the [memory types table above](#determine-memory-type).

206 214 

2072. Deploy via your configuration management system (MDM, Group Policy, Ansible, etc.) to ensure consistent distribution across all developer machines.2152. Deploy via your configuration management system (MDM, Group Policy, Ansible, etc.) to ensure consistent distribution across all developer machines.

208 216 

Details

103settings like the model to use, the tools they have available, and some context103settings like the model to use, the tools they have available, and some context

104about when to use the agent.104about when to use the agent.

105 105 

106### Output Styles vs. [Custom Slash Commands](/en/slash-commands)106### Output Styles vs. [Skills](/en/skills)

107 107 

108You can think of output styles as "stored system prompts" and custom slash108Output styles modify how Claude responds (formatting, tone, structure) and are always active once selected. Skills are task-specific prompts that you invoke with `/skill-name` or that Claude loads automatically when relevant. Use output styles for consistent formatting preferences; use skills for reusable workflows and tasks.

109commands as "stored prompts".

110 109 

111 110 

112---111---

overview.md +17 −7

Details

6 6 

7Prerequisites:7Prerequisites:

8 8 

9* A [Claude.ai](https://claude.ai) (recommended) or [Claude Console](https://console.anthropic.com/) account9* A [Claude subscription](https://claude.com/pricing) (Pro, Max, Teams, or Enterprise) or [Claude Console](https://console.anthropic.com/) account

10 10 

11**Install Claude Code:**11**Install Claude Code:**

12 12 


31 ```batch theme={null}31 ```batch theme={null}

32 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd32 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

33 ```33 ```

34 

35 <Info>

36 Native installations automatically update in the background to keep you on the latest version.

37 </Info>

34 </Tab>38 </Tab>

35 39 

36 <Tab title="Homebrew">40 <Tab title="Homebrew">

37 ```sh theme={null}41 ```sh theme={null}

38 brew install --cask claude-code42 brew install --cask claude-code

39 ```43 ```

40 </Tab>

41 44 

42 <Tab title="NPM">45 <Info>

43 If you have [Node.js 18 or newer installed](https://nodejs.org/en/download/):46 Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.

47 </Info>

48 </Tab>

44 49 

45 ```sh theme={null}50 <Tab title="WinGet">

46 npm install -g @anthropic-ai/claude-code51 ```powershell theme={null}

52 winget install Anthropic.ClaudeCode

47 ```53 ```

54 

55 <Info>

56 WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

57 </Info>

48 </Tab>58 </Tab>

49</Tabs>59</Tabs>

50 60 


58You'll be prompted to log in on first use. That's it! [Continue with Quickstart (5 minutes) →](/en/quickstart)68You'll be prompted to log in on first use. That's it! [Continue with Quickstart (5 minutes) →](/en/quickstart)

59 69 

60<Tip>70<Tip>

61 Claude Code automatically keeps itself up to date. See [advanced setup](/en/setup) for installation options, manual updates, or uninstallation instructions. Visit [troubleshooting](/en/troubleshooting) if you hit issues.71 See [advanced setup](/en/setup) for installation options, manual updates, or uninstallation instructions. Visit [troubleshooting](/en/troubleshooting) if you hit issues.

62</Tip>72</Tip>

63 73 

64## What Claude Code does for you74## What Claude Code does for you

Details

19 19 

20## Walkthrough: create a local marketplace20## Walkthrough: create a local marketplace

21 21 

22This example creates a marketplace with one plugin: a `/review` command for code reviews. You'll create the directory structure, add a slash command, create the plugin manifest and marketplace catalog, then install and test it.22This example creates a marketplace with one plugin: a `/review` skill for code reviews. You'll create the directory structure, add a skill, create the plugin manifest and marketplace catalog, then install and test it.

23 23 

24<Steps>24<Steps>

25 <Step title="Create the directory structure">25 <Step title="Create the directory structure">

26 ```bash theme={null}26 ```bash theme={null}

27 mkdir -p my-marketplace/.claude-plugin27 mkdir -p my-marketplace/.claude-plugin

28 mkdir -p my-marketplace/plugins/review-plugin/.claude-plugin28 mkdir -p my-marketplace/plugins/review-plugin/.claude-plugin

29 mkdir -p my-marketplace/plugins/review-plugin/commands29 mkdir -p my-marketplace/plugins/review-plugin/skills/review

30 ```30 ```

31 </Step>31 </Step>

32 32 

33 <Step title="Create the plugin command">33 <Step title="Create the skill">

34 Create a Markdown file that defines what the `/review` command does.34 Create a `SKILL.md` file that defines what the `/review` skill does.

35 

36 ```markdown my-marketplace/plugins/review-plugin/skills/review/SKILL.md theme={null}

37 ---

38 description: Review code for bugs, security, and performance

39 disable-model-invocation: true

40 ---

35 41 

36 ```markdown my-marketplace/plugins/review-plugin/commands/review.md theme={null}

37 Review the code I've selected or the recent changes for:42 Review the code I've selected or the recent changes for:

38 - Potential bugs or edge cases43 - Potential bugs or edge cases

39 - Security concerns44 - Security concerns


50 ```json my-marketplace/plugins/review-plugin/.claude-plugin/plugin.json theme={null}55 ```json my-marketplace/plugins/review-plugin/.claude-plugin/plugin.json theme={null}

51 {56 {

52 "name": "review-plugin",57 "name": "review-plugin",

53 "description": "Adds a /review command for quick code reviews",58 "description": "Adds a /review skill for quick code reviews",

54 "version": "1.0.0"59 "version": "1.0.0"

55 }60 }

56 ```61 ```


69 {74 {

70 "name": "review-plugin",75 "name": "review-plugin",

71 "source": "./plugins/review-plugin",76 "source": "./plugins/review-plugin",

72 "description": "Adds a /review command for quick code reviews"77 "description": "Adds a /review skill for quick code reviews"

73 }78 }

74 ]79 ]

75 }80 }


217}222}

218```223```

219 224 

225<Note>

226 Relative paths only work when users add your marketplace via Git (GitHub, GitLab, or git URL). If users add your marketplace via a direct URL to the `marketplace.json` file, relative paths will not resolve correctly. For URL-based distribution, use GitHub, npm, or git URL sources instead. See [Troubleshooting](#plugins-with-relative-paths-fail-in-url-based-marketplaces) for details.

227</Note>

228 

220### GitHub repositories229### GitHub repositories

221 230 

222```json theme={null}231```json theme={null}


318/plugin marketplace add https://gitlab.com/company/plugins.git327/plugin marketplace add https://gitlab.com/company/plugins.git

319```328```

320 329 

330### Private repositories

331 

332Claude Code supports installing plugins from private repositories. Set the appropriate authentication token in your environment, and Claude Code will use it when authentication is required.

333 

334| Provider | Environment variables | Notes |

335| :-------- | :--------------------------- | :---------------------------------------- |

336| GitHub | `GITHUB_TOKEN` or `GH_TOKEN` | Personal access token or GitHub App token |

337| GitLab | `GITLAB_TOKEN` or `GL_TOKEN` | Personal access token or project token |

338| Bitbucket | `BITBUCKET_TOKEN` | App password or repository access token |

339 

340Set the token in your shell configuration (for example, `.bashrc`, `.zshrc`) or pass it when running Claude Code:

341 

342```bash theme={null}

343export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx

344```

345 

346Authentication tokens are only used when a repository requires authentication. Public repositories work without any tokens configured, even if tokens are present in your environment.

347 

348<Note>

349 For CI/CD environments, configure the token as a secret environment variable. GitHub Actions automatically provides `GITHUB_TOKEN` for repositories in the same organization.

350</Note>

351 

321### Test locally before distribution352### Test locally before distribution

322 353 

323Test your marketplace locally before sharing:354Test your marketplace locally before sharing:


359 390 

360For full configuration options, see [Plugin settings](/en/settings#plugin-settings).391For full configuration options, see [Plugin settings](/en/settings#plugin-settings).

361 392 

362### Enterprise marketplace restrictions393### Managed marketplace restrictions

363 394 

364For organizations requiring strict control over plugin sources, enterprise administrators can restrict which plugin marketplaces users are allowed to add using the [`strictKnownMarketplaces`](/en/settings#strictknownmarketplaces) setting in managed settings.395For organizations requiring strict control over plugin sources, administrators can restrict which plugin marketplaces users are allowed to add using the [`strictKnownMarketplaces`](/en/settings#strictknownmarketplaces) setting in managed settings.

365 396 

366When `strictKnownMarketplaces` is configured in managed settings, the restriction behavior depends on the value:397When `strictKnownMarketplaces` is configured in managed settings, the restriction behavior depends on the value:

367 398 


412* For GitHub sources: `repo` is required, and `ref` or `path` must also match if specified in the allowlist443* For GitHub sources: `repo` is required, and `ref` or `path` must also match if specified in the allowlist

413* For URL sources: the full URL must match exactly444* For URL sources: the full URL must match exactly

414 445 

415Because `strictKnownMarketplaces` is set in [managed settings](/en/settings#settings-file-locations), individual users and project configurations cannot override these restrictions.446Because `strictKnownMarketplaces` is set in [managed settings](/en/settings#settings-files), individual users and project configurations cannot override these restrictions.

416 447 

417For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](/en/settings#strictknownmarketplaces).448For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](/en/settings#strictknownmarketplaces).

418 449 


487* For GitHub sources, ensure repositories are public or you have access518* For GitHub sources, ensure repositories are public or you have access

488* Test plugin sources manually by cloning/downloading519* Test plugin sources manually by cloning/downloading

489 520 

521### Private repository authentication fails

522 

523**Symptoms**: Authentication errors when installing plugins from private repositories, even with tokens configured

524 

525**Solutions**:

526 

527* Verify your token is set in the current shell session: `echo $GITHUB_TOKEN`

528* Check that the token has the required permissions (read access to the repository)

529* For GitHub, ensure the token has the `repo` scope for private repositories

530* For GitLab, ensure the token has at least `read_repository` scope

531* Verify the token hasn't expired

532* If using multiple git providers, ensure you've set the token for the correct provider

533 

534### Plugins with relative paths fail in URL-based marketplaces

535 

536**Symptoms**: Added a marketplace via URL (such as `https://example.com/marketplace.json`), but plugins with relative path sources like `"./plugins/my-plugin"` fail to install with "path not found" errors.

537 

538**Cause**: URL-based marketplaces only download the `marketplace.json` file itself. They do not download plugin files from the server. Relative paths in the marketplace entry reference files on the remote server that were not downloaded.

539 

540**Solutions**:

541 

542* **Use external sources**: Change plugin entries to use GitHub, npm, or git URL sources instead of relative paths:

543 ```json theme={null}

544 { "name": "my-plugin", "source": { "source": "github", "repo": "owner/repo" } }

545 ```

546* **Use a Git-based marketplace**: Host your marketplace in a Git repository and add it with the git URL. Git-based marketplaces clone the entire repository, making relative paths work correctly.

547 

490### Files not found after installation548### Files not found after installation

491 549 

492**Symptoms**: Plugin installs but references to files fail, especially files outside the plugin directory550**Symptoms**: Plugin installs but references to files fail, especially files outside the plugin directory


503* [Plugins](/en/plugins) - Creating your own plugins561* [Plugins](/en/plugins) - Creating your own plugins

504* [Plugins reference](/en/plugins-reference) - Complete technical specifications and schemas562* [Plugins reference](/en/plugins-reference) - Complete technical specifications and schemas

505* [Plugin settings](/en/settings#plugin-settings) - Plugin configuration options563* [Plugin settings](/en/settings#plugin-settings) - Plugin configuration options

506* [strictKnownMarketplaces reference](/en/settings#strictknownmarketplaces) - Enterprise marketplace restrictions564* [strictKnownMarketplaces reference](/en/settings#strictknownmarketplaces) - Managed marketplace restrictions

507 565 

508 566 

509---567---

plugins.md +29 −31

Details

1# Create plugins1# Create plugins

2 2 

3> Create custom plugins to extend Claude Code with slash commands, agents, hooks, Skills, and MCP servers.3> Create custom plugins to extend Claude Code with skills, agents, hooks, and MCP servers.

4 4 

5Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with slash commands, agents, Skills, hooks, and MCP servers.5Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. This guide covers creating your own plugins with skills, agents, hooks, and MCP servers.

6 6 

7Looking to install existing plugins? See [Discover and install plugins](/en/discover-plugins). For complete technical specifications, see [Plugins reference](/en/plugins-reference).7Looking to install existing plugins? See [Discover and install plugins](/en/discover-plugins). For complete technical specifications, see [Plugins reference](/en/plugins-reference).

8 8 

9## When to use plugins vs standalone configuration9## When to use plugins vs standalone configuration

10 10 

11Claude Code supports two ways to add custom slash commands, agents, and hooks:11Claude Code supports two ways to add custom skills, agents, and hooks:

12 12 

13| Approach | Slash command names | Best for |13| Approach | Skill names | Best for |

14| :---------------------------------------------------------- | :------------------- | :---------------------------------------------------------------------------------------------- |14| :---------------------------------------------------------- | :------------------- | :---------------------------------------------------------------------------------------------- |

15| **Standalone** (`.claude/` directory) | `/hello` | Personal workflows, project-specific customizations, quick experiments |15| **Standalone** (`.claude/` directory) | `/hello` | Personal workflows, project-specific customizations, quick experiments |

16| **Plugins** (directories with `.claude-plugin/plugin.json`) | `/plugin-name:hello` | Sharing with teammates, distributing to community, versioned releases, reusable across projects |16| **Plugins** (directories with `.claude-plugin/plugin.json`) | `/plugin-name:hello` | Sharing with teammates, distributing to community, versioned releases, reusable across projects |


19 19 

20* You're customizing Claude Code for a single project20* You're customizing Claude Code for a single project

21* The configuration is personal and doesn't need to be shared21* The configuration is personal and doesn't need to be shared

22* You're experimenting with slash commands or hooks before packaging them22* You're experimenting with skills or hooks before packaging them

23* You want short slash command names like `/hello` or `/review`23* You want short skill names like `/hello` or `/review`

24 24 

25**Use plugins when**:25**Use plugins when**:

26 26 

27* You want to share functionality with your team or community27* You want to share functionality with your team or community

28* You need the same slash commands/agents across multiple projects28* You need the same skills/agents across multiple projects

29* You want version control and easy updates for your extensions29* You want version control and easy updates for your extensions

30* You're distributing through a marketplace30* You're distributing through a marketplace

31* You're okay with namespaced slash commands like `/my-plugin:hello` (namespacing prevents conflicts between plugins)31* You're okay with namespaced skills like `/my-plugin:hello` (namespacing prevents conflicts between plugins)

32 32 

33<Tip>33<Tip>

34 Start with standalone configuration in `.claude/` for quick iteration, then [convert to a plugin](#convert-existing-configurations-to-plugins) when you're ready to share.34 Start with standalone configuration in `.claude/` for quick iteration, then [convert to a plugin](#convert-existing-configurations-to-plugins) when you're ready to share.


36 36 

37## Quickstart37## Quickstart

38 38 

39This quickstart walks you through creating a plugin with a custom slash command. You'll create a manifest (the configuration file that defines your plugin), add a slash command, and test it locally using the `--plugin-dir` flag.39This quickstart walks you through creating a plugin with a custom skill. You'll create a manifest (the configuration file that defines your plugin), add a skill, and test it locally using the `--plugin-dir` flag.

40 40 

41### Prerequisites41### Prerequisites

42 42 


51 51 

52<Steps>52<Steps>

53 <Step title="Create the plugin directory">53 <Step title="Create the plugin directory">

54 Every plugin lives in its own directory containing a manifest and your custom commands, agents, or hooks. Create one now:54 Every plugin lives in its own directory containing a manifest and your skills, agents, or hooks. Create one now:

55 55 

56 ```bash theme={null}56 ```bash theme={null}

57 mkdir my-first-plugin57 mkdir my-first-plugin


81 ```81 ```

82 82 

83 | Field | Purpose |83 | Field | Purpose |

84 | :------------ | :--------------------------------------------------------------------------------------------------------------------- |84 | :------------ | :----------------------------------------------------------------------------------------------------- |

85 | `name` | Unique identifier and slash command namespace. Slash commands are prefixed with this (e.g., `/my-first-plugin:hello`). |85 | `name` | Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). |

86 | `description` | Shown in the plugin manager when browsing or installing plugins. |86 | `description` | Shown in the plugin manager when browsing or installing plugins. |

87 | `version` | Track releases using [semantic versioning](/en/plugins-reference#version-management). |87 | `version` | Track releases using [semantic versioning](/en/plugins-reference#version-management). |

88 | `author` | Optional. Helpful for attribution. |88 | `author` | Optional. Helpful for attribution. |


90 For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](/en/plugins-reference#plugin-manifest-schema).90 For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](/en/plugins-reference#plugin-manifest-schema).

91 </Step>91 </Step>

92 92 

93 <Step title="Add a slash command">93 <Step title="Add a skill">

94 Slash commands are Markdown files in the `commands/` directory. The filename becomes the slash command name, prefixed with the plugin's namespace (`hello.md` in a plugin named `my-first-plugin` creates `/my-first-plugin:hello`). The Markdown content tells Claude how to respond when someone runs the slash command.94 Skills live in the `skills/` directory. Each skill is a folder containing a `SKILL.md` file. The folder name becomes the skill name, prefixed with the plugin's namespace (`hello/` in a plugin named `my-first-plugin` creates `/my-first-plugin:hello`).

95 95 

96 Create a `commands` directory in your plugin folder:96 Create a skill directory in your plugin folder:

97 97 

98 ```bash theme={null}98 ```bash theme={null}

99 mkdir my-first-plugin/commands99 mkdir -p my-first-plugin/skills/hello

100 ```100 ```

101 101 

102 Then create `my-first-plugin/commands/hello.md` with this content:102 Then create `my-first-plugin/skills/hello/SKILL.md` with this content:

103 103 

104 ```markdown my-first-plugin/commands/hello.md theme={null}104 ```markdown my-first-plugin/skills/hello/SKILL.md theme={null}

105 ---105 ---

106 description: Greet the user with a friendly message106 description: Greet the user with a friendly message

107 disable-model-invocation: true

107 ---108 ---

108 109 

109 # Hello Command

110 

111 Greet the user warmly and ask how you can help them today.110 Greet the user warmly and ask how you can help them today.

112 ```111 ```

113 </Step>112 </Step>


128 You'll see Claude respond with a greeting. Run `/help` to see your command listed under the plugin namespace.127 You'll see Claude respond with a greeting. Run `/help` to see your command listed under the plugin namespace.

129 128 

130 <Note>129 <Note>

131 **Why namespacing?** Plugin slash commands are always namespaced (like `/greet:hello`) to prevent conflicts when multiple plugins have commands with the same name.130 **Why namespacing?** Plugin skills are always namespaced (like `/greet:hello`) to prevent conflicts when multiple plugins have skills with the same name.

132 131 

133 To change the namespace prefix, update the `name` field in `plugin.json`.132 To change the namespace prefix, update the `name` field in `plugin.json`.

134 </Note>133 </Note>

135 </Step>134 </Step>

136 135 

137 <Step title="Add slash command arguments">136 <Step title="Add skill arguments">

138 Make your slash command dynamic by accepting user input. The `$ARGUMENTS` placeholder captures any text the user provides after the slash command.137 Make your skill dynamic by accepting user input. The `$ARGUMENTS` placeholder captures any text the user provides after the skill name.

139 138 

140 Update your `hello.md` file:139 Update your `hello.md` file:

141 140 


155 /my-first-plugin:hello Alex154 /my-first-plugin:hello Alex

156 ```155 ```

157 156 

158 Claude will greet you by name. For more argument options like `$1`, `$2` for individual parameters, see [Slash commands](/en/slash-commands).157 Claude will greet you by name. For more on passing arguments to skills, see [Skills](/en/skills#pass-arguments-to-skills).

159 </Step>158 </Step>

160</Steps>159</Steps>

161 160 

162You've successfully created and tested a plugin with these key components:161You've successfully created and tested a plugin with these key components:

163 162 

164* **Plugin manifest** (`.claude-plugin/plugin.json`): describes your plugin's metadata163* **Plugin manifest** (`.claude-plugin/plugin.json`): describes your plugin's metadata

165* **Commands directory** (`commands/`): contains your custom slash commands164* **Commands directory** (`commands/`): contains your custom skills

166* **Command arguments** (`$ARGUMENTS`): captures user input for dynamic behavior165* **Skill arguments** (`$ARGUMENTS`): captures user input for dynamic behavior

167 166 

168<Tip>167<Tip>

169 The `--plugin-dir` flag is useful for development and testing. When you're ready to share your plugin with others, see [Create and distribute a plugin marketplace](/en/plugin-marketplaces).168 The `--plugin-dir` flag is useful for development and testing. When you're ready to share your plugin with others, see [Create and distribute a plugin marketplace](/en/plugin-marketplaces).


171 170 

172## Plugin structure overview171## Plugin structure overview

173 172 

174You've created a plugin with a slash command, but plugins can include much more: custom agents, Skills, hooks, MCP servers, and LSP servers.173You've created a plugin with a skill, but plugins can include much more: custom agents, hooks, MCP servers, and LSP servers.

175 174 

176<Warning>175<Warning>

177 **Common mistake**: Don't put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level.176 **Common mistake**: Don't put `commands/`, `agents/`, `skills/`, or `hooks/` inside the `.claude-plugin/` directory. Only `plugin.json` goes inside `.claude-plugin/`. All other directories must be at the plugin root level.


180| Directory | Location | Purpose |179| Directory | Location | Purpose |

181| :---------------- | :---------- | :---------------------------------------------- |180| :---------------- | :---------- | :---------------------------------------------- |

182| `.claude-plugin/` | Plugin root | Contains only `plugin.json` manifest (required) |181| `.claude-plugin/` | Plugin root | Contains only `plugin.json` manifest (required) |

183| `commands/` | Plugin root | Slash commands as Markdown files |182| `commands/` | Plugin root | Skills as Markdown files |

184| `agents/` | Plugin root | Custom agent definitions |183| `agents/` | Plugin root | Custom agent definitions |

185| `skills/` | Plugin root | Agent Skills with `SKILL.md` files |184| `skills/` | Plugin root | Agent Skills with `SKILL.md` files |

186| `hooks/` | Plugin root | Event handlers in `hooks.json` |185| `hooks/` | Plugin root | Event handlers in `hooks.json` |


302 301 

303## Convert existing configurations to plugins302## Convert existing configurations to plugins

304 303 

305If you already have custom commands, Skills, or hooks in your `.claude/` directory, you can convert them into a plugin for easier sharing and distribution.304If you already have skills or hooks in your `.claude/` directory, you can convert them into a plugin for easier sharing and distribution.

306 305 

307### Migration steps306### Migration steps

308 307 


401* [Create and distribute a marketplace](/en/plugin-marketplaces): package and share your plugins400* [Create and distribute a marketplace](/en/plugin-marketplaces): package and share your plugins

402* [Plugins reference](/en/plugins-reference): complete technical specifications401* [Plugins reference](/en/plugins-reference): complete technical specifications

403* Dive deeper into specific plugin components:402* Dive deeper into specific plugin components:

404 * [Slash commands](/en/slash-commands): command development details403 * [Skills](/en/skills): skill development details

405 * [Subagents](/en/sub-agents): agent configuration and capabilities404 * [Subagents](/en/sub-agents): agent configuration and capabilities

406 * [Agent Skills](/en/skills): extend Claude's capabilities

407 * [Hooks](/en/hooks): event handling and automation405 * [Hooks](/en/hooks): event handling and automation

408 * [MCP](/en/mcp): external tool integration406 * [MCP](/en/mcp): external tool integration

409 407 

Details

10 10 

11## Plugin components reference11## Plugin components reference

12 12 

13This section documents the five types of components that plugins can provide.13This section documents the types of components that plugins can provide.

14 14 

15### Commands15### Skills

16 

17Plugins add skills to Claude Code, creating `/name` shortcuts that you or Claude can invoke.

18 

19**Location**: `skills/` or `commands/` directory in plugin root

20 

21**File format**: Skills are directories with `SKILL.md`; commands are simple markdown files

16 22 

17Plugins add custom slash commands that integrate seamlessly with Claude Code's command system.23**Skill structure**:

24 

25```

26skills/

27├── pdf-processor/

28│ ├── SKILL.md

29│ ├── reference.md (optional)

30│ └── scripts/ (optional)

31└── code-reviewer/

32 └── SKILL.md

33```

18 34 

19**Location**: `commands/` directory in plugin root35**Integration behavior**:

20 36 

21**File format**: Markdown files with frontmatter37* Skills and commands are automatically discovered when the plugin is installed

38* Claude can invoke them automatically based on task context

39* Skills can include supporting files alongside SKILL.md

22 40 

23For complete details on plugin command structure, invocation patterns, and features, see [Plugin commands](/en/slash-commands#plugin-commands).41For complete details, see [Skills](/en/skills).

24 42 

25### Agents43### Agents

26 44 


58* Agents can be invoked manually by users76* Agents can be invoked manually by users

59* Plugin agents work alongside built-in Claude agents77* Plugin agents work alongside built-in Claude agents

60 78 

61### Skills

62 

63Plugins can provide Agent Skills that extend Claude's capabilities. Skills are model-invoked—Claude autonomously decides when to use them based on the task context.

64 

65**Location**: `skills/` directory in plugin root

66 

67**File format**: Directories containing `SKILL.md` files with frontmatter

68 

69**Skill structure**:

70 

71```

72skills/

73├── pdf-processor/

74│ ├── SKILL.md

75│ ├── reference.md (optional)

76│ └── scripts/ (optional)

77└── code-reviewer/

78 └── SKILL.md

79```

80 

81**Integration behavior**:

82 

83* Plugin Skills are automatically discovered when the plugin is installed

84* Claude autonomously invokes Skills based on matching task context

85* Skills can include supporting files alongside SKILL.md

86 

87For SKILL.md format and complete Skill authoring guidance, see:

88 

89* [Use Skills in Claude Code](/en/skills)

90* [Agent Skills overview](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview#skill-structure)

91 

92### Hooks79### Hooks

93 80 

94Plugins can provide event handlers that respond to Claude Code events automatically.81Plugins can provide event handlers that respond to Claude Code events automatically.


128* `Stop`: When Claude attempts to stop115* `Stop`: When Claude attempts to stop

129* `SubagentStart`: When a subagent is started116* `SubagentStart`: When a subagent is started

130* `SubagentStop`: When a subagent attempts to stop117* `SubagentStop`: When a subagent attempts to stop

118* `Setup`: When `--init`, `--init-only`, or `--maintenance` flags are used

131* `SessionStart`: At the beginning of sessions119* `SessionStart`: At the beginning of sessions

132* `SessionEnd`: At the end of sessions120* `SessionEnd`: At the end of sessions

133* `PreCompact`: Before conversation history is compacted121* `PreCompact`: Before conversation history is compacted


244| `shutdownTimeout` | Max time to wait for graceful shutdown (milliseconds) |232| `shutdownTimeout` | Max time to wait for graceful shutdown (milliseconds) |

245| `restartOnCrash` | Whether to automatically restart the server if it crashes |233| `restartOnCrash` | Whether to automatically restart the server if it crashes |

246| `maxRestarts` | Maximum number of restart attempts before giving up |234| `maxRestarts` | Maximum number of restart attempts before giving up |

247| `loggingConfig` | Debug logging configuration (see below) |

248 

249**Debug logging configuration:**

250 

251The `loggingConfig` field enables verbose LSP logging when users pass `--enable-lsp-logging`. This helps debug language server issues without impacting normal operation.

252 

253```json theme={null}

254"loggingConfig": {

255 "args": ["--log-level", "4"],

256 "env": {

257 "TSS_LOG": "-level verbose -file ${CLAUDE_PLUGIN_LSP_LOG_FILE}"

258 }

259}

260```

261 

262| Field | Description |

263| :----- | :----------------------------------------------------------------- |

264| `args` | Additional command-line arguments appended when logging is enabled |

265| `env` | Additional environment variables merged when logging is enabled |

266 

267The `${CLAUDE_PLUGIN_LSP_LOG_FILE}` variable expands to the log file path. Logs are written to `~/.claude/debug/`.

268 235 

269<Warning>236<Warning>

270 **You must install the language server binary separately.** LSP plugins configure how Claude Code connects to a language server, but they don't include the server itself. If you see `Executable not found in $PATH` in the `/plugin` Errors tab, install the required binary for your language.237 **You must install the language server binary separately.** LSP plugins configure how Claude Code connects to a language server, but they don't include the server itself. If you see `Executable not found in $PATH` in the `/plugin` Errors tab, install the required binary for your language.


291| `user` | `~/.claude/settings.json` | Personal plugins available across all projects (default) |258| `user` | `~/.claude/settings.json` | Personal plugins available across all projects (default) |

292| `project` | `.claude/settings.json` | Team plugins shared via version control |259| `project` | `.claude/settings.json` | Team plugins shared via version control |

293| `local` | `.claude/settings.local.json` | Project-specific plugins, gitignored |260| `local` | `.claude/settings.local.json` | Project-specific plugins, gitignored |

294| `managed` | `managed-settings.json` | Enterprise-managed plugins (read-only, update only) |261| `managed` | `managed-settings.json` | Managed plugins (read-only, update only) |

295 262 

296Plugins use the same scope system as other Claude Code configurations. For installation instructions and scope flags, see [Install plugins](/en/discover-plugins#install-plugins). For a complete explanation of scopes, see [Configuration scopes](/en/settings#configuration-scopes).263Plugins use the same scope system as other Claude Code configurations. For installation instructions and scope flags, see [Install plugins](/en/discover-plugins#install-plugins). For a complete explanation of scopes, see [Configuration scopes](/en/settings#configuration-scopes).

297 264 


500### File locations reference467### File locations reference

501 468 

502| Component | Default Location | Purpose |469| Component | Default Location | Purpose |

503| :-------------- | :--------------------------- | :------------------------------- |470| :-------------- | :--------------------------- | :---------------------------------------------------------- |

504| **Manifest** | `.claude-plugin/plugin.json` | Required metadata file |471| **Manifest** | `.claude-plugin/plugin.json` | Required metadata file |

505| **Commands** | `commands/` | Slash command Markdown files |472| **Commands** | `commands/` | Skill Markdown files (legacy; use `skills/` for new skills) |

506| **Agents** | `agents/` | Subagent Markdown files |473| **Agents** | `agents/` | Subagent Markdown files |

507| **Skills** | `skills/` | Agent Skills with SKILL.md files |474| **Skills** | `skills/` | Skills with `<name>/SKILL.md` structure |

508| **Hooks** | `hooks/hooks.json` | Hook configuration |475| **Hooks** | `hooks/hooks.json` | Hook configuration |

509| **MCP servers** | `.mcp.json` | MCP server definitions |476| **MCP servers** | `.mcp.json` | MCP server definitions |

510| **LSP servers** | `.lsp.json` | Language server configurations |477| **LSP servers** | `.lsp.json` | Language server configurations |


756 723 

757* [Plugins](/en/plugins) - Tutorials and practical usage724* [Plugins](/en/plugins) - Tutorials and practical usage

758* [Plugin marketplaces](/en/plugin-marketplaces) - Creating and managing marketplaces725* [Plugin marketplaces](/en/plugin-marketplaces) - Creating and managing marketplaces

759* [Slash commands](/en/slash-commands) - Command development details726* [Skills](/en/skills) - Skill development details

760* [Subagents](/en/sub-agents) - Agent configuration and capabilities727* [Subagents](/en/sub-agents) - Agent configuration and capabilities

761* [Agent Skills](/en/skills) - Extend Claude's capabilities

762* [Hooks](/en/hooks) - Event handling and automation728* [Hooks](/en/hooks) - Event handling and automation

763* [MCP](/en/mcp) - External tool integration729* [MCP](/en/mcp) - External tool integration

764* [Settings](/en/settings) - Configuration options for plugins730* [Settings](/en/settings) - Configuration options for plugins

quickstart.md +24 −14

Details

10 10 

11* A terminal or command prompt open11* A terminal or command prompt open

12* A code project to work with12* A code project to work with

13* A [Claude.ai](https://claude.ai) (recommended) or [Claude Console](https://console.anthropic.com/) account13* A [Claude subscription](https://claude.com/pricing) (Pro, Max, Teams, or Enterprise) or [Claude Console](https://console.anthropic.com/) account

14 14 

15## Step 1: Install Claude Code15## Step 1: Install Claude Code

16 16 


20 <Tab title="Native Install (Recommended)">20 <Tab title="Native Install (Recommended)">

21 **macOS, Linux, WSL:**21 **macOS, Linux, WSL:**

22 22 

23 ```bash theme={null} theme={null}23 ```bash theme={null}

24 curl -fsSL https://claude.ai/install.sh | bash24 curl -fsSL https://claude.ai/install.sh | bash

25 ```25 ```

26 26 

27 **Windows PowerShell:**27 **Windows PowerShell:**

28 28 

29 ```powershell theme={null} theme={null}29 ```powershell theme={null}

30 irm https://claude.ai/install.ps1 | iex30 irm https://claude.ai/install.ps1 | iex

31 ```31 ```

32 32 

33 **Windows CMD:**33 **Windows CMD:**

34 34 

35 ```batch theme={null} theme={null}35 ```batch theme={null}

36 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd36 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

37 ```37 ```

38 

39 <Info>

40 Native installations automatically update in the background to keep you on the latest version.

41 </Info>

38 </Tab>42 </Tab>

39 43 

40 <Tab title="Homebrew">44 <Tab title="Homebrew">

41 ```sh theme={null} theme={null}45 ```sh theme={null}

42 brew install --cask claude-code46 brew install --cask claude-code

43 ```47 ```

44 </Tab>

45 48 

46 <Tab title="NPM">49 <Info>

47 If you have [Node.js 18 or newer installed](https://nodejs.org/en/download/):50 Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.

51 </Info>

52 </Tab>

48 53 

49 ```sh theme={null} theme={null}54 <Tab title="WinGet">

50 npm install -g @anthropic-ai/claude-code55 ```powershell theme={null}

56 winget install Anthropic.ClaudeCode

51 ```57 ```

58 

59 <Info>

60 WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

61 </Info>

52 </Tab>62 </Tab>

53</Tabs>63</Tabs>

54 64 


66# Follow the prompts to log in with your account76# Follow the prompts to log in with your account

67```77```

68 78 

69You can log in using either account type:79You can log in using any of these account types:

70 80 

71* [Claude.ai](https://claude.ai) (subscription plans - recommended)81* [Claude Pro, Max, Teams, or Enterprise](https://claude.com/pricing) (recommended)

72* [Claude Console](https://console.anthropic.com/) (API access with pre-paid credits)82* [Claude Console](https://console.anthropic.com/) (API access with pre-paid credits)

73 83 

74Once logged in, your credentials are stored and you won't need to log in again.84Once logged in, your credentials are stored and you won't need to log in again.


125```135```

126 136 

127```137```

128> how do I use slash commands in Claude Code?138> how do I create custom skills in Claude Code?

129```139```

130 140 

131```141```


295 * Press `?` to see all available keyboard shortcuts305 * Press `?` to see all available keyboard shortcuts

296 * Use Tab for command completion306 * Use Tab for command completion

297 * Press ↑ for command history307 * Press ↑ for command history

298 * Type `/` to see all slash commands308 * Type `/` to see all commands and skills

299 </Accordion>309 </Accordion>

300</AccordionGroup>310</AccordionGroup>

301 311 

sandboxing.md +2 −2

Details

60 60 

61### Enable sandboxing61### Enable sandboxing

62 62 

63You can enable sandboxing by running the `/sandbox` slash command:63You can enable sandboxing by running the `/sandbox` command:

64 64 

65```65```

66> /sandbox66> /sandbox


216* [Security](/en/security) - Comprehensive security features and best practices216* [Security](/en/security) - Comprehensive security features and best practices

217* [IAM](/en/iam) - Permission configuration and access control217* [IAM](/en/iam) - Permission configuration and access control

218* [Settings](/en/settings) - Complete configuration reference218* [Settings](/en/settings) - Complete configuration reference

219* [CLI reference](/en/cli-reference) - Command-line options including `-sb`219* [CLI reference](/en/cli-reference) - Command-line options

220 220 

221 221 

222---222---

security.md +2 −2

Details

87 87 

88## IDE security88## IDE security

89 89 

90See [here](/en/vs-code#security) for more information on the security of running Claude Code in an IDE.90See [VS Code security and privacy](/en/vs-code#security-and-privacy) for more information on running Claude Code in an IDE.

91 91 

92## Cloud execution security92## Cloud execution security

93 93 


113 113 

114### Team security114### Team security

115 115 

116* Use [enterprise managed settings](/en/iam#enterprise-managed-settings) to enforce organizational standards116* Use [managed settings](/en/iam#managed-settings) to enforce organizational standards

117* Share approved permission configurations through version control117* Share approved permission configurations through version control

118* Train team members on security best practices118* Train team members on security best practices

119* Monitor Claude Code usage through [OpenTelemetry metrics](/en/monitoring-usage)119* Monitor Claude Code usage through [OpenTelemetry metrics](/en/monitoring-usage)

settings.md +158 −55

Details

11### Available scopes11### Available scopes

12 12 

13| Scope | Location | Who it affects | Shared with team? |13| Scope | Location | Who it affects | Shared with team? |

14| :------------- | :----------------------------------- | :----------------------------------- | :--------------------- |14| :---------- | :----------------------------------- | :----------------------------------- | :--------------------- |

15| **Enterprise** | System-level `managed-settings.json` | All users on the machine | Yes (deployed by IT) |15| **Managed** | System-level `managed-settings.json` | All users on the machine | Yes (deployed by IT) |

16| **User** | `~/.claude/` directory | You, across all projects | No |16| **User** | `~/.claude/` directory | You, across all projects | No |

17| **Project** | `.claude/` in repository | All collaborators on this repository | Yes (committed to git) |17| **Project** | `.claude/` in repository | All collaborators on this repository | Yes (committed to git) |

18| **Local** | `.claude/*.local.*` files | You, in this repository only | No (gitignored) |18| **Local** | `.claude/*.local.*` files | You, in this repository only | No (gitignored) |

19 19 

20### When to use each scope20### When to use each scope

21 21 

22**Enterprise scope** is for:22**Managed scope** is for:

23 23 

24* Security policies that must be enforced organization-wide24* Security policies that must be enforced organization-wide

25* Compliance requirements that can't be overridden25* Compliance requirements that can't be overridden


47 47 

48When the same setting is configured in multiple scopes, more specific scopes take precedence:48When the same setting is configured in multiple scopes, more specific scopes take precedence:

49 49 

501. **Enterprise** (highest) - can't be overridden by anything501. **Managed** (highest) - can't be overridden by anything

512. **Command line arguments** - temporary session overrides512. **Command line arguments** - temporary session overrides

523. **Local** - overrides project and user settings523. **Local** - overrides project and user settings

534. **Project** - overrides user settings534. **Project** - overrides user settings


79* **Project settings** are saved in your project directory:79* **Project settings** are saved in your project directory:

80 * `.claude/settings.json` for settings that are checked into source control and shared with your team80 * `.claude/settings.json` for settings that are checked into source control and shared with your team

81 * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore `.claude/settings.local.json` when it is created.81 * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore `.claude/settings.local.json` when it is created.

82* **Managed settings** (Enterprise): Enterprise administrators can configure and distribute Claude Code settings to their organization through the [Claude.ai admin console](https://claude.ai/admin-settings/claude-code). These settings are fetched automatically when users authenticate, take precedence over user and project settings, and cannot be overridden locally. This feature is available to Claude for Enterprise customers. If you don't see this option in your admin console, contact your Anthropic account team to have the feature enabled.82* **Managed settings**: For organizations that need centralized control, Claude Code supports `managed-settings.json` and `managed-mcp.json` files that can be deployed to system directories:

83 

84 For organizations that prefer file-based policy distribution, Claude Code also supports `managed-settings.json` and `managed-mcp.json` files that can be deployed to system directories:

85 83 

86 * macOS: `/Library/Application Support/ClaudeCode/`84 * macOS: `/Library/Application Support/ClaudeCode/`

87 * Linux and WSL: `/etc/claude-code/`85 * Linux and WSL: `/etc/claude-code/`


91 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.89 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.

92 </Note>90 </Note>

93 91 

94 See [Enterprise managed settings](/en/iam#enterprise-managed-settings) and [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) for details.92 See [Managed settings](/en/iam#managed-settings) and [Managed MCP configuration](/en/mcp#managed-mcp-configuration) for details.

95 93 

96 <Note>94 <Note>

97 Enterprise deployments can also restrict **plugin marketplace additions** using95 Managed deployments can also restrict **plugin marketplace additions** using

98 `strictKnownMarketplaces`. For more information, see [Enterprise marketplace restrictions](/en/plugin-marketplaces#enterprise-marketplace-restrictions).96 `strictKnownMarketplaces`. For more information, see [Managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions).

99 </Note>97 </Note>

100* **Other configuration** is stored in `~/.claude.json`. This file contains your preferences (theme, notification settings, editor mode), OAuth session, [MCP server](/en/mcp) configurations for user and local scopes, per-project state (allowed tools, trust settings), and various caches. Project-scoped MCP servers are stored separately in `.mcp.json`.98* **Other configuration** is stored in `~/.claude.json`. This file contains your preferences (theme, notification settings, editor mode), OAuth session, [MCP server](/en/mcp) configurations for user and local scopes, per-project state (allowed tools, trust settings), and various caches. Project-scoped MCP servers are stored separately in `.mcp.json`.

101 99 


131`settings.json` supports a number of options:129`settings.json` supports a number of options:

132 130 

133| Key | Description | Example |131| Key | Description | Example |

134| :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |132| :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |

135| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |133| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |

136| `cleanupPeriodDays` | Sessions inactive for longer than this period are deleted at startup. Setting to `0` immediately deletes all sessions. (default: 30 days) | `20` |134| `cleanupPeriodDays` | Sessions inactive for longer than this period are deleted at startup. Setting to `0` immediately deletes all sessions. (default: 30 days) | `20` |

137| `companyAnnouncements` | Announcement to display to users at startup. If multiple announcements are provided, they will be cycled through at random. | `["Welcome to Acme Corp! Review our code guidelines at docs.acme.com"]` |135| `companyAnnouncements` | Announcement to display to users at startup. If multiple announcements are provided, they will be cycled through at random. | `["Welcome to Acme Corp! Review our code guidelines at docs.acme.com"]` |


141| `permissions` | See table below for structure of permissions. | |139| `permissions` | See table below for structure of permissions. | |

142| `hooks` | Configure custom commands to run before or after tool executions. See [hooks documentation](/en/hooks) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |140| `hooks` | Configure custom commands to run before or after tool executions. See [hooks documentation](/en/hooks) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |

143| `disableAllHooks` | Disable all [hooks](/en/hooks) | `true` |141| `disableAllHooks` | Disable all [hooks](/en/hooks) | `true` |

144| `allowManagedHooksOnly` | (Enterprise) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See [Hook configuration](#hook-configuration) | `true` |142| `allowManagedHooksOnly` | (Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See [Hook configuration](#hook-configuration) | `true` |

145| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |143| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |

146| `otelHeadersHelper` | Script to generate dynamic OpenTelemetry headers. Runs at startup and periodically (see [Dynamic headers](/en/monitoring-usage#dynamic-headers)) | `/bin/generate_otel_headers.sh` |144| `otelHeadersHelper` | Script to generate dynamic OpenTelemetry headers. Runs at startup and periodically (see [Dynamic headers](/en/monitoring-usage#dynamic-headers)) | `/bin/generate_otel_headers.sh` |

147| `statusLine` | Configure a custom status line to display context. See [`statusLine` documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |145| `statusLine` | Configure a custom status line to display context. See [`statusLine` documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |

148| `fileSuggestion` | Configure a custom script for `@` file autocomplete. See [File suggestion settings](#file-suggestion-settings) | `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` |146| `fileSuggestion` | Configure a custom script for `@` file autocomplete. See [File suggestion settings](#file-suggestion-settings) | `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` |

147| `respectGitignore` | Control whether the `@` file picker respects `.gitignore` patterns. When `true` (default), files matching `.gitignore` patterns are excluded from suggestions | `false` |

149| `outputStyle` | Configure an output style to adjust the system prompt. See [output styles documentation](/en/output-styles) | `"Explanatory"` |148| `outputStyle` | Configure an output style to adjust the system prompt. See [output styles documentation](/en/output-styles) | `"Explanatory"` |

150| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |149| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |

151| `forceLoginOrgUUID` | Specify the UUID of an organization to automatically select it during login, bypassing the organization selection step. Requires `forceLoginMethod` to be set | `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` |150| `forceLoginOrgUUID` | Specify the UUID of an organization to automatically select it during login, bypassing the organization selection step. Requires `forceLoginMethod` to be set | `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` |

152| `enableAllProjectMcpServers` | Automatically approve all MCP servers defined in project `.mcp.json` files | `true` |151| `enableAllProjectMcpServers` | Automatically approve all MCP servers defined in project `.mcp.json` files | `true` |

153| `enabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to approve | `["memory", "github"]` |152| `enabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to approve | `["memory", "github"]` |

154| `disabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to reject | `["filesystem"]` |153| `disabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to reject | `["filesystem"]` |

155| `allowedMcpServers` | When set in managed-settings.json, allowlist of MCP servers users can configure. Undefined = no restrictions, empty array = lockdown. Applies to all scopes. Denylist takes precedence. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) | `[{ "serverName": "github" }]` |154| `allowedMcpServers` | When set in managed-settings.json, allowlist of MCP servers users can configure. Undefined = no restrictions, empty array = lockdown. Applies to all scopes. Denylist takes precedence. See [Managed MCP configuration](/en/mcp#managed-mcp-configuration) | `[{ "serverName": "github" }]` |

156| `deniedMcpServers` | When set in managed-settings.json, denylist of MCP servers that are explicitly blocked. Applies to all scopes including enterprise servers. Denylist takes precedence over allowlist. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) | `[{ "serverName": "filesystem" }]` |155| `deniedMcpServers` | When set in managed-settings.json, denylist of MCP servers that are explicitly blocked. Applies to all scopes including managed servers. Denylist takes precedence over allowlist. See [Managed MCP configuration](/en/mcp#managed-mcp-configuration) | `[{ "serverName": "filesystem" }]` |

157| `strictKnownMarketplaces` | When set in managed-settings.json, allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Applies to marketplace additions only. See [Enterprise marketplace restrictions](/en/plugin-marketplaces#enterprise-marketplace-restrictions) | `[{ "source": "github", "repo": "acme-corp/plugins" }]` |156| `strictKnownMarketplaces` | When set in managed-settings.json, allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Applies to marketplace additions only. See [Managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) | `[{ "source": "github", "repo": "acme-corp/plugins" }]` |

158| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |157| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |

159| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |158| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |

160| `alwaysThinkingEnabled` | Enable [extended thinking](/en/common-workflows#use-extended-thinking) by default for all sessions. Typically configured via the `/config` command rather than editing directly | `true` |159| `alwaysThinkingEnabled` | Enable [extended thinking](/en/common-workflows#use-extended-thinking-thinking-mode) by default for all sessions. Typically configured via the `/config` command rather than editing directly | `true` |

160| `plansDirectory` | Customize where plan files are stored. Path is relative to project root. Default: `~/.claude/plans` | `"./plans"` |

161| `showTurnDuration` | Show turn duration messages after responses (e.g., "Cooked for 1m 6s"). Set to `false` to hide these messages | `true` |

162| `language` | Configure Claude's preferred response language (e.g., `"japanese"`, `"spanish"`, `"french"`). Claude will respond in this language by default | `"japanese"` |

163| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |

164| `spinnerTipsEnabled` | Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`) | `false` |

165| `terminalProgressBarEnabled` | Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: `true`) | `false` |

161 166 

162### Permission settings167### Permission settings

163 168 

164| Keys | Description | Example |169| Keys | Description | Example |

165| :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------- |170| :----------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------- |

166| `allow` | Array of [permission rules](/en/iam#configuring-permissions) to allow tool use. **Note:** Bash rules use prefix matching, not regex | `[ "Bash(git diff:*)" ]` |171| `allow` | Array of permission rules to allow tool use. See [Permission rule syntax](#permission-rule-syntax) below for pattern matching details | `[ "Bash(git diff:*)" ]` |

167| `ask` | Array of [permission rules](/en/iam#configuring-permissions) to ask for confirmation upon tool use. | `[ "Bash(git push:*)" ]` |172| `ask` | Array of permission rules to ask for confirmation upon tool use. See [Permission rule syntax](#permission-rule-syntax) below | `[ "Bash(git push:*)" ]` |

168| `deny` | Array of [permission rules](/en/iam#configuring-permissions) to deny tool use. Use this to also exclude sensitive files from Claude Code access. **Note:** Bash patterns are prefix matches and can be bypassed (see [Bash permission limitations](/en/iam#tool-specific-permission-rules)) | `[ "WebFetch", "Bash(curl:*)", "Read(./.env)", "Read(./secrets/**)" ]` |173| `deny` | Array of permission rules to deny tool use. Use this to exclude sensitive files from Claude Code access. See [Permission rule syntax](#permission-rule-syntax) and [Bash permission limitations](/en/iam#tool-specific-permission-rules) | `[ "WebFetch", "Bash(curl:*)", "Read(./.env)", "Read(./secrets/**)" ]` |

169| `additionalDirectories` | Additional [working directories](/en/iam#working-directories) that Claude has access to | `[ "../docs/" ]` |174| `additionalDirectories` | Additional [working directories](/en/iam#working-directories) that Claude has access to | `[ "../docs/" ]` |

170| `defaultMode` | Default [permission mode](/en/iam#permission-modes) when opening Claude Code | `"acceptEdits"` |175| `defaultMode` | Default [permission mode](/en/iam#permission-modes) when opening Claude Code | `"acceptEdits"` |

171| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed settings](/en/iam#enterprise-managed-settings) | `"disable"` |176| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed settings](/en/iam#managed-settings) | `"disable"` |

177 

178### Permission rule syntax

179 

180Permission rules follow the format `Tool` or `Tool(specifier)`. Understanding the syntax helps you write rules that match exactly what you intend.

181 

182#### Rule evaluation order

183 

184When multiple rules could match the same tool use, rules are evaluated in this order:

185 

1861. **Deny** rules are checked first

1872. **Ask** rules are checked second

1883. **Allow** rules are checked last

189 

190The first matching rule determines the behavior. This means deny rules always take precedence over allow rules, even if both match the same command.

191 

192#### Matching all uses of a tool

193 

194To match all uses of a tool, use just the tool name without parentheses:

195 

196| Rule | Effect |

197| :--------- | :--------------------------------- |

198| `Bash` | Matches **all** Bash commands |

199| `WebFetch` | Matches **all** web fetch requests |

200| `Read` | Matches **all** file reads |

201 

202<Warning>

203 `Bash(*)` does **not** match all Bash commands. The `*` wildcard only matches within the specifier context. To allow or deny all uses of a tool, use just the tool name: `Bash`, not `Bash(*)`.

204</Warning>

205 

206#### Using specifiers for fine-grained control

207 

208Add a specifier in parentheses to match specific tool uses:

209 

210| Rule | Effect |

211| :----------------------------- | :------------------------------------------------------- |

212| `Bash(npm run build)` | Matches the exact command `npm run build` |

213| `Read(./.env)` | Matches reading the `.env` file in the current directory |

214| `WebFetch(domain:example.com)` | Matches fetch requests to example.com |

215 

216#### Wildcard patterns

217 

218Two wildcard syntaxes are available for Bash rules:

219 

220| Wildcard | Position | Behavior | Example |

221| :------- | :------------------ | :----------------------------------------------------------------------------------------------- | :------------------------------------------- |

222| `:*` | End of pattern only | **Prefix matching** with word boundary. The prefix must be followed by a space or end-of-string. | `Bash(ls:*)` matches `ls -la` but not `lsof` |

223| `*` | Anywhere in pattern | **Glob matching** with no word boundary. Matches any sequence of characters at that position. | `Bash(ls*)` matches both `ls -la` and `lsof` |

224 

225**Prefix matching with `:*`**

226 

227The `:*` suffix matches any command that starts with the specified prefix. This works with multi-word commands. The following configuration allows npm and git commit commands while blocking git push and rm -rf:

228 

229```json theme={null}

230{

231 "permissions": {

232 "allow": [

233 "Bash(npm run:*)",

234 "Bash(git commit:*)",

235 "Bash(docker compose:*)"

236 ],

237 "deny": [

238 "Bash(git push:*)",

239 "Bash(rm -rf:*)"

240 ]

241 }

242}

243```

244 

245**Glob matching with `*`**

246 

247The `*` wildcard can appear at the beginning, middle, or end of a pattern. The following configuration allows any git command targeting main (like `git checkout main`, `git merge main`) and any version check command (like `node --version`, `npm --version`):

248 

249```json theme={null}

250{

251 "permissions": {

252 "allow": [

253 "Bash(git * main)",

254 "Bash(* --version)"

255 ]

256 }

257}

258```

259 

260<Warning>

261 Bash permission patterns that try to constrain command arguments are fragile. For example, `Bash(curl http://github.com/:*)` intends to restrict curl to GitHub URLs, but won't match `curl -X GET http://github.com/...` (flags before URL), `curl https://github.com/...` (different protocol), or commands using shell variables. Do not rely on argument-constraining patterns as a security boundary. See [Bash permission limitations](/en/iam#tool-specific-permission-rules) for alternatives.

262</Warning>

263 

264For detailed information about tool-specific permission patterns—including Read, Edit, WebFetch, MCP, Task rules, and Bash permission limitations—see [Tool-specific permission rules](/en/iam#tool-specific-permission-rules).

172 265 

173### Sandbox settings266### Sandbox settings

174 267 


297 390 

298### Hook configuration391### Hook configuration

299 392 

300**Enterprise-only setting**: Controls which hooks are allowed to run. This setting can only be configured in [managed settings](#settings-files) and provides enterprise administrators with strict control over hook execution.393**Managed settings only**: Controls which hooks are allowed to run. This setting can only be configured in [managed settings](#settings-files) and provides administrators with strict control over hook execution.

301 394 

302**Behavior when `allowManagedHooksOnly` is `true`:**395**Behavior when `allowManagedHooksOnly` is `true`:**

303 396 


316 409 

317Settings apply in order of precedence. From highest to lowest:410Settings apply in order of precedence. From highest to lowest:

318 411 

3191. **Managed settings** (Enterprise)4121. **Managed settings** (`managed-settings.json`)

320 * Remote settings configured via the [Claude.ai admin console](https://claude.ai/admin-settings/claude-code)

321 * Fetched automatically when users authenticate

322 * Cannot be overridden

323 

3242. **File-based managed settings** (`managed-settings.json`)

325 * Policies deployed by IT/DevOps to system directories413 * Policies deployed by IT/DevOps to system directories

326 * Cannot be overridden by user or project settings414 * Cannot be overridden by user or project settings

327 * Ignored when remote managed settings are configured

328 415 

3293. **Command line arguments**4162. **Command line arguments**

330 * Temporary overrides for a specific session417 * Temporary overrides for a specific session

331 418 

3324. **Local project settings** (`.claude/settings.local.json`)4193. **Local project settings** (`.claude/settings.local.json`)

333 * Personal project-specific settings420 * Personal project-specific settings

334 421 

3355. **Shared project settings** (`.claude/settings.json`)4224. **Shared project settings** (`.claude/settings.json`)

336 * Team-shared project settings in source control423 * Team-shared project settings in source control

337 424 

3386. **User settings** (`~/.claude/settings.json`)4255. **User settings** (`~/.claude/settings.json`)

339 * Personal global settings426 * Personal global settings

340 427 

341This hierarchy ensures that enterprise security policies are always enforced while still allowing teams and individuals to customize their experience.428This hierarchy ensures that organizational policies are always enforced while still allowing teams and individuals to customize their experience.

342 429 

343For example, if your user settings allow `Bash(npm run:*)` but a project's shared settings deny it, the project setting takes precedence and the command is blocked.430For example, if your user settings allow `Bash(npm run:*)` but a project's shared settings deny it, the project setting takes precedence and the command is blocked.

344 431 


346 433 

347* **Memory files (`CLAUDE.md`)**: Contain instructions and context that Claude loads at startup434* **Memory files (`CLAUDE.md`)**: Contain instructions and context that Claude loads at startup

348* **Settings files (JSON)**: Configure permissions, environment variables, and tool behavior435* **Settings files (JSON)**: Configure permissions, environment variables, and tool behavior

349* **Slash commands**: Custom commands that can be invoked during a session with `/command-name`436* **Skills**: Custom prompts that can be invoked with `/skill-name` or loaded by Claude automatically

350* **MCP servers**: Extend Claude Code with additional tools and integrations437* **MCP servers**: Extend Claude Code with additional tools and integrations

351* **Precedence**: Higher-level configurations (Enterprise) override lower-level ones (User/Project)438* **Precedence**: Higher-level configurations (Managed) override lower-level ones (User/Project)

352* **Inheritance**: Settings are merged, with more specific settings adding to or overriding broader ones439* **Inheritance**: Settings are merged, with more specific settings adding to or overriding broader ones

353 440 

354### System prompt441### System prompt


386 473 

387## Plugin configuration474## Plugin configuration

388 475 

389Claude Code supports a plugin system that lets you extend functionality with custom commands, agents, hooks, and MCP servers. Plugins are distributed through marketplaces and can be configured at both user and repository levels.476Claude Code supports a plugin system that lets you extend functionality with skills, agents, hooks, and MCP servers. Plugins are distributed through marketplaces and can be configured at both user and repository levels.

390 477 

391### Plugin settings478### Plugin settings

392 479 


470 557 

471#### `strictKnownMarketplaces`558#### `strictKnownMarketplaces`

472 559 

473**Enterprise-only setting**: Controls which plugin marketplaces users are allowed to add. This setting can only be configured in [`managed-settings.json`](/en/iam#enterprise-managed-settings) and provides enterprise administrators with strict control over marketplace sources.560**Managed settings only**: Controls which plugin marketplaces users are allowed to add. This setting can only be configured in [`managed-settings.json`](/en/iam#managed-settings) and provides administrators with strict control over marketplace sources.

474 561 

475**Managed settings file locations**:562**Managed settings file locations**:

476 563 


480 567 

481**Key characteristics**:568**Key characteristics**:

482 569 

483* Only available in enterprise managed settings (`managed-settings.json`)570* Only available in managed settings (`managed-settings.json`)

484* Cannot be overridden by user or project settings (highest precedence)571* Cannot be overridden by user or project settings (highest precedence)

485* Enforced BEFORE network/filesystem operations (blocked sources never execute)572* Enforced BEFORE network/filesystem operations (blocked sources never execute)

486* Uses exact matching for source specifications (including `ref`, `path` for git sources)573* Uses exact matching for source specifications (including `ref`, `path` for git sources)


524 611 

525Fields: `url` (required), `headers` (optional: HTTP headers for authenticated access)612Fields: `url` (required), `headers` (optional: HTTP headers for authenticated access)

526 613 

614<Note>

615 URL-based marketplaces only download the `marketplace.json` file. They do not download plugin files from the server. Plugins in URL-based marketplaces must use external sources (GitHub, npm, or git URLs) rather than relative paths. For plugins with relative paths, use a Git-based marketplace instead. See [Troubleshooting](/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces) for details.

616</Note>

617 

5274. **NPM packages**:6184. **NPM packages**:

528 619 

529```json theme={null}620```json theme={null}


611 702 

612| Aspect | `strictKnownMarketplaces` | `extraKnownMarketplaces` |703| Aspect | `strictKnownMarketplaces` | `extraKnownMarketplaces` |

613| --------------------- | ------------------------------------ | ------------------------------------ |704| --------------------- | ------------------------------------ | ------------------------------------ |

614| **Purpose** | Enterprise policy enforcement | Team convenience |705| **Purpose** | Organizational policy enforcement | Team convenience |

615| **Settings file** | `managed-settings.json` only | Any settings file |706| **Settings file** | `managed-settings.json` only | Any settings file |

616| **Behavior** | Blocks non-allowlisted additions | Auto-installs missing marketplaces |707| **Behavior** | Blocks non-allowlisted additions | Auto-installs missing marketplaces |

617| **When enforced** | Before network/filesystem operations | After user trust prompt |708| **When enforced** | Before network/filesystem operations | After user trust prompt |


646**Important notes**:737**Important notes**:

647 738 

648* Restrictions are checked BEFORE any network requests or filesystem operations739* Restrictions are checked BEFORE any network requests or filesystem operations

649* When blocked, users see clear error messages indicating the source is blocked by enterprise policy740* When blocked, users see clear error messages indicating the source is blocked by managed policy

650* The restriction applies only to adding NEW marketplaces; previously installed marketplaces remain accessible741* The restriction applies only to adding NEW marketplaces; previously installed marketplaces remain accessible

651* Enterprise managed settings have the highest precedence and cannot be overridden742* Managed settings have the highest precedence and cannot be overridden

652 743 

653See [Enterprise marketplace restrictions](/en/plugin-marketplaces#enterprise-marketplace-restrictions) for user-facing documentation.744See [Managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) for user-facing documentation.

654 745 

655### Managing plugins746### Managing plugins

656 747 


673</Note>764</Note>

674 765 

675| Variable | Purpose |766| Variable | Purpose |

676| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |767| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

677| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) |768| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) |

678| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |769| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |

679| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |770| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |


688| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |779| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |

689| `BASH_MAX_OUTPUT_LENGTH` | Maximum number of characters in bash outputs before they are middle-truncated |780| `BASH_MAX_OUTPUT_LENGTH` | Maximum number of characters in bash outputs before they are middle-truncated |

690| `BASH_MAX_TIMEOUT_MS` | Maximum timeout the model can set for long-running bash commands |781| `BASH_MAX_TIMEOUT_MS` | Maximum timeout the model can set for long-running bash commands |

782| `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](/en/statusline) |

691| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command |783| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command |

692| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) |784| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) |

693| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |785| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |

694| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) |786| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) |

695| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |787| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |

696| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers |788| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers |

789| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut |

790| `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` | Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode |

791| `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` | Set to `true` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution |

792| `CLAUDE_CODE_TMPDIR` | Override the temp directory used for internal temp files. Claude Code appends `/claude/` to this path. Default: `/tmp` on Unix/macOS, `os.tmpdir()` on Windows |

697| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |793| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |

698| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |794| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |

795| `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS` | Override the default token limit for file reads. Useful when you need to read larger files in full |

796| `CLAUDE_CODE_HIDE_ACCOUNT_INFO` | Set to `1` to hide your email address and organization name from the Claude Code UI. Useful when streaming or recording |

699| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |797| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |

700| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests |798| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests. Default: 32,000. Maximum: 64,000. Increasing this value reduces the effective context window available before [auto-compaction](/en/costs#reduce-token-usage) triggers. |

701| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) |799| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) |

800| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) |

702| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` |801| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` |

703| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) |802| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) |

704| `CLAUDE_CODE_SKIP_FOUNDRY_AUTH` | Skip Azure authentication for Microsoft Foundry (for example, when using an LLM gateway) |803| `CLAUDE_CODE_SKIP_FOUNDRY_AUTH` | Skip Azure authentication for Microsoft Foundry (for example, when using an LLM gateway) |


718| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models |817| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models |

719| `DISABLE_PROMPT_CACHING_SONNET` | Set to `1` to disable prompt caching for Sonnet models |818| `DISABLE_PROMPT_CACHING_SONNET` | Set to `1` to disable prompt caching for Sonnet models |

720| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |819| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |

820| `ENABLE_TOOL_SEARCH` | Controls [MCP tool search](/en/mcp#scale-with-mcp-tool-search). Values: `auto` (default, enables at 10% context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `true` (always on), `false` (disabled) |

821| `FORCE_AUTOUPDATE_PLUGINS` | Set to `true` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER` |

721| `HTTP_PROXY` | Specify HTTP proxy server for network connections |822| `HTTP_PROXY` | Specify HTTP proxy server for network connections |

722| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |823| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |

824| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization from the UI, skips onboarding, and hides internal commands. Useful for streaming or recording sessions |

723| `MAX_MCP_OUTPUT_TOKENS` | Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens (default: 25000) |825| `MAX_MCP_OUTPUT_TOKENS` | Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens (default: 25000) |

724| `MAX_THINKING_TOKENS` | Enable [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) and set the token budget for the thinking process. Extended thinking improves performance on complex reasoning and coding tasks but impacts [prompt caching efficiency](https://docs.claude.com/en/docs/build-with-claude/prompt-caching#caching-with-thinking-blocks). Disabled by default. |826| `MAX_THINKING_TOKENS` | Override the [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) token budget. Thinking is enabled at max budget (31,999 tokens) by default. Use this to limit the budget (for example, `MAX_THINKING_TOKENS=10000`) or disable thinking entirely (`MAX_THINKING_TOKENS=0`). Extended thinking improves performance on complex reasoning and coding tasks but impacts [prompt caching efficiency](https://docs.claude.com/en/docs/build-with-claude/prompt-caching#caching-with-thinking-blocks). |

725| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |827| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |

726| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |828| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |

727| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |829| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |

728| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for slash command metadata shown to [SlashCommand tool](/en/slash-commands#slashcommand-tool) (default: 15000) |830| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for skill metadata shown to the [Skill tool](/en/skills#control-who-invokes-a-skill) (default: 15000). Legacy name kept for backwards compatibility. |

729| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code |831| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code |

730| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI |832| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI |

731| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI |833| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI |


738Claude Code has access to a set of powerful tools that help it understand and modify your codebase:840Claude Code has access to a set of powerful tools that help it understand and modify your codebase:

739 841 

740| Tool | Description | Permission Required |842| Tool | Description | Permission Required |

741| :------------------ | :------------------------------------------------------------------------------------------------ | :------------------ |843| :------------------ | :------------------------------------------------------------------------------------------------- | :------------------ |

742| **AskUserQuestion** | Asks the user multiple choice questions to gather information or clarify ambiguity | No |844| **AskUserQuestion** | Asks multiple-choice questions to gather requirements or clarify ambiguity | No |

743| **Bash** | Executes shell commands in your environment (see [Bash tool behavior](#bash-tool-behavior) below) | Yes |845| **Bash** | Executes shell commands in your environment (see [Bash tool behavior](#bash-tool-behavior) below) | Yes |

744| **BashOutput** | Retrieves output from a background bash shell | No |846| **TaskOutput** | Retrieves output from a background task (bash shell or subagent) | No |

745| **Edit** | Makes targeted edits to specific files | Yes |847| **Edit** | Makes targeted edits to specific files | Yes |

746| **ExitPlanMode** | Prompts the user to exit plan mode and start coding | Yes |848| **ExitPlanMode** | Prompts the user to exit plan mode and start coding | Yes |

747| **Glob** | Finds files based on pattern matching | No |849| **Glob** | Finds files based on pattern matching | No |

748| **Grep** | Searches for patterns in file contents | No |850| **Grep** | Searches for patterns in file contents | No |

749| **KillShell** | Kills a running background bash shell by its ID | No |851| **KillShell** | Kills a running background bash shell by its ID | No |

852| **MCPSearch** | Searches for and loads MCP tools when [tool search](/en/mcp#scale-with-mcp-tool-search) is enabled | No |

750| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |853| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |

751| **Read** | Reads the contents of files | No |854| **Read** | Reads the contents of files | No |

752| **Skill** | Executes a skill within the main conversation | Yes |855| **Skill** | Executes a [skill](/en/skills#control-who-invokes-a-skill) within the main conversation | Yes |

753| **SlashCommand** | Runs a [custom slash command](/en/slash-commands#slashcommand-tool) | Yes |

754| **Task** | Runs a sub-agent to handle complex, multi-step tasks | No |856| **Task** | Runs a sub-agent to handle complex, multi-step tasks | No |

755| **TodoWrite** | Creates and manages structured task lists | No |857| **TodoWrite** | Creates and manages structured task lists | No |

756| **WebFetch** | Fetches content from a specified URL | Yes |858| **WebFetch** | Fetches content from a specified URL | Yes |


832 934 

833## See also935## See also

834 936 

835* [Identity and Access Management](/en/iam#configuring-permissions) - Learn about Claude Code's permission system937* [Identity and Access Management](/en/iam#configuring-permissions) - Permission system overview and how allow/ask/deny rules interact

836* [IAM and access control](/en/iam#enterprise-managed-settings) - Enterprise policy management938* [Tool-specific permission rules](/en/iam#tool-specific-permission-rules) - Detailed patterns for Bash, Read, Edit, WebFetch, MCP, and Task tools, including security limitations

837* [Troubleshooting](/en/troubleshooting#auto-updater-issues) - Solutions for common configuration issues939* [Managed settings](/en/iam#managed-settings) - Managed policy configuration for organizations

940* [Troubleshooting](/en/troubleshooting) - Solutions for common configuration issues

838 941 

839 942 

840---943---

setup.md +136 −91

Details

4 4 

5## System requirements5## System requirements

6 6 

7* **Operating Systems**: macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL 1, WSL 2, or Git for Windows)7* **Operating Systems**: macOS 13.0+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL 1, WSL 2, or Git for Windows)

8* **Hardware**: 4 GB+ RAM8* **Hardware**: 4 GB+ RAM

9* **Software**: [Node.js 18+](https://nodejs.org/en/download) (only required for npm installation)9* **Network**: Internet connection required (see [network configuration](/en/network-config#network-access-requirements))

10* **Network**: Internet connection required for authentication and AI processing10* **Shell**: Works best in Bash or Zsh

11* **Shell**: Works best in Bash, Zsh or Fish

12* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)11* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)

13 12 

14### Additional dependencies13### Additional dependencies

15 14 

16* **ripgrep**: Usually included with Claude Code. If search fails, see [search troubleshooting](/en/troubleshooting#search-and-discovery-issues).15* **ripgrep**: Usually included with Claude Code. If search fails, see [search troubleshooting](/en/troubleshooting#search-and-discovery-issues).

16* **[Node.js 18+](https://nodejs.org/en/download)**: Only required for [deprecated npm installation](#npm-installation-deprecated)

17 17 

18## Standard installation18## Installation

19 19 

20To install Claude Code, use one of the following methods:20To install Claude Code, use one of the following methods:

21 21 


38 ```batch theme={null}38 ```batch theme={null}

39 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd39 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

40 ```40 ```

41 

42 <Info>

43 Native installations automatically update in the background to keep you on the latest version.

44 </Info>

41 </Tab>45 </Tab>

42 46 

43 <Tab title="Homebrew">47 <Tab title="Homebrew">

44 ```sh theme={null}48 ```sh theme={null}

45 brew install --cask claude-code49 brew install --cask claude-code

46 ```50 ```

47 </Tab>

48 51 

49 <Tab title="NPM">52 <Info>

50 If you have [Node.js 18 or newer installed](https://nodejs.org/en/download/):53 Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.

54 </Info>

55 </Tab>

51 56 

52 ```sh theme={null}57 <Tab title="WinGet">

53 npm install -g @anthropic-ai/claude-code58 ```powershell theme={null}

59 winget install Anthropic.ClaudeCode

54 ```60 ```

61 

62 <Info>

63 WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

64 </Info>

55 </Tab>65 </Tab>

56</Tabs>66</Tabs>

57 67 

58<Note>

59 Some users may be automatically migrated to an improved installation method.

60</Note>

61 

62After the installation process completes, navigate to your project and start Claude Code:68After the installation process completes, navigate to your project and start Claude Code:

63 69 

64```bash theme={null}70```bash theme={null}


66claude72claude

67```73```

68 74 

69Claude Code offers the following authentication options:75If you encounter any issues during installation, consult the [troubleshooting guide](/en/troubleshooting).

70 

711. **Claude Console**: The default option. Connect through the Claude Console and complete the OAuth process. Requires active billing in the [Anthropic console](https://console.anthropic.com). A "Claude Code" workspace is automatically created for usage tracking and cost management. You can't create API keys for the Claude Code workspace; it's dedicated exclusively for Claude Code usage.

722. **Claude App (with Pro or Max plan)**: Subscribe to Claude's [Pro or Max plan](https://claude.com/pricing) for a unified subscription that includes both Claude Code and the web interface. Get more value at the same price point while managing your account in one place. Log in with your Claude.ai account. During launch, choose the option that matches your subscription type.

733. **Enterprise platforms**: Configure Claude Code to use [Amazon Bedrock, Google Vertex AI, or Microsoft Foundry](/en/third-party-integrations) for enterprise deployments with your existing cloud infrastructure.

74 

75<Note>

76 Claude Code securely stores your credentials. See [Credential Management](/en/iam#credential-management) for details.

77</Note>

78 

79## Windows setup

80 

81**Option 1: Claude Code within WSL**

82 

83* Both WSL 1 and WSL 2 are supported

84 

85**Option 2: Claude Code on native Windows with Git Bash**

86 

87* Requires [Git for Windows](https://git-scm.com/downloads/win)

88* For portable Git installations, specify the path to your `bash.exe`:

89 ```powershell theme={null}

90 $env:CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"

91 ```

92 

93## Alternative installation methods

94 

95Claude Code offers multiple installation methods to suit different environments.

96 

97If you encounter any issues during installation, consult the [troubleshooting guide](/en/troubleshooting#linux-permission-issues).

98 76 

99<Tip>77<Tip>

100 Run `claude doctor` after installation to check your installation type and version.78 Run `claude doctor` after installation to check your installation type and version.

101</Tip>79</Tip>

102 80 

103### Native installation options81<Note>

82 **Alpine Linux and other musl/uClibc-based distributions**: The native installer requires `libgcc`, `libstdc++`, and `ripgrep`. For Alpine: `apk add libgcc libstdc++ ripgrep`. Set `USE_BUILTIN_RIPGREP=0`.

83</Note>

104 84 

105The native installation is the recommended method and offers several benefits:85### Authentication

106 86 

107* One self-contained executable87#### For individuals

108* No Node.js dependency

109* Improved auto-updater stability

110 88 

111If you have an existing installation of Claude Code, use `claude install` to migrate to the native binary installation.891. **Claude Pro or Max plan** (recommended): Subscribe to Claude's [Pro or Max plan](https://claude.ai/pricing) for a unified subscription that includes both Claude Code and Claude on the web. Manage your account in one place and log in with your Claude.ai account.

902. **Claude Console**: Connect through the [Claude Console](https://console.anthropic.com) and complete the OAuth process. Requires active billing in the Anthropic Console. A "Claude Code" workspace is automatically created for usage tracking and cost management. You can't create API keys for the Claude Code workspace; it's dedicated exclusively for Claude Code usage.

112 91 

113For advanced installation options with the native installer:92#### For teams and organizations

114 93 

115**macOS, Linux, WSL:**941. **Claude for Teams or Enterprise** (recommended): Subscribe to [Claude for Teams](https://claude.com/pricing#team-&-enterprise) or [Claude for Enterprise](https://anthropic.com/contact-sales) for centralized billing, team management, and access to both Claude Code and Claude on the web. Team members log in with their Claude.ai accounts.

952. **Claude Console with team billing**: Set up a shared [Claude Console](https://console.anthropic.com) organization with team billing. Invite team members and assign roles for usage tracking.

963. **Cloud providers**: Configure Claude Code to use [Amazon Bedrock, Google Vertex AI, or Microsoft Foundry](/en/third-party-integrations) for deployments with your existing cloud infrastructure.

116 97 

117```bash theme={null}98### Install a specific version

118# Install stable version (default)

119curl -fsSL https://claude.ai/install.sh | bash

120 99 

121# Install latest version100The native installer accepts either a specific version number or a release channel (`latest` or `stable`). The channel you choose at install time becomes your default for auto-updates. See [Configure release channel](#configure-release-channel) for more information.

122curl -fsSL https://claude.ai/install.sh | bash -s latest

123 101 

124# Install specific version number102To install the latest version (default):

125curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58

126```

127 103 

128<Note>104<Tabs>

129 **Alpine Linux and other musl/uClibc-based distributions**: The native build requires `libgcc`, `libstdc++`, and `ripgrep`. For Alpine: `apk add libgcc libstdc++ ripgrep`. Set `USE_BUILTIN_RIPGREP=0`.105 <Tab title="macOS, Linux, WSL">

130</Note>106 ```bash theme={null}

107 curl -fsSL https://claude.ai/install.sh | bash

108 ```

109 </Tab>

131 110 

132**Windows PowerShell:**111 <Tab title="Windows PowerShell">

112 ```powershell theme={null}

113 irm https://claude.ai/install.ps1 | iex

114 ```

115 </Tab>

133 116 

134```powershell theme={null}117 <Tab title="Windows CMD">

135# Install stable version (default)118 ```batch theme={null}

136irm https://claude.ai/install.ps1 | iex119 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

120 ```

121 </Tab>

122</Tabs>

137 123 

138# Install latest version124To install the stable version:

139& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) latest

140 125 

141# Install specific version number126<Tabs>

142& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 1.0.58127 <Tab title="macOS, Linux, WSL">

143```128 ```bash theme={null}

129 curl -fsSL https://claude.ai/install.sh | bash -s stable

130 ```

131 </Tab>

144 132 

145**Windows CMD:**133 <Tab title="Windows PowerShell">

134 ```powershell theme={null}

135 & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable

136 ```

137 </Tab>

146 138 

147```batch theme={null}139 <Tab title="Windows CMD">

148REM Install stable version (default)140 ```batch theme={null}

149curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd141 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmd

142 ```

143 </Tab>

144</Tabs>

150 145 

151REM Install latest version146To install a specific version number:

152curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd latest && del install.cmd

153 147 

154REM Install specific version number148<Tabs>

155curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 1.0.58 && del install.cmd149 <Tab title="macOS, Linux, WSL">

156```150 ```bash theme={null}

151 curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58

152 ```

153 </Tab>

157 154 

158<Tip>155 <Tab title="Windows PowerShell">

159 Make sure that you remove any outdated aliases or symlinks before installing.156 ```powershell theme={null}

160</Tip>157 & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 1.0.58

158 ```

159 </Tab>

161 160 

162**Binary integrity and code signing**161 <Tab title="Windows CMD">

162 ```batch theme={null}

163 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 1.0.58 && del install.cmd

164 ```

165 </Tab>

166</Tabs>

167 

168### Binary integrity and code signing

163 169 

164* SHA256 checksums for all platforms are published in the release manifests, currently located at `https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/{VERSION}/manifest.json` (example: replace `{VERSION}` with `2.0.30`)170* SHA256 checksums for all platforms are published in the release manifests, currently located at `https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/{VERSION}/manifest.json` (example: replace `{VERSION}` with `2.0.30`)

165* Signed binaries are distributed for the following platforms:171* Signed binaries are distributed for the following platforms:

166 * macOS: Signed by "Anthropic PBC" and notarized by Apple172 * macOS: Signed by "Anthropic PBC" and notarized by Apple

167 * Windows: Signed by "Anthropic, PBC"173 * Windows: Signed by "Anthropic, PBC"

168 174 

169### NPM installation175## NPM installation (deprecated)

170 176 

171For environments where NPM is preferred or required:177NPM installation is deprecated. Use the [native installation](#installation) method when possible. To migrate an existing npm installation to native, run `claude install`.

178 

179**Global npm installation**

172 180 

173```sh theme={null}181```sh theme={null}

174npm install -g @anthropic-ai/claude-code182npm install -g @anthropic-ai/claude-code


176 184 

177<Warning>185<Warning>

178 Do NOT use `sudo npm install -g` as this can lead to permission issues and security risks.186 Do NOT use `sudo npm install -g` as this can lead to permission issues and security risks.

179 If you encounter permission errors, see [configure Claude Code](/en/troubleshooting#linux-permission-issues) for recommended solutions.187 If you encounter permission errors, see [troubleshooting permission errors](/en/troubleshooting#command-not-found-claude-or-permission-errors) for recommended solutions.

180</Warning>188</Warning>

181 189 

182## Running on AWS or GCP190## Windows setup

191 

192**Option 1: Claude Code within WSL**

183 193 

184By default, Claude Code uses the Claude API.194* Both WSL 1 and WSL 2 are supported

195 

196**Option 2: Claude Code on native Windows with Git Bash**

185 197 

186For details on running Claude Code on AWS or GCP, see [third-party integrations](/en/third-party-integrations).198* Requires [Git for Windows](https://git-scm.com/downloads/win)

199* For portable Git installations, specify the path to your `bash.exe`:

200 ```powershell theme={null}

201 $env:CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"

202 ```

187 203 

188## Update Claude Code204## Update Claude Code

189 205 


196* **Notifications**: You'll see a notification when updates are installed212* **Notifications**: You'll see a notification when updates are installed

197* **Applying updates**: Updates take effect the next time you start Claude Code213* **Applying updates**: Updates take effect the next time you start Claude Code

198 214 

199**Disable auto-updates:**215<Note>

216 Homebrew and WinGet installations do not auto-update. Use `brew upgrade claude-code` or `winget upgrade Anthropic.ClaudeCode` to update manually.

217 

218 **Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.

219</Note>

220 

221### Configure release channel

222 

223Configure which release channel Claude Code follows for both auto-updates and `claude update` with the `autoUpdatesChannel` setting:

224 

225* `"latest"` (default): Receive new features as soon as they're released

226* `"stable"`: Use a version that is typically about one week old, skipping releases with major regressions

227 

228Configure this via `/config` → **Auto-update channel**, or add it to your [settings.json file](/en/settings):

229 

230```json theme={null}

231{

232 "autoUpdatesChannel": "stable"

233}

234```

235 

236For enterprise deployments, you can enforce a consistent release channel across your organization using [managed settings](/en/iam#managed-settings).

237 

238### Disable auto-updates

200 239 

201Set the `DISABLE_AUTOUPDATER` environment variable in your shell or [settings.json file](/en/settings):240Set the `DISABLE_AUTOUPDATER` environment variable in your shell or [settings.json file](/en/settings):

202 241 


245brew uninstall --cask claude-code284brew uninstall --cask claude-code

246```285```

247 286 

287### WinGet installation

288 

289```powershell theme={null}

290winget uninstall Anthropic.ClaudeCode

291```

292 

248### NPM installation293### NPM installation

249 294 

250```bash theme={null}295```bash theme={null}

skills.md +445 −277

Details

1# Agent Skills1# Extend Claude with skills

2 2 

3> Create, manage, and share Skills to extend Claude's capabilities in Claude Code.3> Create, manage, and share skills to extend Claude's capabilities in Claude Code. Includes custom slash commands.

4 4 

5This guide shows you how to create, use, and manage Agent Skills in Claude Code. For background on how Skills work across Claude products, see [What are Skills?](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview).5Skills extend what Claude can do. Create a `SKILL.md` file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly with `/skill-name`.

6 6 

7A Skill is a markdown file that teaches Claude how to do something specific: reviewing PRs using your team's standards, generating commit messages in your preferred format, or querying your company's database schema. When you ask Claude something that matches a Skill's purpose, Claude automatically applies it.7<Note>

8 For built-in commands like `/help` and `/compact`, see [interactive mode](/en/interactive-mode#built-in-commands).

8 9 

9## Create your first Skill10 **Custom slash commands have been merged into skills.** A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review` and work the same way. Your existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to [control whether you or Claude invokes them](#control-who-invokes-a-skill), and the ability for Claude to load them automatically when relevant.

11</Note>

10 12 

11This example creates a personal Skill that teaches Claude to explain code using visual diagrams and analogies. Unlike Claude's default explanations, this Skill ensures every explanation includes an ASCII diagram and a real-world analogy.13Claude Code skills follow the [Agent Skills](https://agentskills.io) open standard, which works across multiple AI tools. Claude Code extends the standard with additional features like [invocation control](#control-who-invokes-a-skill), [subagent execution](#run-skills-in-a-subagent), and [dynamic context injection](#inject-dynamic-context).

12 14 

13<Steps>15## Getting started

14 <Step title="Check available Skills">

15 Before creating a Skill, see what Skills Claude already has access to:

16 16 

17 ```17### Create your first skill

18 What Skills are available?

19 ```

20 18 

21 Claude will list any Skills currently loaded. You may see none, or you may see Skills from plugins or your organization.19This example creates a skill that teaches Claude to explain code using visual diagrams and analogies. Since it uses default frontmatter, Claude can load it automatically when you ask how something works, or you can invoke it directly with `/explain-code`.

22 </Step>

23 20 

24 <Step title="Create the Skill directory">21<Steps>

25 Create a directory for the Skill in your personal Skills folder. Personal Skills are available across all your projects. (You can also create [project Skills](#where-skills-live) in `.claude/skills/` to share with your team.)22 <Step title="Create the skill directory">

23 Create a directory for the skill in your personal skills folder. Personal skills are available across all your projects.

26 24 

27 ```bash theme={null}25 ```bash theme={null}

28 mkdir -p ~/.claude/skills/explaining-code26 mkdir -p ~/.claude/skills/explain-code

29 ```27 ```

30 </Step>28 </Step>

31 29 

32 <Step title="Write SKILL.md">30 <Step title="Write SKILL.md">

33 Every Skill needs a `SKILL.md` file. The file starts with YAML metadata between `---` markers and must include a `name` and `description`, followed by Markdown instructions that Claude follows when the Skill is active.31 Every skill needs a `SKILL.md` file with two parts: YAML frontmatter (between `---` markers) that tells Claude when to use the skill, and markdown content with instructions Claude follows when the skill is invoked. The `name` field becomes the `/slash-command`, and the `description` helps Claude decide when to load it automatically.

34 

35 The `description` is especially important, because Claude uses it to decide when to apply the Skill.

36 32 

37 Create `~/.claude/skills/explaining-code/SKILL.md`:33 Create `~/.claude/skills/explain-code/SKILL.md`:

38 34 

39 ```yaml theme={null}35 ```yaml theme={null}

40 ---36 ---

41 name: explaining-code37 name: explain-code

42 description: Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?"38 description: Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?"

43 ---39 ---

44 40 


53 ```49 ```

54 </Step>50 </Step>

55 51 

56 <Step title="Load and verify the Skill">52 <Step title="Test the skill">

57 Exit and restart Claude Code to load the new Skill. Then verify it appears in the list:53 You can test it two ways:

54 

55 **Let Claude invoke it automatically** by asking something that matches the description:

58 56 

59 ```57 ```

60 What Skills are available?58 How does this code work?

61 ```59 ```

62 60 

63 You should see `explaining-code` in the list with its description.61 **Or invoke it directly** with the skill name:

64 </Step>

65 

66 <Step title="Test the Skill">

67 Open any file in your project and ask Claude a question that matches the Skill's description:

68 62 

69 ```63 ```

70 How does this code work?64 /explain-code src/auth/login.ts

71 ```65 ```

72 66 

73 Claude should ask to use the `explaining-code` Skill, then include an analogy and ASCII diagram in its explanation. If the Skill doesn't trigger, try rephrasing to include more keywords from the description, like "explain how this works."67 Either way, Claude should include an analogy and ASCII diagram in its explanation.

74 </Step>68 </Step>

75</Steps>69</Steps>

76 70 

77The rest of this guide covers how Skills work, configuration options, and troubleshooting.71### Where skills live

78 72 

79## How Skills work73Where you store a skill determines who can use it:

80 74 

81Skills are **model-invoked**: Claude decides which Skills to use based on your request. You don't need to explicitly call a Skill. Claude automatically applies relevant Skills when your request matches their description.75| Location | Path | Applies to |

76| :--------- | :----------------------------------------------- | :----------------------------- |

77| Enterprise | See [managed settings](/en/iam#managed-settings) | All users in your organization |

78| Personal | `~/.claude/skills/<skill-name>/SKILL.md` | All your projects |

79| Project | `.claude/skills/<skill-name>/SKILL.md` | This project only |

80| Plugin | `<plugin>/skills/<skill-name>/SKILL.md` | Where plugin is enabled |

82 81 

83When you send a request, Claude follows these steps to find and use relevant Skills:82Project skills override personal skills with the same name. If you have files in `.claude/commands/`, those work the same way but a skill takes precedence over a command with the same name.

84 83 

85<Steps>84#### Automatic discovery from nested directories

86 <Step title="Discovery">

87 At startup, Claude loads only the name and description of each available Skill. This keeps startup fast while giving Claude enough context to know when each Skill might be relevant.

88 </Step>

89 85 

90 <Step title="Activation">86When you work with files in subdirectories, Claude Code automatically discovers skills from nested `.claude/skills/` directories. For example, if you're editing a file in `packages/frontend/`, Claude Code also looks for skills in `packages/frontend/.claude/skills/`. This supports monorepo setups where packages have their own skills.

91 When your request matches a Skill's description, Claude asks to use the Skill. You'll see a confirmation prompt before the full `SKILL.md` is loaded into context. Since Claude reads these descriptions to find relevant Skills, [write descriptions](#skill-not-triggering) that include keywords users would naturally say.

92 </Step>

93 87 

94 <Step title="Execution">88Each skill is a directory with `SKILL.md` as the entrypoint:

95 Claude follows the Skill's instructions, loading referenced files or running bundled scripts as needed.89 

96 </Step>90```

97</Steps>91my-skill/

92├── SKILL.md # Main instructions (required)

93├── template.md # Template for Claude to fill in

94├── examples/

95│ └── sample.md # Example output showing expected format

96└── scripts/

97 └── validate.sh # Script Claude can execute

98```

98 99 

99### Where Skills live100The `SKILL.md` contains the main instructions and is required. Other files are optional and let you build more powerful skills: templates for Claude to fill in, example outputs showing the expected format, scripts Claude can execute, or detailed reference documentation. Reference these files from your `SKILL.md` so Claude knows what they contain and when to load them. See [Add supporting files](#add-supporting-files) for more details.

100 101 

101Where you store a Skill determines who can use it:102<Note>

103 Files in `.claude/commands/` still work and support the same [frontmatter](#frontmatter-reference). Skills are recommended since they support additional features like supporting files.

104</Note>

102 105 

103| Location | Path | Applies to |106## Configure skills

104| :--------- | :---------------------------------------------------------- | :-------------------------------- |107 

105| Enterprise | See [managed settings](/en/iam#enterprise-managed-settings) | All users in your organization |108Skills are configured through YAML frontmatter at the top of `SKILL.md` and the markdown content that follows.

106| Personal | `~/.claude/skills/` | You, across all projects |

107| Project | `.claude/skills/` | Anyone working in this repository |

108| Plugin | Bundled with [plugins](/en/plugins) | Anyone with the plugin installed |

109 109 

110If two Skills have the same name, the higher row wins: enterprise overrides personal, personal overrides project, and project overrides plugin.110### Types of skill content

111 111 

112### When to use Skills versus other options112Skill files can contain any instructions, but thinking about how you want to invoke them helps guide what to include:

113 113 

114Claude Code offers several ways to customize behavior. The key difference: **Skills are triggered automatically by Claude** based on your request, while slash commands require you to type `/command` explicitly.114**Reference content** adds knowledge Claude applies to your current work. Conventions, patterns, style guides, domain knowledge. This content runs inline so Claude can use it alongside your conversation context.

115 115 

116| Use this | When you want to... | When it runs |116```yaml theme={null}

117| :--------------------------------------- | :------------------------------------------------------------------------- | :----------------------------------------- |117---

118| **Skills** | Give Claude specialized knowledge (e.g., "review PRs using our standards") | Claude chooses when relevant |118name: api-conventions

119| **[Slash commands](/en/slash-commands)** | Create reusable prompts (e.g., `/deploy staging`) | You type `/command` to run it |119description: API design patterns for this codebase

120| **[CLAUDE.md](/en/memory)** | Set project-wide instructions (e.g., "use TypeScript strict mode") | Loaded into every conversation |120---

121| **[Subagents](/en/sub-agents)** | Delegate tasks to a separate context with its own tools | Claude delegates, or you invoke explicitly |

122| **[Hooks](/en/hooks)** | Run scripts on events (e.g., lint on file save) | Fires on specific tool events |

123| **[MCP servers](/en/mcp)** | Connect Claude to external tools and data sources | Claude calls MCP tools as needed |

124 121 

125**Skills vs. subagents**: Skills add knowledge to the current conversation. Subagents run in a separate context with their own tools. Use Skills for guidance and standards; use subagents when you need isolation or different tool access.122When writing API endpoints:

123- Use RESTful naming conventions

124- Return consistent error formats

125- Include request validation

126```

126 127 

127**Skills vs. MCP**: Skills tell Claude *how* to use tools; MCP *provides* the tools. For example, an MCP server connects Claude to your database, while a Skill teaches Claude your data model and query patterns.128**Task content** gives Claude step-by-step instructions for a specific action, like deployments, commits, or code generation. These are often actions you want to invoke directly with `/skill-name` rather than letting Claude decide when to run them. Add `disable-model-invocation: true` to prevent Claude from triggering it automatically.

128 129 

129<Note>130```yaml theme={null}

130 For a deep dive into the architecture and real-world applications of Agent Skills, read [Equipping agents for the real world with Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills).131---

131</Note>132name: deploy

133description: Deploy the application to production

134context: fork

135disable-model-invocation: true

136---

132 137 

133## Configure Skills138Deploy the application:

1391. Run the test suite

1402. Build the application

1413. Push to the deployment target

142```

134 143 

135This section covers Skill file structure, supporting files, tool restrictions, and distribution options.144Your `SKILL.md` can contain anything, but thinking through how you want the skill invoked (by you, by Claude, or both) and where you want it to run (inline or in a subagent) helps guide what to include. For complex skills, you can also [add supporting files](#add-supporting-files) to keep the main skill focused.

136 145 

137### Write SKILL.md146### Frontmatter reference

138 147 

139The `SKILL.md` file is the only required file in a Skill. It has two parts: YAML metadata (the section between `---` markers) at the top, and Markdown instructions that tell Claude how to use the Skill:148Beyond the markdown content, you can configure skill behavior using YAML frontmatter fields between `---` markers at the top of your `SKILL.md` file:

140 149 

141```yaml theme={null}150```yaml theme={null}

142---151---

143name: your-skill-name152name: my-skill

144description: Brief description of what this Skill does and when to use it153description: What this skill does

154disable-model-invocation: true

155allowed-tools: Read, Grep

145---156---

146 157 

147# Your Skill Name158Your skill instructions here...

148 

149## Instructions

150Provide clear, step-by-step guidance for Claude.

151 

152## Examples

153Show concrete examples of using this Skill.

154```159```

155 160 

156#### Available metadata fields161All fields are optional. Only `description` is recommended so Claude knows when to use the skill.

157 

158You can use the following fields in the YAML frontmatter:

159 162 

160| Field | Required | Description |163| Field | Required | Description |

161| :-------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |164| :------------------------- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |

162| `name` | Yes | Skill name. Must use lowercase letters, numbers, and hyphens only (max 64 characters). Should match the directory name. |165| `name` | No | Display name for the skill. If omitted, uses the directory name. Lowercase letters, numbers, and hyphens only (max 64 characters). |

163| `description` | Yes | What the Skill does and when to use it (max 1024 characters). Claude uses this to decide when to apply the Skill. |166| `description` | Recommended | What the skill does and when to use it. Claude uses this to decide when to apply the skill. If omitted, uses the first paragraph of markdown content. |

164| `allowed-tools` | No | Tools Claude can use without asking permission when this Skill is active. See [Restrict tool access](#restrict-tool-access-with-allowed-tools). |167| `argument-hint` | No | Hint shown during autocomplete to indicate expected arguments. Example: `[issue-number]` or `[filename] [format]`. |

165| `model` | No | [Model](https://docs.claude.com/en/docs/about-claude/models/overview) to use when this Skill is active (e.g., `claude-sonnet-4-20250514`). Defaults to the conversation's model. |168| `disable-model-invocation` | No | Set to `true` to prevent Claude from automatically loading this skill. Use for workflows you want to trigger manually with `/name`. Default: `false`. |

169| `user-invocable` | No | Set to `false` to hide from the `/` menu. Use for background knowledge users shouldn't invoke directly. Default: `true`. |

170| `allowed-tools` | No | Tools Claude can use without asking permission when this skill is active. |

171| `model` | No | Model to use when this skill is active. |

172| `context` | No | Set to `fork` to run in a forked subagent context. |

173| `agent` | No | Which subagent type to use when `context: fork` is set. |

174| `hooks` | No | Hooks scoped to this skill's lifecycle. See [Hooks](/en/hooks) for configuration format. |

166 175 

167See the [best practices guide](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices) for complete authoring guidance including validation rules.176#### Available string substitutions

168 177 

169### Update or delete a Skill178Skills support string substitution for dynamic values in the skill content:

170 179 

171To update a Skill, edit its `SKILL.md` file directly. To remove a Skill, delete its directory. Exit and restart Claude Code for changes to take effect.180| Variable | Description |

181| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- |

182| `$ARGUMENTS` | All arguments passed when invoking the skill. If `$ARGUMENTS` is not present in the content, arguments are appended as `ARGUMENTS: <value>`. |

183| `${CLAUDE_SESSION_ID}` | The current session ID. Useful for logging, creating session-specific files, or correlating skill output with sessions. |

172 184 

173### Add supporting files with progressive disclosure185**Example using substitutions:**

174 186 

175Skills share Claude's context window with conversation history, other Skills, and your request. To keep context focused, use **progressive disclosure**: put essential information in `SKILL.md` and detailed reference material in separate files that Claude reads only when needed.187```yaml theme={null}

188---

189name: session-logger

190description: Log activity for this session

191---

176 192 

177This approach lets you bundle comprehensive documentation, examples, and scripts without consuming context upfront. Claude loads additional files only when the task requires them.193Log the following to logs/${CLAUDE_SESSION_ID}.log:

178 194 

179<Tip>Keep `SKILL.md` under 500 lines for optimal performance. If your content exceeds this, split detailed reference material into separate files.</Tip>195$ARGUMENTS

196```

180 197 

181#### Example: multi-file Skill structure198### Add supporting files

182 199 

183Claude discovers supporting files through links in your `SKILL.md`. The following example shows a Skill with detailed documentation in separate files and utility scripts that Claude can execute without reading:200Skills can include multiple files in their directory. This keeps `SKILL.md` focused on the essentials while letting Claude access detailed reference material only when needed. Large reference docs, API specifications, or example collections don't need to load into context every time the skill runs.

184 201 

185```202```

186my-skill/203my-skill/


191 └── helper.py (utility script - executed, not loaded)208 └── helper.py (utility script - executed, not loaded)

192```209```

193 210 

194The `SKILL.md` file references these supporting files so Claude knows they exist:211Reference supporting files from `SKILL.md` so Claude knows what each file contains and when to load it:

195 

196````markdown theme={null}

197## Overview

198 

199[Essential instructions here]

200 212 

213```markdown theme={null}

201## Additional resources214## Additional resources

202 215 

203- For complete API details, see [reference.md](reference.md)216- For complete API details, see [reference.md](reference.md)

204- For usage examples, see [examples.md](examples.md)217- For usage examples, see [examples.md](examples.md)

218```

205 219 

206## Utility scripts220<Tip>Keep `SKILL.md` under 500 lines. Move detailed reference material to separate files.</Tip>

207 221 

208To validate input files, run the helper script. It checks for required fields and returns any validation errors:222### Control who invokes a skill

209```bash

210python scripts/helper.py input.txt

211```

212````

213 223 

214<Tip>Keep references one level deep. Link directly from `SKILL.md` to reference files. Deeply nested references (file A links to file B which links to file C) may result in Claude partially reading files.</Tip>224By default, both you and Claude can invoke any skill. You can type `/skill-name` to invoke it directly, and Claude can load it automatically when relevant to your conversation. Two frontmatter fields let you restrict this:

215 225 

216**Bundle utility scripts for zero-context execution.** Scripts in your Skill directory can be executed without loading their contents into context. Claude runs the script and only the output consumes tokens. This is useful for:226* **`disable-model-invocation: true`**: Only you can invoke the skill. Use this for workflows with side effects or that you want to control timing, like `/commit`, `/deploy`, or `/send-slack-message`. You don't want Claude deciding to deploy because your code looks ready.

217 227 

218* Complex validation logic that would be verbose to describe in prose228* **`user-invocable: false`**: Only Claude can invoke the skill. Use this for background knowledge that isn't actionable as a command. A `legacy-system-context` skill explains how an old system works. Claude should know this when relevant, but `/legacy-system-context` isn't a meaningful action for users to take.

219* Data processing that's more reliable as tested code than generated code

220* Operations that benefit from consistency across uses

221 229 

222In `SKILL.md`, tell Claude to run the script rather than read it:230This example creates a deploy skill that only you can trigger. The `disable-model-invocation: true` field prevents Claude from running it automatically:

223 231 

224```markdown theme={null}232```yaml theme={null}

225Run the validation script to check the form:233---

226python scripts/validate_form.py input.pdf234name: deploy

235description: Deploy the application to production

236disable-model-invocation: true

237---

238 

239Deploy $ARGUMENTS to production:

240 

2411. Run the test suite

2422. Build the application

2433. Push to the deployment target

2444. Verify the deployment succeeded

227```245```

228 246 

229For complete guidance on structuring Skills, see the [best practices guide](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices#progressive-disclosure-patterns).247Here's how the two fields affect invocation and context loading:

230 248 

231### Restrict tool access with allowed-tools249| Frontmatter | You can invoke | Claude can invoke | When loaded into context |

250| :------------------------------- | :------------- | :---------------- | :----------------------------------------------------------- |

251| (default) | Yes | Yes | Description always in context, full skill loads when invoked |

252| `disable-model-invocation: true` | Yes | No | Description not in context, full skill loads when you invoke |

253| `user-invocable: false` | No | Yes | Description always in context, full skill loads when invoked |

232 254 

233Use the `allowed-tools` frontmatter field to limit which tools Claude can use when a Skill is active:255<Note>

256 In a regular session, skill descriptions are loaded into context so Claude knows what's available, but full skill content only loads when invoked. [Subagents with preloaded skills](/en/sub-agents#preload-skills-into-subagents) work differently: the full skill content is injected at startup.

257</Note>

258 

259### Restrict tool access

260 

261Use the `allowed-tools` field to limit which tools Claude can use when a skill is active. This skill creates a read-only mode where Claude can explore files but not modify them:

234 262 

235```yaml theme={null}263```yaml theme={null}

236---264---

237name: reading-files-safely265name: safe-reader

238description: Read files without making changes. Use when you need read-only file access.266description: Read files without making changes

239allowed-tools: Read, Grep, Glob267allowed-tools: Read, Grep, Glob

240---268---

269```

270 

271### Pass arguments to skills

241 272 

242# Safe File Reader273Both you and Claude can pass arguments when invoking a skill. Arguments are available via the `$ARGUMENTS` placeholder.

243 274 

244This Skill provides read-only file access.275This skill fixes a GitHub issue by number. The `$ARGUMENTS` placeholder gets replaced with whatever follows the skill name:

245 276 

246## Instructions277```yaml theme={null}

2471. Use Read to view file contents278---

2482. Use Grep to search within files279name: fix-issue

2493. Use Glob to find files by pattern280description: Fix a GitHub issue

281disable-model-invocation: true

282---

283 

284Fix GitHub issue $ARGUMENTS following our coding standards.

285 

2861. Read the issue description

2872. Understand the requirements

2883. Implement the fix

2894. Write tests

2905. Create a commit

250```291```

251 292 

252When this Skill is active, Claude can only use the specified tools (Read, Grep, Glob) without needing to ask for permission. This is useful for:293When you run `/fix-issue 123`, Claude receives "Fix GitHub issue 123 following our coding standards..."

253 294 

254* Read-only Skills that shouldn't modify files295If you invoke a skill with arguments but the skill doesn't include `$ARGUMENTS`, Claude Code appends `ARGUMENTS: <your input>` to the end of the skill content so Claude still sees what you typed.

255* Skills with limited scope: for example, only data analysis, no file writing

256* Security-sensitive workflows where you want to restrict capabilities

257 296 

258If `allowed-tools` is omitted, the Skill doesn't restrict tools. Claude uses its standard permission model and may ask you to approve tool usage.297## Advanced patterns

259 298 

260<Note>299### Inject dynamic context

261 `allowed-tools` is only supported for Skills in Claude Code.

262</Note>

263 300 

264### Use Skills with subagents301The `!`command\`\` syntax runs shell commands before the skill content is sent to Claude. The command output replaces the placeholder, so Claude receives actual data, not the command itself.

265 302 

266[Subagents](/en/sub-agents) do not automatically inherit Skills from the main conversation. To give a custom subagent access to specific Skills, list them in the subagent's `skills` field in `.claude/agents/`:303This skill summarizes a pull request by fetching live PR data with the GitHub CLI. The `!`gh pr diff\`\` and other commands run first, and their output gets inserted into the prompt:

267 304 

268```yaml theme={null}305```yaml theme={null}

269# .claude/agents/code-reviewer/AGENT.md

270---306---

271name: code-reviewer307name: pr-summary

272description: Review code for quality and best practices308description: Summarize changes in a pull request

273skills: pr-review, security-check309context: fork

310agent: Explore

311allowed-tools: Bash(gh:*)

274---312---

313 

314## Pull request context

315- PR diff: !`gh pr diff`

316- PR comments: !`gh pr view --comments`

317- Changed files: !`gh pr diff --name-only`

318 

319## Your task

320Summarize this pull request...

275```321```

276 322 

277The listed Skills are loaded into the subagent's context when it starts. If the `skills` field is omitted, no Skills are preloaded for that subagent.323When this skill runs:

278 324 

279<Note>3251. Each `!`command\`\` executes immediately (before Claude sees anything)

280 Built-in agents (Explore, Plan, Verify) and the Task tool do not have access to your Skills. Only custom subagents you define in `.claude/agents/` with an explicit `skills` field can use Skills.3262. The output replaces the placeholder in the skill content

281</Note>3273. Claude receives the fully-rendered prompt with actual PR data

282 328 

283### Distribute Skills329This is preprocessing, not something Claude executes. Claude only sees the final result.

284 330 

285You can share Skills in several ways:331<Tip>

332 To enable [extended thinking](/en/common-workflows#use-extended-thinking-thinking-mode) in a skill, include the word "ultrathink" anywhere in your skill content.

333</Tip>

286 334 

287* **Project Skills**: Commit `.claude/skills/` to version control. Anyone who clones the repository gets the Skills.335### Run skills in a subagent

288* **Plugins**: To share Skills across multiple repositories, create a `skills/` directory in your [plugin](/en/plugins) with Skill folders containing `SKILL.md` files. Distribute through a [plugin marketplace](/en/plugin-marketplaces).

289* **Enterprise**: Administrators can deploy Skills organization-wide through [managed settings](/en/iam#enterprise-managed-settings). See [Where Skills live](#where-skills-live) for enterprise Skill paths.

290 336 

291## Examples337Add `context: fork` to your frontmatter when you want a skill to run in isolation. The skill content becomes the prompt that drives the subagent. It won't have access to your conversation history.

292 338 

293These examples show common Skill patterns, from minimal single-file Skills to multi-file Skills with supporting documentation and scripts.339<Warning>

340 `context: fork` only makes sense for skills with explicit instructions. If your skill contains guidelines like "use these API conventions" without a task, the subagent receives the guidelines but no actionable prompt, and returns without meaningful output.

341</Warning>

294 342 

295### Simple Skill (single file)343Skills and [subagents](/en/sub-agents) work together in two directions:

296 344 

297A minimal Skill needs only a `SKILL.md` file with frontmatter and instructions. This example helps Claude generate commit messages by examining staged changes:345| Approach | System prompt | Task | Also loads |

346| :--------------------------- | :---------------------------------------- | :-------------------------- | :--------------------------- |

347| Skill with `context: fork` | From agent type (`Explore`, `Plan`, etc.) | SKILL.md content | CLAUDE.md |

348| Subagent with `skills` field | Subagent's markdown body | Claude's delegation message | Preloaded skills + CLAUDE.md |

298 349 

299```350With `context: fork`, you write the task in your skill and pick an agent type to execute it. For the inverse (defining a custom subagent that uses skills as reference material), see [Subagents](/en/sub-agents#preload-skills-into-subagents).

300commit-helper/351 

301└── SKILL.md352#### Example: Research skill using Explore agent

302```353 

354This skill runs research in a forked Explore agent. The skill content becomes the task, and the agent provides read-only tools optimized for codebase exploration:

303 355 

304```yaml theme={null}356```yaml theme={null}

305---357---

306name: generating-commit-messages358name: deep-research

307description: Generates clear commit messages from git diffs. Use when writing commit messages or reviewing staged changes.359description: Research a topic thoroughly

360context: fork

361agent: Explore

308---362---

309 363 

310# Generating Commit Messages364Research $ARGUMENTS thoroughly:

311 

312## Instructions

313 365 

3141. Run `git diff --staged` to see changes3661. Find relevant files using Glob and Grep

3152. I'll suggest a commit message with:3672. Read and analyze the code

316 - Summary under 50 characters3683. Summarize findings with specific file references

317 - Detailed description

318 - Affected components

319 

320## Best practices

321 

322- Use present tense

323- Explain what and why, not how

324```369```

325 370 

326### Use multiple files371When this skill runs:

327 372 

328For complex Skills, use progressive disclosure to keep the main `SKILL.md` focused while providing detailed documentation in supporting files. This PDF processing Skill includes reference docs, utility scripts, and uses `allowed-tools` to restrict Claude to specific tools:3731. A new isolated context is created

3742. The subagent receives the skill content as its prompt ("Research \$ARGUMENTS thoroughly...")

3753. The `agent` field determines the execution environment (model, tools, and permissions)

3764. Results are summarized and returned to your main conversation

329 377 

330```378The `agent` field specifies which subagent configuration to use. Options include built-in agents (`Explore`, `Plan`, `general-purpose`) or any custom subagent from `.claude/agents/`. If omitted, uses `general-purpose`.

331pdf-processing/

332├── SKILL.md # Overview and quick start

333├── FORMS.md # Form field mappings and filling instructions

334├── REFERENCE.md # API details for pypdf and pdfplumber

335└── scripts/

336 ├── fill_form.py # Utility to populate form fields

337 └── validate.py # Checks PDFs for required fields

338```

339 379 

340**`SKILL.md`**:380### Restrict Claude's skill access

341 381 

342````yaml theme={null}382By default, Claude can invoke any skill that doesn't have `disable-model-invocation: true` set. Built-in commands like `/compact` and `/init` are not available through the Skill tool.

343name: pdf-processing

344description: Extract text, fill forms, merge PDFs. Use when working with PDF files, forms, or document extraction. Requires pypdf and pdfplumber packages.

345allowed-tools: Read, Bash(python:*)

346 383 

347# PDF Processing384Three ways to control which skills Claude can invoke:

348 385 

349## Quick start386**Disable all skills** by denying the Skill tool in `/permissions`:

350 387 

351Extract text:388```

352```python389# Add to deny rules:

353import pdfplumber390Skill

354with pdfplumber.open("doc.pdf") as pdf:

355 text = pdf.pages[0].extract_text()

356```391```

357 392 

358For form filling, see [FORMS.md](FORMS.md).393**Allow or deny specific skills** using [permission rules](/en/iam):

359For detailed API reference, see [REFERENCE.md](REFERENCE.md).

360 394 

361## Requirements395```

396# Allow only specific skills

397Skill(commit)

398Skill(review-pr:*)

362 399 

363Packages must be installed in your environment:400# Deny specific skills

364```bash401Skill(deploy:*)

365pip install pypdf pdfplumber

366```402```

367````403 

404Permission syntax: `Skill(name)` for exact match, `Skill(name:*)` for prefix match with any arguments.

405 

406**Hide individual skills** by adding `disable-model-invocation: true` to their frontmatter. This removes the skill from Claude's context entirely.

368 407 

369<Note>408<Note>

370 If your Skill requires external packages, list them in the description. Packages must be installed in your environment before Claude can use them.409 The `user-invocable` field only controls menu visibility, not Skill tool access. Use `disable-model-invocation: true` to block programmatic invocation.

371</Note>410</Note>

372 411 

373## Troubleshooting412## Share skills

374 

375### View and test Skills

376 413 

377To see which Skills Claude has access to, ask Claude a question like "What Skills are available?" Claude loads all available Skill names and descriptions into the context window when a conversation starts, so it can list the Skills it currently has access to.414Skills can be distributed at different scopes depending on your audience:

378 415 

379To test a specific Skill, ask Claude to do a task that matches the Skill's description. For example, if your Skill has the description "Reviews pull requests for code quality", ask Claude to "Review the changes in my current branch." Claude automatically uses the Skill when the request matches its description.416* **Project skills**: Commit `.claude/skills/` to version control

417* **Plugins**: Create a `skills/` directory in your [plugin](/en/plugins)

418* **Managed**: Deploy organization-wide through [managed settings](/en/iam#managed-settings)

380 419 

381### Skill not triggering420### Generate visual output

382 421 

383The description field is how Claude decides whether to use your Skill. Vague descriptions like "Helps with documents" don't give Claude enough information to match your Skill to relevant requests.422Skills can bundle and run scripts in any language, giving Claude capabilities beyond what's possible in a single prompt. One powerful pattern is generating visual output: interactive HTML files that open in your browser for exploring data, debugging, or creating reports.

384 423 

385A good description answers two questions:424This example creates a codebase explorer: an interactive tree view where you can expand and collapse directories, see file sizes at a glance, and identify file types by color.

386 425 

3871. **What does this Skill do?** List the specific capabilities.426Create the Skill directory:

3882. **When should Claude use it?** Include trigger terms users would mention.

389 427 

390```yaml theme={null}428```bash theme={null}

391description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.429mkdir -p ~/.claude/skills/codebase-visualizer/scripts

392```430```

393 431 

394This description works because it names specific actions (extract, fill, merge) and includes keywords users would say (PDF, forms, document extraction).432Create `~/.claude/skills/codebase-visualizer/SKILL.md`. The description tells Claude when to activate this Skill, and the instructions tell Claude to run the bundled script:

395 

396### Skill doesn't load

397 

398**Check the file path.** Skills must be in the correct directory with the exact filename `SKILL.md` (case-sensitive):

399 433 

400| Type | Path |434````yaml theme={null}

401| :--------- | :---------------------------------------------------------------------- |435---

402| Personal | `~/.claude/skills/my-skill/SKILL.md` |436name: codebase-visualizer

403| Project | `.claude/skills/my-skill/SKILL.md` |437description: Generate an interactive collapsible tree visualization of your codebase. Use when exploring a new repo, understanding project structure, or identifying large files.

404| Enterprise | See [Where Skills live](#where-skills-live) for platform-specific paths |438allowed-tools: Bash(python:*)

405| Plugin | `skills/my-skill/SKILL.md` inside the plugin directory |439---

406 440 

407**Check the YAML syntax.** Invalid YAML in the frontmatter prevents the Skill from loading. The frontmatter must start with `---` on line 1 (no blank lines before it), end with `---` before the Markdown content, and use spaces for indentation (not tabs).441# Codebase Visualizer

408 442 

409**Run debug mode.** Use `claude --debug` to see Skill loading errors.443Generate an interactive HTML tree view that shows your project's file structure with collapsible directories.

410 444 

411### Skill has errors445## Usage

412 446 

413**Check dependencies are installed.** If your Skill uses external packages, they must be installed in your environment before Claude can use them.447Run the visualization script from your project root:

414 448 

415**Check script permissions.** Scripts need execute permissions: `chmod +x scripts/*.py`449```bash

450python ~/.claude/skills/codebase-visualizer/scripts/visualize.py .

451```

416 452 

417**Check file paths.** Use forward slashes (Unix style) in all paths. Use `scripts/helper.py`, not `scripts\helper.py`.453This creates `codebase-map.html` in the current directory and opens it in your default browser.

418 454 

419### Multiple Skills conflict455## What the visualization shows

420 456 

421If Claude uses the wrong Skill or seems confused between similar Skills, the descriptions are probably too similar. Make each description distinct by using specific trigger terms.457- **Collapsible directories**: Click folders to expand/collapse

458- **File sizes**: Displayed next to each file

459- **Colors**: Different colors for different file types

460- **Directory totals**: Shows aggregate size of each folder

461````

422 462 

423For example, instead of two Skills with "data analysis" in both descriptions, differentiate them: one for "sales data in Excel files and CRM exports" and another for "log files and system metrics". The more specific your trigger terms, the easier it is for Claude to match the right Skill to your request.463Create `~/.claude/skills/codebase-visualizer/scripts/visualize.py`. This script scans a directory tree and generates a self-contained HTML file with:

464 

465* A **summary sidebar** showing file count, directory count, total size, and number of file types

466* A **bar chart** breaking down the codebase by file type (top 8 by size)

467* A **collapsible tree** where you can expand and collapse directories, with color-coded file type indicators

468 

469The script requires Python but uses only built-in libraries, so there are no packages to install:

470 

471```python expandable theme={null}

472#!/usr/bin/env python3

473"""Generate an interactive collapsible tree visualization of a codebase."""

474 

475import json

476import sys

477import webbrowser

478from pathlib import Path

479from collections import Counter

480 

481IGNORE = {'.git', 'node_modules', '__pycache__', '.venv', 'venv', 'dist', 'build'}

482 

483def scan(path: Path, stats: dict) -> dict:

484 result = {"name": path.name, "children": [], "size": 0}

485 try:

486 for item in sorted(path.iterdir()):

487 if item.name in IGNORE or item.name.startswith('.'):

488 continue

489 if item.is_file():

490 size = item.stat().st_size

491 ext = item.suffix.lower() or '(no ext)'

492 result["children"].append({"name": item.name, "size": size, "ext": ext})

493 result["size"] += size

494 stats["files"] += 1

495 stats["extensions"][ext] += 1

496 stats["ext_sizes"][ext] += size

497 elif item.is_dir():

498 stats["dirs"] += 1

499 child = scan(item, stats)

500 if child["children"]:

501 result["children"].append(child)

502 result["size"] += child["size"]

503 except PermissionError:

504 pass

505 return result

506 

507def generate_html(data: dict, stats: dict, output: Path) -> None:

508 ext_sizes = stats["ext_sizes"]

509 total_size = sum(ext_sizes.values()) or 1

510 sorted_exts = sorted(ext_sizes.items(), key=lambda x: -x[1])[:8]

511 colors = {

512 '.js': '#f7df1e', '.ts': '#3178c6', '.py': '#3776ab', '.go': '#00add8',

513 '.rs': '#dea584', '.rb': '#cc342d', '.css': '#264de4', '.html': '#e34c26',

514 '.json': '#6b7280', '.md': '#083fa1', '.yaml': '#cb171e', '.yml': '#cb171e',

515 '.mdx': '#083fa1', '.tsx': '#3178c6', '.jsx': '#61dafb', '.sh': '#4eaa25',

516 }

517 lang_bars = "".join(

518 f'<div class="bar-row"><span class="bar-label">{ext}</span>'

519 f'<div class="bar" style="width:{(size/total_size)*100}%;background:{colors.get(ext,"#6b7280")}"></div>'

520 f'<span class="bar-pct">{(size/total_size)*100:.1f}%</span></div>'

521 for ext, size in sorted_exts

522 )

523 def fmt(b):

524 if b < 1024: return f"{b} B"

525 if b < 1048576: return f"{b/1024:.1f} KB"

526 return f"{b/1048576:.1f} MB"

527 

528 html = f'''<!DOCTYPE html>

529<html><head>

530 <meta charset="utf-8"><title>Codebase Explorer</title>

531 <style>

532 body {{ font: 14px/1.5 system-ui, sans-serif; margin: 0; background: #1a1a2e; color: #eee; }}

533 .container {{ display: flex; height: 100vh; }}

534 .sidebar {{ width: 280px; background: #252542; padding: 20px; border-right: 1px solid #3d3d5c; overflow-y: auto; flex-shrink: 0; }}

535 .main {{ flex: 1; padding: 20px; overflow-y: auto; }}

536 h1 {{ margin: 0 0 10px 0; font-size: 18px; }}

537 h2 {{ margin: 20px 0 10px 0; font-size: 14px; color: #888; text-transform: uppercase; }}

538 .stat {{ display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #3d3d5c; }}

539 .stat-value {{ font-weight: bold; }}

540 .bar-row {{ display: flex; align-items: center; margin: 6px 0; }}

541 .bar-label {{ width: 55px; font-size: 12px; color: #aaa; }}

542 .bar {{ height: 18px; border-radius: 3px; }}

543 .bar-pct {{ margin-left: 8px; font-size: 12px; color: #666; }}

544 .tree {{ list-style: none; padding-left: 20px; }}

545 details {{ cursor: pointer; }}

546 summary {{ padding: 4px 8px; border-radius: 4px; }}

547 summary:hover {{ background: #2d2d44; }}

548 .folder {{ color: #ffd700; }}

549 .file {{ display: flex; align-items: center; padding: 4px 8px; border-radius: 4px; }}

550 .file:hover {{ background: #2d2d44; }}

551 .size {{ color: #888; margin-left: auto; font-size: 12px; }}

552 .dot {{ width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }}

553 </style>

554</head><body>

555 <div class="container">

556 <div class="sidebar">

557 <h1>📊 Summary</h1>

558 <div class="stat"><span>Files</span><span class="stat-value">{stats["files"]:,}</span></div>

559 <div class="stat"><span>Directories</span><span class="stat-value">{stats["dirs"]:,}</span></div>

560 <div class="stat"><span>Total size</span><span class="stat-value">{fmt(data["size"])}</span></div>

561 <div class="stat"><span>File types</span><span class="stat-value">{len(stats["extensions"])}</span></div>

562 <h2>By file type</h2>

563 {lang_bars}

564 </div>

565 <div class="main">

566 <h1>📁 {data["name"]}</h1>

567 <ul class="tree" id="root"></ul>

568 </div>

569 </div>

570 <script>

571 const data = {json.dumps(data)};

572 const colors = {json.dumps(colors)};

573 function fmt(b) {{ if (b < 1024) return b + ' B'; if (b < 1048576) return (b/1024).toFixed(1) + ' KB'; return (b/1048576).toFixed(1) + ' MB'; }}

574 function render(node, parent) {{

575 if (node.children) {{

576 const det = document.createElement('details');

577 det.open = parent === document.getElementById('root');

578 det.innerHTML = `<summary><span class="folder">📁 ${{node.name}}</span><span class="size">${{fmt(node.size)}}</span></summary>`;

579 const ul = document.createElement('ul'); ul.className = 'tree';

580 node.children.sort((a,b) => (b.children?1:0)-(a.children?1:0) || a.name.localeCompare(b.name));

581 node.children.forEach(c => render(c, ul));

582 det.appendChild(ul);

583 const li = document.createElement('li'); li.appendChild(det); parent.appendChild(li);

584 }} else {{

585 const li = document.createElement('li'); li.className = 'file';

586 li.innerHTML = `<span class="dot" style="background:${{colors[node.ext]||'#6b7280'}}"></span>${{node.name}}<span class="size">${{fmt(node.size)}}</span>`;

587 parent.appendChild(li);

588 }}

589 }}

590 data.children.forEach(c => render(c, document.getElementById('root')));

591 </script>

592</body></html>'''

593 output.write_text(html)

594 

595if __name__ == '__main__':

596 target = Path(sys.argv[1] if len(sys.argv) > 1 else '.').resolve()

597 stats = {"files": 0, "dirs": 0, "extensions": Counter(), "ext_sizes": Counter()}

598 data = scan(target, stats)

599 out = Path('codebase-map.html')

600 generate_html(data, stats, out)

601 print(f'Generated {out.absolute()}')

602 webbrowser.open(f'file://{out.absolute()}')

603```

424 604 

425### Plugin Skills not appearing605To test, open Claude Code in any project and ask "Visualize this codebase." Claude runs the script, generates `codebase-map.html`, and opens it in your browser.

426 606 

427**Symptom**: You installed a plugin from a marketplace, but its Skills don't appear when you ask Claude "What Skills are available?"607This pattern works for any visual output: dependency graphs, test coverage reports, API documentation, or database schema visualizations. The bundled script does the heavy lifting while Claude handles orchestration.

428 608 

429**Solution**: Clear the plugin cache and reinstall:609## Troubleshooting

430 610 

431```bash theme={null}611### Skill not triggering

432rm -rf ~/.claude/plugins/cache

433```

434 612 

435Then restart Claude Code and reinstall the plugin:613If Claude doesn't use your skill when expected:

436 614 

437```shell theme={null}6151. Check the description includes keywords users would naturally say

438/plugin install plugin-name@marketplace-name6162. Verify the skill appears in `What skills are available?`

439```6173. Try rephrasing your request to match the description more closely

6184. Invoke it directly with `/skill-name` if the skill is user-invocable

440 619 

441This forces Claude Code to re-download and re-register the plugin's Skills.620### Skill triggers too often

442 621 

443**If Skills still don't appear**, verify the plugin's directory structure is correct. Skills must be in a `skills/` directory at the plugin root:622If Claude uses your skill when you don't want it:

444 623 

445```6241. Make the description more specific

446my-plugin/6252. Add `disable-model-invocation: true` if you only want manual invocation

447├── .claude-plugin/

448│ └── plugin.json

449└── skills/

450 └── my-skill/

451 └── SKILL.md

452```

453 626 

454## Next steps627### Claude doesn't see all my skills

455 628 

456<CardGroup cols={2}>629Skill descriptions are loaded into context so Claude knows what's available. If you have many skills, they may exceed the character budget (default 15,000 characters). Run `/context` to check for a warning about excluded skills.

457 <Card title="Authoring best practices" icon="lightbulb" href="https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices">

458 Write Skills that Claude can use effectively

459 </Card>

460 630 

461 <Card title="Agent Skills overview" icon="book" href="https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview">631To increase the limit, set the `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable.

462 Learn how Skills work across Claude products

463 </Card>

464 632 

465 <Card title="Use Skills in the Agent SDK" icon="cube" href="https://docs.claude.com/en/docs/agent-sdk/skills">633## Related resources

466 Use Skills programmatically with TypeScript and Python

467 </Card>

468 634 

469 <Card title="Get started with Agent Skills" icon="rocket" href="https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart">635* **[Subagents](/en/sub-agents)**: delegate tasks to specialized agents

470 Create your first Skill636* **[Plugins](/en/plugins)**: package and distribute skills with other extensions

471 </Card>637* **[Hooks](/en/hooks)**: automate workflows around tool events

472</CardGroup>638* **[Memory](/en/memory)**: manage CLAUDE.md files for persistent context

639* **[Interactive mode](/en/interactive-mode#built-in-commands)**: built-in commands and shortcuts

640* **[Permissions](/en/iam)**: control tool and skill access

473 641 

474 642 

475---643---

slash-commands.md +0 −506 deleted

File DeletedView Diff

1# Slash commands

2 

3> Control Claude's behavior during an interactive session with slash commands.

4 

5## Built-in slash commands

6 

7| Command | Purpose |

8| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |

9| `/add-dir` | Add additional working directories |

10| `/agents` | Manage custom AI subagents for specialized tasks |

11| `/bashes` | List and manage background tasks |

12| `/bug` | Report bugs (sends conversation to Anthropic) |

13| `/clear` | Clear conversation history |

14| `/compact [instructions]` | Compact conversation with optional focus instructions |

15| `/config` | Open the Settings interface (Config tab) |

16| `/context` | Visualize current context usage as a colored grid |

17| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |

18| `/doctor` | Checks the health of your Claude Code installation |

19| `/exit` | Exit the REPL |

20| `/export [filename]` | Export the current conversation to a file or clipboard |

21| `/help` | Get usage help |

22| `/hooks` | Manage hook configurations for tool events |

23| `/ide` | Manage IDE integrations and show status |

24| `/init` | Initialize project with `CLAUDE.md` guide |

25| `/install-github-app` | Set up Claude GitHub Actions for a repository |

26| `/login` | Switch Anthropic accounts |

27| `/logout` | Sign out from your Anthropic account |

28| `/mcp` | Manage MCP server connections and OAuth authentication |

29| `/memory` | Edit `CLAUDE.md` memory files |

30| `/model` | Select or change the AI model |

31| `/output-style [style]` | Set the output style directly or from a selection menu |

32| `/permissions` | View or update [permissions](/en/iam#configuring-permissions) |

33| `/plugin` | Manage Claude Code plugins |

34| `/pr-comments` | View pull request comments |

35| `/privacy-settings` | View and update your privacy settings |

36| `/release-notes` | View release notes |

37| `/rename <name>` | Rename the current session for easier identification |

38| `/resume [session]` | Resume a conversation by ID or name, or open the session picker |

39| `/review` | Request code review |

40| `/rewind` | Rewind the conversation and/or code |

41| `/sandbox` | Enable sandboxed bash tool with filesystem and network isolation for safer, more autonomous execution |

42| `/security-review` | Complete a security review of pending changes on the current branch |

43| `/stats` | Visualize daily usage, session history, streaks, and model preferences |

44| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |

45| `/statusline` | Set up Claude Code's status line UI |

46| `/terminal-setup` | Install Shift+Enter key binding for newlines (iTerm2 and VSCode only) |

47| `/todos` | List current TODO items |

48| `/usage` | For subscription plans only: show plan usage limits and rate limit status |

49| `/vim` | Enter vim mode for alternating insert and command modes |

50 

51## Custom slash commands

52 

53Custom slash commands allow you to define frequently used prompts as Markdown files that Claude Code can execute. Commands are organized by scope (project-specific or personal) and support namespacing through directory structures.

54 

55### Syntax

56 

57```

58/<command-name> [arguments]

59```

60 

61#### Parameters

62 

63| Parameter | Description |

64| :--------------- | :---------------------------------------------------------------- |

65| `<command-name>` | Name derived from the Markdown filename (without `.md` extension) |

66| `[arguments]` | Optional arguments passed to the command |

67 

68### Command types

69 

70#### Project commands

71 

72Commands stored in your repository and shared with your team. When listed in `/help`, these commands show "(project)" after their description.

73 

74**Location**: `.claude/commands/`

75 

76The following example creates the `/optimize` command:

77 

78```bash theme={null}

79# Create a project command

80mkdir -p .claude/commands

81echo "Analyze this code for performance issues and suggest optimizations:" > .claude/commands/optimize.md

82```

83 

84#### Personal commands

85 

86Commands available across all your projects. When listed in `/help`, these commands show "(user)" after their description.

87 

88**Location**: `~/.claude/commands/`

89 

90The following example creates the `/security-review` command:

91 

92```bash theme={null}

93# Create a personal command

94mkdir -p ~/.claude/commands

95echo "Review this code for security vulnerabilities:" > ~/.claude/commands/security-review.md

96```

97 

98### Features

99 

100#### Namespacing

101 

102Use subdirectories to group related commands. Subdirectories appear in the command description but don't affect the command name.

103 

104For example:

105 

106* `.claude/commands/frontend/component.md` creates `/component` with description "(project:frontend)"

107* `~/.claude/commands/component.md` creates `/component` with description "(user)"

108 

109If a project command and user command share the same name, the project command takes precedence and the user command is silently ignored. For example, if both `.claude/commands/deploy.md` and `~/.claude/commands/deploy.md` exist, `/deploy` runs the project version.

110 

111Commands in different subdirectories can share names since the subdirectory appears in the description to distinguish them. For example, `.claude/commands/frontend/test.md` and `.claude/commands/backend/test.md` both create `/test`, but show as "(project:frontend)" and "(project:backend)" respectively.

112 

113#### Arguments

114 

115Pass dynamic values to commands using argument placeholders:

116 

117##### All arguments with `$ARGUMENTS`

118 

119The `$ARGUMENTS` placeholder captures all arguments passed to the command:

120 

121```bash theme={null}

122# Command definition

123echo 'Fix issue #$ARGUMENTS following our coding standards' > .claude/commands/fix-issue.md

124 

125# Usage

126> /fix-issue 123 high-priority

127# $ARGUMENTS becomes: "123 high-priority"

128```

129 

130##### Individual arguments with `$1`, `$2`, etc.

131 

132Access specific arguments individually using positional parameters (similar to shell scripts):

133 

134```bash theme={null}

135# Command definition

136echo 'Review PR #$1 with priority $2 and assign to $3' > .claude/commands/review-pr.md

137 

138# Usage

139> /review-pr 456 high alice

140# $1 becomes "456", $2 becomes "high", $3 becomes "alice"

141```

142 

143Use positional arguments when you need to:

144 

145* Access arguments individually in different parts of your command

146* Provide defaults for missing arguments

147* Build more structured commands with specific parameter roles

148 

149#### Bash command execution

150 

151Execute bash commands before the slash command runs using the `!` prefix. The output is included in the command context. You *must* include `allowed-tools` with the `Bash` tool, but you can choose the specific bash commands to allow.

152 

153For example:

154 

155```markdown theme={null}

156allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)

157description: Create a git commit

158 

159## Context

160 

161- Current git status: !`git status`

162- Current git diff (staged and unstaged changes): !`git diff HEAD`

163- Current branch: !`git branch --show-current`

164- Recent commits: !`git log --oneline -10`

165 

166## Your task

167 

168Based on the above changes, create a single git commit.

169```

170 

171#### File references

172 

173Include file contents in commands using the `@` prefix to [reference files](/en/common-workflows#reference-files-and-directories).

174 

175For example:

176 

177```markdown theme={null}

178# Reference a specific file

179 

180Review the implementation in @src/utils/helpers.js

181 

182# Reference multiple files

183 

184Compare @src/old-version.js with @src/new-version.js

185```

186 

187#### Thinking mode

188 

189Slash commands can trigger extended thinking by including [extended thinking keywords](/en/common-workflows#use-extended-thinking).

190 

191### Frontmatter

192 

193Command files support frontmatter, useful for specifying metadata about the command:

194 

195| Frontmatter | Purpose | Default |

196| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------- |

197| `allowed-tools` | List of tools the command can use | Inherits from the conversation |

198| `argument-hint` | The arguments expected for the slash command. Example: `argument-hint: add [tagId] \| remove [tagId] \| list`. This hint is shown to the user when auto-completing the slash command. | None |

199| `description` | Brief description of the command | Uses the first line from the prompt |

200| `model` | Specific model string (see [Models overview](https://docs.claude.com/en/docs/about-claude/models/overview)) | Inherits from the conversation |

201| `disable-model-invocation` | Whether to prevent `SlashCommand` tool from calling this command | false |

202 

203For example:

204 

205```markdown theme={null}

206allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)

207argument-hint: [message]

208description: Create a git commit

209model: claude-3-5-haiku-20241022

210 

211Create a git commit with message: $ARGUMENTS

212```

213 

214Example using positional arguments:

215 

216```markdown theme={null}

217argument-hint: [pr-number] [priority] [assignee]

218description: Review pull request

219 

220Review PR #$1 with priority $2 and assign to $3.

221Focus on security, performance, and code style.

222```

223 

224## Plugin commands

225 

226[Plugins](/en/plugins) can provide custom slash commands that integrate seamlessly with Claude Code. Plugin commands work exactly like user-defined commands but are distributed through [plugin marketplaces](/en/plugin-marketplaces).

227 

228### How plugin commands work

229 

230Plugin commands are:

231 

232* **Namespaced**: Commands can use the format `/plugin-name:command-name` to avoid conflicts (plugin prefix is optional unless there are name collisions)

233* **Automatically available**: Once a plugin is installed and enabled, its commands appear in `/help`

234* **Fully integrated**: Support all command features (arguments, frontmatter, bash execution, file references)

235 

236### Plugin command structure

237 

238**Location**: `commands/` directory in plugin root

239 

240**File format**: Markdown files with frontmatter

241 

242**Basic command structure**:

243 

244```markdown theme={null}

245description: Brief description of what the command does

246 

247# Command Name

248 

249Detailed instructions for Claude on how to execute this command.

250Include specific guidance on parameters, expected outcomes, and any special considerations.

251```

252 

253**Advanced command features**:

254 

255* **Arguments**: Use placeholders like `{arg1}` in command descriptions

256* **Subdirectories**: Organize commands in subdirectories for namespacing

257* **Bash integration**: Commands can execute shell scripts and programs

258* **File references**: Commands can reference and modify project files

259 

260### Invocation patterns

261 

262```shell Direct command (when no conflicts) theme={null}

263/command-name

264```

265 

266```shell Plugin-prefixed (when needed for disambiguation) theme={null}

267/plugin-name:command-name

268```

269 

270```shell With arguments (if command supports them) theme={null}

271/command-name arg1 arg2

272```

273 

274## MCP slash commands

275 

276MCP servers can expose prompts as slash commands that become available in Claude Code. These commands are dynamically discovered from connected MCP servers.

277 

278### Command format

279 

280MCP commands follow the pattern:

281 

282```

283/mcp__<server-name>__<prompt-name> [arguments]

284```

285 

286### Features

287 

288#### Dynamic discovery

289 

290MCP commands are automatically available when:

291 

292* An MCP server is connected and active

293* The server exposes prompts through the MCP protocol

294* The prompts are successfully retrieved during connection

295 

296#### Arguments

297 

298MCP prompts can accept arguments defined by the server:

299 

300```

301# Without arguments

302> /mcp__github__list_prs

303 

304# With arguments

305> /mcp__github__pr_review 456

306> /mcp__jira__create_issue "Bug title" high

307```

308 

309#### Naming conventions

310 

311Server and prompt names are normalized:

312 

313* Spaces and special characters become underscores

314* Names are lowercase for consistency

315 

316### Managing MCP connections

317 

318Use the `/mcp` command to:

319 

320* View all configured MCP servers

321* Check connection status

322* Authenticate with OAuth-enabled servers

323* Clear authentication tokens

324* View available tools and prompts from each server

325 

326### MCP permissions and wildcards

327 

328To approve all tools from an MCP server, use either the server name alone or wildcard syntax:

329 

330* `mcp__github` (approves all GitHub tools)

331* `mcp__github__*` (wildcard syntax, also approves all GitHub tools)

332 

333To approve specific tools, list each one explicitly:

334 

335* `mcp__github__get_issue`

336* `mcp__github__list_issues`

337 

338See [MCP permission rules](/en/iam#tool-specific-permission-rules) for more details.

339 

340## `SlashCommand` tool

341 

342The `SlashCommand` tool allows Claude to execute [custom slash commands](/en/slash-commands#custom-slash-commands) programmatically

343during a conversation. This gives Claude the ability to invoke custom commands

344on your behalf when appropriate.

345 

346To encourage Claude to use the `SlashCommand` tool, reference the command by name, including the slash, in your prompts or `CLAUDE.md` file. For example:

347 

348```

349> Run /write-unit-test when you are about to start writing tests.

350```

351 

352This tool puts each available custom slash command's metadata into context up to the character budget limit. You can use `/context` to monitor token usage and follow the operations below to manage context.

353 

354### `SlashCommand` tool supported commands

355 

356`SlashCommand` tool only supports custom slash commands that:

357 

358* Are user-defined. Built-in commands like `/compact` and `/init` are *not* supported.

359* Have the `description` frontmatter field populated. The description is used in the context.

360 

361For Claude Code versions >= 1.0.124, you can see which custom slash commands

362`SlashCommand` tool can invoke by running `claude --debug` and triggering a query.

363 

364### Disable `SlashCommand` tool

365 

366To prevent Claude from executing any slash commands via the tool:

367 

368```bash theme={null}

369/permissions

370# Add to deny rules: SlashCommand

371```

372 

373This also removes the SlashCommand tool and command descriptions from context.

374 

375### Disable specific commands only

376 

377To prevent a specific slash command from becoming available, add

378`disable-model-invocation: true` to the slash command's frontmatter.

379 

380This also removes the command's metadata from context.

381 

382### `SlashCommand` permission rules

383 

384The permission rules support:

385 

386* **Exact match**: `SlashCommand:/commit` (allows only `/commit` with no arguments)

387* **Prefix match**: `SlashCommand:/review-pr:*` (allows `/review-pr` with any arguments)

388 

389### Character budget limit

390 

391The `SlashCommand` tool includes a character budget to limit the size of command

392descriptions shown to Claude. This prevents token overflow when many commands

393are available.

394 

395The budget includes each custom slash command's name, arguments, and description.

396 

397* **Default limit**: 15,000 characters

398* **Custom limit**: Set via `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable

399 

400When the character budget is exceeded, Claude sees only a subset of the available commands. In `/context`, a warning shows "M of N commands".

401 

402## Skills vs slash commands

403 

404**Slash commands** and **Agent Skills** serve different purposes in Claude Code:

405 

406### Use slash commands for

407 

408**Quick, frequently used prompts**:

409 

410* Simple prompt snippets you use often

411* Quick reminders or templates

412* Frequently used instructions that fit in one file

413 

414**Examples**:

415 

416* `/review` → "Review this code for bugs and suggest improvements"

417* `/explain` → "Explain this code in simple terms"

418* `/optimize` → "Analyze this code for performance issues"

419 

420### Use Skills for

421 

422**Comprehensive capabilities with structure**:

423 

424* Complex workflows with multiple steps

425* Capabilities requiring scripts or utilities

426* Knowledge organized across multiple files

427* Team workflows you want to standardize

428 

429**Examples**:

430 

431* PDF processing Skill with form-filling scripts and validation

432* Data analysis Skill with reference docs for different data types

433* Documentation Skill with style guides and templates

434 

435### Key differences

436 

437| Aspect | Slash Commands | Agent Skills |

438| -------------- | -------------------------------- | ----------------------------------- |

439| **Complexity** | Simple prompts | Complex capabilities |

440| **Structure** | Single .md file | Directory with SKILL.md + resources |

441| **Discovery** | Explicit invocation (`/command`) | Automatic (based on context) |

442| **Files** | One file only | Multiple files, scripts, templates |

443| **Scope** | Project or personal | Project or personal |

444| **Sharing** | Via git | Via git |

445 

446### Example comparison

447 

448**As a slash command**:

449 

450```markdown theme={null}

451# .claude/commands/review.md

452Review this code for:

453- Security vulnerabilities

454- Performance issues

455- Code style violations

456```

457 

458Usage: `/review` (manual invocation)

459 

460**As a Skill**:

461 

462```

463.claude/skills/code-review/

464├── SKILL.md (overview and workflows)

465├── SECURITY.md (security checklist)

466├── PERFORMANCE.md (performance patterns)

467├── STYLE.md (style guide reference)

468└── scripts/

469 └── run-linters.sh

470```

471 

472Usage: "Can you review this code?" (automatic discovery)

473 

474The Skill provides richer context, validation scripts, and organized reference material.

475 

476### When to use each

477 

478**Use slash commands**:

479 

480* You invoke the same prompt repeatedly

481* The prompt fits in a single file

482* You want explicit control over when it runs

483 

484**Use Skills**:

485 

486* Claude should discover the capability automatically

487* Multiple files or scripts are needed

488* Complex workflows with validation steps

489* Team needs standardized, detailed guidance

490 

491Both slash commands and Skills can coexist. Use the approach that fits your needs.

492 

493Learn more about [Agent Skills](/en/skills).

494 

495## See also

496 

497* [Plugins](/en/plugins) - Extend Claude Code with custom commands through plugins

498* [Identity and Access Management](/en/iam) - Complete guide to permissions, including MCP tool permissions

499* [Interactive mode](/en/interactive-mode) - Shortcuts, input modes, and interactive features

500* [CLI reference](/en/cli-reference) - Command-line flags and options

501* [Settings](/en/settings) - Configuration options

502* [Memory management](/en/memory) - Managing Claude's memory across sessions

503 

504 

505 

506> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://code.claude.com/docs/llms.txt

statusline.md +19 −1

Details

63 "total_input_tokens": 15234,63 "total_input_tokens": 15234,

64 "total_output_tokens": 4521,64 "total_output_tokens": 4521,

65 "context_window_size": 200000,65 "context_window_size": 200000,

66 "used_percentage": 42.5,

67 "remaining_percentage": 57.5,

66 "current_usage": {68 "current_usage": {

67 "input_tokens": 8500,69 "input_tokens": 8500,

68 "output_tokens": 1200,70 "output_tokens": 1200,


207Display the percentage of context window consumed. The `context_window` object contains:209Display the percentage of context window consumed. The `context_window` object contains:

208 210 

209* `total_input_tokens` / `total_output_tokens`: Cumulative totals across the entire session211* `total_input_tokens` / `total_output_tokens`: Cumulative totals across the entire session

212* `used_percentage`: Pre-calculated percentage of context window used (0-100)

213* `remaining_percentage`: Pre-calculated percentage of context window remaining (0-100)

210* `current_usage`: Current context window usage from the last API call (may be `null` if no messages yet)214* `current_usage`: Current context window usage from the last API call (may be `null` if no messages yet)

211 * `input_tokens`: Input tokens in current context215 * `input_tokens`: Input tokens in current context

212 * `output_tokens`: Output tokens generated216 * `output_tokens`: Output tokens generated

213 * `cache_creation_input_tokens`: Tokens written to cache217 * `cache_creation_input_tokens`: Tokens written to cache

214 * `cache_read_input_tokens`: Tokens read from cache218 * `cache_read_input_tokens`: Tokens read from cache

215 219 

216For accurate context percentage, use `current_usage` which reflects the actual context window state:220You can use the pre-calculated `used_percentage` and `remaining_percentage` fields directly, or calculate from `current_usage` for more control.

221 

222**Simple approach using pre-calculated percentages:**

223 

224```bash theme={null}

225#!/bin/bash

226input=$(cat)

227 

228MODEL=$(echo "$input" | jq -r '.model.display_name')

229PERCENT_USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0')

230 

231echo "[$MODEL] Context: ${PERCENT_USED}%"

232```

233 

234**Advanced approach with manual calculation:**

217 235 

218```bash theme={null}236```bash theme={null}

219#!/bin/bash237#!/bin/bash

sub-agents.md +452 −285

Details

1# Subagents1# Create custom subagents

2 2 

3> Create and use specialized AI subagents in Claude Code for task-specific workflows and improved context management.3> Create and use specialized AI subagents in Claude Code for task-specific workflows and improved context management.

4 4 

5Custom subagents in Claude Code are specialized AI assistants that can be invoked to handle specific types of tasks. They enable more efficient problem-solving by providing task-specific configurations with customized system prompts, tools and a separate context window.5Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.

6 6 

7## What are subagents?7Subagents help you:

8 8 

9Subagents are pre-configured AI personalities that Claude Code can delegate tasks to. Each subagent:9* **Preserve context** by keeping exploration and implementation out of your main conversation

10* **Enforce constraints** by limiting which tools a subagent can use

11* **Reuse configurations** across projects with user-level subagents

12* **Specialize behavior** with focused system prompts for specific domains

13* **Control costs** by routing tasks to faster, cheaper models like Haiku

10 14 

11* Has a specific purpose and expertise area15Claude uses each subagent's description to decide when to delegate tasks. When you create a subagent, write a clear description so Claude knows when to use it.

12* Uses its own context window separate from the main conversation

13* Can be configured with specific tools it's allowed to use

14* Includes a custom system prompt that guides its behavior

15 16 

16When Claude Code encounters a task that matches a subagent's expertise, it can delegate that task to the specialized subagent, which works independently and returns results.17Claude Code includes several built-in subagents like **Explore**, **Plan**, and **general-purpose**. You can also create custom subagents to handle specific tasks. This page covers the [built-in subagents](#built-in-subagents), [how to create your own](#quickstart-create-your-first-subagent), [full configuration options](#configure-subagents), [patterns for working with subagents](#work-with-subagents), and [example subagents](#example-subagents).

17 18 

18## Key benefits19## Built-in subagents

20 

21Claude Code includes built-in subagents that Claude automatically uses when appropriate. Each inherits the parent conversation's permissions with additional tool restrictions.

22 

23<Tabs>

24 <Tab title="Explore">

25 A fast, read-only agent optimized for searching and analyzing codebases.

26 

27 * **Model**: Haiku (fast, low-latency)

28 * **Tools**: Read-only tools (denied access to Write and Edit tools)

29 * **Purpose**: File discovery, code search, codebase exploration

30 

31 Claude delegates to Explore when it needs to search or understand a codebase without making changes. This keeps exploration results out of your main conversation context.

32 

33 When invoking Explore, Claude specifies a thoroughness level: **quick** for targeted lookups, **medium** for balanced exploration, or **very thorough** for comprehensive analysis.

34 </Tab>

35 

36 <Tab title="Plan">

37 A research agent used during [plan mode](/en/common-workflows#use-plan-mode-for-safe-code-analysis) to gather context before presenting a plan.

38 

39 * **Model**: Inherits from main conversation

40 * **Tools**: Read-only tools (denied access to Write and Edit tools)

41 * **Purpose**: Codebase research for planning

42 

43 When you're in plan mode and Claude needs to understand your codebase, it delegates research to the Plan subagent. This prevents infinite nesting (subagents cannot spawn other subagents) while still gathering necessary context.

44 </Tab>

45 

46 <Tab title="General-purpose">

47 A capable agent for complex, multi-step tasks that require both exploration and action.

19 48 

20<CardGroup cols={2}>49 * **Model**: Inherits from main conversation

21 <Card title="Context preservation" icon="layer-group">50 * **Tools**: All tools

22 Each subagent operates in its own context, preventing pollution of the main conversation and keeping it focused on high-level objectives.51 * **Purpose**: Complex research, multi-step operations, code modifications

23 </Card>

24 52 

25 <Card title="Specialized expertise" icon="brain">53 Claude delegates to general-purpose when the task requires both exploration and modification, complex reasoning to interpret results, or multiple dependent steps.

26 Subagents can be fine-tuned with detailed instructions for specific domains, leading to higher success rates on designated tasks.54 </Tab>

27 </Card>

28 55 

29 <Card title="Reusability" icon="rotate">56 <Tab title="Other">

30 Once created, you can use subagents across different projects and share them with your team for consistent workflows.57 Claude Code includes additional helper agents for specific tasks. These are typically invoked automatically, so you don't need to use them directly.

31 </Card>

32 58 

33 <Card title="Flexible permissions" icon="shield-check">59 | Agent | Model | When Claude uses it |

34 Each subagent can have different tool access levels, allowing you to limit powerful tools to specific subagent types.60 | :---------------- | :------- | :------------------------------------------------------- |

35 </Card>61 | Bash | Inherits | Running terminal commands in a separate context |

36</CardGroup>62 | statusline-setup | Sonnet | When you run `/statusline` to configure your status line |

63 | Claude Code Guide | Haiku | When you ask questions about Claude Code features |

64 </Tab>

65</Tabs>

37 66 

38## Quick start67Beyond these built-in subagents, you can create your own with custom prompts, tool restrictions, permission modes, hooks, and skills. The following sections show how to get started and customize subagents.

39 68 

40To create your first subagent:69## Quickstart: create your first subagent

70 

71Subagents are defined in Markdown files with YAML frontmatter. You can [create them manually](#write-subagent-files) or use the `/agents` command.

72 

73This walkthrough guides you through creating a user-level subagent with the `/agent` command. The subagent reviews code and suggests improvements for the codebase.

41 74 

42<Steps>75<Steps>

43 <Step title="Open the subagents interface">76 <Step title="Open the subagents interface">

44 Run the following command:77 In Claude Code, run:

45 78 

46 ```79 ```

47 /agents80 /agents

48 ```81 ```

49 </Step>82 </Step>

50 83 

51 <Step title="Select 'Create New Agent'">84 <Step title="Create a new user-level agent">

52 Choose whether to create a project-level or user-level subagent85 Select **Create new agent**, then choose **User-level**. This saves the subagent to `~/.claude/agents/` so it's available in all your projects.

86 </Step>

87 

88 <Step title="Generate with Claude">

89 Select **Generate with Claude**. When prompted, describe the subagent:

90 

91 ```

92 A code improvement agent that scans files and suggests improvements

93 for readability, performance, and best practices. It should explain

94 each issue, show the current code, and provide an improved version.

95 ```

96 

97 Claude generates the system prompt and configuration. Press `e` to open it in your editor if you want to customize it.

98 </Step>

99 

100 <Step title="Select tools">

101 For a read-only reviewer, deselect everything except **Read-only tools**. If you keep all tools selected, the subagent inherits all tools available to the main conversation.

102 </Step>

103 

104 <Step title="Select model">

105 Choose which model the subagent uses. For this example agent, select **Sonnet**, which balances capability and speed for analyzing code patterns.

53 </Step>106 </Step>

54 107 

55 <Step title="Define the subagent">108 <Step title="Choose a color">

56 * **Recommended**: generate with Claude first, then customize to make it yours109 Pick a background color for the subagent. This helps you identify which subagent is running in the UI.

57 * Describe your subagent in detail, including when Claude should use it

58 * Select the tools you want to grant access to, or leave this blank to inherit all tools

59 * The interface shows all available tools

60 * If you're generating with Claude, you can also edit the system prompt in your own editor by pressing `e`

61 </Step>110 </Step>

62 111 

63 <Step title="Save and use">112 <Step title="Save and try it out">

64 Your subagent is now available. Claude uses it automatically when appropriate, or you can invoke it explicitly:113 Save the subagent. It's available immediately (no restart needed). Try it:

65 114 

66 ```115 ```

67 > Use the code-reviewer subagent to check my recent changes116 Use the code-improver agent to suggest improvements in this project

68 ```117 ```

118 

119 Claude delegates to your new subagent, which scans the codebase and returns improvement suggestions.

69 </Step>120 </Step>

70</Steps>121</Steps>

71 122 

72## Subagent configuration123You now have a subagent you can use in any project on your machine to analyze codebases and suggest improvements.

73 124 

74### File locations125You can also create subagents manually as Markdown files, define them via CLI flags, or distribute them through plugins. The following sections cover all configuration options.

75 126 

76Subagents are stored as Markdown files with YAML frontmatter in two possible locations:127## Configure subagents

77 128 

78| Type | Location | Scope | Priority |129### Use the /agents command

79| :-------------------- | :------------------ | :---------------------------- | :------- |

80| **Project subagents** | `.claude/agents/` | Available in current project | Highest |

81| **User subagents** | `~/.claude/agents/` | Available across all projects | Lower |

82 130 

83When subagent names conflict, project-level subagents take precedence over user-level subagents.131The `/agents` command provides an interactive interface for managing subagents. Run `/agents` to:

84 132 

85### Plugin agents133* View all available subagents (built-in, user, project, and plugin)

134* Create new subagents with guided setup or Claude generation

135* Edit existing subagent configuration and tool access

136* Delete custom subagents

137* See which subagents are active when duplicates exist

86 138 

87[Plugins](/en/plugins) can provide custom subagents that integrate seamlessly with Claude Code. Plugin agents work identically to user-defined agents and appear in the `/agents` interface.139This is the recommended way to create and manage subagents. For manual creation or automation, you can also add subagent files directly.

88 140 

89**Plugin agent locations**: plugins include agents in their `agents/` directory (or custom paths specified in the plugin manifest).141### Choose the subagent scope

90 142 

91**Using plugin agents**:143Subagents are Markdown files with YAML frontmatter. Store them in different locations depending on scope. When multiple subagents share the same name, the higher-priority location wins.

92 144 

93* Plugin agents appear in `/agents` alongside your custom agents145| Location | Scope | Priority | How to create |

94* Can be invoked explicitly: "Use the code-reviewer agent from the security-plugin"146| :--------------------------- | :---------------------- | :---------- | :------------------------------------ |

95* Can be invoked automatically by Claude when appropriate147| `--agents` CLI flag | Current session | 1 (highest) | Pass JSON when launching Claude Code |

96* Can be managed (viewed, inspected) through `/agents` interface148| `.claude/agents/` | Current project | 2 | Interactive or manual |

149| `~/.claude/agents/` | All your projects | 3 | Interactive or manual |

150| Plugin's `agents/` directory | Where plugin is enabled | 4 (lowest) | Installed with [plugins](/en/plugins) |

97 151 

98See the [plugin components reference](/en/plugins-reference#agents) for details on creating plugin agents.152**Project subagents** (`.claude/agents/`) are ideal for subagents specific to a codebase. Check them into version control so your team can use and improve them collaboratively.

99 153 

100### CLI-based configuration154**User subagents** (`~/.claude/agents/`) are personal subagents available in all your projects.

101 155 

102You can also define subagents dynamically using the `--agents` CLI flag, which accepts a JSON object:156**CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren't saved to disk, making them useful for quick testing or automation scripts:

103 157 

104```bash theme={null}158```bash theme={null}

105claude --agents '{159claude --agents '{


112}'166}'

113```167```

114 168 

115**Priority**: CLI-defined subagents have lower priority than project-level subagents but higher priority than user-level subagents.169The `--agents` flag accepts JSON with the same fields as [frontmatter](#supported-frontmatter-fields). Use `prompt` for the system prompt (equivalent to the markdown body in file-based subagents). See the [CLI reference](/en/cli-reference#agents-flag-format) for the full JSON format.

116 

117**Use case**: This approach is useful for:

118 170 

119* Quick testing of subagent configurations171**Plugin subagents** come from [plugins](/en/plugins) you've installed. They appear in `/agents` alongside your custom subagents. See the [plugin components reference](/en/plugins-reference#agents) for details on creating plugin subagents.

120* Session-specific subagents that don't need to be saved

121* Automation scripts that need custom subagents

122* Sharing subagent definitions in documentation or scripts

123 172 

124For detailed information about the JSON format and all available options, see the [CLI reference documentation](/en/cli-reference#agents-flag-format).173### Write subagent files

125 174 

126### File format175Subagent files use YAML frontmatter for configuration, followed by the system prompt in Markdown:

127 176 

128Each subagent is defined in a Markdown file with this structure:177<Note>

178 Subagents are loaded at session start. If you create a subagent by manually adding a file, restart your session or use `/agents` to load it immediately.

179</Note>

129 180 

130```markdown theme={null}181```markdown theme={null}

131---182---

132name: your-sub-agent-name183name: code-reviewer

133description: Description of when this subagent should be invoked184description: Reviews code for quality and best practices

134tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted185tools: Read, Glob, Grep

135model: sonnet # Optional - specify model alias or 'inherit'186model: sonnet

136permissionMode: default # Optional - permission mode for the subagent

137skills: skill1, skill2 # Optional - skills to auto-load

138---187---

139 188 

140Your subagent's system prompt goes here. This can be multiple paragraphs189You are a code reviewer. When invoked, analyze the code and provide

141and should clearly define the subagent's role, capabilities, and approach190specific, actionable feedback on quality, security, and best practices.

142to solving problems.

143 

144Include specific instructions, best practices, and any constraints

145the subagent should follow.

146```191```

147 192 

148#### Configuration fields193The frontmatter defines the subagent's metadata and configuration. The body becomes the system prompt that guides the subagent's behavior. Subagents receive only this system prompt (plus basic environment details like working directory), not the full Claude Code system prompt.

194 

195#### Supported frontmatter fields

196 

197The following fields can be used in the YAML frontmatter. Only `name` and `description` are required.

149 198 

150| Field | Required | Description |199| Field | Required | Description |

151| :--------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |200| :---------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

152| `name` | Yes | Unique identifier using lowercase letters and hyphens |201| `name` | Yes | Unique identifier using lowercase letters and hyphens |

153| `description` | Yes | Natural language description of the subagent's purpose |202| `description` | Yes | When Claude should delegate to this subagent |

154| `tools` | No | Comma-separated list of specific tools. If omitted, inherits all tools from the main thread |203| `tools` | No | [Tools](#available-tools) the subagent can use. Inherits all tools if omitted |

155| `model` | No | Model to use for this subagent. Can be a model alias (`sonnet`, `opus`, `haiku`) or `'inherit'` to use the main conversation's model. If omitted, defaults to the [configured subagent model](/en/model-config) |204| `disallowedTools` | No | Tools to deny, removed from inherited or specified list |

156| `permissionMode` | No | Permission mode for the subagent. Valid values: `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, `plan`, `ignore`. Controls how the subagent handles permission requests |205| `model` | No | [Model](#choose-a-model) to use: `sonnet`, `opus`, `haiku`, or `inherit`. Defaults to `inherit` |

157| `skills` | No | Comma-separated list of skill names to auto-load when the subagent starts. Subagents do not inherit Skills from the parent conversation. If omitted, no Skills are preloaded. |206| `permissionMode` | No | [Permission mode](#permission-modes): `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, or `plan` |

207| `skills` | No | [Skills](/en/skills) to load into the subagent's context at startup. The full skill content is injected, not just made available for invocation. Subagents don't inherit skills from the parent conversation |

208| `hooks` | No | [Lifecycle hooks](#define-hooks-for-subagents) scoped to this subagent |

158 209 

159### Model selection210### Choose a model

160 211 

161The `model` field allows you to control which [AI model](/en/model-config) the subagent uses:212The `model` field controls which [AI model](/en/model-config) the subagent uses:

162 213 

163* **Model alias**: Use one of the available aliases: `sonnet`, `opus`, or `haiku`214* **Model alias**: Use one of the available aliases: `sonnet`, `opus`, or `haiku`

164* **`'inherit'`**: Use the same model as the main conversation (useful for consistency)215* **inherit**: Use the same model as the main conversation

165* **Omitted**: If not specified, uses the default model configured for subagents (`sonnet`)216* **Omitted**: If not specified, defaults to `inherit` (uses the same model as the main conversation)

217 

218### Control subagent capabilities

219 

220You can control what subagents can do through tool access, permission modes, and conditional rules.

221 

222#### Available tools

223 

224Subagents can use any of Claude Code's [internal tools](/en/settings#tools-available-to-claude). By default, subagents inherit all tools from the main conversation, including MCP tools.

225 

226To restrict tools, use the `tools` field (allowlist) or `disallowedTools` field (denylist):

227 

228```yaml theme={null}

229---

230name: safe-researcher

231description: Research agent with restricted capabilities

232tools: Read, Grep, Glob, Bash

233disallowedTools: Write, Edit

234---

235```

236 

237#### Permission modes

238 

239The `permissionMode` field controls how the subagent handles permission prompts. Subagents inherit the permission context from the main conversation but can override the mode.

240 

241| Mode | Behavior |

242| :------------------ | :----------------------------------------------------------------- |

243| `default` | Standard permission checking with prompts |

244| `acceptEdits` | Auto-accept file edits |

245| `dontAsk` | Auto-deny permission prompts (explicitly allowed tools still work) |

246| `bypassPermissions` | Skip all permission checks |

247| `plan` | Plan mode (read-only exploration) |

248 

249<Warning>

250 Use `bypassPermissions` with caution. It skips all permission checks, allowing the subagent to execute any operation without approval.

251</Warning>

252 

253If the parent uses `bypassPermissions`, this takes precedence and cannot be overridden.

254 

255#### Preload skills into subagents

256 

257Use the `skills` field to inject skill content into a subagent's context at startup. This gives the subagent domain knowledge without requiring it to discover and load skills during execution.

258 

259```yaml theme={null}

260---

261name: api-developer

262description: Implement API endpoints following team conventions

263skills:

264 - api-conventions

265 - error-handling-patterns

266---

267 

268Implement API endpoints. Follow the conventions and patterns from the preloaded skills.

269```

270 

271The full content of each skill is injected into the subagent's context, not just made available for invocation. Subagents don't inherit skills from the parent conversation; you must list them explicitly.

166 272 

167<Note>273<Note>

168 Using `'inherit'` is particularly useful when you want your subagents to adapt to the model choice of the main conversation, ensuring consistent capabilities and response style throughout your session.274 This is the inverse of [running a skill in a subagent](/en/skills#run-skills-in-a-subagent). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system.

169</Note>275</Note>

170 276 

171### Available tools277#### Conditional rules with hooks

172 278 

173Subagents can be granted access to any of Claude Code's internal tools. See the [tools documentation](/en/settings#tools-available-to-claude) for a complete list of available tools.279For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.

174 280 

175<Tip>281This example creates a subagent that only allows read-only database queries. The `PreToolUse` hook runs the script specified in `command` before each Bash command executes:

176 **Recommended:** Use the `/agents` command to modify tool access - it provides an interactive interface that lists all available tools, including any connected MCP server tools, making it easier to select the ones you need.282 

177</Tip>283```yaml theme={null}

284---

285name: db-reader

286description: Execute read-only database queries

287tools: Bash

288hooks:

289 PreToolUse:

290 - matcher: "Bash"

291 hooks:

292 - type: command

293 command: "./scripts/validate-readonly-query.sh"

294---

295```

178 296 

179You have two options for configuring tools:297Claude Code [passes hook input as JSON](/en/hooks#pretooluse-input) via stdin to hook commands. The validation script reads this JSON, extracts the Bash command, and [exits with code 2](/en/hooks#exit-code-2-behavior) to block write operations:

180 298 

181* **Omit the `tools` field** to inherit all tools from the main thread (default), including MCP tools299```bash theme={null}

182* **Specify individual tools** as a comma-separated list for more granular control (can be edited manually or via `/agents`)300#!/bin/bash

301# ./scripts/validate-readonly-query.sh

302 

303INPUT=$(cat)

304COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')

183 305 

184**MCP Tools**: Subagents can access MCP tools from configured MCP servers. When the `tools` field is omitted, subagents inherit all MCP tools available to the main thread.306# Block SQL write operations (case-insensitive)

307if echo "$COMMAND" | grep -iE '\b(INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|TRUNCATE)\b' > /dev/null; then

308 echo "Blocked: Only SELECT queries are allowed" >&2

309 exit 2

310fi

185 311 

186## Managing subagents312exit 0

313```

187 314 

188### Using the /agents command (Recommended)315See [Hook input](/en/hooks#pretooluse-input) for the complete input schema and [exit codes](/en/hooks#simple-exit-code) for how exit codes affect behavior.

189 316 

190The `/agents` command provides a comprehensive interface for subagent management:317#### Disable specific subagents

191 318 

319You can prevent Claude from using specific subagents by adding them to the `deny` array in your [settings](/en/settings#permission-settings). Use the format `Task(subagent-name)` where `subagent-name` matches the subagent's name field.

320 

321```json theme={null}

322{

323 "permissions": {

324 "deny": ["Task(Explore)", "Task(my-custom-agent)"]

325 }

326}

192```327```

193/agents328 

329This works for both built-in and custom subagents. You can also use the `--disallowedTools` CLI flag:

330 

331```bash theme={null}

332claude --disallowedTools "Task(Explore)"

194```333```

195 334 

196This opens an interactive menu where you can:335See [IAM documentation](/en/iam#tool-specific-permission-rules) for more details on permission rules.

197 336 

198* View all available subagents (built-in, user, and project)337### Define hooks for subagents

199* Create new subagents with guided setup

200* Edit existing custom subagents, including their tool access

201* Delete custom subagents

202* See which subagents are active when duplicates exist

203* **Manage tool permissions** with a complete list of available tools

204 338 

205### Direct file management339Subagents can define [hooks](/en/hooks) that run during the subagent's lifecycle. There are two ways to configure hooks:

206 340 

207You can also manage subagents by working directly with their files:3411. **In the subagent's frontmatter**: Define hooks that run only while that subagent is active

3422. **In `settings.json`**: Define hooks that run in the main session when subagents start or stop

208 343 

209```bash theme={null}344#### Hooks in subagent frontmatter

210# Create a project subagent

211mkdir -p .claude/agents

212echo '---

213name: test-runner

214description: Use proactively to run tests and fix failures

215 345 

216You are a test automation expert. When you see code changes, proactively run the appropriate tests. If tests fail, analyze the failures and fix them while preserving the original test intent.' > .claude/agents/test-runner.md346Define hooks directly in the subagent's markdown file. These hooks only run while that specific subagent is active and are cleaned up when it finishes.

217 347 

218# Create a user subagent348| Event | Matcher input | When it fires |

219mkdir -p ~/.claude/agents349| :------------ | :------------ | :------------------------------ |

220# ... create subagent file350| `PreToolUse` | Tool name | Before the subagent uses a tool |

351| `PostToolUse` | Tool name | After the subagent uses a tool |

352| `Stop` | (none) | When the subagent finishes |

353 

354This example validates Bash commands with the `PreToolUse` hook and runs a linter after file edits with `PostToolUse`:

355 

356```yaml theme={null}

357---

358name: code-reviewer

359description: Review code changes with automatic linting

360hooks:

361 PreToolUse:

362 - matcher: "Bash"

363 hooks:

364 - type: command

365 command: "./scripts/validate-command.sh $TOOL_INPUT"

366 PostToolUse:

367 - matcher: "Edit|Write"

368 hooks:

369 - type: command

370 command: "./scripts/run-linter.sh"

371---

221```372```

222 373 

223<Note>374`Stop` hooks in frontmatter are automatically converted to `SubagentStop` events.

224 Subagents created by manually adding files will be loaded the next time you start a Claude Code session. To create and use a subagent immediately without restarting, use the `/agents` command instead.

225</Note>

226 375 

227## Using subagents effectively376#### Project-level hooks for subagent events

228 377 

229### Automatic delegation378Configure hooks in `settings.json` that respond to subagent lifecycle events in the main session. Use the `matcher` field to target specific agent types by name.

230 379 

231Claude Code proactively delegates tasks based on:380| Event | Matcher input | When it fires |

381| :-------------- | :-------------- | :------------------------------- |

382| `SubagentStart` | Agent type name | When a subagent begins execution |

383| `SubagentStop` | Agent type name | When a subagent completes |

232 384 

233* The task description in your request385This example runs setup and cleanup scripts only when the `db-agent` subagent starts and stops:

234* The `description` field in subagent configurations

235* Current context and available tools

236 386 

237<Tip>387```json theme={null}

238 To encourage more proactive subagent use, include phrases like "use PROACTIVELY" or "MUST BE USED" in your `description` field.388{

239</Tip>389 "hooks": {

390 "SubagentStart": [

391 {

392 "matcher": "db-agent",

393 "hooks": [

394 { "type": "command", "command": "./scripts/setup-db-connection.sh" }

395 ]

396 }

397 ],

398 "SubagentStop": [

399 {

400 "matcher": "db-agent",

401 "hooks": [

402 { "type": "command", "command": "./scripts/cleanup-db-connection.sh" }

403 ]

404 }

405 ]

406 }

407}

408```

240 409 

241### Explicit invocation410See [Hooks](/en/hooks) for the complete hook configuration format.

242 411 

243Request a specific subagent by mentioning it in your command:412## Work with subagents

413 

414### Understand automatic delegation

415 

416Claude automatically delegates tasks based on the task description in your request, the `description` field in subagent configurations, and current context. To encourage proactive delegation, include phrases like "use proactively" in your subagent's description field.

417 

418You can also request a specific subagent explicitly:

244 419 

245```420```

246> Use the test-runner subagent to fix failing tests421Use the test-runner subagent to fix failing tests

247> Have the code-reviewer subagent look at my recent changes422Have the code-reviewer subagent look at my recent changes

248> Ask the debugger subagent to investigate this error

249```423```

250 424 

251## Built-in subagents425### Run subagents in foreground or background

252 426 

253Claude Code includes built-in subagents that are available out of the box:427Subagents can run in the foreground (blocking) or background (concurrent):

254 428 

255### General-purpose subagent429* **Foreground subagents** block the main conversation until complete. Permission prompts and clarifying questions (like [`AskUserQuestion`](/en/settings#tools-available-to-claude)) are passed through to you.

430* **Background subagents** run concurrently while you continue working. They inherit the parent's permissions and auto-deny anything not pre-approved. If a background subagent needs a permission it doesn't have or needs to ask clarifying questions, that tool call fails but the subagent continues. MCP tools are not available in background subagents.

256 431 

257The general-purpose subagent is a capable agent for complex, multi-step tasks that require both exploration and action. Unlike the Explore subagent, it can modify files and execute a wider range of operations.432If a background subagent fails due to missing permissions, you can [resume it](#resume-subagents) in the foreground to retry with interactive prompts.

258 433 

259**Key characteristics:**434Claude decides whether to run subagents in the foreground or background based on the task. You can also:

260 435 

261* **Model**: Uses Sonnet for more capable reasoning436* Ask Claude to "run this in the background"

262* **Tools**: Has access to all tools437* Press **Ctrl+B** to background a running task

263* **Mode**: Can read and write files, execute commands, make changes

264* **Purpose**: Complex research tasks, multi-step operations, code modifications

265 438 

266**When Claude uses it:**439To disable all background task functionality, set the `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` environment variable to `1`. See [Environment variables](/en/settings#environment-variables).

267 440 

268Claude delegates to the general-purpose subagent when:441### Common patterns

269 442 

270* The task requires both exploration and modification443#### Isolate high-volume operations

271* Complex reasoning is needed to interpret search results

272* Multiple strategies may be needed if initial searches fail

273* The task has multiple steps that depend on each other

274 444 

275**Example scenario:**445One of the most effective uses for subagents is isolating operations that produce large amounts of output. Running tests, fetching documentation, or processing log files can consume significant context. By delegating these to a subagent, the verbose output stays in the subagent's context while only the relevant summary returns to your main conversation.

276 446 

277```447```

278User: Find all the places where we handle authentication and update them to use the new token format448Use a subagent to run the test suite and report only the failing tests with their error messages

279 

280Claude: [Invokes general-purpose subagent]

281[Agent searches for auth-related code across codebase]

282[Agent reads and analyzes multiple files]

283[Agent makes necessary edits]

284[Returns detailed writeup of changes made]

285```449```

286 450 

287### Plan subagent451#### Run parallel research

288 452 

289The Plan subagent is a specialized built-in agent designed for use during plan mode. When Claude is operating in plan mode (non-execution mode), it uses the Plan subagent to conduct research and gather information about your codebase before presenting a plan.453For independent investigations, spawn multiple subagents to work simultaneously:

290 454 

291**Key characteristics:**455```

456Research the authentication, database, and API modules in parallel using separate subagents

457```

292 458 

293* **Model**: Uses Sonnet for more capable analysis459Each subagent explores its area independently, then Claude synthesizes the findings. This works best when the research paths don't depend on each other.

294* **Tools**: Has access to Read, Glob, Grep, and Bash tools for codebase exploration

295* **Purpose**: Searches files, analyzes code structure, and gathers context

296* **Automatic invocation**: Claude automatically uses this agent when in plan mode and needs to research the codebase

297 460 

298**How it works:**461<Warning>

299When you're in plan mode and Claude needs to understand your codebase to create a plan, it delegates research tasks to the Plan subagent. This prevents infinite nesting of agents (subagents cannot spawn other subagents) while still allowing Claude to gather the necessary context.462 When subagents complete, their results return to your main conversation. Running many subagents that each return detailed results can consume significant context.

463</Warning>

300 464 

301**Example scenario:**465#### Chain subagents

302 466 

303```467For multi-step workflows, ask Claude to use subagents in sequence. Each subagent completes its task and returns results to Claude, which then passes relevant context to the next subagent.

304User: [In plan mode] Help me refactor the authentication module

305 468 

306Claude: Let me research your authentication implementation first...469```

307[Internally invokes Plan subagent to explore auth-related files]470Use the code-reviewer subagent to find performance issues, then use the optimizer subagent to fix them

308[Plan subagent searches codebase and returns findings]

309Claude: Based on my research, here's my proposed plan...

310```471```

311 472 

312<Tip>473### Choose between subagents and main conversation

313 The Plan subagent is only used in plan mode. In normal execution mode, Claude uses the general-purpose agent or other custom subagents you've created.

314</Tip>

315 474 

316### Explore subagent475Use the **main conversation** when:

317 476 

318The Explore subagent is a fast, lightweight agent optimized for searching and analyzing codebases. It operates in strict read-only mode and is designed for rapid file discovery and code exploration.477* The task needs frequent back-and-forth or iterative refinement

478* Multiple phases share significant context (planning → implementation → testing)

479* You're making a quick, targeted change

480* Latency matters. Subagents start fresh and may need time to gather context

319 481 

320**Key characteristics:**482Use **subagents** when:

321 483 

322* **Model**: Uses Haiku for fast, low-latency searches484* The task produces verbose output you don't need in your main context

323* **Mode**: Strictly read-only - cannot create, modify, or delete files485* You want to enforce specific tool restrictions or permissions

324* **Tools available**:486* The work is self-contained and can return a summary

325 * Glob - File pattern matching

326 * Grep - Content searching with regular expressions

327 * Read - Reading file contents

328 * Bash - Read-only commands only (ls, git status, git log, git diff, find, cat, head, tail)

329 487 

330**When Claude uses it:**488Consider [Skills](/en/skills) instead when you want reusable prompts or workflows that run in the main conversation context rather than isolated subagent context.

331 489 

332Claude will delegate to the Explore subagent when it needs to search or understand a codebase but doesn't need to make changes. This is more efficient than the main agent running multiple search commands directly, as content found during the exploration process doesn't bloat the main conversation.490<Note>

491 Subagents cannot spawn other subagents. If your workflow requires nested delegation, use [Skills](/en/skills) or [chain subagents](#chain-subagents) from the main conversation.

492</Note>

333 493 

334**Thoroughness levels:**494### Manage subagent context

335 495 

336When invoking the Explore subagent, Claude specifies a thoroughness level:496#### Resume subagents

337 497 

338* **Quick** - Fast searches with minimal exploration. Good for targeted lookups.498Each subagent invocation creates a new instance with fresh context. To continue an existing subagent's work instead of starting over, ask Claude to resume it.

339* **Medium** - Moderate exploration. Balances speed and thoroughness.

340* **Very thorough** - Comprehensive analysis across multiple locations and naming conventions. Used when the target might be in unexpected places.

341 499 

342**Example scenarios:**500Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh.

343 501 

344```502When a subagent completes, Claude receives its agent ID. To resume a subagent, ask Claude to continue the previous work:

345User: Where are errors from the client handled?

346 503 

347Claude: [Invokes Explore subagent with "medium" thoroughness]

348[Explore uses Grep to search for error handling patterns]

349[Explore uses Read to examine promising files]

350[Returns findings with absolute file paths]

351Claude: Client errors are handled in src/services/process.ts:712...

352```504```

505Use the code-reviewer subagent to review the authentication module

506[Agent completes]

353 507 

508Continue that code review and now analyze the authorization logic

509[Claude resumes the subagent with full context from previous conversation]

354```510```

355User: What's the codebase structure?

356 511 

357Claude: [Invokes Explore subagent with "quick" thoroughness]512You can also ask Claude for the agent ID if you want to reference it explicitly, or find IDs in the transcript files at `~/.claude/projects/{project}/{sessionId}/subagents/`. Each transcript is stored as `agent-{agentId}.jsonl`.

358[Explore uses Glob and ls to map directory structure]513 

359[Returns overview of key directories and their purposes]514Subagent transcripts persist independently of the main conversation:

515 

516* **Main conversation compaction**: When the main conversation compacts, subagent transcripts are unaffected. They're stored in separate files.

517* **Session persistence**: Subagent transcripts persist within their session. You can [resume a subagent](#resume-subagents) after restarting Claude Code by resuming the same session.

518* **Automatic cleanup**: Transcripts are cleaned up based on the `cleanupPeriodDays` setting (default: 30 days).

519 

520#### Auto-compaction

521 

522Subagents support automatic compaction using the same logic as the main conversation. By default, auto-compaction triggers at approximately 95% capacity. To trigger compaction earlier, set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to a lower percentage (for example, `50`). See [environment variables](/en/settings#environment-variables) for details.

523 

524Compaction events are logged in subagent transcript files:

525 

526```json theme={null}

527{

528 "type": "system",

529 "subtype": "compact_boundary",

530 "compactMetadata": {

531 "trigger": "auto",

532 "preTokens": 167189

533 }

534}

360```535```

361 536 

537The `preTokens` value shows how many tokens were used before compaction occurred.

538 

362## Example subagents539## Example subagents

363 540 

541These examples demonstrate effective patterns for building subagents. Use them as starting points, or generate a customized version with Claude.

542 

543<Tip>

544 **Best practices:**

545 

546 * **Design focused subagents:** each subagent should excel at one specific task

547 * **Write detailed descriptions:** Claude uses the description to decide when to delegate

548 * **Limit tool access:** grant only necessary permissions for security and focus

549 * **Check into version control:** share project subagents with your team

550</Tip>

551 

364### Code reviewer552### Code reviewer

365 553 

554A read-only subagent that reviews code without modifying it. This example shows how to design a focused subagent with limited tool access (no Edit or Write) and a detailed prompt that specifies exactly what to look for and how to format output.

555 

366```markdown theme={null}556```markdown theme={null}

367---557---

368name: code-reviewer558name: code-reviewer


399 588 

400### Debugger589### Debugger

401 590 

591A subagent that can both analyze and fix issues. Unlike the code reviewer, this one includes Edit because fixing bugs requires modifying code. The prompt provides a clear workflow from diagnosis to verification.

592 

402```markdown theme={null}593```markdown theme={null}

403---594---

404name: debugger595name: debugger


434 625 

435### Data scientist626### Data scientist

436 627 

628A domain-specific subagent for data analysis work. This example shows how to create subagents for specialized workflows outside of typical coding tasks. It explicitly sets `model: sonnet` for more capable analysis.

629 

437```markdown theme={null}630```markdown theme={null}

438---631---

439name: data-scientist632name: data-scientist


467Always ensure queries are efficient and cost-effective.660Always ensure queries are efficient and cost-effective.

468```661```

469 662 

470## Best practices663### Database query validator

471 

472* **Start with Claude-generated agents**: We highly recommend generating your initial subagent with Claude and then iterating on it to make it personally yours. This approach gives you the best results - a solid foundation that you can customize to your specific needs.

473 664 

474* **Design focused subagents**: Create subagents with single, clear responsibilities rather than trying to make one subagent do everything. This improves performance and makes subagents more predictable.665A subagent that allows Bash access but validates commands to permit only read-only SQL queries. This example shows how to use `PreToolUse` hooks for conditional validation when you need finer control than the `tools` field provides.

475 666 

476* **Write detailed prompts**: Include specific instructions, examples, and constraints in your system prompts. The more guidance you provide, the better the subagent will perform.667```markdown theme={null}

477 668---

478* **Limit tool access**: Only grant tools that are necessary for the subagent's purpose. This improves security and helps the subagent focus on relevant actions.669name: db-reader

479 670description: Execute read-only database queries. Use when analyzing data or generating reports.

480* **Version control**: Check project subagents into version control so your team can benefit from and improve them collaboratively.671tools: Bash

481 672hooks:

482## Advanced usage673 PreToolUse:

674 - matcher: "Bash"

675 hooks:

676 - type: command

677 command: "./scripts/validate-readonly-query.sh"

678---

483 679 

484### Chaining subagents680You are a database analyst with read-only access. Execute SELECT queries to answer questions about the data.

485 681 

486For complex workflows, you can chain multiple subagents:682When asked to analyze data:

6831. Identify which tables contain the relevant data

6842. Write efficient SELECT queries with appropriate filters

6853. Present results clearly with context

487 686 

687You cannot modify data. If asked to INSERT, UPDATE, DELETE, or modify schema, explain that you only have read access.

488```688```

489> First use the code-analyzer subagent to find performance issues, then use the optimizer subagent to fix them

490```

491 

492### Dynamic subagent selection

493 

494Claude Code intelligently selects subagents based on context. Make your `description` fields specific and action-oriented for best results.

495 689 

496### Resumable subagents690Claude Code [passes hook input as JSON](/en/hooks#pretooluse-input) via stdin to hook commands. The validation script reads this JSON, extracts the command being executed, and checks it against a list of SQL write operations. If a write operation is detected, the script [exits with code 2](/en/hooks#exit-code-2-behavior) to block execution and returns an error message to Claude via stderr.

497 691 

498Subagents can be resumed to continue previous conversations, which is particularly useful for long-running research or analysis tasks that need to be continued across multiple invocations.692Create the validation script anywhere in your project. The path must match the `command` field in your hook configuration:

499 693 

500**How it works:**694```bash theme={null}

501 695#!/bin/bash

502* Each subagent execution is assigned a unique `agentId`696# Blocks SQL write operations, allows SELECT queries

503* The agent's conversation is stored in a separate transcript file: `agent-{agentId}.jsonl`

504* You can resume a previous agent by providing its `agentId` via the `resume` parameter

505* When resumed, the agent continues with full context from its previous conversation

506 697 

507**Example workflow:**698# Read JSON input from stdin

699INPUT=$(cat)

508 700 

509Initial invocation:701# Extract the command field from tool_input using jq

702COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')

510 703 

511```704if [ -z "$COMMAND" ]; then

512> Use the code-analyzer agent to start reviewing the authentication module705 exit 0

513 706fi

514[Agent completes initial analysis and returns agentId: "abc123"]

515```

516 707 

517Resume the agent:708# Block write operations (case-insensitive)

709if echo "$COMMAND" | grep -iE '\b(INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|TRUNCATE|REPLACE|MERGE)\b' > /dev/null; then

710 echo "Blocked: Write operations not allowed. Use SELECT queries only." >&2

711 exit 2

712fi

518 713 

714exit 0

519```715```

520> Resume agent abc123 and now analyze the authorization logic as well

521 

522[Agent continues with full context from previous conversation]

523```

524 

525**Use cases:**

526 

527* **Long-running research**: Break down large codebase analysis into multiple sessions

528* **Iterative refinement**: Continue refining a subagent's work without losing context

529* **Multi-step workflows**: Have a subagent work on related tasks sequentially while maintaining context

530 716 

531**Technical details:**717Make the script executable:

532 718 

533* Agent transcripts are stored in your project directory719```bash theme={null}

534* Recording is disabled during resume to avoid duplicating messages720chmod +x ./scripts/validate-readonly-query.sh

535* Both synchronous and asynchronous agents can be resumed

536* The `resume` parameter accepts the agent ID from a previous execution

537 

538**Programmatic usage:**

539 

540If you're using the Agent SDK or interacting with the AgentTool directly, you can pass the `resume` parameter:

541 

542```typescript theme={null}

543{

544 "description": "Continue analysis",

545 "prompt": "Now examine the error handling patterns",

546 "subagent_type": "code-analyzer",

547 "resume": "abc123" // Agent ID from previous execution

548}

549```721```

550 722 

551<Tip>723The hook receives JSON via stdin with the Bash command in `tool_input.command`. Exit code 2 blocks the operation and feeds the error message back to Claude. See [Hooks](/en/hooks#simple-exit-code) for details on exit codes and [Hook input](/en/hooks#pretooluse-input) for the complete input schema.

552 Keep track of agent IDs for tasks you may want to resume later. Claude Code displays the agent ID when a subagent completes its work.

553</Tip>

554 

555## Performance considerations

556 724 

557* **Context efficiency**: Agents help preserve main context, enabling longer overall sessions725## Next steps

558* **Latency**: Subagents start off with a clean slate each time they are invoked and may add latency as they gather context that they require to do their job effectively.

559 726 

560## Related documentation727Now that you understand subagents, explore these related features:

561 728 

562* [Plugins](/en/plugins) - Extend Claude Code with custom agents through plugins729* [Distribute subagents with plugins](/en/plugins) to share subagents across teams or projects

563* [Slash commands](/en/slash-commands) - Learn about other built-in commands730* [Run Claude Code programmatically](/en/headless) with the Agent SDK for CI/CD and automation

564* [Settings](/en/settings) - Configure Claude Code behavior731* [Use MCP servers](/en/mcp) to give subagents access to external tools and data

565* [Hooks](/en/hooks) - Automate workflows with event handlers

566 732 

567 733 

568---734---

Details

13You have several options for entering line breaks into Claude Code:13You have several options for entering line breaks into Claude Code:

14 14 

15* **Quick escape**: Type `\` followed by Enter to create a newline15* **Quick escape**: Type `\` followed by Enter to create a newline

16* **Keyboard shortcut**: Set up a keybinding to insert a newline16* **Shift+Enter**: Works out of the box in iTerm2, WezTerm, Ghostty, and Kitty

17* **Keyboard shortcut**: Set up a keybinding to insert a newline in other terminals

17 18 

18#### Set up Shift+Enter (VS Code or iTerm2):19**Set up Shift+Enter for other terminals**

19 20 

20Run `/terminal-setup` within Claude Code to automatically configure Shift+Enter.21Run `/terminal-setup` within Claude Code to automatically configure Shift+Enter for VS Code, Alacritty, Zed, and Warp.

21 22 

22#### Set up Option+Enter (VS Code, iTerm2 or macOS Terminal.app):23<Note>

24 The `/terminal-setup` command is only visible in terminals that require manual configuration. If you're using iTerm2, WezTerm, Ghostty, or Kitty, you won't see this command because Shift+Enter already works natively.

25</Note>

26 

27**Set up Option+Enter (VS Code, iTerm2 or macOS Terminal.app)**

23 28 

24**For Mac Terminal.app:**29**For Mac Terminal.app:**

25 30 


65The supported subset includes:70The supported subset includes:

66 71 

67* Mode switching: `Esc` (to NORMAL), `i`/`I`, `a`/`A`, `o`/`O` (to INSERT)72* Mode switching: `Esc` (to NORMAL), `i`/`I`, `a`/`A`, `o`/`O` (to INSERT)

68* Navigation: `h`/`j`/`k`/`l`, `w`/`e`/`b`, `0`/`$`/`^`, `gg`/`G`73* Navigation: `h`/`j`/`k`/`l`, `w`/`e`/`b`, `0`/`$`/`^`, `gg`/`G`, `f`/`F`/`t`/`T` with `;`/`,` repeat

69* Editing: `x`, `dw`/`de`/`db`/`dd`/`D`, `cw`/`ce`/`cb`/`cc`/`C`, `.` (repeat)74* Editing: `x`, `dw`/`de`/`db`/`dd`/`D`, `cw`/`ce`/`cb`/`cc`/`C`, `.` (repeat)

75* Yank/paste: `yy`/`Y`, `yw`/`ye`/`yb`, `p`/`P`

76* Text objects: `iw`/`aw`, `iW`/`aW`, `i"`/`a"`, `i'`/`a'`, `i(`/`a(`, `i[`/`a[`, `i{`/`a{`

77* Indentation: `>>`/`<<`

78* Line operations: `J` (join lines)

79 

80See [Interactive mode](/en/interactive-mode#vim-editor-mode) for the complete reference.

70 81 

71 82 

72---83---

Details

2 2 

3> Learn how Claude Code can integrate with various third-party services and infrastructure to meet enterprise deployment requirements.3> Learn how Claude Code can integrate with various third-party services and infrastructure to meet enterprise deployment requirements.

4 4 

5This page provides an overview of available deployment options and helps you choose the right configuration for your organization.5Organizations can deploy Claude Code through Anthropic directly or through a cloud provider. This page helps you choose the right configuration.

6 6 

7## Provider comparison7## Compare deployment options

8 

9For most organizations, Claude for Teams or Claude for Enterprise provides the best experience. Team members get access to both Claude Code and Claude on the web with a single subscription, centralized billing, and no infrastructure setup required.

10 

11**Claude for Teams** is self-service and includes collaboration features, admin tools, and billing management. Best for smaller teams that need to get started quickly.

12 

13**Claude for Enterprise** adds SSO and domain capture, role-based permissions, compliance API access, and managed policy settings for deploying organization-wide Claude Code configurations. Best for larger organizations with security and compliance requirements.

14 

15Learn more about [Team plans](https://support.claude.com/en/articles/9266767-what-is-the-team-plan) and [Enterprise plans](https://support.claude.com/en/articles/9797531-what-is-the-enterprise-plan).

16 

17If your organization has specific infrastructure requirements, compare the options below:

8 18 

9<table>19<table>

10 <thead>20 <thead>

11 <tr>21 <tr>

12 <th>Feature</th>22 <th>Feature</th>

13 <th>Anthropic</th>23 <th>Claude for Teams/Enterprise</th>

24 <th>Anthropic Console</th>

14 <th>Amazon Bedrock</th>25 <th>Amazon Bedrock</th>

15 <th>Google Vertex AI</th>26 <th>Google Vertex AI</th>

16 <th>Microsoft Foundry</th>27 <th>Microsoft Foundry</th>


18 </thead>29 </thead>

19 30 

20 <tbody>31 <tbody>

32 <tr>

33 <td>Best for</td>

34 <td>Most organizations (recommended)</td>

35 <td>Individual developers</td>

36 <td>AWS-native deployments</td>

37 <td>GCP-native deployments</td>

38 <td>Azure-native deployments</td>

39 </tr>

40 

41 <tr>

42 <td>Billing</td>

43 <td><strong>Teams:</strong> \$150/seat (Premium) with PAYG available<br /><strong>Enterprise:</strong> <a href="https://claude.com/contact-sales">Contact Sales</a></td>

44 <td>PAYG</td>

45 <td>PAYG through AWS</td>

46 <td>PAYG through GCP</td>

47 <td>PAYG through Azure</td>

48 </tr>

49 

21 <tr>50 <tr>

22 <td>Regions</td>51 <td>Regions</td>

23 <td>Supported [countries](https://www.anthropic.com/supported-countries)</td>52 <td>Supported [countries](https://www.anthropic.com/supported-countries)</td>

53 <td>Supported [countries](https://www.anthropic.com/supported-countries)</td>

24 <td>Multiple AWS [regions](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html)</td>54 <td>Multiple AWS [regions](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html)</td>

25 <td>Multiple GCP [regions](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations)</td>55 <td>Multiple GCP [regions](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations)</td>

26 <td>Multiple Azure [regions](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/)</td>56 <td>Multiple Azure [regions](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/)</td>


32 <td>Enabled by default</td>62 <td>Enabled by default</td>

33 <td>Enabled by default</td>63 <td>Enabled by default</td>

34 <td>Enabled by default</td>64 <td>Enabled by default</td>

65 <td>Enabled by default</td>

35 </tr>66 </tr>

36 67 

37 <tr>68 <tr>

38 <td>Authentication</td>69 <td>Authentication</td>

70 <td>Claude.ai SSO or email</td>

39 <td>API key</td>71 <td>API key</td>

40 <td>API key or AWS credentials</td>72 <td>API key or AWS credentials</td>

41 <td>GCP credentials</td>73 <td>GCP credentials</td>


44 76 

45 <tr>77 <tr>

46 <td>Cost tracking</td>78 <td>Cost tracking</td>

47 <td>Dashboard</td>79 <td>Usage dashboard</td>

80 <td>Usage dashboard</td>

48 <td>AWS Cost Explorer</td>81 <td>AWS Cost Explorer</td>

49 <td>GCP Billing</td>82 <td>GCP Billing</td>

50 <td>Azure Cost Management</td>83 <td>Azure Cost Management</td>

51 </tr>84 </tr>

52 85 

86 <tr>

87 <td>Includes Claude on web</td>

88 <td>Yes</td>

89 <td>No</td>

90 <td>No</td>

91 <td>No</td>

92 <td>No</td>

93 </tr>

94 

53 <tr>95 <tr>

54 <td>Enterprise features</td>96 <td>Enterprise features</td>

55 <td>Teams, usage monitoring</td>97 <td>Team management, SSO, usage monitoring</td>

98 <td>None</td>

56 <td>IAM policies, CloudTrail</td>99 <td>IAM policies, CloudTrail</td>

57 <td>IAM roles, Cloud Audit Logs</td>100 <td>IAM roles, Cloud Audit Logs</td>

58 <td>RBAC policies, Azure Monitor</td>101 <td>RBAC policies, Azure Monitor</td>


60 </tbody>103 </tbody>

61</table>104</table>

62 105 

63## Cloud providers106Select a deployment option to view setup instructions:

64 

65<CardGroup cols={3}>

66 <Card title="Amazon Bedrock" icon="aws" href="/en/amazon-bedrock">

67 Use Claude models through AWS infrastructure with API key or IAM-based authentication and AWS-native monitoring

68 </Card>

69 

70 <Card title="Google Vertex AI" icon="google" href="/en/google-vertex-ai">

71 Access Claude models via Google Cloud Platform with enterprise-grade security and compliance

72 </Card>

73 

74 <Card title="Microsoft Foundry" icon="microsoft" href="/en/microsoft-foundry">

75 Access Claude through Azure with API key or Microsoft Entra ID authentication and Azure billing

76 </Card>

77</CardGroup>

78 

79## Corporate infrastructure

80 

81<CardGroup cols={2}>

82 <Card title="Enterprise Network" icon="shield" href="/en/network-config">

83 Configure Claude Code to work with your organization's proxy servers and SSL/TLS requirements

84 </Card>

85 107 

86 <Card title="LLM Gateway" icon="server" href="/en/llm-gateway">108* [Claude for Teams or Enterprise](/en/iam#claude-for-teams-or-enterprise-recommended)

87 Deploy centralized model access with usage tracking, budgeting, and audit logging109* [Anthropic Console](/en/iam#claude-console-authentication)

88 </Card>110* [Amazon Bedrock](/en/amazon-bedrock)

89</CardGroup>111* [Google Vertex AI](/en/google-vertex-ai)

112* [Microsoft Foundry](/en/microsoft-foundry)

90 113 

91## Configuration overview114## Configure proxies and gateways

92 115 

93Claude Code supports flexible configuration options that allow you to combine different providers and infrastructure:116Most organizations can use a cloud provider directly without additional configuration. However, you may need to configure a corporate proxy or LLM gateway if your organization has specific network or management requirements. These are different configurations that can be used together:

94 117 

95<Note>118* **Corporate proxy**: Routes traffic through an HTTP/HTTPS proxy. Use this if your organization requires all outbound traffic to pass through a proxy server for security monitoring, compliance, or network policy enforcement. Configure with the `HTTPS_PROXY` or `HTTP_PROXY` environment variables. Learn more in [Enterprise network configuration](/en/network-config).

96 Understand the difference between:119* **LLM Gateway**: A service that sits between Claude Code and the cloud provider to handle authentication and routing. Use this if you need centralized usage tracking across teams, custom rate limiting or budgets, or centralized authentication management. Configure with the `ANTHROPIC_BASE_URL`, `ANTHROPIC_BEDROCK_BASE_URL`, or `ANTHROPIC_VERTEX_BASE_URL` environment variables. Learn more in [LLM gateway configuration](/en/llm-gateway).

97 120 

98 * **Corporate proxy**: An HTTP/HTTPS proxy for routing traffic (set via `HTTPS_PROXY` or `HTTP_PROXY`)121The following examples show the environment variables to set in your shell or shell profile (`.bashrc`, `.zshrc`). See [Settings](/en/settings) for other configuration methods.

99 * **LLM Gateway**: A service that handles authentication and provides provider-compatible endpoints (set via `ANTHROPIC_BASE_URL`, `ANTHROPIC_BEDROCK_BASE_URL`, or `ANTHROPIC_VERTEX_BASE_URL`)

100 122 

101 Both configurations can be used in tandem.123### Amazon Bedrock

102</Note>

103 124 

104### Using Bedrock with corporate proxy125<Tabs>

126 <Tab title="Corporate proxy">

127 Route Bedrock traffic through your corporate proxy by setting the following [environment variables](/en/settings#environment-variables):

105 128 

106Route Bedrock traffic through a corporate HTTP/HTTPS proxy:129 ```bash theme={null}

130 # Enable Bedrock

131 export CLAUDE_CODE_USE_BEDROCK=1

132 export AWS_REGION=us-east-1

107 133 

108```bash theme={null}134 # Configure corporate proxy

109# Enable Bedrock135 export HTTPS_PROXY='https://proxy.example.com:8080'

110export CLAUDE_CODE_USE_BEDROCK=1136 ```

111export AWS_REGION=us-east-1137 </Tab>

112 138 

113# Configure corporate proxy139 <Tab title="LLM Gateway">

114export HTTPS_PROXY='https://proxy.example.com:8080'140 Route Bedrock traffic through your LLM gateway by setting the following [environment variables](/en/settings#environment-variables):

115```

116 141 

117### Using Bedrock with LLM Gateway142 ```bash theme={null}

143 # Enable Bedrock

144 export CLAUDE_CODE_USE_BEDROCK=1

118 145 

119Use a gateway service that provides Bedrock-compatible endpoints:146 # Configure LLM gateway

147 export ANTHROPIC_BEDROCK_BASE_URL='https://your-llm-gateway.com/bedrock'

148 export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1 # If gateway handles AWS auth

149 ```

150 </Tab>

151</Tabs>

120 152 

121```bash theme={null}153### Microsoft Foundry

122# Enable Bedrock

123export CLAUDE_CODE_USE_BEDROCK=1

124 154 

125# Configure LLM gateway155<Tabs>

126export ANTHROPIC_BEDROCK_BASE_URL='https://your-llm-gateway.com/bedrock'156 <Tab title="Corporate proxy">

127export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1 # If gateway handles AWS auth157 Route Foundry traffic through your corporate proxy by setting the following [environment variables](/en/settings#environment-variables):

128```

129 158 

130### Using Foundry with corporate proxy159 ```bash theme={null}

160 # Enable Microsoft Foundry

161 export CLAUDE_CODE_USE_FOUNDRY=1

162 export ANTHROPIC_FOUNDRY_RESOURCE=your-resource

163 export ANTHROPIC_FOUNDRY_API_KEY=your-api-key # Or omit for Entra ID auth

131 164 

132Route Azure traffic through a corporate HTTP/HTTPS proxy:165 # Configure corporate proxy

166 export HTTPS_PROXY='https://proxy.example.com:8080'

167 ```

168 </Tab>

133 169 

134```bash theme={null}170 <Tab title="LLM Gateway">

135# Enable Microsoft Foundry171 Route Foundry traffic through your LLM gateway by setting the following [environment variables](/en/settings#environment-variables):

136export CLAUDE_CODE_USE_FOUNDRY=1

137export ANTHROPIC_FOUNDRY_RESOURCE=your-resource

138export ANTHROPIC_FOUNDRY_API_KEY=your-api-key # Or omit for Entra ID auth

139 172 

140# Configure corporate proxy173 ```bash theme={null}

141export HTTPS_PROXY='https://proxy.example.com:8080'174 # Enable Microsoft Foundry

142```175 export CLAUDE_CODE_USE_FOUNDRY=1

143 176 

144### Using Foundry with LLM Gateway177 # Configure LLM gateway

178 export ANTHROPIC_FOUNDRY_BASE_URL='https://your-llm-gateway.com'

179 export CLAUDE_CODE_SKIP_FOUNDRY_AUTH=1 # If gateway handles Azure auth

180 ```

181 </Tab>

182</Tabs>

145 183 

146Use a gateway service that provides Azure-compatible endpoints:184### Google Vertex AI

147 185 

148```bash theme={null}186<Tabs>

149# Enable Microsoft Foundry187 <Tab title="Corporate proxy">

150export CLAUDE_CODE_USE_FOUNDRY=1188 Route Vertex AI traffic through your corporate proxy by setting the following [environment variables](/en/settings#environment-variables):

151 189 

152# Configure LLM gateway190 ```bash theme={null}

153export ANTHROPIC_FOUNDRY_BASE_URL='https://your-llm-gateway.com'191 # Enable Vertex

154export CLAUDE_CODE_SKIP_FOUNDRY_AUTH=1 # If gateway handles Azure auth192 export CLAUDE_CODE_USE_VERTEX=1

155```193 export CLOUD_ML_REGION=us-east5

194 export ANTHROPIC_VERTEX_PROJECT_ID=your-project-id

156 195 

157### Using Vertex AI with corporate proxy196 # Configure corporate proxy

197 export HTTPS_PROXY='https://proxy.example.com:8080'

198 ```

199 </Tab>

158 200 

159Route Vertex AI traffic through a corporate HTTP/HTTPS proxy:201 <Tab title="LLM Gateway">

202 Route Vertex AI traffic through your LLM gateway by setting the following [environment variables](/en/settings#environment-variables):

160 203 

161```bash theme={null}204 ```bash theme={null}

162# Enable Vertex205 # Enable Vertex

163export CLAUDE_CODE_USE_VERTEX=1206 export CLAUDE_CODE_USE_VERTEX=1

164export CLOUD_ML_REGION=us-east5

165export ANTHROPIC_VERTEX_PROJECT_ID=your-project-id

166 207 

167# Configure corporate proxy208 # Configure LLM gateway

168export HTTPS_PROXY='https://proxy.example.com:8080'209 export ANTHROPIC_VERTEX_BASE_URL='https://your-llm-gateway.com/vertex'

169```210 export CLAUDE_CODE_SKIP_VERTEX_AUTH=1 # If gateway handles GCP auth

211 ```

212 </Tab>

213</Tabs>

170 214 

171### Using Vertex AI with LLM Gateway215<Tip>

172 216 Use `/status` in Claude Code to verify your proxy and gateway configuration is applied correctly.

173Combine Google Vertex AI models with an LLM gateway for centralized management:217</Tip>

174 

175```bash theme={null}

176# Enable Vertex

177export CLAUDE_CODE_USE_VERTEX=1

178 

179# Configure LLM gateway

180export ANTHROPIC_VERTEX_BASE_URL='https://your-llm-gateway.com/vertex'

181export CLAUDE_CODE_SKIP_VERTEX_AUTH=1 # If gateway handles GCP auth

182```

183 

184### Authentication configuration

185 

186Claude Code uses the `ANTHROPIC_AUTH_TOKEN` for the `Authorization` header when needed. The `SKIP_AUTH` flags (`CLAUDE_CODE_SKIP_BEDROCK_AUTH`, `CLAUDE_CODE_SKIP_VERTEX_AUTH`) are used in LLM gateway scenarios where the gateway handles provider authentication.

187 

188## Choosing the right deployment configuration

189 

190Consider these factors when selecting your deployment approach:

191 

192### Direct provider access

193 

194Best for organizations that:

195 

196* Want the simplest setup

197* Have existing AWS or GCP infrastructure

198* Need provider-native monitoring and compliance

199 

200### Corporate proxy

201 

202Best for organizations that:

203 

204* Have existing corporate proxy requirements

205* Need traffic monitoring and compliance

206* Must route all traffic through specific network paths

207 

208### LLM Gateway

209 

210Best for organizations that:

211 

212* Need usage tracking across teams

213* Want to dynamically switch between models

214* Require custom rate limiting or budgets

215* Need centralized authentication management

216 

217## Debugging

218 

219When debugging your deployment:

220 

221* Use the `claude /status` [slash command](/en/slash-commands). This command provides observability into any applied authentication, proxy, and URL settings.

222* Set environment variable `export ANTHROPIC_LOG=debug` to log requests.

223 218 

224## Best practices for organizations219## Best practices for organizations

225 220 

226### 1. Invest in documentation and memory221### Invest in documentation and memory

227 222 

228We strongly recommend investing in documentation so that Claude Code understands your codebase. Organizations can deploy CLAUDE.md files at multiple levels:223We strongly recommend investing in documentation so that Claude Code understands your codebase. Organizations can deploy CLAUDE.md files at multiple levels:

229 224 

230* **Organization-wide**: Deploy to system directories like `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS) for company-wide standards225* **Organization-wide**: Deploy to system directories like `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS) for company-wide standards

231* **Repository-level**: Create `CLAUDE.md` files in repository roots containing project architecture, build commands, and contribution guidelines. Check these into source control so all users benefit226* **Repository-level**: Create `CLAUDE.md` files in repository roots containing project architecture, build commands, and contribution guidelines. Check these into source control so all users benefit

232 227 

233 [Learn more](/en/memory).228Learn more in [Memory and CLAUDE.md files](/en/memory).

234 229 

235### 2. Simplify deployment230### Simplify deployment

236 231 

237If you have a custom development environment, we find that creating a "one click" way to install Claude Code is key to growing adoption across an organization.232If you have a custom development environment, we find that creating a "one click" way to install Claude Code is key to growing adoption across an organization.

238 233 

239### 3. Start with guided usage234### Start with guided usage

240 235 

241Encourage new users to try Claude Code for codebase Q\&A, or on smaller bug fixes or feature requests. Ask Claude Code to make a plan. Check Claude's suggestions and give feedback if it's off-track. Over time, as users understand this new paradigm better, then they'll be more effective at letting Claude Code run more agentically.236Encourage new users to try Claude Code for codebase Q\&A, or on smaller bug fixes or feature requests. Ask Claude Code to make a plan. Check Claude's suggestions and give feedback if it's off-track. Over time, as users understand this new paradigm better, then they'll be more effective at letting Claude Code run more agentically.

242 237 

243### 4. Configure security policies238### Configure security policies

244 239 

245Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. [Learn more](/en/security).240Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. [Learn more](/en/security).

246 241 

247### 5. Leverage MCP for integrations242### Leverage MCP for integrations

248 243 

249MCP is a great way to give Claude Code more information, such as connecting to ticket management systems or error logs. We recommend that one central team configures MCP servers and checks a `.mcp.json` configuration into the codebase so that all users benefit. [Learn more](/en/mcp).244MCP is a great way to give Claude Code more information, such as connecting to ticket management systems or error logs. We recommend that one central team configures MCP servers and checks a `.mcp.json` configuration into the codebase so that all users benefit. [Learn more](/en/mcp).

250 245 


252 247 

253## Next steps248## Next steps

254 249 

255* [Set up Amazon Bedrock](/en/amazon-bedrock) for AWS-native deployment250Once you've chosen a deployment option and configured access for your team:

256* [Configure Google Vertex AI](/en/google-vertex-ai) for GCP deployment251 

257* [Set up Microsoft Foundry](/en/microsoft-foundry) for Azure deployment2521. **Roll out to your team**: Share installation instructions and have team members [install Claude Code](/en/setup) and authenticate with their credentials.

258* [Configure Enterprise Network](/en/network-config) for network requirements2532. **Set up shared configuration**: Create a [CLAUDE.md file](/en/memory) in your repositories to help Claude Code understand your codebase and coding standards.

259* [Deploy LLM Gateway](/en/llm-gateway) for enterprise management2543. **Configure permissions**: Review [security settings](/en/security) to define what Claude Code can and cannot do in your environment.

260* [Settings](/en/settings) for configuration options and environment variables

261 255 

262 256 

263---257---

Details

1532. Close Claude Code1532. Close Claude Code

1543. Restart with `claude` and complete the authentication process again1543. Restart with `claude` and complete the authentication process again

155 155 

156If the browser doesn't open automatically during login, press `c` to copy the OAuth URL to your clipboard, then paste it into your browser manually.

157 

156If problems persist, try:158If problems persist, try:

157 159 

158```bash theme={null}160```bash theme={null}


167Claude Code stores configuration in several locations:169Claude Code stores configuration in several locations:

168 170 

169| File | Purpose |171| File | Purpose |

170| :---------------------------- | :--------------------------------------------------------------------- |172| :---------------------------- | :------------------------------------------------------- |

171| `~/.claude/settings.json` | User settings (permissions, hooks, model overrides) |173| `~/.claude/settings.json` | User settings (permissions, hooks, model overrides) |

172| `.claude/settings.json` | Project settings (checked into source control) |174| `.claude/settings.json` | Project settings (checked into source control) |

173| `.claude/settings.local.json` | Local project settings (not committed) |175| `.claude/settings.local.json` | Local project settings (not committed) |

174| `~/.claude.json` | Global state (theme, OAuth, MCP servers, allowed tools) |176| `~/.claude.json` | Global state (theme, OAuth, MCP servers, allowed tools) |

175| `.mcp.json` | Project MCP servers (checked into source control) |177| `.mcp.json` | Project MCP servers (checked into source control) |

176| `managed-settings.json` | [Enterprise managed settings](/en/settings#settings-files) |178| `managed-settings.json` | [Managed settings](/en/settings#settings-files) |

177| `managed-mcp.json` | [Enterprise managed MCP servers](/en/mcp#enterprise-mcp-configuration) |179| `managed-mcp.json` | [Managed MCP servers](/en/mcp#managed-mcp-configuration) |

178 180 

179On Windows, `~` refers to your user home directory, such as `C:\Users\YourName`.181On Windows, `~` refers to your user home directory, such as `C:\Users\YourName`.

180 182 

181**Enterprise managed file locations:**183**Managed file locations:**

182 184 

183* macOS: `/Library/Application Support/ClaudeCode/`185* macOS: `/Library/Application Support/ClaudeCode/`

184* Linux/WSL: `/etc/claude-code/`186* Linux/WSL: `/etc/claude-code/`


223 225 

224### Search and discovery issues226### Search and discovery issues

225 227 

226If Search tool, `@file` mentions, custom agents, and custom slash commands aren't working, install system `ripgrep`:228If Search tool, `@file` mentions, custom agents, and custom skills aren't working, install system `ripgrep`:

227 229 

228```bash theme={null}230```bash theme={null}

229# macOS (Homebrew) 231# macOS (Homebrew)


387 389 

3881. Use the `/bug` command within Claude Code to report problems directly to Anthropic3901. Use the `/bug` command within Claude Code to report problems directly to Anthropic

3892. Check the [GitHub repository](https://github.com/anthropics/claude-code) for known issues3912. Check the [GitHub repository](https://github.com/anthropics/claude-code) for known issues

3903. Run `/doctor` to check the health of your Claude Code installation3923. Run `/doctor` to diagnose issues. It checks:

393 * Installation type, version, and search functionality

394 * Auto-update status and available versions

395 * Invalid settings files (malformed JSON, incorrect types)

396 * MCP server configuration errors

397 * Keybinding configuration problems

398 * Context usage warnings (large CLAUDE.md files, high MCP token usage, unreachable permission rules)

399 * Plugin and agent loading errors

3914. Ask Claude directly about its capabilities and features - Claude has built-in access to its documentation4004. Ask Claude directly about its capabilities and features - Claude has built-in access to its documentation

392 401 

393 402 

vs-code.md +166 −79

Details

13* VS Code 1.98.0 or higher13* VS Code 1.98.0 or higher

14* An Anthropic account (you'll sign in when you first open the extension). If you're using a third-party provider like Amazon Bedrock or Google Vertex AI, see [Use third-party providers](#use-third-party-providers) instead.14* An Anthropic account (you'll sign in when you first open the extension). If you're using a third-party provider like Amazon Bedrock or Google Vertex AI, see [Use third-party providers](#use-third-party-providers) instead.

15 15 

16You don't need to install the Claude Code CLI first. However, some features like MCP server configuration require the CLI. See [VS Code extension vs. Claude Code CLI](#vs-code-extension-vs-claude-code-cli) for details.16<Tip>

17 The extension includes the CLI (command-line interface), which you can access from VS Code's integrated terminal for advanced features. See [VS Code extension vs. Claude Code CLI](#vs-code-extension-vs-claude-code-cli) for details.

18</Tip>

17 19 

18## Install the extension20## Install the extension

19 21 


24 26 

25Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for "Claude Code", and click **Install**.27Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for "Claude Code", and click **Install**.

26 28 

27<Note>You may need to restart VS Code or run "Developer: Reload Window" from the Command Palette after installation.</Note>29<Note>If the extension doesn't appear after installation, restart VS Code or run "Developer: Reload Window" from the Command Palette.</Note>

28 30 

29## Get started31## Get started

30 32 


49 <Step title="Send a prompt">51 <Step title="Send a prompt">

50 Ask Claude to help with your code or files, whether that's explaining how something works, debugging an issue, or making changes.52 Ask Claude to help with your code or files, whether that's explaining how something works, debugging an issue, or making changes.

51 53 

52 <Tip>Select text in the editor and press `Alt+K` to insert an @-mention with the file path and line numbers directly into your prompt.</Tip>54 <Tip>Claude automatically sees your selected text. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to also insert an @-mention reference (like `@file.ts#5-10`) into your prompt.</Tip>

53 55 

54 Here's an example of asking about a particular line in a file:56 Here's an example of asking about a particular line in a file:

55 57 


57 </Step>59 </Step>

58 60 

59 <Step title="Review changes">61 <Step title="Review changes">

60 When Claude wants to edit a file, it shows you a diff and asks for permission. You can accept, reject, or tell Claude what to do instead.62 When Claude wants to edit a file, it shows a side-by-side comparison of the original and proposed changes, then asks for permission. You can accept, reject, or tell Claude what to do instead.

61 63 

62 <img src="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=e005f9b41c541c5c7c59c082f7c4841c" alt="VS Code showing a diff of Claude's proposed changes with a permission prompt asking whether to make the edit" data-og-width="3292" width="3292" data-og-height="1876" height="1876" data-path="images/vs-code-edits.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=280&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=cb5d41b81087f79b842a56b5a3304660 280w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=560&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=90bb691960decdc06393c3c21cd62c75 560w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=840&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=9a11bf878ba619e850380904ff4f38e8 840w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=1100&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=6dddbf596b4f69ec6245bdc5eb6dd487 1100w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=1650&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=ef2713b8cbfd2cee97af817d813d64c7 1650w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=2500&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=1f7e1c52919cdfddf295f32a2ec7ae59 2500w" />64 <img src="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=e005f9b41c541c5c7c59c082f7c4841c" alt="VS Code showing a diff of Claude's proposed changes with a permission prompt asking whether to make the edit" data-og-width="3292" width="3292" data-og-height="1876" height="1876" data-path="images/vs-code-edits.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=280&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=cb5d41b81087f79b842a56b5a3304660 280w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=560&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=90bb691960decdc06393c3c21cd62c75 560w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=840&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=9a11bf878ba619e850380904ff4f38e8 840w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=1100&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=6dddbf596b4f69ec6245bdc5eb6dd487 1100w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=1650&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=ef2713b8cbfd2cee97af817d813d64c7 1650w, https://mintcdn.com/claude-code/FVYz38sRY-VuoGHA/images/vs-code-edits.png?w=2500&fit=max&auto=format&n=FVYz38sRY-VuoGHA&q=85&s=1f7e1c52919cdfddf295f32a2ec7ae59 2500w" />

63 </Step>65 </Step>


65 67 

66For more ideas on what you can do with Claude Code, see [Common workflows](/en/common-workflows).68For more ideas on what you can do with Claude Code, see [Common workflows](/en/common-workflows).

67 69 

70<Tip>

71 The extension includes two built-in tutorials:

72 

73 * **VS Code walkthrough**: Run "Claude Code: Open Walkthrough" from the Command Palette for a guided tour of the basics.

74 * **Interactive checklist**: Click the graduation cap icon in the Claude panel header to work through features like writing code, using Plan mode, and setting up rules.

75</Tip>

76 

77## Use the prompt box

78 

79The prompt box supports several features:

80 

81* **Permission modes**: Click the mode indicator at the bottom of the prompt box to switch modes. In normal mode, Claude asks permission before each action. In Plan mode, Claude describes what it will do and waits for approval before making changes. In auto-accept mode, Claude makes edits without asking. Set the default in VS Code settings under `claudeCode.initialPermissionMode`.

82* **Command menu**: Click `/` or type `/` to open the command menu. Options include attaching files, switching models, toggling extended thinking, and viewing account usage. The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal.

83* **Context indicator**: The prompt box shows how much of Claude's context window you're using. Claude automatically compacts when needed, or you can run `/compact` manually.

84* **Extended thinking**: Lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). See [Extended thinking](/en/common-workflows#use-extended-thinking-thinking-mode) for details.

85* **Multi-line input**: Press `Shift+Enter` to add a new line without sending.

86 

87### Reference files and folders

88 

89Use @-mentions to give Claude context about specific files or folders. When you type `@` followed by a file or folder name, Claude reads that content and can answer questions about it or make changes to it. Claude Code supports fuzzy matching, so you can type partial names to find what you need:

90 

91```

92> Explain the logic in @auth (fuzzy matches auth.js, AuthService.ts, etc.)

93> What's in @src/components/ (include a trailing slash for folders)

94```

95 

96When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., `@app.ts#5-10`). Click the selection indicator to toggle whether Claude can see your highlighted text - the eye-slash icon means the selection is hidden from Claude.

97 

98You can also hold `Shift` while dragging files into the prompt box to add them as attachments. Click the X on any attachment to remove it from context.

99 

100### Resume past conversations

101 

102Click the dropdown at the top of the Claude Code panel to access your conversation history. You can search by keyword or browse by time (Today, Yesterday, Last 7 days, etc.). Click any conversation to resume it with the full message history. For more on resuming sessions, see [Common workflows](/en/common-workflows#resume-previous-conversations).

103 

68## Customize your workflow104## Customize your workflow

69 105 

70Once you're up and running, you can reposition the Claude panel or switch to terminal mode.106Once you're up and running, you can reposition the Claude panel, run multiple sessions, or switch to terminal mode.

71 107 

72### Change the layout108### Choose where Claude lives

73 109 

74You can drag the Claude panel to reposition it anywhere in VS Code. Grab the panel's tab or title bar and drag it to:110You can drag the Claude panel to reposition it anywhere in VS Code. Grab the panel's tab or title bar and drag it to:

75 111 

76* **Secondary sidebar** (default): The right side of the window112* **Secondary sidebar**: The right side of the window. Keeps Claude visible while you code.

77* **Primary sidebar**: The left sidebar with icons for Explorer, Search, etc.113* **Primary sidebar**: The left sidebar with icons for Explorer, Search, etc.

78* **Editor area**: Opens Claude as a tab alongside your files114* **Editor area**: Opens Claude as a tab alongside your files. Useful for side tasks.

79 115 

80<Note>116<Tip>

81 The Spark icon only appears in the Activity Bar (left sidebar icons) when the Claude panel is docked to the left. Since Claude defaults to the right side, use the Editor Toolbar icon to open Claude.117 Use the sidebar for your main Claude session and open additional tabs for side tasks. Claude remembers your preferred location. Note that the Spark icon only appears in the Activity Bar when the Claude panel is docked to the left. Since Claude defaults to the right side, use the Editor Toolbar icon to open Claude.

82</Note>118</Tip>

119 

120### Run multiple conversations

121 

122Use **Open in New Tab** or **Open in New Window** from the Command Palette to start additional conversations. Each conversation maintains its own history and context, allowing you to work on different tasks in parallel.

123 

124When using tabs, a small colored dot on the spark icon indicates status: blue means a permission request is pending, orange means Claude finished while the tab was hidden.

83 125 

84### Switch to terminal mode126### Switch to terminal mode

85 127 


89 131 

90## VS Code commands and shortcuts132## VS Code commands and shortcuts

91 133 

92Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type "Claude Code" to see all available VS Code commands for the Claude Code extension:134Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type "Claude Code" to see all available VS Code commands for the Claude Code extension.

135 

136Some shortcuts depend on which panel is "focused" (receiving keyboard input). When your cursor is in a code file, the editor is focused. When your cursor is in Claude's prompt box, Claude is focused. Use `Cmd+Esc` / `Ctrl+Esc` to toggle between them.

93 137 

94<Note>138<Note>

95 These are VS Code commands for controlling the extension. For Claude Code slash commands (like `/help` or `/compact`), not all CLI commands are available in the extension yet. See [VS Code extension vs. Claude Code CLI](#vs-code-extension-vs-claude-code-cli) for details.139 These are VS Code commands for controlling the extension. Not all built-in Claude Code commands are available in the extension. See [VS Code extension vs. Claude Code CLI](#vs-code-extension-vs-claude-code-cli) for details.

96</Note>140</Note>

97 141 

98| Command | Shortcut | Description |142| Command | Shortcut | Description |

99| -------------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------- |143| -------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------ |

100| Focus Input | `Cmd+Esc` (Mac) / `Ctrl+Esc` (Windows/Linux) | Toggle focus between editor and Claude |144| Focus Input | `Cmd+Esc` (Mac) / `Ctrl+Esc` (Windows/Linux) | Toggle focus between editor and Claude |

101| Open in Side Bar | | Open Claude in the left sidebar |145| Open in Side Bar | - | Open Claude in the left sidebar |

102| Open in Terminal | | Open Claude in terminal mode |146| Open in Terminal | - | Open Claude in terminal mode |

103| Open in New Tab | `Cmd+Shift+Esc` (Mac) / `Ctrl+Shift+Esc` (Windows/Linux) | Open a new conversation as an editor tab |147| Open in New Tab | `Cmd+Shift+Esc` (Mac) / `Ctrl+Shift+Esc` (Windows/Linux) | Open a new conversation as an editor tab |

104| Open in New Window | | Open a new conversation in a separate window |148| Open in New Window | - | Open a new conversation in a separate window |

105| New Conversation | `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux) | Start a new conversation (when Claude is focused) |149| New Conversation | `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux) | Start a new conversation (requires Claude to be focused) |

106| Insert @-Mention Reference | `Alt+K` | Insert a reference to the current file (includes line numbers if text is selected) |150| Insert @-Mention Reference | `Option+K` (Mac) / `Alt+K` (Windows/Linux) | Insert a reference to the current file and selection (requires editor to be focused) |

107| Show Logs | | View extension debug logs |151| Show Logs | - | View extension debug logs |

108| Logout | | Sign out of your Anthropic account |152| Logout | - | Sign out of your Anthropic account |

109 

110Use **Open in New Tab** or **Open in New Window** to run multiple conversations simultaneously. Each tab or window maintains its own conversation history and context.

111 153 

112## Configure settings154## Configure settings

113 155 

114The extension has two types of settings:156The extension has two types of settings:

115 157 

116* **Extension settings**: Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to Extensions → Claude Code.158* **Extension settings** in VS Code: Control the extension's behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to Extensions → Claude Code. You can also type `/` and select **General Config** to open settings.

117 159* **Claude Code settings** in `~/.claude/settings.json`: Shared between the extension and CLI. Use for allowed commands, environment variables, hooks, and MCP servers. See [Settings](/en/settings) for details.

118 | Setting | Description |160 

119 | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |161### Extension settings

120 | Selected Model | Default model for new conversations. Change per-session with `/model`. |162 

121 | Use Terminal | Launch Claude in terminal mode instead of graphical panel |163| Setting | Default | Description |

122 | Initial Permission Mode | Controls approval prompts for file edits and commands. Defaults to `default` (ask before each action). |164| --------------------------------- | --------- | ----------------------------------------------------------------------------------------------------- |

123 | Preferred Location | Default location: sidebar (right) or panel (new tab) |165| `selectedModel` | `default` | Model for new conversations. Change per-session with `/model`. |

124 | Autosave | Auto-save files before Claude reads or writes them |166| `useTerminal` | `false` | Launch Claude in terminal mode instead of graphical panel |

125 | Use Ctrl+Enter to Send | Use Ctrl/Cmd+Enter instead of Enter to send prompts |167| `initialPermissionMode` | `default` | Controls approval prompts: `default` (ask each time), `plan`, `acceptEdits`, or `bypassPermissions` |

126 | Enable New Conversation Shortcut | Enable Cmd/Ctrl+N to start a new conversation |168| `preferredLocation` | `panel` | Where Claude opens: `sidebar` (right) or `panel` (new tab) |

127 | Respect Git Ignore | Exclude .gitignore patterns from file searches |169| `autosave` | `true` | Auto-save files before Claude reads or writes them |

128 | Environment Variables | Set environment variables for the Claude process. **Not recommended**—use [Claude Code settings](/en/settings) instead so configuration is shared between extension and CLI. |170| `useCtrlEnterToSend` | `false` | Use Ctrl/Cmd+Enter instead of Enter to send prompts |

129 | Disable Login Prompt | Skip authentication prompts (for third-party provider setups) |171| `enableNewConversationShortcut` | `true` | Enable Cmd/Ctrl+N to start a new conversation |

130 | Allow Dangerously Skip Permissions | Bypass all permission prompts. **Use with extreme caution**—recommended only for isolated sandboxes with no internet access. |172| `hideOnboarding` | `false` | Hide the onboarding checklist (graduation cap icon) |

131 | Claude Process Wrapper | Executable path used to launch the Claude process |173| `respectGitIgnore` | `true` | Exclude .gitignore patterns from file searches |

132 174| `environmentVariables` | `[]` | Set environment variables for the Claude process. Use Claude Code settings instead for shared config. |

133* **Claude Code settings** (`~/.claude/settings.json`): These settings are shared between the VS Code extension and the CLI. Use this file for allowed commands and directories, environment variables, hooks, and MCP servers. See the [settings documentation](/en/settings) for details.175| `disableLoginPrompt` | `false` | Skip authentication prompts (for third-party provider setups) |

176| `allowDangerouslySkipPermissions` | `false` | Bypass all permission prompts. **Use with extreme caution.** |

177| `claudeProcessWrapper` | - | Executable path used to launch the Claude process |

178 

179## VS Code extension vs. Claude Code CLI

180 

181Claude Code is available as both a VS Code extension (graphical panel) and a CLI (command-line interface in the terminal). Some features are only available in the CLI. If you need a CLI-only feature, run `claude` in VS Code's integrated terminal.

182 

183| Feature | CLI | VS Code Extension |

184| ------------------- | --------------------------------------------- | ---------------------------------------- |

185| Commands and skills | [All](/en/interactive-mode#built-in-commands) | Subset (type `/` to see available) |

186| MCP server config | Yes | No (configure via CLI, use in extension) |

187| Checkpoints | Yes | Coming soon |

188| `!` bash shortcut | Yes | No |

189| Tab completion | Yes | No |

190 

191### Run CLI in VS Code

192 

193To use the CLI while staying in VS Code, open the integrated terminal (`` Ctrl+` `` on Windows/Linux or `` Cmd+` `` on Mac) and run `claude`. The CLI automatically integrates with your IDE for features like diff viewing and diagnostic sharing.

194 

195If using an external terminal, run `/ide` inside Claude Code to connect it to VS Code.

196 

197### Switch between extension and CLI

198 

199The extension and CLI share the same conversation history. To continue an extension conversation in the CLI, run `claude --resume` in the terminal. This opens an interactive picker where you can search for and select your conversation.

200 

201### Include terminal output in prompts

202 

203Reference terminal output in your prompts using `@terminal:name` where `name` is the terminal's title. This lets Claude see command output, error messages, or logs without copy-pasting.

204 

205### Monitor background processes

206 

207When Claude runs long-running commands, the extension shows progress in the status bar. However, visibility for background tasks is limited compared to the CLI. For better visibility, have Claude output the command so you can run it in VS Code's integrated terminal.

208 

209### Connect to external tools with MCP

210 

211MCP (Model Context Protocol) servers give Claude access to external tools, databases, and APIs. Configure them via CLI, then use them in both extension and CLI.

212 

213To add an MCP server, open the integrated terminal (`` Ctrl+` `` or `` Cmd+` ``) and run:

214 

215```bash theme={null}

216claude mcp add --transport http github https://api.githubcopilot.com/mcp/

217```

218 

219Once configured, ask Claude to use the tools (e.g., "Review PR #456"). Some servers require authentication: run `claude` in the terminal, then type `/mcp` to authenticate. See the [MCP documentation](/en/mcp) for available servers.

220 

221## Work with git

222 

223Claude Code integrates with git to help with version control workflows directly in VS Code. Ask Claude to commit changes, create pull requests, or work across branches.

224 

225### Create commits and pull requests

226 

227Claude can stage changes, write commit messages, and create pull requests based on your work:

228 

229```

230> commit my changes with a descriptive message

231> create a pr for this feature

232> summarize the changes I've made to the auth module

233```

234 

235When creating pull requests, Claude generates descriptions based on the actual code changes and can add context about testing or implementation decisions.

236 

237### Use git worktrees for parallel tasks

238 

239Git worktrees allow multiple Claude Code sessions to work on separate branches simultaneously, each with isolated files:

240 

241```bash theme={null}

242# Create a worktree for a new feature

243git worktree add ../project-feature-a -b feature-a

244 

245# Run Claude Code in each worktree

246cd ../project-feature-a && claude

247```

248 

249Each worktree maintains independent file state while sharing git history. This prevents Claude instances from interfering with each other when working on different tasks.

250 

251For detailed git workflows including PR reviews and branch management, see [Common workflows](/en/common-workflows#create-pull-requests).

134 252 

135## Use third-party providers253## Use third-party providers

136 254 


154 </Step>272 </Step>

155</Steps>273</Steps>

156 274 

157## VS Code extension vs. Claude Code CLI275## Security and privacy

158 276 

159The extension doesn't yet have full feature parity with the CLI. If you need CLI-only features, you can run `claude` directly in VS Code's integrated terminal.277Your code stays private. Claude Code processes your code to provide assistance but does not use it to train models. For details on data handling and how to opt out of logging, see [Data and privacy](/en/data-usage).

160 278 

161| Feature | CLI | VS Code Extension |279With auto-edit permissions enabled, Claude Code can modify VS Code configuration files (like `settings.json` or `tasks.json`) that VS Code may execute automatically. To reduce risk when working with untrusted code:

162| ----------------- | ------------------------------ | ---------------------------------------- |

163| Slash commands | [Full set](/en/slash-commands) | Subset (type `/` to see available) |

164| MCP server config | Yes | No (configure via CLI, use in extension) |

165| Checkpoints | Yes | Coming soon |

166| `!` bash shortcut | Yes | No |

167| Tab completion | Yes | No |

168 

169### Run CLI in VS Code

170 

171To use the CLI while staying in VS Code, open the integrated terminal (`` Ctrl+` `` on Windows/Linux or `` Cmd+` `` on Mac) and run `claude`. The CLI automatically integrates with your IDE for features like diff viewing and diagnostic sharing.

172 

173If using an external terminal, run `/ide` inside Claude Code to connect it to VS Code.

174 

175### Switch between extension and CLI

176 

177The extension and CLI share the same conversation history. To continue an extension conversation in the CLI, run `claude --resume` in the terminal. This opens an interactive picker where you can search for and select your conversation.

178 

179## Security considerations

180 

181With auto-edit permissions enabled, Claude Code can modify VS Code configuration files (like `settings.json` or `tasks.json`) that VS Code may execute automatically. This could potentially bypass Claude Code's normal permission prompts.

182 

183To reduce risk when working with untrusted code:

184 280 

185* Enable [VS Code Restricted Mode](https://code.visualstudio.com/docs/editor/workspace-trust#_restricted-mode) for untrusted workspaces281* Enable [VS Code Restricted Mode](https://code.visualstudio.com/docs/editor/workspace-trust#_restricted-mode) for untrusted workspaces

186* Use manual approval mode instead of auto-accept for edits282* Use manual approval mode instead of auto-accept for edits


192 288 

193* Ensure you have a compatible version of VS Code (1.98.0 or later)289* Ensure you have a compatible version of VS Code (1.98.0 or later)

194* Check that VS Code has permission to install extensions290* Check that VS Code has permission to install extensions

195* Try installing directly from the Marketplace website291* Try installing directly from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code)

196 292 

197### Spark icon not visible293### Spark icon not visible

198 294 

199The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don't see it:295The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don't see it:

200 296 

2011. **Open a file**: The icon requires a file to be open—having just a folder open isn't enough2971. **Open a file**: The icon requires a file to be open. Having just a folder open isn't enough.

2022. **Check VS Code version**: Requires 1.98.0 or higher (Help → About)2982. **Check VS Code version**: Requires 1.98.0 or higher (Help → About)

2033. **Restart VS Code**: Run "Developer: Reload Window" from the Command Palette2993. **Restart VS Code**: Run "Developer: Reload Window" from the Command Palette

2044. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)3004. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)

2055. **Check workspace trust**: The extension doesn't work in Restricted Mode3015. **Check workspace trust**: The extension doesn't work in Restricted Mode

206 302 

207Alternatively, click "✱ Claude Code" in the **Status Bar** (bottom-right corner)—this works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".303Alternatively, click "✱ Claude Code" in the **Status Bar** (bottom-right corner). This works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".

208 304 

209### Claude Code never responds305### Claude Code never responds

210 306 


2131. **Check your internet connection**: Ensure you have a stable internet connection3091. **Check your internet connection**: Ensure you have a stable internet connection

2142. **Start a new conversation**: Try starting a fresh conversation to see if the issue persists3102. **Start a new conversation**: Try starting a fresh conversation to see if the issue persists

2153. **Try the CLI**: Run `claude` from the terminal to see if you get more detailed error messages3113. **Try the CLI**: Run `claude` from the terminal to see if you get more detailed error messages

2164. **File a bug report**: If the problem continues, [file an issue on GitHub](https://github.com/anthropics/claude-code/issues) with details about the error

217 

218### Standalone CLI not connecting to IDE

219 312 

220* Ensure you're running Claude Code from VS Code's integrated terminal (not an external terminal)313If problems persist, [file an issue on GitHub](https://github.com/anthropics/claude-code/issues) with details about the error.

221* Ensure the CLI for your IDE variant is installed:

222 * VS Code: `code` command should be available

223 * Cursor: `cursor` command should be available

224 * Windsurf: `windsurf` command should be available

225 * VSCodium: `codium` command should be available

226* If the command isn't available, install it from the Command Palette → "Shell Command: Install 'code' command in PATH"

227 314 

228## Uninstall the extension315## Uninstall the extension

229 316