SpyBara
Go Premium Account
2025
15 Oct 2025, 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
4 Dec 2025, 06: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
Mon 1 03:31 Tue 2 00:04 Tue 2 21:01 Wed 3 00:04 Thu 4 03:26 Thu 4 06:02 Thu 4 18:02 Thu 4 21:02 Fri 5 00:04 Sat 6 18:02 Mon 8 00:05 Mon 8 06:02 Mon 8 21:01 Tue 9 03:25 Tue 9 06:02 Tue 9 18:01 Wed 10 09:03 Thu 11 06:02 Thu 11 18:01 Thu 11 21:02 Fri 12 00:05 Fri 12 21:01 Sat 13 06:02 Mon 15 18:02 Mon 15 21:01 Tue 16 00:05 Tue 16 18:02 Tue 16 21:01 Wed 17 03:27 Wed 17 15:02 Thu 18 15:02 Thu 18 18:02 Thu 18 21:01 Fri 19 00:05 Fri 19 18:02 Fri 19 21:01 Sat 20 00:04 Tue 23 18:02 Sat 27 03:28 Sat 27 06:02

amazon-bedrock.md +37 −10

Details

13 13 

14## Setup14## Setup

15 15 

16### 1. Enable model access16### 1. Submit use case details

17 17 

18First, ensure you have access to the required Claude models in your AWS account:18First-time users of Anthropic models are required to submit use case details before invoking a model. This is done once per account.

19 19 

201. Navigate to the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock/)201. Ensure you have the right IAM permissions (see more on that below)

212. Go to **Model access** in the left navigation212. Navigate to the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock/)

223. Request access to desired Claude models (e.g., Claude Sonnet 4.5)223. Select **Chat/Text playground**

234. Wait for approval (usually instant for most regions)234. Choose any Anthropic model and you will be prompted to fill out the use case form

24 24 

25### 2. Configure AWS credentials25### 2. Configure AWS credentials

26 26 


58 58 

59#### Advanced credential configuration59#### Advanced credential configuration

60 60 

61Claude Code supports automatic credential refresh for AWS SSO and corporate identity providers. Add these settings to your Claude Code settings file (see [Settings](/en/docs/claude-code/settings) for file locations).61Claude Code supports automatic credential refresh for AWS SSO and corporate identity providers. Add these settings to your Claude Code settings file (see [Settings](/en/settings) for file locations).

62 62 

63When Claude Code detects that your AWS credentials are expired (either locally based on their timestamp or when Bedrock returns a credential error), it will automatically run your configured `awsAuthRefresh` and/or `awsCredentialExport` commands to obtain new credentials before retrying the request.63When Claude Code detects that your AWS credentials are expired (either locally based on their timestamp or when Bedrock returns a credential error), it will automatically run your configured `awsAuthRefresh` and/or `awsCredentialExport` commands to obtain new credentials before retrying the request.

64 64 


102export ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION=us-west-2102export ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION=us-west-2

103```103```

104 104 

105**For VS Code Extension users**: Configure environment variables in the VS Code extension settings instead of exporting them in your shell. See [Using Third-Party Providers in VS Code](/en/vs-code#using-third-party-providers-vertex-and-bedrock) for detailed instructions. All environment variables shown in this guide should work when configured through the VS Code extension settings.

106 

105When enabling Bedrock for Claude Code, keep the following in mind:107When enabling Bedrock for Claude Code, keep the following in mind:

106 108 

107* `AWS_REGION` is a required environment variable. Claude Code does not read from the `.aws` config file for this setting.109* `AWS_REGION` is a required environment variable. Claude Code does not read from the `.aws` config file for this setting.

108* When using Bedrock, the `/login` and `/logout` commands are disabled since authentication is handled through AWS credentials.110* When using Bedrock, the `/login` and `/logout` commands are disabled since authentication is handled through AWS credentials.

109* You can use settings files for environment variables like `AWS_PROFILE` that you don't want to leak to other processes. See [Settings](/en/docs/claude-code/settings) for more information.111* You can use settings files for environment variables like `AWS_PROFILE` that you don't want to leak to other processes. See [Settings](/en/settings) for more information.

110 112 

111### 4. Model configuration113### 4. Model configuration

112 114 


117| Primary model | `global.anthropic.claude-sonnet-4-5-20250929-v1:0` |119| Primary model | `global.anthropic.claude-sonnet-4-5-20250929-v1:0` |

118| Small/fast model | `us.anthropic.claude-haiku-4-5-20251001-v1:0` |120| Small/fast model | `us.anthropic.claude-haiku-4-5-20251001-v1:0` |

119 121 

122<Note>

123 For Bedrock users, Claude Code will not automatically upgrade from Haiku 3.5 to Haiku 4.5. To manually switch to a newer Haiku model, set the `ANTHROPIC_DEFAULT_HAIKU_MODEL` environment variable to the full model name (e.g., `us.anthropic.claude-haiku-4-5-20251001-v1:0`).

124</Note>

125 

120To customize models, use one of these methods:126To customize models, use one of these methods:

121 127 

122```bash theme={null}128```bash theme={null}


132```138```

133 139 

134<Note>140<Note>

135 [Prompt caching](/en/docs/build-with-claude/prompt-caching) may not be available in all regions141 [Prompt caching](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) may not be available in all regions

136</Note>142</Note>

137 143 

138### 5. Output token configuration144### 5. Output token configuration


160 "Version": "2012-10-17",166 "Version": "2012-10-17",

161 "Statement": [167 "Statement": [

162 {168 {

169 "Sid": "AllowModelAndInferenceProfileAccess",

163 "Effect": "Allow",170 "Effect": "Allow",

164 "Action": [171 "Action": [

165 "bedrock:InvokeModel",172 "bedrock:InvokeModel",


168 ],175 ],

169 "Resource": [176 "Resource": [

170 "arn:aws:bedrock:*:*:inference-profile/*",177 "arn:aws:bedrock:*:*:inference-profile/*",

171 "arn:aws:bedrock:*:*:application-inference-profile/*"178 "arn:aws:bedrock:*:*:application-inference-profile/*",

179 "arn:aws:bedrock:*:*:foundation-model/*"

172 ]180 ]

181 },

182 {

183 "Sid": "AllowMarketplaceSubscription",

184 "Effect": "Allow",

185 "Action": [

186 "aws-marketplace:ViewSubscriptions",

187 "aws-marketplace:Subscribe"

188 ],

189 "Resource": "*",

190 "Condition": {

191 "StringEquals": {

192 "aws:CalledViaLast": "bedrock.amazonaws.com"

193 }

194 }

173 }195 }

174 ]196 ]

175}197}


203* [Bedrock pricing](https://aws.amazon.com/bedrock/pricing/)225* [Bedrock pricing](https://aws.amazon.com/bedrock/pricing/)

204* [Bedrock inference profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html)226* [Bedrock inference profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html)

205* [Claude Code on Amazon Bedrock: Quick Setup Guide](https://community.aws/content/2tXkZKrZzlrlu0KfH8gST5Dkppq/claude-code-on-amazon-bedrock-quick-setup-guide)- [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md)227* [Claude Code on Amazon Bedrock: Quick Setup Guide](https://community.aws/content/2tXkZKrZzlrlu0KfH8gST5Dkppq/claude-code-on-amazon-bedrock-quick-setup-guide)- [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md)

228 

229 

230---

231 

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

analytics.md +7 −2

Details

83 83 

84## Related resources84## Related resources

85 85 

86* [Monitoring usage with OpenTelemetry](/en/docs/claude-code/monitoring-usage) for custom metrics and alerting86* [Monitoring usage with OpenTelemetry](/en/monitoring-usage) for custom metrics and alerting

87* [Identity and access management](/en/docs/claude-code/iam) for role configuration87* [Identity and access management](/en/iam) for role configuration

88 

89 

90---

91 

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

Details

60 60 

61## See also61## See also

62 62 

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

64* [Slash commands](/en/docs/claude-code/slash-commands) - Accessing checkpoints using `/rewind`64* [Slash commands](/en/slash-commands) - Accessing checkpoints using `/rewind`

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

66 

67 

68---

69 

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

claude-code-on-the-web.md +489 −0 added

Details

1# Claude Code on the web

2 

3> Run Claude Code tasks asynchronously on secure cloud infrastructure

4 

5<Note>

6 Claude Code on the web is currently in research preview.

7</Note>

8 

9## What is Claude Code on the web?

10 

11Claude Code on the web lets developers kick off Claude Code from the Claude app. This is perfect for:

12 

13* **Answering questions**: Ask about code architecture and how features are implemented

14* **Bugfixes and routine tasks**: Well-defined tasks that don't require frequent steering

15* **Parallel work**: Tackle multiple bug fixes in parallel

16* **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 tests

18 

19Claude Code is also available on the Claude iOS app. This is perfect for:

20 

21* **On the go**: Kick off tasks while commuting or away from laptop

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 

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

27 

28Claude Code on the web is available in research preview to:

29 

30* **Pro users**

31* **Max users**

32* **Team premium seat users**

33* **Enterprise premium seat users**

34 

35## Getting started

36 

371. Visit [claude.ai/code](https://claude.ai/code)

382. Connect your GitHub account

393. Install the Claude GitHub app in your repositories

404. Select your default environment

415. Submit your coding task

426. Review changes and create a pull request in GitHub

43 

44## How it works

45 

46When you start a task on Claude Code on the web:

47 

481. **Repository cloning**: Your repository is cloned to an Anthropic-managed virtual machine

492. **Environment setup**: Claude prepares a secure cloud environment with your code

503. **Network configuration**: Internet access is configured based on your settings

514. **Task execution**: Claude analyzes code, makes changes, runs tests, and checks its work

525. **Completion**: You're notified when finished and can create a PR with the changes

536. **Results**: Changes are pushed to a branch, ready for pull request creation

54 

55## Moving tasks between web and terminal

56 

57### From web to terminal

58 

59After starting a task on the web:

60 

611. Click the "Open in CLI" button

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

633. Any existing local changes will be stashed, and the remote session will be loaded

644. Continue working locally

65 

66## Cloud environment

67 

68### Default image

69 

70We build and maintain a universal image with common toolchains and language ecosystems pre-installed. This image includes:

71 

72* Popular programming languages and runtimes

73* Common build tools and package managers

74* Testing frameworks and linters

75 

76#### Checking available tools

77 

78To see what's pre-installed in your environment, ask Claude Code to run:

79 

80```bash theme={null}

81check-tools

82```

83 

84This command displays:

85 

86* Programming languages and their versions

87* Available package managers

88* Installed development tools

89 

90#### Language-specific setups

91 

92The universal image includes pre-configured environments for:

93 

94* **Python**: Python 3.x with pip, poetry, and common scientific libraries

95* **Node.js**: Latest LTS versions with npm, yarn, pnpm, and bun

96* **Ruby**: Versions 3.1.6, 3.2.6, 3.3.6 (default: 3.3.6) with gem, bundler, and rbenv for version management

97* **PHP**: Version 8.4.14

98* **Java**: OpenJDK with Maven and Gradle

99* **Go**: Latest stable version with module support

100* **Rust**: Rust toolchain with cargo

101* **C++**: GCC and Clang compilers

102 

103#### Databases

104 

105The universal image includes the following databases:

106 

107* **PostgreSQL**: Version 16

108* **Redis**: Version 7.0

109 

110### Environment configuration

111 

112When you start a session in Claude Code on the web, here's what happens under the hood:

113 

1141. **Environment preparation**: We clone your repository and run any configured Claude hooks for initialization. The repo will be cloned with the default branch on your GitHub repo. If you would like to check out a specific branch, you can specify that in the prompt.

115 

1162. **Network configuration**: We configure internet access for the agent. Internet access is limited by default, but you can configure the environment to have no internet or full internet access based on your needs.

117 

1183. **Claude Code execution**: Claude Code runs to complete your task, writing code, running tests, and checking its work. You can guide and steer Claude throughout the session via the web interface. Claude respects context you've defined in your `CLAUDE.md`.

119 

1204. **Outcome**: When Claude completes its work, it will push the branch to remote. You will be able to create a PR for the branch.

121 

122<Note>

123 Claude operates entirely through the terminal and CLI tools available in the environment. It uses the pre-installed tools in the universal image and any additional tools you install through hooks or dependency management.

124</Note>

125 

126**To add a new environment:** Select the current environment to open the environment selector, and then select "Add environment". This will open a dialog where you can specify the environment name, network access level, and any environment variables you want to set.

127 

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.

129 

130<Note>

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

132 

133 ```

134 API_KEY=your_api_key

135 DEBUG=true

136 ```

137</Note>

138 

139### Dependency management

140 

141Configure automatic dependency installation using [SessionStart hooks](/en/hooks#sessionstart). This can be configured in your repository's `.claude/settings.json` file:

142 

143```json theme={null}

144{

145 "hooks": {

146 "SessionStart": [

147 {

148 "matcher": "startup",

149 "hooks": [

150 {

151 "type": "command",

152 "command": "\"$CLAUDE_PROJECT_DIR\"/scripts/install_pkgs.sh"

153 }

154 ]

155 }

156 ]

157 }

158}

159```

160 

161Create the corresponding script at `scripts/install_pkgs.sh`:

162 

163```bash theme={null}

164#!/bin/bash

165npm install

166pip install -r requirements.txt

167exit 0

168```

169 

170Make it executable: `chmod +x scripts/install_pkgs.sh`

171 

172#### Local vs remote execution

173 

174By default, all hooks execute both locally and in remote (web) environments. To run a hook only in one environment, check the `CLAUDE_CODE_REMOTE` environment variable in your hook script.

175 

176```bash theme={null}

177#!/bin/bash

178 

179# Example: Only run in remote environments

180if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then

181 exit 0

182fi

183 

184npm install

185pip install -r requirements.txt

186```

187 

188#### Persisting environment variables

189 

190SessionStart hooks can persist environment variables for subsequent bash commands by writing to the file specified in the `CLAUDE_ENV_FILE` environment variable. For details, see [SessionStart hooks](/en/hooks#sessionstart) in the hooks reference.

191 

192## Network access and security

193 

194### Network policy

195 

196#### GitHub proxy

197 

198For security, all GitHub operations go through a dedicated proxy service that transparently handles all git interactions. Inside the sandbox, the git client authenticates using a custom-built scoped credential. This proxy:

199 

200* Manages GitHub authentication securely - the git client uses a scoped credential inside the sandbox, which the proxy verifies and translates to your actual GitHub authentication token

201* Restricts git push operations to the current working branch for safety

202* Enables seamless cloning, fetching, and PR operations while maintaining security boundaries

203 

204#### Security proxy

205 

206Environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes. All outbound internet traffic passes through this proxy, which provides:

207 

208* Protection against malicious requests

209* Rate limiting and abuse prevention

210* Content filtering for enhanced security

211 

212### Access levels

213 

214By default, network access is limited to [allowlisted domains](#default-allowed-domains).

215 

216You can configure custom network access, including disabling network access.

217 

218### Default allowed domains

219 

220When using "Limited" network access, the following domains are allowed by default:

221 

222#### Anthropic Services

223 

224* api.anthropic.com

225* statsig.anthropic.com

226* claude.ai

227 

228#### Version Control

229 

230* github.com

231* [www.github.com](http://www.github.com)

232* api.github.com

233* raw\.githubusercontent.com

234* objects.githubusercontent.com

235* codeload.github.com

236* avatars.githubusercontent.com

237* camo.githubusercontent.com

238* gist.github.com

239* gitlab.com

240* [www.gitlab.com](http://www.gitlab.com)

241* registry.gitlab.com

242* bitbucket.org

243* [www.bitbucket.org](http://www.bitbucket.org)

244* api.bitbucket.org

245 

246#### Container Registries

247 

248* registry-1.docker.io

249* auth.docker.io

250* index.docker.io

251* hub.docker.com

252* [www.docker.com](http://www.docker.com)

253* production.cloudflare.docker.com

254* download.docker.com

255* \*.gcr.io

256* ghcr.io

257* mcr.microsoft.com

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

259 

260#### Cloud Platforms

261 

262* cloud.google.com

263* accounts.google.com

264* gcloud.google.com

265* \*.googleapis.com

266* storage.googleapis.com

267* compute.googleapis.com

268* container.googleapis.com

269* azure.com

270* portal.azure.com

271* microsoft.com

272* [www.microsoft.com](http://www.microsoft.com)

273* \*.microsoftonline.com

274* packages.microsoft.com

275* dotnet.microsoft.com

276* dot.net

277* visualstudio.com

278* dev.azure.com

279* oracle.com

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

281* java.com

282* [www.java.com](http://www.java.com)

283* java.net

284* [www.java.net](http://www.java.net)

285* download.oracle.com

286* yum.oracle.com

287 

288#### Package Managers - JavaScript/Node

289 

290* registry.npmjs.org

291* [www.npmjs.com](http://www.npmjs.com)

292* [www.npmjs.org](http://www.npmjs.org)

293* npmjs.com

294* npmjs.org

295* yarnpkg.com

296* registry.yarnpkg.com

297 

298#### Package Managers - Python

299 

300* pypi.org

301* [www.pypi.org](http://www.pypi.org)

302* files.pythonhosted.org

303* pythonhosted.org

304* test.pypi.org

305* pypi.python.org

306* pypa.io

307* [www.pypa.io](http://www.pypa.io)

308 

309#### Package Managers - Ruby

310 

311* rubygems.org

312* [www.rubygems.org](http://www.rubygems.org)

313* api.rubygems.org

314* index.rubygems.org

315* ruby-lang.org

316* [www.ruby-lang.org](http://www.ruby-lang.org)

317* rubyforge.org

318* [www.rubyforge.org](http://www.rubyforge.org)

319* rubyonrails.org

320* [www.rubyonrails.org](http://www.rubyonrails.org)

321* rvm.io

322* get.rvm.io

323 

324#### Package Managers - Rust

325 

326* crates.io

327* [www.crates.io](http://www.crates.io)

328* static.crates.io

329* rustup.rs

330* static.rust-lang.org

331* [www.rust-lang.org](http://www.rust-lang.org)

332 

333#### Package Managers - Go

334 

335* proxy.golang.org

336* sum.golang.org

337* index.golang.org

338* golang.org

339* [www.golang.org](http://www.golang.org)

340* goproxy.io

341* pkg.go.dev

342 

343#### Package Managers - JVM

344 

345* maven.org

346* repo.maven.org

347* central.maven.org

348* repo1.maven.org

349* jcenter.bintray.com

350* gradle.org

351* [www.gradle.org](http://www.gradle.org)

352* services.gradle.org

353* spring.io

354* repo.spring.io

355 

356#### Package Managers - Other Languages

357 

358* packagist.org (PHP Composer)

359* [www.packagist.org](http://www.packagist.org)

360* repo.packagist.org

361* nuget.org (.NET NuGet)

362* [www.nuget.org](http://www.nuget.org)

363* api.nuget.org

364* pub.dev (Dart/Flutter)

365* api.pub.dev

366* hex.pm (Elixir/Erlang)

367* [www.hex.pm](http://www.hex.pm)

368* cpan.org (Perl CPAN)

369* [www.cpan.org](http://www.cpan.org)

370* metacpan.org

371* [www.metacpan.org](http://www.metacpan.org)

372* api.metacpan.org

373* cocoapods.org (iOS/macOS)

374* [www.cocoapods.org](http://www.cocoapods.org)

375* cdn.cocoapods.org

376* haskell.org

377* [www.haskell.org](http://www.haskell.org)

378* hackage.haskell.org

379* swift.org

380* [www.swift.org](http://www.swift.org)

381 

382#### Linux Distributions

383 

384* archive.ubuntu.com

385* security.ubuntu.com

386* ubuntu.com

387* [www.ubuntu.com](http://www.ubuntu.com)

388* \*.ubuntu.com

389* ppa.launchpad.net

390* launchpad.net

391* [www.launchpad.net](http://www.launchpad.net)

392 

393#### Development Tools & Platforms

394 

395* dl.k8s.io (Kubernetes)

396* pkgs.k8s.io

397* k8s.io

398* [www.k8s.io](http://www.k8s.io)

399* releases.hashicorp.com (HashiCorp)

400* apt.releases.hashicorp.com

401* rpm.releases.hashicorp.com

402* archive.releases.hashicorp.com

403* hashicorp.com

404* [www.hashicorp.com](http://www.hashicorp.com)

405* repo.anaconda.com (Anaconda/Conda)

406* conda.anaconda.org

407* anaconda.org

408* [www.anaconda.com](http://www.anaconda.com)

409* anaconda.com

410* continuum.io

411* apache.org (Apache)

412* [www.apache.org](http://www.apache.org)

413* archive.apache.org

414* downloads.apache.org

415* eclipse.org (Eclipse)

416* [www.eclipse.org](http://www.eclipse.org)

417* download.eclipse.org

418* nodejs.org (Node.js)

419* [www.nodejs.org](http://www.nodejs.org)

420 

421#### Cloud Services & Monitoring

422 

423* statsig.com

424* [www.statsig.com](http://www.statsig.com)

425* api.statsig.com

426* \*.sentry.io

427 

428#### Content Delivery & Mirrors

429 

430* \*.sourceforge.net

431* packagecloud.io

432* \*.packagecloud.io

433 

434#### Schema & Configuration

435 

436* json-schema.org

437* [www.json-schema.org](http://www.json-schema.org)

438* json.schemastore.org

439* [www.schemastore.org](http://www.schemastore.org)

440 

441<Note>

442 Domains marked with `*` indicate wildcard subdomain matching. For example, `*.gcr.io` allows access to any subdomain of `gcr.io`.

443</Note>

444 

445### Security best practices for customized network access

446 

4471. **Principle of least privilege**: Only enable the minimum network access required

4482. **Audit regularly**: Review allowed domains periodically

4493. **Use HTTPS**: Always prefer HTTPS endpoints over HTTP

450 

451## Security and isolation

452 

453Claude Code on the web provides strong security guarantees:

454 

455* **Isolated virtual machines**: Each session runs in an isolated, Anthropic-managed VM

456* **Network access controls**: Network access is limited by default, and can be disabled

457 

458<Note>

459 When running with network access disabled, Claude Code is allowed to communicate with the Anthropic API which may still allow data to exit the isolated Claude Code VM.

460</Note>

461 

462* **Credential protection**: Sensitive credentials (such as git credentials or signing keys) are never inside the sandbox with Claude Code. Authentication is handled through a secure proxy using scoped credentials

463* **Secure analysis**: Code is analyzed and modified within isolated VMs before creating PRs

464 

465## Pricing and rate limits

466 

467Claude Code on the web shares rate limits with all other Claude and Claude Code usage within your account. Running multiple tasks in parallel will consume more rate limits proportionately.

468 

469## Limitations

470 

471* **Repository authentication**: You can only move sessions from web to local when you are authenticated to the same account

472* **Platform restrictions**: Claude Code on the web only works with code hosted in GitHub. GitLab and other non-GitHub repositories cannot be used with cloud sessions

473 

474## Best practices

475 

4761. **Use Claude Code hooks**: Configure [sessionStart hooks](/en/hooks#sessionstart) to automate environment setup and dependency installation.

4772. **Document requirements**: Clearly specify dependencies and commands in your `CLAUDE.md` file. If you have an `AGENTS.md` file, you can source it in your `CLAUDE.md` using `@AGENTS.md` to maintain a single source of truth.

478 

479## Related resources

480 

481* [Hooks configuration](/en/hooks)

482* [Settings reference](/en/settings)

483* [Security](/en/security)

484* [Data usage](/en/data-usage)

485 

486 

487---

488 

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

cli-reference.md +60 −17

Details

5## CLI commands5## CLI commands

6 6 

7| Command | Description | Example |7| Command | Description | Example |

8| :--------------------------------- | :--------------------------------------------- | :----------------------------------------------------------------- |8| :--------------------------------- | :--------------------------------------------- | :------------------------------------------------ |

9| `claude` | Start interactive REPL | `claude` |9| `claude` | Start interactive REPL | `claude` |

10| `claude "query"` | Start REPL with initial prompt | `claude "explain this project"` |10| `claude "query"` | Start REPL with initial prompt | `claude "explain this project"` |

11| `claude -p "query"` | Query via SDK, then exit | `claude -p "explain this function"` |11| `claude -p "query"` | Query via SDK, then exit | `claude -p "explain this function"` |


14| `claude -c -p "query"` | Continue via SDK | `claude -c -p "Check for type errors"` |14| `claude -c -p "query"` | Continue via SDK | `claude -c -p "Check for type errors"` |

15| `claude -r "<session-id>" "query"` | Resume session by ID | `claude -r "abc123" "Finish this PR"` |15| `claude -r "<session-id>" "query"` | Resume session by ID | `claude -r "abc123" "Finish this PR"` |

16| `claude update` | Update to latest version | `claude update` |16| `claude update` | Update to latest version | `claude update` |

17| `claude mcp` | Configure Model Context Protocol (MCP) servers | See the [Claude Code MCP documentation](/en/docs/claude-code/mcp). |17| `claude mcp` | Configure Model Context Protocol (MCP) servers | See the [Claude Code MCP documentation](/en/mcp). |

18 18 

19## CLI flags19## CLI flags

20 20 

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| `--agents` | Define custom [subagents](/en/docs/claude-code/sub-agents) dynamically via JSON (see below for format) | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |26| `--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| `--allowedTools` | A list of tools that should be allowed without prompting the user for permission, in addition to [settings.json files](/en/docs/claude-code/settings) | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |27| `--allowedTools` | A list of tools that should be allowed without prompting the user for permission, in addition to [settings.json files](/en/settings) | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |

28| `--disallowedTools` | A list of tools that should be disallowed without prompting the user for permission, in addition to [settings.json files](/en/docs/claude-code/settings) | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |28| `--disallowedTools` | A list of tools that should be disallowed without prompting the user for permission, in addition to [settings.json files](/en/settings) | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |

29| `--print`, `-p` | Print response without interactive mode (see [SDK documentation](/en/docs/claude-code/sdk) for programmatic usage details) | `claude -p "query"` |29| `--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"` |

30| `--append-system-prompt` | Append to system prompt (only with `--print`) | `claude --append-system-prompt "Custom instruction"` |30| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes; added in v2.0.14) | `claude --system-prompt "You are a Python expert"` |

31| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only; added in v1.0.54) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |

32| `--append-system-prompt` | Append custom text to the end of the default system prompt (works in both interactive and print modes; added in v1.0.55) | `claude --append-system-prompt "Always use TypeScript"` |

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

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

35| `--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"` |

33| `--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"` |36| `--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"` |

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

35| `--max-turns` | Limit the number of agentic turns in non-interactive mode | `claude -p --max-turns 3 "query"` |38| `--max-turns` | Limit the number of agentic turns in non-interactive mode | `claude -p --max-turns 3 "query"` |

36| `--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` |39| `--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` |

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

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

39| `--resume` | Resume a specific session by ID, or by choosing in interactive mode | `claude --resume abc123 "query"` |42| `--resume` | Resume a specific session by ID, or by choosing in interactive mode | `claude --resume abc123 "query"` |

40| `--continue` | Load the most recent conversation in the current directory | `claude --continue` |43| `--continue` | Load the most recent conversation in the current directory | `claude --continue` |


73}'76}'

74```77```

75 78 

76For more details on creating and using subagents, see the [subagents documentation](/en/docs/claude-code/sub-agents).79For more details on creating and using subagents, see the [subagents documentation](/en/sub-agents).

80 

81### System prompt flags

82 

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

84 

85| Flag | Behavior | Modes | Use Case |

86| :----------------------- | :--------------------------------- | :------------------ | :------------------------------------------------------------------- |

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

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

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

90 

91**When to use each:**

92 

93* **`--system-prompt`**: Use when you need complete control over Claude's system prompt. This removes all default Claude Code instructions, giving you a blank slate.

94 ```bash theme={null}

95 claude --system-prompt "You are a Python expert who only writes type-annotated code"

96 ```

97 

98* **`--system-prompt-file`**: Use when you want to load a custom prompt from a file, useful for team consistency or version-controlled prompt templates.

99 ```bash theme={null}

100 claude -p --system-prompt-file ./prompts/code-review.txt "Review this PR"

101 ```

102 

103* **`--append-system-prompt`**: Use when you want to add specific instructions while keeping Claude Code's default capabilities intact. This is the safest option for most use cases.

104 ```bash theme={null}

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

106 ```

107 

108<Note>

109 `--system-prompt` and `--system-prompt-file` are mutually exclusive. You cannot use both flags simultaneously.

110</Note>

111 

112<Tip>

113 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.

114</Tip>

77 115 

78For detailed information about print mode (`-p`) including output formats,116For detailed information about print mode (`-p`) including output formats,

79streaming, verbose logging, and programmatic usage, see the117streaming, verbose logging, and programmatic usage, see the

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

81 119 

82## See also120## See also

83 121 

84* [Interactive mode](/en/docs/claude-code/interactive-mode) - Shortcuts, input modes, and interactive features122* [Interactive mode](/en/interactive-mode) - Shortcuts, input modes, and interactive features

85* [Slash commands](/en/docs/claude-code/slash-commands) - Interactive session commands123* [Slash commands](/en/slash-commands) - Interactive session commands

86* [Quickstart guide](/en/docs/claude-code/quickstart) - Getting started with Claude Code124* [Quickstart guide](/en/quickstart) - Getting started with Claude Code

87* [Common workflows](/en/docs/claude-code/common-workflows) - Advanced workflows and patterns125* [Common workflows](/en/common-workflows) - Advanced workflows and patterns

88* [Settings](/en/docs/claude-code/settings) - Configuration options126* [Settings](/en/settings) - Configuration options

89* [SDK documentation](/en/docs/claude-code/sdk) - Programmatic usage and integrations127* [SDK documentation](https://docs.claude.com/en/docs/agent-sdk) - Programmatic usage and integrations

128 

129 

130---

131 

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

Details

214 * Create project-specific subagents in `.claude/agents/` for team sharing214 * Create project-specific subagents in `.claude/agents/` for team sharing

215 * Use descriptive `description` fields to enable automatic delegation215 * Use descriptive `description` fields to enable automatic delegation

216 * Limit tool access to what each subagent actually needs216 * Limit tool access to what each subagent actually needs

217 * Check the [subagents documentation](/en/docs/claude-code/sub-agents) for detailed examples217 * Check the [subagents documentation](/en/sub-agents) for detailed examples

218</Tip>218</Tip>

219 219 

220***220***


247 247 

248**Run "headless" queries in Plan Mode**248**Run "headless" queries in Plan Mode**

249 249 

250You can also run a query in Plan Mode directly with `-p` (i.e., in ["headless mode"](/en/docs/claude-code/sdk/sdk-headless)):250You can also run a query in Plan Mode directly with `-p` (i.e., in ["headless mode"](/en/headless)):

251 251 

252```bash theme={null}252```bash theme={null}

253claude --permission-mode plan -p "Analyze the authentication system and suggest improvements"253claude --permission-mode plan -p "Analyze the authentication system and suggest improvements"


281}281}

282```282```

283 283 

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

285 285 

286***286***

287 287 


488 > Show me the data from @github:repos/owner/repo/issues488 > Show me the data from @github:repos/owner/repo/issues

489 ```489 ```

490 490 

491 This fetches data from connected MCP servers using the format @server:resource. See [MCP resources](/en/docs/claude-code/mcp#use-mcp-resources) for details.491 This fetches data from connected MCP servers using the format @server:resource. See [MCP resources](/en/mcp#use-mcp-resources) for details.

492 </Step>492 </Step>

493</Steps>493</Steps>

494 494 


508Suppose you're working on complex architectural decisions, challenging bugs, or planning multi-step implementations that require deep reasoning.508Suppose you're working on complex architectural decisions, challenging bugs, or planning multi-step implementations that require deep reasoning.

509 509 

510<Note>510<Note>

511 [Extended thinking](/en/docs/build-with-claude/extended-thinking) is disabled by default in Claude Code. You can enable it on-demand by using `Tab` to toggle Thinking on, or by using prompts like "think" or "think hard". You can also enable it permanently by setting the [`MAX_THINKING_TOKENS` environment variable](/en/docs/claude-code/settings#environment-variables) in your settings.511 [Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) is disabled by default in Claude Code. You can enable it on-demand by using `Tab` to toggle Thinking on, or by using prompts like "think" or "think hard". You can also enable it permanently by setting the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) in your settings.

512</Note>512</Note>

513 513 

514<Steps>514<Steps>


535<Tip>535<Tip>

536 Tips to get the most value out of extended thinking:536 Tips to get the most value out of extended thinking:

537 537 

538 [Extended thinking](/en/docs/build-with-claude/extended-thinking) is most valuable for complex tasks such as:538 [Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) is most valuable for complex tasks such as:

539 539 

540 * Planning complex architectural changes540 * Planning complex architectural changes

541 * Debugging intricate issues541 * Debugging intricate issues


550 * "think" triggers basic extended thinking550 * "think" triggers basic extended thinking

551 * intensifying phrases such as "keep hard", "think more", "think a lot", or "think longer" triggers deeper thinking551 * intensifying phrases such as "keep hard", "think more", "think a lot", or "think longer" triggers deeper thinking

552 552 

553 For more extended thinking prompting tips, see [Extended thinking tips](/en/docs/build-with-claude/prompt-engineering/extended-thinking-tips).553 For more extended thinking prompting tips, see [Extended thinking tips](https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/extended-thinking-tips).

554</Tip>554</Tip>

555 555 

556<Note>556<Note>


793 793 

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

795 795 

796For more details, see the [Slash commands](/en/docs/claude-code/slash-commands) reference page.796For more details, see the [Slash commands](/en/slash-commands) reference page.

797 797 

798### Create project-specific commands798### Create project-specific commands

799 799 


947<Card title="Claude Code reference implementation" icon="code" href="https://github.com/anthropics/claude-code/tree/main/.devcontainer">947<Card title="Claude Code reference implementation" icon="code" href="https://github.com/anthropics/claude-code/tree/main/.devcontainer">

948 Clone our development container reference implementation.948 Clone our development container reference implementation.

949</Card>949</Card>

950 

951 

952---

953 

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

costs.md +6 −1

Details

35 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).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 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/docs/claude-code/bedrock-vertex-proxies#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.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 39 

40### Rate limit recommendations40### Rate limit recommendations

41 41 


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

130 establish usage patterns before wider rollout.130 establish usage patterns before wider rollout.

131</Note>131</Note>

132 

133 

134---

135 

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

data-usage.md +29 −4

Details

25 25 

26### Feedback using the `/bug` command26### Feedback using the `/bug` command

27 27 

28If you choose to send us feedback about Claude Code using the `/bug` command, we may use your feedback to improve our products and services. Transcripts shared via `/bug` are retained for 30 days.28If you choose to send us feedback about Claude Code using the `/bug` command, we may use your feedback to improve our products and services. Transcripts shared via `/bug` are retained for 5 years.

29 

30### Session quality surveys

31 

32When you see the "How is Claude doing this session?" prompt in Claude Code, responding to this survey (including selecting "Dismiss"), only your numeric rating (1, 2, 3, or dismiss) is recorded. We do not collect or store any conversation transcripts, inputs, outputs, or other session data as part of this survey. Unlike thumbs up/down feedback or `/bug` reports, this session quality survey is a simple product satisfaction metric. Your responses to this survey do not impact your data training preferences and cannot be used to train our AI models.

29 33 

30### Data retention34### Data retention

31 35 


35 39 

36* Users who allow data use for model improvement: 5-year retention period to support model development and safety improvements40* Users who allow data use for model improvement: 5-year retention period to support model development and safety improvements

37* Users who don't allow data use for model improvement: 30-day retention period41* Users who don't allow data use for model improvement: 30-day retention period

38* Privacy settings can be changed at any time at [claude.ai/settings/data-privacy-controls](claude.ai/settings/data-privacy-controls).42* Privacy settings can be changed at any time at [claude.ai/settings/data-privacy-controls](https://claude.ai/settings/data-privacy-controls).

39 43 

40**Commercial users (Team, Enterprise, and API)**:44**Commercial users (Team, Enterprise, and API)**:

41 45 


49 53 

50## Data flow and dependencies54## Data flow and dependencies

51 55 

52<img src="https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=4b30069d702719e7bfb974eaaafab21c" alt="Claude Code data flow diagram" data-og-width="1597" width="1597" data-og-height="1285" height="1285" data-path="images/claude-code-data-flow.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?w=280&fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=067676caa12f89051cb193e6b3f7d0a0 280w, https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?w=560&fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=5506197deff927f54f2fb5a349f358a8 560w, https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?w=840&fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=bb4febe7974dde5b76b88744f89ab472 840w, https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?w=1100&fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=b51af3074f87b33ccc342aaad655dcbf 1100w, https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?w=1650&fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=8fd96f1dde615877d4e4bbe1874af12d 1650w, https://mintcdn.com/anthropic-claude-docs/LF5WV0SNF6oudpT5/images/claude-code-data-flow.png?w=2500&fit=max&auto=format&n=LF5WV0SNF6oudpT5&q=85&s=056deded541ec30e9b67a67d620f6aaf 2500w" />56<img src="https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=4672f138596e864633b4b7c7ae4ae812" alt="Claude Code data flow diagram" data-og-width="1597" width="1597" data-og-height="1285" height="1285" data-path="images/claude-code-data-flow.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?w=280&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=5d9bdaf7ea50fc38dc01bbde7b952835 280w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?w=560&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=525736e5860ac9f262de4b40c9c68a0e 560w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?w=840&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=5262f9d1a1d0cffb0d5944e49b2d72be 840w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?w=1100&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=ec74e6b2f87b667f6d0e2278c20944de 1100w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?w=1650&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=05f11b1d061b6ddbb69969d4e535547a 1650w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/claude-code-data-flow.png?w=2500&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=9b9cce0fb5989bd1d27f143825be73ff 2500w" />

53 57 

54Claude Code is installed from [NPM](https://www.npmjs.com/package/@anthropic-ai/claude-code). Claude Code runs locally. In order to interact with the LLM, Claude Code sends data over the network. This data includes all user prompts and model outputs. The data is encrypted in transit via TLS and is not encrypted at rest. Claude Code is compatible with most popular VPNs and LLM proxies.58Claude Code is installed from [NPM](https://www.npmjs.com/package/@anthropic-ai/claude-code). Claude Code runs locally. In order to interact with the LLM, Claude Code sends data over the network. This data includes all user prompts and model outputs. The data is encrypted in transit via TLS and is not encrypted at rest. Claude Code is compatible with most popular VPNs and LLM proxies.

55 59 

56Claude Code is built on Anthropic's APIs. For details regarding our API's security controls, including our API logging procedures, please refer to compliance artifacts offered in the [Anthropic Trust Center](https://trust.anthropic.com).60Claude Code is built on Anthropic's APIs. For details regarding our API's security controls, including our API logging procedures, please refer to compliance artifacts offered in the [Anthropic Trust Center](https://trust.anthropic.com).

57 61 

62### Cloud execution

63 

64<Note>

65 The above data flow diagram and description applies to Claude Code CLI running locally on your machine. For cloud-based sessions using Claude Code on the web, see the section below.

66</Note>

67 

68When using [Claude Code on the web](/en/claude-code-on-the-web), sessions run in Anthropic-managed virtual machines instead of locally. In cloud environments:

69 

70* **Code storage**: Your repository is cloned to an isolated VM and automatically deleted after session completion

71* **Credentials**: GitHub authentication is handled through a secure proxy; your GitHub credentials never enter the sandbox

72* **Network traffic**: All outbound traffic goes through a security proxy for audit logging and abuse prevention

73* **Data retention**: Code and session data are subject to the retention and usage policies for your account type

74* **Session data**: Prompts, code changes, and outputs follow the same data policies as local Claude Code usage

75 

76For security details about cloud execution, see [Security](/en/security#cloud-execution-security).

77 

58## Telemetry services78## Telemetry services

59 79 

60Claude Code connects from users' machines to the Statsig service to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Statsig security documentation](https://www.statsig.com/trust/security). To opt out of Statsig telemetry, set the `DISABLE_TELEMETRY` environment variable.80Claude Code connects from users' machines to the Statsig service to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Statsig security documentation](https://www.statsig.com/trust/security). To opt out of Statsig telemetry, set the `DISABLE_TELEMETRY` environment variable.


73| **Sentry (Errors)** | Default on.<br />`DISABLE_ERROR_REPORTING=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. |93| **Sentry (Errors)** | Default on.<br />`DISABLE_ERROR_REPORTING=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. |

74| **Claude API (`/bug` reports)** | Default on.<br />`DISABLE_BUG_COMMAND=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. |94| **Claude API (`/bug` reports)** | Default on.<br />`DISABLE_BUG_COMMAND=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. |

75 95 

76All environment variables can be checked into `settings.json` ([read more](/en/docs/claude-code/settings)).96All environment variables can be checked into `settings.json` ([read more](/en/settings)).

97 

98 

99---

100 

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

desktop.md +85 −0 added

Details

1# Claude Code on desktop

2 

3> Run Claude Code tasks locally or on secure cloud infrastructure with the Claude desktop app

4 

5<img src="https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=c4e9dc9737b437d36ab253b75a1cc595" alt="Claude Code on desktop interface" data-og-width="4132" width="4132" data-og-height="2620" height="2620" data-path="images/desktop-interface.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?w=280&fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=b1a8421a544c3e8c78679fa1a7b56190 280w, https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?w=560&fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=79cf4ea0923098cc429198678ea50903 560w, https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?w=840&fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=14bcbcd569d179770fe656686ffbf6bf 840w, https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?w=1100&fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=b873274db1e9ff8585ba545032aa24a5 1100w, https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?w=1650&fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=25553dced783c3a8c2a1134a53295f7e 1650w, https://mintcdn.com/claude-code/zEGbGSbinVtT3BLw/images/desktop-interface.png?w=2500&fit=max&auto=format&n=zEGbGSbinVtT3BLw&q=85&s=9ad49e6468c2f87b1895093deeea7bb2 2500w" />

6 

7## Claude Code on desktop (Preview)

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.

10 

11## Features

12 

13Claude Code on desktop provides:

14 

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

16* **Include `.gitignored` files in your worktrees**: Automatically copy gitignored files like `.env` to new worktrees using `.worktreeinclude`

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

18 

19## Installation

20 

21Download and install the Claude Desktop app from [claude.ai/download](https://claude.ai/download)

22 

23<Note>

24 Local sessions are not available on Windows arm64 architectures.

25</Note>

26 

27## Using Git worktrees

28 

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.

30 

31<Note>

32 If you start a local session in a folder that does not have Git initialized, the desktop app will not create a new worktree.

33</Note>

34 

35### Copying files ignored with `.gitignore`

36 

37When Claude Code creates a worktree, files ignored via `.gitignore` aren't automatically available. Including a `.worktreeinclude` file solves this by specifying which ignored files should be copied to new worktrees.

38 

39Create a `.worktreeinclude` file in your repository root:

40 

41```

42.env

43.env.local

44.env.*

45**/.claude/settings.local.json

46```

47 

48The file uses `.gitignore`-style patterns. When a worktree is created, files matching these patterns that are also in your `.gitignore` will be copied from your main repository to the worktree.

49 

50<Tip>

51 Only files that are both matched by `.worktreeinclude` AND listed in `.gitignore` are copied. This prevents accidentally duplicating tracked files.

52</Tip>

53 

54### Launch Claude Code on the web

55 

56From the desktop app, you can kick off Claude Code sessions that run on Anthropic's secure cloud infrastructure. This is useful for:

57 

58To start a web session from desktop, select a remote environment when creating a new session.

59 

60For more details, see [Claude Code on the web](/en/claude-code-on-the-web).

61 

62## Bundled Claude Code version

63 

64Claude Code on desktop includes a bundled, stable version of Claude Code to ensure a consistent experience for all desktop users. The bundled version is required and downloaded on first launch even if a version of Claude Code exists on the computer. Desktop automatically manages version updates and cleans up old versions.

65 

66<Note>

67 The bundled Claude Code version in Desktop may differ from the latest CLI version. Desktop prioritizes stability while the CLI may have newer features.

68</Note>

69 

70### Enterprise configuration

71 

72Organizations can disable local Claude Code use in the desktop application with the `isClaudeCodeForDesktopEnabled` [enterprise policy option](https://support.claude.com/en/articles/12622667-enterprise-configuration#h_003283c7cb). Additionally, Claude Code on the web can be disabled in your [admin settings](https://claude.ai/admin-settings/claude-code).

73 

74## Related resources

75 

76* [Claude Code on the web](/en/claude-code-on-the-web)

77* [Claude Desktop support articles](https://support.claude.com/en/collections/16163169-claude-desktop)

78* [Enterprise Configuration](https://support.claude.com/en/articles/12622667-enterprise-configuration)

79* [Common workflows](/en/common-workflows)

80* [Settings reference](/en/settings)

81 

82 

83---

84 

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

devcontainer.md +7 −2

Details

73## Related resources73## Related resources

74 74 

75* [VS Code devcontainers documentation](https://code.visualstudio.com/docs/devcontainers/containers)75* [VS Code devcontainers documentation](https://code.visualstudio.com/docs/devcontainers/containers)

76* [Claude Code security best practices](/en/docs/claude-code/security)76* [Claude Code security best practices](/en/security)

77* [Enterprise network configuration](/en/docs/claude-code/network-config)77* [Enterprise network configuration](/en/network-config)

78 

79 

80---

81 

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

Details

6 6 

7<Note>7<Note>

8 Claude Code GitHub Actions is built on top of the [Claude Code8 Claude Code GitHub Actions is built on top of the [Claude Code

9 SDK](/en/docs/claude-code/sdk), which enables programmatic integration of9 SDK](https://docs.claude.com/en/docs/agent-sdk), which enables programmatic integration of

10 Claude Code into your applications. You can use the SDK to build custom10 Claude Code into your applications. You can use the SDK to build custom

11 automation workflows beyond GitHub Actions.11 automation workflows beyond GitHub Actions.

12</Note>12</Note>

13 13 

14<Info>

15 **Claude Opus 4.5 is now available.** Claude Code GitHub Actions default to Sonnet. To use Opus 4.5, configure the [model parameter](#breaking-changes-reference) to use `claude-opus-4-5-20251101`.

16</Info>

17 

14## Why use Claude Code GitHub Actions?18## Why use Claude Code GitHub Actions?

15 19 

16* **Instant PR creation**: Describe what you need, and Claude creates a complete PR with all necessary changes20* **Instant PR creation**: Describe what you need, and Claude creates a complete PR with all necessary changes


110 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}114 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

111 custom_instructions: "Follow our coding standards"115 custom_instructions: "Follow our coding standards"

112 max_turns: "10"116 max_turns: "10"

113 model: "claude-3-5-sonnet-20241022"117 model: "claude-sonnet-4-5-20250929"

114```118```

115 119 

116**GA version (v1.0):**120**GA version (v1.0):**


186 with:190 with:

187 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}191 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

188 prompt: "Generate a summary of yesterday's commits and open issues"192 prompt: "Generate a summary of yesterday's commits and open issues"

189 claude_args: "--model claude-opus-4-1-20250805"193 claude_args: "--model claude-opus-4-5-20251101"

190```194```

191 195 

192### Common use cases196### Common use cases


663 667 

664You can configure Claude's behavior in two ways:668You can configure Claude's behavior in two ways:

665 669 

6661. **CLAUDE.md**: Define coding standards, review criteria, and project-specific rules in a `CLAUDE.md` file at the root of your repository. Claude will follow these guidelines when creating PRs and responding to requests. Check out our [Memory documentation](/en/docs/claude-code/memory) for more details.6701. **CLAUDE.md**: Define coding standards, review criteria, and project-specific rules in a `CLAUDE.md` file at the root of your repository. Claude will follow these guidelines when creating PRs and responding to requests. Check out our [Memory documentation](/en/memory) for more details.

6672. **Custom prompts**: Use the `prompt` parameter in the workflow file to provide workflow-specific instructions. This allows you to customize Claude's behavior for different workflows or tasks.6712. **Custom prompts**: Use the `prompt` parameter in the workflow file to provide workflow-specific instructions. This allows you to customize Claude's behavior for different workflows or tasks.

668 672 

669Claude will follow these guidelines when creating PRs and responding to requests.673Claude will follow these guidelines when creating PRs and responding to requests.

674 

675 

676---

677 

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

gitlab-ci-cd.md +8 −3

Details

9</Info>9</Info>

10 10 

11<Note>11<Note>

12 This integration is built on top of the [Claude Code CLI and SDK](/en/docs/claude-code/sdk), enabling programmatic use of Claude in your CI/CD jobs and custom automation workflows.12 This integration is built on top of the [Claude Code CLI and SDK](https://docs.claude.com/en/docs/agent-sdk), enabling programmatic use of Claude in your CI/CD jobs and custom automation workflows.

13</Note>13</Note>

14 14 

15## Why use Claude Code with GitLab?15## Why use Claude Code with GitLab?


315```315```

316 316 

317<Note>317<Note>

318 Model IDs for Bedrock include region-specific prefixes and version suffixes (for example, `us.anthropic.claude-3-7-sonnet-20250219-v1:0`). Pass the desired model via your job configuration or prompt if your workflow supports it.318 Model IDs for Bedrock include region-specific prefixes and version suffixes (for example, `us.anthropic.claude-sonnet-4-5-20250929-v1:0`). Pass the desired model via your job configuration or prompt if your workflow supports it.

319</Note>319</Note>

320 320 

321### Google Vertex AI job example (Workload Identity Federation)321### Google Vertex AI job example (Workload Identity Federation)


404* **API costs**:404* **API costs**:

405 * Each Claude interaction consumes tokens based on prompt and response size405 * Each Claude interaction consumes tokens based on prompt and response size

406 * Token usage varies by task complexity and codebase size406 * Token usage varies by task complexity and codebase size

407 * See [Anthropic pricing](/en/docs/about-claude/pricing) for details407 * See [Anthropic pricing](https://docs.claude.com/en/docs/about-claude/pricing) for details

408 408 

409* **Cost optimization tips**:409* **Cost optimization tips**:

410 * Use specific `@claude` commands to reduce unnecessary turns410 * Use specific `@claude` commands to reduce unnecessary turns


460 460 

4611. **CLAUDE.md**: Define coding standards, security requirements, and project conventions. Claude reads this during runs and follows your rules.4611. **CLAUDE.md**: Define coding standards, security requirements, and project conventions. Claude reads this during runs and follows your rules.

4622. **Custom prompts**: Pass task-specific instructions via `prompt`/`prompt_file` in the job. Use different prompts for different jobs (for example, review, implement, refactor).4622. **Custom prompts**: Pass task-specific instructions via `prompt`/`prompt_file` in the job. Use different prompts for different jobs (for example, review, implement, refactor).

463 

464 

465---

466 

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

Details

82```82```

83 83 

84<Note>84<Note>

85 [Prompt caching](/en/docs/build-with-claude/prompt-caching) is automatically supported when you specify the `cache_control` ephemeral flag. To disable it, set `DISABLE_PROMPT_CACHING=1`. For heightened rate limits, contact Google Cloud support.85 [Prompt caching](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) is automatically supported when you specify the `cache_control` ephemeral flag. To disable it, set `DISABLE_PROMPT_CACHING=1`. For heightened rate limits, contact Google Cloud support.

86</Note>86</Note>

87 87 

88<Note>88<Note>


98| Primary model | `claude-sonnet-4-5@20250929` |98| Primary model | `claude-sonnet-4-5@20250929` |

99| Small/fast model | `claude-haiku-4-5@20251001` |99| Small/fast model | `claude-haiku-4-5@20251001` |

100 100 

101<Note>

102 For Vertex AI users, Claude Code will not automatically upgrade from Haiku 3.5 to Haiku 4.5. To manually switch to a newer Haiku model, set the `ANTHROPIC_DEFAULT_HAIKU_MODEL` environment variable to the full model name (e.g., `claude-haiku-4-5@20251001`).

103</Note>

104 

101To customize models:105To customize models:

102 106 

103```bash theme={null}107```bash theme={null}


111 115 

112The `roles/aiplatform.user` role includes the required permissions:116The `roles/aiplatform.user` role includes the required permissions:

113 117 

114* `aiplatform.endpoints.predict` - Required for model invocation118* `aiplatform.endpoints.predict` - Required for model invocation and token counting

115* `aiplatform.endpoints.computeTokens` - Required for token counting

116 119 

117For more restrictive permissions, create a custom role with only the permissions above.120For more restrictive permissions, create a custom role with only the permissions above.

118 121 


122 We recommend creating a dedicated GCP project for Claude Code to simplify cost tracking and access control.125 We recommend creating a dedicated GCP project for Claude Code to simplify cost tracking and access control.

123</Note>126</Note>

124 127 

125### 1M token context window128## 1M token context window

126 129 

127Claude Sonnet 4 and Sonnet 4.5 support the [1M token context window](/en/docs/build-with-claude/context-windows#1m-token-context-window) on Vertex AI.130Claude Sonnet 4 and Sonnet 4.5 support the [1M token context window](https://docs.claude.com/en/docs/build-with-claude/context-windows#1m-token-context-window) on Vertex AI.

128 131 

129<Note>132<Note>

130 The 1M token context window is currently in beta. To use the extended context window, include the `context-1m-2025-08-07` beta header in your Vertex AI requests.133 The 1M token context window is currently in beta. To use the extended context window, include the `context-1m-2025-08-07` beta header in your Vertex AI requests.


154* [Vertex AI documentation](https://cloud.google.com/vertex-ai/docs)157* [Vertex AI documentation](https://cloud.google.com/vertex-ai/docs)

155* [Vertex AI pricing](https://cloud.google.com/vertex-ai/pricing)158* [Vertex AI pricing](https://cloud.google.com/vertex-ai/pricing)

156* [Vertex AI quotas and limits](https://cloud.google.com/vertex-ai/docs/quotas)159* [Vertex AI quotas and limits](https://cloud.google.com/vertex-ai/docs/quotas)

160 

161 

162---

163 

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

headless.md +8 −3

Details

33| `--mcp-config` | Load MCP servers from a JSON file | `claude --mcp-config servers.json` |33| `--mcp-config` | Load MCP servers from a JSON file | `claude --mcp-config servers.json` |

34| `--permission-prompt-tool` | MCP tool for handling permission prompts (only with `--print`) | `claude --permission-prompt-tool mcp__auth__prompt` |34| `--permission-prompt-tool` | MCP tool for handling permission prompts (only with `--print`) | `claude --permission-prompt-tool mcp__auth__prompt` |

35 35 

36For a complete list of CLI options and features, see the [CLI reference](/en/docs/claude-code/cli-reference) documentation.36For a complete list of CLI options and features, see the [CLI reference](/en/cli-reference) documentation.

37 37 

38## Multi-turn conversations38## Multi-turn conversations

39 39 


200 200 

201## Related Resources201## Related Resources

202 202 

203* [CLI usage and controls](/en/docs/claude-code/cli-reference) - Complete CLI documentation203* [CLI usage and controls](/en/cli-reference) - Complete CLI documentation

204* [Common workflows](/en/docs/claude-code/common-workflows) - Step-by-step guides for common use cases204* [Common workflows](/en/common-workflows) - Step-by-step guides for common use cases

205 

206 

207---

208 

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

hooks.md +345 −48

Details

3> This page provides reference documentation for implementing hooks in Claude Code.3> This page provides reference documentation for implementing hooks in Claude Code.

4 4 

5<Tip>5<Tip>

6 For a quickstart guide with examples, see [Get started with Claude Code hooks](/en/docs/claude-code/hooks-guide).6 For a quickstart guide with examples, see [Get started with Claude Code hooks](/en/hooks-guide).

7</Tip>7</Tip>

8 8 

9## Configuration9## Configuration

10 10 

11Claude Code hooks are configured in your [settings files](/en/docs/claude-code/settings):11Claude Code hooks are configured in your [settings files](/en/settings):

12 12 

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

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


38```38```

39 39 

40* **matcher**: Pattern to match tool names, case-sensitive (only applicable for40* **matcher**: Pattern to match tool names, case-sensitive (only applicable for

41 `PreToolUse` and `PostToolUse`)41 `PreToolUse`, `PermissionRequest`, and `PostToolUse`)

42 * Simple strings match exactly: `Write` matches only the Write tool42 * Simple strings match exactly: `Write` matches only the Write tool

43 * Supports regex: `Edit|Write` or `Notebook.*`43 * Supports regex: `Edit|Write` or `Notebook.*`

44 * Use `*` to match all tools. You can also use empty string (`""`) or leave44 * Use `*` to match all tools. You can also use empty string (`""`) or leave

45 `matcher` blank.45 `matcher` blank.

46* **hooks**: Array of commands to execute when the pattern matches46* **hooks**: Array of hooks to execute when the pattern matches

47 * `type`: Currently only `"command"` is supported47 * `type`: Hook execution type - `"command"` for bash commands or `"prompt"` for LLM-based evaluation

48 * `command`: The bash command to execute (can use `$CLAUDE_PROJECT_DIR`48 * `command`: (For `type: "command"`) The bash command to execute (can use `$CLAUDE_PROJECT_DIR` environment variable)

49 environment variable)49 * `prompt`: (For `type: "prompt"`) The prompt to send to the LLM for evaluation

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

51 canceling that specific command.51 

52 52For events like `UserPromptSubmit`, `Stop`, and `SubagentStop`

53For events like `UserPromptSubmit`, `Notification`, `Stop`, and `SubagentStop`

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

55 54 

56```json theme={null}55```json theme={null}


96 95 

97### Plugin hooks96### Plugin hooks

98 97 

99[Plugins](/en/docs/claude-code/plugins) can provide hooks that integrate seamlessly with your user and project hooks. Plugin hooks are automatically merged with your configuration when plugins are enabled.98[Plugins](/en/plugins) can provide hooks that integrate seamlessly with your user and project hooks. Plugin hooks are automatically merged with your configuration when plugins are enabled.

100 99 

101**How plugin hooks work**:100**How plugin hooks work**:

102 101 


141* `${CLAUDE_PROJECT_DIR}`: Project root directory (same as for project hooks)140* `${CLAUDE_PROJECT_DIR}`: Project root directory (same as for project hooks)

142* All standard environment variables are available141* All standard environment variables are available

143 142 

144See the [plugin components reference](/en/docs/claude-code/plugins-reference#hooks) for details on creating plugin hooks.143See the [plugin components reference](/en/plugins-reference#hooks) for details on creating plugin hooks.

144 

145## Prompt-Based Hooks

146 

147In 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.

148 

149### How prompt-based hooks work

150 

151Instead of executing a bash command, prompt-based hooks:

152 

1531. Send the hook input and your prompt to a fast LLM (Haiku)

1542. The LLM responds with structured JSON containing a decision

1553. Claude Code processes the decision automatically

156 

157### Configuration

158 

159```json theme={null}

160{

161 "hooks": {

162 "Stop": [

163 {

164 "hooks": [

165 {

166 "type": "prompt",

167 "prompt": "Evaluate if Claude should stop: $ARGUMENTS. Check if all tasks are complete."

168 }

169 ]

170 }

171 ]

172 }

173}

174```

175 

176**Fields:**

177 

178* `type`: Must be `"prompt"`

179* `prompt`: The prompt text to send to the LLM

180 * Use `$ARGUMENTS` as a placeholder for the hook input JSON

181 * If `$ARGUMENTS` is not present, input JSON is appended to the prompt

182* `timeout`: (Optional) Timeout in seconds (default: 30 seconds)

183 

184### Response schema

185 

186The LLM must respond with JSON containing:

187 

188```json theme={null}

189{

190 "decision": "approve" | "block",

191 "reason": "Explanation for the decision",

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

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

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

195}

196```

197 

198**Response fields:**

199 

200* `decision`: `"approve"` allows the action, `"block"` prevents it

201* `reason`: Explanation shown to Claude when decision is `"block"`

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

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

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

205 

206### Supported hook events

207 

208Prompt-based hooks work with any hook event, but are most useful for:

209 

210* **Stop**: Intelligently decide if Claude should continue working

211* **SubagentStop**: Evaluate if a subagent has completed its task

212* **UserPromptSubmit**: Validate user prompts with LLM assistance

213* **PreToolUse**: Make context-aware permission decisions

214* **PermissionRequest**: Intelligently allow or deny permission dialogs

215 

216### Example: Intelligent Stop hook

217 

218```json theme={null}

219{

220 "hooks": {

221 "Stop": [

222 {

223 "hooks": [

224 {

225 "type": "prompt",

226 "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\"}",

227 "timeout": 30

228 }

229 ]

230 }

231 ]

232 }

233}

234```

235 

236### Example: SubagentStop with custom logic

237 

238```json theme={null}

239{

240 "hooks": {

241 "SubagentStop": [

242 {

243 "hooks": [

244 {

245 "type": "prompt",

246 "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\"}"

247 }

248 ]

249 }

250 ]

251 }

252}

253```

254 

255### Comparison with bash command hooks

256 

257| Feature | Bash Command Hooks | Prompt-Based Hooks |

258| --------------------- | ----------------------- | ------------------------------ |

259| **Execution** | Runs bash script | Queries LLM |

260| **Decision logic** | You implement in code | LLM evaluates context |

261| **Setup complexity** | Requires script file | Just configure prompt |

262| **Context awareness** | Limited to script logic | Natural language understanding |

263| **Performance** | Fast (local execution) | Slower (API call) |

264| **Use case** | Deterministic rules | Context-aware decisions |

265 

266### Best practices

267 

268* **Be specific in prompts**: Clearly state what you want the LLM to evaluate

269* **Include decision criteria**: List the factors the LLM should consider

270* **Test your prompts**: Verify the LLM makes correct decisions for your use cases

271* **Set appropriate timeouts**: Default is 30 seconds, adjust if needed

272* **Use for complex decisions**: Bash hooks are better for simple, deterministic rules

273 

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

145 275 

146## Hook Events276## Hook Events

147 277 


151 281 

152**Common matchers:**282**Common matchers:**

153 283 

154* `Task` - Subagent tasks (see [subagents documentation](/en/docs/claude-code/sub-agents))284* `Task` - Subagent tasks (see [subagents documentation](/en/sub-agents))

155* `Bash` - Shell commands285* `Bash` - Shell commands

156* `Glob` - File pattern matching286* `Glob` - File pattern matching

157* `Grep` - Content search287* `Grep` - Content search


160* `Write` - File writing290* `Write` - File writing

161* `WebFetch`, `WebSearch` - Web operations291* `WebFetch`, `WebSearch` - Web operations

162 292 

293Use [PreToolUse decision control](#pretooluse-decision-control) to allow, deny, or ask for permission to use the tool.

294 

295### PermissionRequest

296 

297Runs when the user is shown a permission dialog.

298Use [PermissionRequest decision control](#permissionrequest-decision-control) to allow or deny on behalf of the user.

299 

300Recognizes the same matcher values as PreToolUse.

301 

163### PostToolUse302### PostToolUse

164 303 

165Runs immediately after a tool completes successfully.304Runs immediately after a tool completes successfully.


168 307 

169### Notification308### Notification

170 309 

171Runs when Claude Code sends notifications. Notifications are sent when:310Runs when Claude Code sends notifications. Supports matchers to filter by notification type.

311 

312**Common matchers:**

172 313 

1731. Claude needs your permission to use a tool. Example: "Claude needs your314* `permission_prompt` - Permission requests from Claude Code

174 permission to use Bash"315* `idle_prompt` - When Claude is waiting for user input (after 60+ seconds of idle time)

1752. The prompt input has been idle for at least 60 seconds. "Claude is waiting316* `auth_success` - Authentication success notifications

176 for your input"317* `elicitation_dialog` - When Claude Code needs input for MCP tool elicitation

318 

319You can use matchers to run different hooks for different notification types, or omit the matcher to run hooks for all notifications.

320 

321**Example: Different notifications for different types**

322 

323```json theme={null}

324{

325 "hooks": {

326 "Notification": [

327 {

328 "matcher": "permission_prompt",

329 "hooks": [

330 {

331 "type": "command",

332 "command": "/path/to/permission-alert.sh"

333 }

334 ]

335 },

336 {

337 "matcher": "idle_prompt",

338 "hooks": [

339 {

340 "type": "command",

341 "command": "/path/to/idle-notification.sh"

342 }

343 ]

344 }

345 ]

346 }

347}

348```

177 349 

178### UserPromptSubmit350### UserPromptSubmit

179 351 


203 375 

204Runs when Claude Code starts a new session or resumes an existing session (which376Runs when Claude Code starts a new session or resumes an existing session (which

205currently does start a new session under the hood). Useful for loading in377currently does start a new session under the hood). Useful for loading in

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

207 379 

208**Matchers:**380**Matchers:**

209 381 


212* `clear` - Invoked from `/clear`384* `clear` - Invoked from `/clear`

213* `compact` - Invoked from auto or manual compact.385* `compact` - Invoked from auto or manual compact.

214 386 

387#### Persisting environment variables

388 

389SessionStart hooks have access to the `CLAUDE_ENV_FILE` environment variable, which provides a file path where you can persist environment variables for subsequent bash commands.

390 

391**Example: Setting individual environment variables**

392 

393```bash theme={null}

394#!/bin/bash

395 

396if [ -n "$CLAUDE_ENV_FILE" ]; then

397 echo 'export NODE_ENV=production' >> "$CLAUDE_ENV_FILE"

398 echo 'export API_KEY=your-api-key' >> "$CLAUDE_ENV_FILE"

399 echo 'export PATH="$PATH:./node_modules/.bin"' >> "$CLAUDE_ENV_FILE"

400fi

401 

402exit 0

403```

404 

405**Example: Persisting all environment changes from the hook**

406 

407When your setup modifies the environment (e.g., `nvm use`), capture and persist all changes by diffing the environment:

408 

409```bash theme={null}

410#!/bin/bash

411 

412ENV_BEFORE=$(export -p | sort)

413 

414# Run your setup commands that modify the environment

415source ~/.nvm/nvm.sh

416nvm use 20

417 

418if [ -n "$CLAUDE_ENV_FILE" ]; then

419 ENV_AFTER=$(export -p | sort)

420 comm -13 <(echo "$ENV_BEFORE") <(echo "$ENV_AFTER") >> "$CLAUDE_ENV_FILE"

421fi

422 

423exit 0

424```

425 

426Any variables written to this file will be available in all subsequent bash commands that Claude Code executes during the session.

427 

428<Note>

429 `CLAUDE_ENV_FILE` is only available for SessionStart hooks. Other hook types do not have access to this variable.

430</Note>

431 

215### SessionEnd432### SessionEnd

216 433 

217Runs when a Claude Code session ends. Useful for cleanup tasks, logging session434Runs when a Claude Code session ends. Useful for cleanup tasks, logging session


235 session_id: string452 session_id: string

236 transcript_path: string // Path to conversation JSON453 transcript_path: string // Path to conversation JSON

237 cwd: string // The current working directory when the hook is invoked454 cwd: string // The current working directory when the hook is invoked

455 permission_mode: string // Current permission mode: "default", "plan", "acceptEdits", or "bypassPermissions"

238 456 

239 // Event-specific fields457 // Event-specific fields

240 hook_event_name: string458 hook_event_name: string


251 "session_id": "abc123",469 "session_id": "abc123",

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

253 "cwd": "/Users/...",471 "cwd": "/Users/...",

472 "permission_mode": "default",

254 "hook_event_name": "PreToolUse",473 "hook_event_name": "PreToolUse",

255 "tool_name": "Write",474 "tool_name": "Write",

256 "tool_input": {475 "tool_input": {

257 "file_path": "/path/to/file.txt",476 "file_path": "/path/to/file.txt",

258 "content": "file content"477 "content": "file content"

259 }478 },

479 "tool_use_id": "toolu_01ABC123..."

260}480}

261```481```

262 482 


269 "session_id": "abc123",489 "session_id": "abc123",

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

271 "cwd": "/Users/...",491 "cwd": "/Users/...",

492 "permission_mode": "default",

272 "hook_event_name": "PostToolUse",493 "hook_event_name": "PostToolUse",

273 "tool_name": "Write",494 "tool_name": "Write",

274 "tool_input": {495 "tool_input": {


278 "tool_response": {499 "tool_response": {

279 "filePath": "/path/to/file.txt",500 "filePath": "/path/to/file.txt",

280 "success": true501 "success": true

281 }502 },

503 "tool_use_id": "toolu_01ABC123..."

282}504}

283```505```

284 506 


289 "session_id": "abc123",511 "session_id": "abc123",

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

291 "cwd": "/Users/...",513 "cwd": "/Users/...",

514 "permission_mode": "default",

292 "hook_event_name": "Notification",515 "hook_event_name": "Notification",

293 "message": "Task completed successfully"516 "message": "Claude needs your permission to use Bash",

517 "notification_type": "permission_prompt"

294}518}

295```519```

296 520 


301 "session_id": "abc123",525 "session_id": "abc123",

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

303 "cwd": "/Users/...",527 "cwd": "/Users/...",

528 "permission_mode": "default",

304 "hook_event_name": "UserPromptSubmit",529 "hook_event_name": "UserPromptSubmit",

305 "prompt": "Write a function to calculate the factorial of a number"530 "prompt": "Write a function to calculate the factorial of a number"

306}531}


316{541{

317 "session_id": "abc123",542 "session_id": "abc123",

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

544 "permission_mode": "default",

319 "hook_event_name": "Stop",545 "hook_event_name": "Stop",

320 "stop_hook_active": true546 "stop_hook_active": true

321}547}


330{556{

331 "session_id": "abc123",557 "session_id": "abc123",

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

559 "permission_mode": "default",

333 "hook_event_name": "PreCompact",560 "hook_event_name": "PreCompact",

334 "trigger": "manual",561 "trigger": "manual",

335 "custom_instructions": ""562 "custom_instructions": ""


342{569{

343 "session_id": "abc123",570 "session_id": "abc123",

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

572 "permission_mode": "default",

345 "hook_event_name": "SessionStart",573 "hook_event_name": "SessionStart",

346 "source": "startup"574 "source": "startup"

347}575}


354 "session_id": "abc123",582 "session_id": "abc123",

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

356 "cwd": "/Users/...",584 "cwd": "/Users/...",

585 "permission_mode": "default",

357 "hook_event_name": "SessionEnd",586 "hook_event_name": "SessionEnd",

358 "reason": "exit"587 "reason": "exit"

359}588}


361 590 

362## Hook Output591## Hook Output

363 592 

364There are two ways for hooks to return output back to Claude Code. The output593There are two mutually-exclusive ways for hooks to return output back to Claude Code. The output

365communicates whether to block and any feedback that should be shown to Claude594communicates whether to block and any feedback that should be shown to Claude

366and the user.595and the user.

367 596 


369 598 

370Hooks communicate status through exit codes, stdout, and stderr:599Hooks communicate status through exit codes, stdout, and stderr:

371 600 

372* **Exit code 0**: Success. `stdout` is shown to the user in transcript mode601* **Exit code 0**: Success. `stdout` is shown to the user in verbose mode

373 (CTRL-R), except for `UserPromptSubmit` and `SessionStart`, where stdout is602 (ctrl+o), except for `UserPromptSubmit` and `SessionStart`, where stdout is

374 added to the context.603 added to the context. JSON output in `stdout` is parsed for structured control

375* **Exit code 2**: Blocking error. `stderr` is fed back to Claude to process604 (see [Advanced: JSON Output](#advanced-json-output)).

376 automatically. See per-hook-event behavior below.605* **Exit code 2**: Blocking error. Only `stderr` is used as the error message

377* **Other exit codes**: Non-blocking error. `stderr` is shown to the user and606 and fed back to Claude. The format is `[command]: {stderr}`. JSON in `stdout`

378 execution continues.607 is **not** processed for exit code 2. See per-hook-event behavior below.

608* **Other exit codes**: Non-blocking error. `stderr` is shown to the user in verbose mode (ctrl+o) with

609 format `Failed with non-blocking status code: {stderr}`. If `stderr` is empty,

610 it shows `No stderr output`. Execution continues.

379 611 

380<Warning>612<Warning>

381 Reminder: Claude Code does not see stdout if the exit code is 0, except for613 Reminder: Claude Code does not see stdout if the exit code is 0, except for


385#### Exit Code 2 Behavior617#### Exit Code 2 Behavior

386 618 

387| Hook Event | Behavior |619| Hook Event | Behavior |

388| ------------------ | ------------------------------------------------------------------ |620| ------------------- | ------------------------------------------------------------------ |

389| `PreToolUse` | Blocks the tool call, shows stderr to Claude |621| `PreToolUse` | Blocks the tool call, shows stderr to Claude |

622| `PermissionRequest` | Denies the permission, shows stderr to Claude |

390| `PostToolUse` | Shows stderr to Claude (tool already ran) |623| `PostToolUse` | Shows stderr to Claude (tool already ran) |

391| `Notification` | N/A, shows stderr to user only |624| `Notification` | N/A, shows stderr to user only |

392| `UserPromptSubmit` | Blocks prompt processing, erases prompt, shows stderr to user only |625| `UserPromptSubmit` | Blocks prompt processing, erases prompt, shows stderr to user only |


398 631 

399### Advanced: JSON Output632### Advanced: JSON Output

400 633 

401Hooks can return structured JSON in `stdout` for more sophisticated control:634Hooks can return structured JSON in `stdout` for more sophisticated control.

635 

636<Warning>

637 JSON output is only processed when the hook exits with code 0. If your hook

638 exits with code 2 (blocking error), `stderr` text is used directly—any JSON in `stdout`

639 is ignored. For other non-zero exit codes, only `stderr` is shown to the user in verbose mode (ctrl+o).

640</Warning>

402 641 

403#### Common JSON Fields642#### Common JSON Fields

404 643 


440* `"ask"` asks the user to confirm the tool call in the UI.679* `"ask"` asks the user to confirm the tool call in the UI.

441 `permissionDecisionReason` is shown to the user but not to Claude.680 `permissionDecisionReason` is shown to the user but not to Claude.

442 681 

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

683 

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

685* This is most useful with `"permissionDecision": "allow"` to modify and approve tool calls.

686 

443```json theme={null}687```json theme={null}

444{688{

445 "hookSpecificOutput": {689 "hookSpecificOutput": {

446 "hookEventName": "PreToolUse",690 "hookEventName": "PreToolUse",

447 "permissionDecision": "allow" | "deny" | "ask",691 "permissionDecision": "allow"

448 "permissionDecisionReason": "My reason here"692 "permissionDecisionReason": "My reason here",

693 "updatedInput": {

694 "field_to_modify": "new value"

695 }

449 }696 }

450}697}

451```698```


457 `"approve"` and `"block"` map to `"allow"` and `"deny"` respectively.704 `"approve"` and `"block"` map to `"allow"` and `"deny"` respectively.

458</Note>705</Note>

459 706 

707#### `PermissionRequest` Decision Control

708 

709`PermissionRequest` hooks can allow or deny permission requests shown to the user.

710 

711* For `"behavior": "allow"` you can also optionally pass in an `"updatedInput"` that modifies the tool's input parameters before the tool executes.

712* For `"behavior": "deny"` you can also optionally pass in a `"message"` string that tells the model why the permission was denied, and a boolean `"interrupt"` which will stop Claude.

713 

714```json theme={null}

715{

716 "hookSpecificOutput": {

717 "hookEventName": "PermissionRequest",

718 "decision": {

719 "behavior": "allow",

720 "updatedInput": {

721 "command": "npm run lint"

722 }

723 }

724 }

725}

726```

727 

460#### `PostToolUse` Decision Control728#### `PostToolUse` Decision Control

461 729 

462`PostToolUse` hooks can provide feedback to Claude after tool execution.730`PostToolUse` hooks can provide feedback to Claude after tool execution.


478 746 

479#### `UserPromptSubmit` Decision Control747#### `UserPromptSubmit` Decision Control

480 748 

481`UserPromptSubmit` hooks can control whether a user prompt is processed.749`UserPromptSubmit` hooks can control whether a user prompt is processed and add context.

750 

751**Adding context (exit code 0):**

752There are two ways to add context to the conversation:

753 

7541. **Plain text stdout** (simpler): Any non-JSON text written to stdout is added

755 as context. This is the easiest way to inject information.

756 

7572. **JSON with `additionalContext`** (structured): Use the JSON format below for

758 more control. The `additionalContext` field is added as context.

482 759 

483* `"block"` prevents the prompt from being processed. The submitted prompt is760Both methods work with exit code 0. Plain stdout is shown as hook output in

484 erased from context. `"reason"` is shown to the user but not added to context.761the transcript; `additionalContext` is added more discretely.

485* `undefined` allows the prompt to proceed normally. `"reason"` is ignored.762 

486* `"hookSpecificOutput.additionalContext"` adds the string to the context if not763**Blocking prompts:**

487 blocked.764 

765* `"decision": "block"` prevents the prompt from being processed. The submitted

766 prompt is erased from context. `"reason"` is shown to the user but not added

767 to context.

768* `"decision": undefined` (or omitted) allows the prompt to proceed normally.

488 769 

489```json theme={null}770```json theme={null}

490{771{


497}778}

498```779```

499 780 

781<Note>

782 The JSON format is not required for simple use cases. To add context, you can

783 just print plain text to stdout with exit code 0. Use JSON when you need to

784 block prompts or want more structured control.

785</Note>

786 

500#### `Stop`/`SubagentStop` Decision Control787#### `Stop`/`SubagentStop` Decision Control

501 788 

502`Stop` and `SubagentStop` hooks can control whether Claude must continue.789`Stop` and `SubagentStop` hooks can control whether Claude must continue.


590<Note>877<Note>

591 For `UserPromptSubmit` hooks, you can inject context using either method:878 For `UserPromptSubmit` hooks, you can inject context using either method:

592 879 

593 * Exit code 0 with stdout: Claude sees the context (special case for `UserPromptSubmit`)880 * **Plain text stdout** with exit code 0: Simplest approach—just print text

594 * JSON output: Provides more control over the behavior881 * **JSON output** with exit code 0: Use `"decision": "block"` to reject prompts,

882 or `additionalContext` for structured context injection

883 

884 Remember: Exit code 2 only uses `stderr` for the error message. To block using

885 JSON (with a custom reason), use `"decision": "block"` with exit code 0.

595</Note>886</Note>

596 887 

597```python theme={null}888```python theme={null}


668 output = {959 output = {

669 "decision": "approve",960 "decision": "approve",

670 "reason": "Documentation file auto-approved",961 "reason": "Documentation file auto-approved",

671 "suppressOutput": True # Don't show in transcript mode962 "suppressOutput": True # Don't show in verbose mode

672 }963 }

673 print(json.dumps(output))964 print(json.dumps(output))

674 sys.exit(0)965 sys.exit(0)


680## Working with MCP Tools971## Working with MCP Tools

681 972 

682Claude Code hooks work seamlessly with973Claude Code hooks work seamlessly with

683[Model Context Protocol (MCP) tools](/en/docs/claude-code/mcp). When MCP servers974[Model Context Protocol (MCP) tools](/en/mcp). When MCP servers

684provide tools, they appear with a special naming pattern that you can match in975provide tools, they appear with a special naming pattern that you can match in

685your hooks.976your hooks.

686 977 


726## Examples1017## Examples

727 1018 

728<Tip>1019<Tip>

729 For practical examples including code formatting, notifications, and file protection, see [More Examples](/en/docs/claude-code/hooks-guide#more-examples) in the get started guide.1020 For practical examples including code formatting, notifications, and file protection, see [More Examples](/en/hooks-guide#more-examples) in the get started guide.

730</Tip>1021</Tip>

731 1022 

732## Security Considerations1023## Security Considerations


778* **Environment**: Runs in current directory with Claude Code's environment1069* **Environment**: Runs in current directory with Claude Code's environment

779 * The `CLAUDE_PROJECT_DIR` environment variable is available and contains the1070 * The `CLAUDE_PROJECT_DIR` environment variable is available and contains the

780 absolute path to the project root directory (where Claude Code was started)1071 absolute path to the project root directory (where Claude Code was started)

1072 * The `CLAUDE_CODE_REMOTE` environment variable indicates whether the hook is running in a remote (web) environment (`"true"`) or local CLI environment (not set or empty). Use this to run different logic based on execution context.

781* **Input**: JSON via stdin1073* **Input**: JSON via stdin

782* **Output**:1074* **Output**:

783 * PreToolUse/PostToolUse/Stop/SubagentStop: Progress shown in transcript (Ctrl-R)1075 * PreToolUse/PermissionRequest/PostToolUse/Stop/SubagentStop: Progress shown in verbose mode (ctrl+o)

784 * Notification/SessionEnd: Logged to debug only (`--debug`)1076 * Notification/SessionEnd: Logged to debug only (`--debug`)

785 * UserPromptSubmit/SessionStart: stdout added as context for Claude1077 * UserPromptSubmit/SessionStart: stdout added as context for Claude

786 1078 


829[DEBUG] Hook command completed with status 0: <Your stdout>1121[DEBUG] Hook command completed with status 0: <Your stdout>

830```1122```

831 1123 

832Progress messages appear in transcript mode (Ctrl-R) showing:1124Progress messages appear in verbose mode (ctrl+o) showing:

833 1125 

834* Which hook is running1126* Which hook is running

835* Command being executed1127* Command being executed

836* Success/failure status1128* Success/failure status

837* Output or error messages1129* Output or error messages

1130 

1131 

1132---

1133 

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

hooks-guide.md +12 −6

Details

8the LLM to choose to run them.8the LLM to choose to run them.

9 9 

10<Tip>10<Tip>

11 For reference documentation on hooks, see [Hooks reference](/en/docs/claude-code/hooks).11 For reference documentation on hooks, see [Hooks reference](/en/hooks).

12</Tip>12</Tip>

13 13 

14Example use cases for hooks include:14Example use cases for hooks include:


31 You must consider the security implication of hooks as you add them, because hooks run automatically during the agent loop with your current environment's credentials.31 You must consider the security implication of hooks as you add them, because hooks run automatically during the agent loop with your current environment's credentials.

32 For example, malicious hooks code can exfiltrate your data. Always review your hooks implementation before registering them.32 For example, malicious hooks code can exfiltrate your data. Always review your hooks implementation before registering them.

33 33 

34 For full security best practices, see [Security Considerations](/en/docs/claude-code/hooks#security-considerations) in the hooks reference documentation.34 For full security best practices, see [Security Considerations](/en/hooks#security-considerations) in the hooks reference documentation.

35</Warning>35</Warning>

36 36 

37## Hook Events Overview37## Hook Events Overview


40workflow:40workflow:

41 41 

42* **PreToolUse**: Runs before tool calls (can block them)42* **PreToolUse**: Runs before tool calls (can block them)

43* **PermissionRequest**: Runs when a permission dialog is shown (can allow or deny)

43* **PostToolUse**: Runs after tool calls complete44* **PostToolUse**: Runs after tool calls complete

44* **UserPromptSubmit**: Runs when the user submits a prompt, before Claude processes it45* **UserPromptSubmit**: Runs when the user submits a prompt, before Claude processes it

45* **Notification**: Runs when Claude Code sends notifications46* **Notification**: Runs when Claude Code sends notifications


63 64 

64### Step 1: Open hooks configuration65### Step 1: Open hooks configuration

65 66 

66Run the `/hooks` [slash command](/en/docs/claude-code/slash-commands) and select67Run the `/hooks` [slash command](/en/slash-commands) and select

67the `PreToolUse` hook event.68the `PreToolUse` hook event.

68 69 

69`PreToolUse` hooks run before tool calls and can block them while providing70`PreToolUse` hooks run before tool calls and can block them while providing


326 327 

327## Learn more328## Learn more

328 329 

329* For reference documentation on hooks, see [Hooks reference](/en/docs/claude-code/hooks).330* For reference documentation on hooks, see [Hooks reference](/en/hooks).

330* For comprehensive security best practices and safety guidelines, see [Security Considerations](/en/docs/claude-code/hooks#security-considerations) in the hooks reference documentation.331* For comprehensive security best practices and safety guidelines, see [Security Considerations](/en/hooks#security-considerations) in the hooks reference documentation.

331* For troubleshooting steps and debugging techniques, see [Debugging](/en/docs/claude-code/hooks#debugging) in the hooks reference332* For troubleshooting steps and debugging techniques, see [Debugging](/en/hooks#debugging) in the hooks reference

332 documentation.333 documentation.

334 

335 

336---

337 

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

iam.md +19 −13

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 three ways:7Setting up Claude Code requires access to Anthropic models. For teams, you can set up Claude Code access in one of four ways:

8 8 

9* Claude API via the Claude Console9* Claude API via the Claude Console

10* Amazon Bedrock10* Amazon Bedrock

11* Microsoft Foundry

11* Google Vertex AI12* Google Vertex AI

12 13 

13### Claude API authentication14### Claude API authentication


23 * "Developer" role means users can create any kind of API key24 * "Developer" role means users can create any kind of API key

244. Each invited user needs to complete these steps:254. Each invited user needs to complete these steps:

25 * Accept the Console invite26 * Accept the Console invite

26 * [Check system requirements](/en/docs/claude-code/setup#system-requirements)27 * [Check system requirements](/en/setup#system-requirements)

27 * [Install Claude Code](/en/docs/claude-code/setup#installation)28 * [Install Claude Code](/en/setup#installation)

28 * Login with Console account credentials29 * Login with Console account credentials

29 30 

30### Cloud provider authentication31### Cloud provider authentication

31 32 

32**To set up Claude Code access for your team via Bedrock or Vertex:**33**To set up Claude Code access for your team via Bedrock, Vertex, or Azure:**

33 34 

341. Follow the [Bedrock docs](/en/docs/claude-code/amazon-bedrock) or [Vertex docs](/en/docs/claude-code/google-vertex-ai)351. Follow the [Bedrock docs](/en/amazon-bedrock), [Vertex docs](/en/google-vertex-ai), or [Microsoft Foundry docs](/en/microsoft-foundry)

352. Distribute the environment variables and instructions for generating cloud credentials to your users. Read more about how to [manage configuration here](/en/docs/claude-code/settings).362. Distribute the environment variables and instructions for generating cloud credentials to your users. Read more about how to [manage configuration here](/en/settings).

363. Users can [install Claude Code](/en/docs/claude-code/setup#installation)373. Users can [install Claude Code](/en/setup#installation)

37 38 

38## Access control and permissions39## Access control and permissions

39 40 


65 66 

66#### Permission modes67#### Permission modes

67 68 

68Claude Code supports several permission modes that can be set as the `defaultMode` in [settings files](/en/docs/claude-code/settings#settings-files):69Claude Code supports several permission modes that can be set as the `defaultMode` in [settings files](/en/settings#settings-files):

69 70 

70| Mode | Description |71| Mode | Description |

71| :------------------ | :--------------------------------------------------------------------------- |72| :------------------ | :--------------------------------------------------------------------------- |


80 81 

81* **During startup**: Use `--add-dir <path>` CLI argument82* **During startup**: Use `--add-dir <path>` CLI argument

82* **During session**: Use `/add-dir` slash command83* **During session**: Use `/add-dir` slash command

83* **Persistent configuration**: Add to `additionalDirectories` in [settings files](/en/docs/claude-code/settings#settings-files)84* **Persistent configuration**: Add to `additionalDirectories` in [settings files](/en/settings#settings-files)

84 85 

85Files 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.86Files 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.

86 87 


164 165 

165### Additional permission control with hooks166### Additional permission control with hooks

166 167 

167[Claude Code hooks](/en/docs/claude-code/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.168[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.

168 169 

169### Enterprise managed policy settings170### Enterprise managed policy settings

170 171 


176* Linux and WSL: `/etc/claude-code/managed-settings.json`177* Linux and WSL: `/etc/claude-code/managed-settings.json`

177* Windows: `C:\ProgramData\ClaudeCode\managed-settings.json`178* Windows: `C:\ProgramData\ClaudeCode\managed-settings.json`

178 179 

179These policy files follow the same format as regular [settings files](/en/docs/claude-code/settings#settings-files) but cannot be overridden by user or project settings. This ensures consistent security policies across your organization.180These policy files follow the same format as regular [settings files](/en/settings#settings-files) but cannot be overridden by user or project settings. This ensures consistent security policies across your organization.

180 181 

181### Settings precedence182### Settings precedence

182 183 


195Claude Code securely manages your authentication credentials:196Claude Code securely manages your authentication credentials:

196 197 

197* **Storage location**: On macOS, API keys, OAuth tokens, and other credentials are stored in the encrypted macOS Keychain.198* **Storage location**: On macOS, API keys, OAuth tokens, and other credentials are stored in the encrypted macOS Keychain.

198* **Supported authentication types**: Claude.ai credentials, Claude API credentials, Bedrock Auth, and Vertex Auth.199* **Supported authentication types**: Claude.ai credentials, Claude API credentials, Azure Auth, Bedrock Auth, and Vertex Auth.

199* **Custom credential scripts**: The [`apiKeyHelper`](/en/docs/claude-code/settings#available-settings) setting can be configured to run a shell script that returns an API key.200* **Custom credential scripts**: The [`apiKeyHelper`](/en/settings#available-settings) setting can be configured to run a shell script that returns an API key.

200* **Refresh intervals**: By default, `apiKeyHelper` is called after 5 minutes or on HTTP 401 response. Set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` environment variable for custom refresh intervals.201* **Refresh intervals**: By default, `apiKeyHelper` is called after 5 minutes or on HTTP 401 response. Set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` environment variable for custom refresh intervals.

202 

203 

204---

205 

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

Details

11### General controls11### General controls

12 12 

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

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

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

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

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


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

21| `Up/Down arrows` | Navigate command history | Recall previous inputs |21| `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 |22| `Esc` + `Esc` | Rewind the code/conversation | Restore the code and/or conversation to a previous point |

23| `Tab` | Toggle [extended thinking](/en/docs/build-with-claude/extended-thinking) | Switch between Thinking on and Thinking off |23| `Tab` | Toggle [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) | Switch between Thinking on and Thinking off |

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

25 25 

26### Multiline input26### Multiline input


42| Shortcut | Description | Notes |42| Shortcut | Description | Notes |

43| :----------- | :--------------------------------- | :------------------------------------------------------------ |43| :----------- | :--------------------------------- | :------------------------------------------------------------ |

44| `#` at start | Memory shortcut - add to CLAUDE.md | Prompts for file selection |44| `#` at start | Memory shortcut - add to CLAUDE.md | Prompts for file selection |

45| `/` at start | Slash command | See [slash commands](/en/docs/claude-code/slash-commands) |45| `/` at start | Slash command | See [slash commands](/en/slash-commands) |

46| `!` at start | Bash mode | Run commands directly and add execution output to the session |46| `!` at start | Bash mode | Run commands directly and add execution output to the session |

47| `@` | File path mention | Trigger file path autocomplete |47| `@` | File path mention | Trigger file path autocomplete |

48 48 


162 162 

163## See also163## See also

164 164 

165* [Slash commands](/en/docs/claude-code/slash-commands) - Interactive session commands165* [Slash commands](/en/slash-commands) - Interactive session commands

166* [Checkpointing](/en/docs/claude-code/checkpointing) - Rewind Claude's edits and restore previous states166* [Checkpointing](/en/checkpointing) - Rewind Claude's edits and restore previous states

167* [CLI reference](/en/docs/claude-code/cli-reference) - Command-line flags and options167* [CLI reference](/en/cli-reference) - Command-line flags and options

168* [Settings](/en/docs/claude-code/settings) - Configuration options168* [Settings](/en/settings) - Configuration options

169* [Memory management](/en/docs/claude-code/memory) - Managing CLAUDE.md files169* [Memory management](/en/memory) - Managing CLAUDE.md files

170 

171 

172---

173 

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

jetbrains.md +10 −7

Details

29 29 

30Find and install the [Claude Code plugin](https://plugins.jetbrains.com/plugin/27310-claude-code-beta-) from the JetBrains marketplace and restart your IDE.30Find and install the [Claude Code plugin](https://plugins.jetbrains.com/plugin/27310-claude-code-beta-) from the JetBrains marketplace and restart your IDE.

31 31 

32### Auto-Installation32If you haven't installed Claude Code yet, see [our quickstart guide](/en/quickstart) for installation instructions.

33 

34The plugin may also be auto-installed when you run `claude` in the integrated terminal. The IDE must be restarted completely to take effect.

35 33 

36<Note>34<Note>

37 After installing the plugin, you must restart your IDE completely for it to take effect. You may need to restart multiple times.35 After installing the plugin, you may need to restart your IDE completely for it to take effect.

38</Note>36</Note>

39 37 

40## Usage38## Usage


104### WSL Configuration102### WSL Configuration

105 103 

106<Warning>104<Warning>

107 WSL users may need additional configuration for IDE detection to work properly. See our [WSL troubleshooting guide](/en/docs/claude-code/troubleshooting#jetbrains-ide-not-detected-on-wsl2) for detailed setup instructions.105 WSL users may need additional configuration for IDE detection to work properly. See our [WSL troubleshooting guide](/en/troubleshooting#jetbrains-ide-not-detected-on-wsl2) for detailed setup instructions.

108</Warning>106</Warning>

109 107 

110WSL configuration may require:108WSL configuration may require:


127* Verify the plugin is installed and enabled125* Verify the plugin is installed and enabled

128* Restart the IDE completely126* Restart the IDE completely

129* Check that you're running Claude Code from the integrated terminal127* Check that you're running Claude Code from the integrated terminal

130* For WSL users, see the [WSL troubleshooting guide](/en/docs/claude-code/troubleshooting#jetbrains-ide-not-detected-on-wsl2)128* For WSL users, see the [WSL troubleshooting guide](/en/troubleshooting#jetbrains-ide-not-detected-on-wsl2)

131 129 

132### Command Not Found130### Command Not Found

133 131 


147* Taking extra care to ensure Claude is only used with trusted prompts145* Taking extra care to ensure Claude is only used with trusted prompts

148* Being aware of which files Claude Code has access to modify146* Being aware of which files Claude Code has access to modify

149 147 

150For additional help, see our [troubleshooting guide](/en/docs/claude-code/troubleshooting).148For additional help, see our [troubleshooting guide](/en/troubleshooting).

149 

150 

151---

152 

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

llm-gateway.md +41 −11

Details

1# LLM gateway configuration1# LLM gateway configuration

2 2 

3> Learn how to configure Claude Code with LLM gateway solutions, including LiteLLM setup, authentication methods, and enterprise features like usage tracking and budget management.3> Learn how to configure Claude Code to work with LLM gateway solutions. Covers gateway requirements, authentication configuration, model selection, and provider-specific endpoint setup.

4 4 

5LLM gateways provide a centralized proxy layer between Claude Code and model providers, offering:5LLM gateways provide a centralized proxy layer between Claude Code and model providers, often providing:

6 6 

7* **Centralized authentication** - Single point for API key management7* **Centralized authentication** - Single point for API key management

8* **Usage tracking** - Monitor usage across teams and projects8* **Usage tracking** - Monitor usage across teams and projects


10* **Audit logging** - Track all model interactions for compliance10* **Audit logging** - Track all model interactions for compliance

11* **Model routing** - Switch between providers without code changes11* **Model routing** - Switch between providers without code changes

12 12 

13## Gateway requirements

14 

15For an LLM gateway to work with Claude Code, it must meet the following requirements:

16 

17**API format**

18 

19The gateway must expose to clients at least one of the following API formats:

20 

211. **Anthropic Messages**: `/v1/messages`, `/v1/messages/count_tokens`

22 * Must forward request headers: `anthropic-beta`, `anthropic-version`

23 

242. **Bedrock InvokeModel**: `/invoke`, `/invoke-with-response-stream`

25 * Must preserve request body fields: `anthropic_beta`, `anthropic_version`

26 

273. **Vertex rawPredict**: `:rawPredict`, `:streamRawPredict`, `/count-tokens:rawPredict`

28 * Must forward request headers: `anthropic-beta`, `anthropic-version`

29 

30Failure to forward headers or preserve body fields may result in reduced functionality or inability to use Claude Code features.

31 

32<Note>

33 Claude Code determines which features to enable based on the API format. When using the Anthropic Messages format with Bedrock or Vertex, you may need to set environment variable `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`.

34</Note>

35 

36## Configuration

37 

38### Model selection

39 

40By default, Claude Code will use standard model names for the selected API format.

41 

42If you have configured custom model names in your gateway, use the environment variables documented in [Model configuration](/en/model-config) to match your custom names.

43 

13## LiteLLM configuration44## LiteLLM configuration

14 45 

15<Note>46<Note>


129export CLOUD_ML_REGION=us-east5160export CLOUD_ML_REGION=us-east5

130```161```

131 162 

132### Model selection

133 

134By default, the models will use those specified in [Model configuration](/en/docs/claude-code/bedrock-vertex-proxies#model-configuration).

135 

136If you have configured custom model names in LiteLLM, set the aforementioned environment variables to those custom names.

137 

138For more detailed information, refer to the [LiteLLM documentation](https://docs.litellm.ai/).163For more detailed information, refer to the [LiteLLM documentation](https://docs.litellm.ai/).

139 164 

140## Additional resources165## Additional resources

141 166 

142* [LiteLLM documentation](https://docs.litellm.ai/)167* [LiteLLM documentation](https://docs.litellm.ai/)

143* [Claude Code settings](/en/docs/claude-code/settings)168* [Claude Code settings](/en/settings)

144* [Enterprise network configuration](/en/docs/claude-code/network-config)169* [Enterprise network configuration](/en/network-config)

145* [Third-party integrations overview](/en/docs/claude-code/third-party-integrations)170* [Third-party integrations overview](/en/third-party-integrations)

171 

172 

173---

174 

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

mcp.md +174 −5

Details

140 139 

141### Plugin-provided MCP servers140### Plugin-provided MCP servers

142 141 

143[Plugins](/en/docs/claude-code/plugins) can bundle MCP servers, automatically providing tools and integrations when the plugin is enabled. Plugin MCP servers work identically to user-configured servers.142[Plugins](/en/plugins) can bundle MCP servers, automatically providing tools and integrations when the plugin is enabled. Plugin MCP servers work identically to user-configured servers.

144 143 

145**How plugin MCP servers work**:144**How plugin MCP servers work**:

146 145 


201* **Automatic setup**: No manual MCP configuration needed200* **Automatic setup**: No manual MCP configuration needed

202* **Team consistency**: Everyone gets the same tools when plugin is installed201* **Team consistency**: Everyone gets the same tools when plugin is installed

203 202 

204See the [plugin components reference](/en/docs/claude-code/plugins-reference#mcp-servers) for details on bundling MCP servers with plugins.203See the [plugin components reference](/en/plugins-reference#mcp-servers) for details on bundling MCP servers with plugins.

205 204 

206## MCP installation scopes205## MCP installation scopes

207 206 


209 208 

210### Local scope209### Local scope

211 210 

212Local-scoped servers represent the default configuration level and are stored in your project-specific user settings. These servers remain private to you and are only accessible when working within the current project directory. This scope is ideal for personal development servers, experimental configurations, or servers containing sensitive credentials that shouldn't be shared.211Local-scoped servers represent the default configuration level and are stored in `~/.claude.json` under your project's path. These servers remain private to you and are only accessible when working within the current project directory. This scope is ideal for personal development servers, experimental configurations, or servers containing sensitive credentials that shouldn't be shared.

213 212 

214```bash theme={null}213```bash theme={null}

215# Add a local-scoped server (default)214# Add a local-scoped server (default)


246 245 

247### User scope246### User scope

248 247 

249User-scoped servers provide cross-project accessibility, making them available across all projects on your machine while remaining private to your user account. This scope works well for personal utility servers, development tools, or services you frequently use across different projects.248User-scoped servers are stored in `~/.claude.json` and provide cross-project accessibility, making them available across all projects on your machine while remaining private to your user account. This scope works well for personal utility servers, development tools, or services you frequently use across different projects.

250 249 

251```bash theme={null}250```bash theme={null}

252# Add a user server251# Add a user server


261* **Project scope**: Team-shared servers, project-specific tools, or services required for collaboration260* **Project scope**: Team-shared servers, project-specific tools, or services required for collaboration

262* **User scope**: Personal utilities needed across multiple projects, development tools, or frequently-used services261* **User scope**: Personal utilities needed across multiple projects, development tools, or frequently-used services

263 262 

263<Note>

264 **Where are MCP servers stored?**

265 

266 * **User and local scope**: `~/.claude.json` (in the `mcpServers` field or under project paths)

267 * **Project scope**: `.mcp.json` in your project root (checked into source control)

268 * **Enterprise managed**: `managed-mcp.json` in system directories (see [Enterprise MCP configuration](#enterprise-mcp-configuration))

269</Note>

270 

264### Scope hierarchy and precedence271### Scope hierarchy and precedence

265 272 

266MCP server configurations follow a clear precedence hierarchy. When servers with the same name exist at multiple scopes, the system resolves conflicts by prioritizing local-scoped servers first, followed by project-scoped servers, and finally user-scoped servers. This design ensures that personal configurations can override shared ones when needed.273MCP server configurations follow a clear precedence hierarchy. When servers with the same name exist at multiple scopes, the system resolves conflicts by prioritizing local-scoped servers first, followed by project-scoped servers, and finally user-scoped servers. This design ensures that personal configurations can override shared ones when needed.


482}489}

483```490```

484 491 

492<Warning>

493 **Configuring the executable path**: The `command` field must reference the Claude Code executable. If the `claude` command is not in your system's PATH, you'll need to specify the full path to the executable.

494 

495 To find the full path:

496 

497 ```bash theme={null}

498 which claude

499 ```

500 

501 Then use the full path in your configuration:

502 

503 ```json theme={null}

504 {

505 "mcpServers": {

506 "claude-code": {

507 "type": "stdio",

508 "command": "/full/path/to/claude",

509 "args": ["mcp", "serve"],

510 "env": {}

511 }

512 }

513 }

514 ```

515 

516 Without the correct executable path, you'll encounter errors like `spawn claude ENOENT`.

517</Warning>

518 

485<Tip>519<Tip>

486 Tips:520 Tips:

487 521 


637}671}

638```672```

639 673 

674### Restricting MCP servers with allowlists and denylists

675 

676In addition to providing enterprise-managed servers, administrators can control which MCP servers users are allowed to configure using `allowedMcpServers` and `deniedMcpServers` in the `managed-settings.json` file:

677 

678* **macOS**: `/Library/Application Support/ClaudeCode/managed-settings.json`

679* **Windows**: `C:\ProgramData\ClaudeCode\managed-settings.json`

680* **Linux**: `/etc/claude-code/managed-settings.json`

681 

682#### Restriction options

683 

684Each entry in the allowlist or denylist can restrict servers in two ways:

685 

6861. **By server name** (`serverName`): Matches the configured name of the server

6872. **By command** (`serverCommand`): Matches the exact command and arguments used to start stdio servers

688 

689**Important**: Each entry must have **either** `serverName` **or** `serverCommand`, not both.

690 

691#### Example configuration

692 

693```json theme={null}

694{

695 "allowedMcpServers": [

696 // Allow by server name

697 { "serverName": "github" },

698 { "serverName": "sentry" },

699 

700 // Allow by exact command (for stdio servers)

701 { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] },

702 { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] }

703 ],

704 "deniedMcpServers": [

705 // Block by server name

706 { "serverName": "dangerous-server" },

707 

708 // Block by exact command (for stdio servers)

709 { "serverCommand": ["npx", "-y", "unapproved-package"] }

710 ]

711}

712```

713 

714#### How command-based restrictions work

715 

716**Exact matching**:

717 

718* Command arrays must match **exactly** - both the command and all arguments in the correct order

719* Example: `["npx", "-y", "server"]` will NOT match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`

720 

721**Stdio server behavior**:

722 

723* When the allowlist contains **any** `serverCommand` entries, stdio servers **must** match one of those commands

724* Stdio servers cannot pass by name alone when command restrictions are present

725* This ensures administrators can enforce which commands are allowed to run

726 

727**Non-stdio server behavior**:

728 

729* Remote servers (HTTP, SSE, WebSocket) always match by name only

730* Command restrictions do not apply to remote servers

731 

732<Accordion title="Example: Command-only allowlist">

733 ```json theme={null}

734 {

735 "allowedMcpServers": [

736 { "serverCommand": ["npx", "-y", "approved-package"] }

737 ]

738 }

739 ```

740 

741 **Result**:

742 

743 * Stdio server with `["npx", "-y", "approved-package"]`: ✅ Allowed (matches command)

744 * Stdio server with `["node", "server.js"]`: ❌ Blocked (doesn't match command)

745 * HTTP server named "my-api": ❌ Blocked (no name entries to match)

746</Accordion>

747 

748<Accordion title="Example: Mixed name and command allowlist">

749 ```json theme={null}

750 {

751 "allowedMcpServers": [

752 { "serverName": "github" },

753 { "serverCommand": ["npx", "-y", "approved-package"] }

754 ]

755 }

756 ```

757 

758 **Result**:

759 

760 * Stdio server named "local-tool" with `["npx", "-y", "approved-package"]`: ✅ Allowed (matches command)

761 * Stdio server named "local-tool" with `["node", "server.js"]`: ❌ Blocked (command entries exist but doesn't match)

762 * Stdio server named "github" with `["node", "server.js"]`: ❌ Blocked (stdio servers must match commands when command entries exist)

763 * HTTP server named "github": ✅ Allowed (matches name)

764 * HTTP server named "other-api": ❌ Blocked (name doesn't match)

765</Accordion>

766 

767<Accordion title="Example: Name-only allowlist">

768 ```json theme={null}

769 {

770 "allowedMcpServers": [

771 { "serverName": "github" },

772 { "serverName": "internal-tool" }

773 ]

774 }

775 ```

776 

777 **Result**:

778 

779 * Stdio server named "github" with any command: ✅ Allowed (no command restrictions)

780 * Stdio server named "internal-tool" with any command: ✅ Allowed (no command restrictions)

781 * HTTP server named "github": ✅ Allowed (matches name)

782 * Any server named "other": ❌ Blocked (name doesn't match)

783</Accordion>

784 

785#### Allowlist behavior (`allowedMcpServers`)

786 

787* `undefined` (default): No restrictions - users can configure any MCP server

788* Empty array `[]`: Complete lockdown - users cannot configure any MCP servers

789* List of entries: Users can only configure servers that match by name or command

790 

791#### Denylist behavior (`deniedMcpServers`)

792 

793* `undefined` (default): No servers are blocked

794* Empty array `[]`: No servers are blocked

795* List of entries: Specified servers are explicitly blocked across all scopes

796 

797#### Important notes

798 

799* These restrictions apply to all scopes: user, project, local, and even enterprise servers from `managed-mcp.json`

800* **Denylist takes absolute precedence**: If a server matches a denylist entry (by name or command), it will be blocked even if it's on the allowlist

801* Name-based and command-based restrictions work together: a server passes if it matches **either** a name entry **or** a command entry (unless blocked by denylist)

802 

640<Note>803<Note>

641 **Enterprise configuration precedence**: The enterprise MCP configuration has the highest precedence and cannot be overridden by user, local, or project configurations when `useEnterpriseMcpConfigOnly` is enabled.804 **Enterprise configuration precedence**: The enterprise MCP configuration has the highest precedence and cannot be overridden by user, local, or project configurations.

642</Note>805</Note>

806 

807 

808---

809 

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

memory.md +11 −2

Details

13| **Enterprise policy** | macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md`<br />Linux: `/etc/claude-code/CLAUDE.md`<br />Windows: `C:\ProgramData\ClaudeCode\CLAUDE.md` | Organization-wide instructions managed by IT/DevOps | Company coding standards, security policies, compliance requirements | All users in organization |13| **Enterprise policy** | macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md`<br />Linux: `/etc/claude-code/CLAUDE.md`<br />Windows: `C:\ProgramData\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| **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |15| **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |

16| **Project memory (local)** | `./CLAUDE.local.md` | Personal project-specific preferences | *(Deprecated, see below)* Your sandbox URLs, preferred test data | Just you (current project) |16| **Project memory (local)** | `./CLAUDE.local.md` | Personal project-specific preferences | Your sandbox URLs, preferred test data | Just you (current project) |

17 17 

18All memory files are automatically loaded into Claude Code's context when launched. Files higher in the hierarchy take precedence and are loaded first, providing a foundation that more specific memories build upon.18All memory files are automatically loaded into Claude Code's context when launched. Files higher in the hierarchy take precedence and are loaded first, providing a foundation that more specific memories build upon.

19 19 

20<Note>

21 CLAUDE.local.md files are automatically added to .gitignore, making them ideal for private project-specific preferences that shouldn't be checked into version control.

22</Note>

23 

20## CLAUDE.md imports24## CLAUDE.md imports

21 25 

22CLAUDE.md files can import additional files using `@path/to/import` syntax. The following example imports 3 files:26CLAUDE.md files can import additional files using `@path/to/import` syntax. The following example imports 3 files:


28- git workflow @docs/git-instructions.md32- git workflow @docs/git-instructions.md

29```33```

30 34 

31Both relative and absolute paths are allowed. In particular, importing files in user's home dir is a convenient way for your team members to provide individual instructions that are not checked into the repository. Previously CLAUDE.local.md served a similar purpose, but is now deprecated in favor of imports since they work better across multiple git worktrees.35Both relative and absolute paths are allowed. In particular, importing files in user's home dir is a convenient way for your team members to provide individual instructions that are not checked into the repository. Imports are an alternative to CLAUDE.local.md that work better across multiple git worktrees.

32 36 

33```37```

34# Individual Preferences38# Individual Preferences


101* **Be specific**: "Use 2-space indentation" is better than "Format code properly".105* **Be specific**: "Use 2-space indentation" is better than "Format code properly".

102* **Use structure to organize**: Format each individual memory as a bullet point and group related memories under descriptive markdown headings.106* **Use structure to organize**: Format each individual memory as a bullet point and group related memories under descriptive markdown headings.

103* **Review periodically**: Update memories as your project evolves to ensure Claude is always using the most up to date information and context.107* **Review periodically**: Update memories as your project evolves to ensure Claude is always using the most up to date information and context.

108 

109 

110---

111 

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

microsoft-foundry.md +112 −0 added

Details

1# Claude Code on Microsoft Foundry

2 

3> Learn about configuring Claude Code through Microsoft Foundry, including setup, configuration, and troubleshooting.

4 

5## Prerequisites

6 

7Before configuring Claude Code with Microsoft Foundry, ensure you have:

8 

9* An Azure subscription with access to Microsoft Foundry

10* RBAC permissions to create Microsoft Foundry resources and deployments

11* Azure CLI installed and configured (optional - only needed if you don't have another mechanism for getting credentials)

12 

13## Setup

14 

15### 1. Provision Microsoft Foundry resource

16 

17First, create a Claude resource in Azure:

18 

191. Navigate to the [Microsoft Foundry portal](https://ai.azure.com/)

202. Create a new resource, noting your resource name

213. Create deployments for the Claude models:

22 * Claude Opus

23 * Claude Sonnet

24 * Claude Haiku

25 

26### 2. Configure Azure credentials

27 

28Claude Code supports two authentication methods for Microsoft Foundry. Choose the method that best fits your security requirements.

29 

30**Option A: API key authentication**

31 

321. Navigate to your resource in the Microsoft Foundry portal

332. Go to the **Endpoints and keys** section

343. Copy **API Key**

354. Set the environment variable:

36 

37```bash theme={null}

38export ANTHROPIC_FOUNDRY_API_KEY=your-azure-api-key

39```

40 

41**Option B: Microsoft Entra ID authentication**

42 

43When `ANTHROPIC_FOUNDRY_API_KEY` is not set, Claude Code automatically uses the Azure SDK [default credential chain](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview).

44This supports a variety of methods for authenticating local and remote workloads.

45 

46On local environments, you commonly may use the Azure CLI:

47 

48```bash theme={null}

49az login

50```

51 

52<Note>

53 When using Microsoft Foundry, the `/login` and `/logout` commands are disabled since authentication is handled through Azure credentials.

54</Note>

55 

56### 3. Configure Claude Code

57 

58Set the following environment variables to enable Microsoft Foundry. Note that your deployments' names are set as the model identifiers in Claude Code (may be optional if using suggested deployment names).

59 

60```bash theme={null}

61# Enable Microsoft Foundry integration

62export CLAUDE_CODE_USE_FOUNDRY=1

63 

64# Azure resource name (replace {resource} with your resource name)

65export ANTHROPIC_FOUNDRY_RESOURCE={resource}

66# Or provide the full base URL:

67# export ANTHROPIC_FOUNDRY_BASE_URL=https://{resource}.services.ai.azure.com

68 

69# Set models to your resource's deployment names

70export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-5'

71export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'

72export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-1'

73```

74 

75For more details on model configuration options, see [Model configuration](/en/model-config).

76 

77## Azure RBAC configuration

78 

79The `Azure AI User` and `Cognitive Services User` default roles include all required permissions for invoking Claude models.

80 

81For more restrictive permissions, create a custom role with the following:

82 

83```json theme={null}

84{

85 "permissions": [

86 {

87 "dataActions": [

88 "Microsoft.CognitiveServices/accounts/providers/*"

89 ]

90 }

91 ]

92}

93```

94 

95For details, see [Microsoft Foundry RBAC documentation](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/rbac-azure-ai-foundry).

96 

97## Troubleshooting

98 

99If you receive an error "Failed to get token from azureADTokenProvider: ChainedTokenCredential authentication failed":

100 

101* Configure Entra ID on the environment, or set `ANTHROPIC_FOUNDRY_API_KEY`.

102 

103## Additional resources

104 

105* [Microsoft Foundry documentation](https://learn.microsoft.com/en-us/azure/ai-foundry/what-is-azure-ai-foundry)

106* [Microsoft Foundry models](https://ai.azure.com/explore/models)

107* [Microsoft Foundry pricing](https://azure.microsoft.com/en-us/pricing/details/ai-foundry/)

108 

109 

110---

111 

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

model-config.md +22 −14

Details

4 4 

5## Available models5## Available models

6 6 

7For the `model` setting in Claude Code, you can either configure:7For the `model` setting in Claude Code, you can configure either:

8 8 

9* A **model alias**9* A **model alias**

10* A full **[model name](/en/docs/about-claude/models/overview#model-names)**10* A **model name**

11* For Bedrock, an ARN11 * Anthropic API: A full **[model name](https://docs.claude.com/en/docs/about-claude/models/overview#model-names)**

12 * Bedrock: an inference profile ARN

13 * Foundry: a deployment name

14 * Vertex: a version name

12 15 

13### Model aliases16### Model aliases

14 17 


16remembering exact version numbers:19remembering exact version numbers:

17 20 

18| Model alias | Behavior |21| Model alias | Behavior |

19| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |22| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

20| **`default`** | Recommended model setting, depending on your account type |23| **`default`** | Recommended model setting, depending on your account type |

21| **`sonnet`** | Uses the latest Sonnet model (currently Sonnet 4.5) for daily coding tasks |24| **`sonnet`** | Uses the latest Sonnet model (currently Sonnet 4.5) for daily coding tasks |

22| **`opus`** | Uses Opus model (currently Opus 4.1) for specialized complex reasoning tasks |25| **`opus`** | Uses Opus model (currently Opus 4.5) for specialized complex reasoning tasks |

23| **`haiku`** | Uses the fast and efficient Haiku model for simple tasks |26| **`haiku`** | Uses the fast and efficient Haiku model for simple tasks |

24| **`sonnet[1m]`** | Uses Sonnet with a [1 million token context window](/en/docs/build-with-claude/context-windows#1m-token-context-window) window for long sessions |27| **`sonnet[1m]`** | Uses Sonnet with a [1 million token context window](https://docs.claude.com/en/docs/build-with-claude/context-windows#1m-token-context-window) window for long sessions |

25| **`opusplan`** | Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution |28| **`opusplan`** | Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution |

26 29 

27### Setting your model30### Setting your model


80 83 

81For Console/API users, the `[1m]` suffix can be added to full model names to84For Console/API users, the `[1m]` suffix can be added to full model names to

82enable a85enable a

83[1 million token context window](/en/docs/build-with-claude/context-windows#1m-token-context-window).86[1 million token context window](https://docs.claude.com/en/docs/build-with-claude/context-windows#1m-token-context-window).

84 87 

85```bash theme={null}88```bash theme={null}

86# Example of using a full model name with the [1m] suffix89# Example of using a full model name with the [1m] suffix


88```91```

89 92 

90Note: Extended context models have93Note: Extended context models have

91[different pricing](/en/docs/about-claude/pricing#long-context-pricing).94[different pricing](https://docs.claude.com/en/docs/about-claude/pricing#long-context-pricing).

92 95 

93## Checking your current model96## Checking your current model

94 97 

95You can see which model you're currently using in several ways:98You can see which model you're currently using in several ways:

96 99 

971. In [status line](/en/docs/claude-code/statusline) (if configured)1001. In [status line](/en/statusline) (if configured)

982. In `/status`, which also displays your account information.1012. In `/status`, which also displays your account information.

99 102 

100## Environment variables103## Environment variables

101 104 

102You can use the following environment variables, which must be full **model105You can use the following environment variables, which must be full **model

103names**, to control the model names that the aliases map to.106names** (or equivalent for your API provider), to control the model names that the aliases map to.

104 107 

105| Env var | Description |108| Env var | Description |

106| -------------------------------- | -------------------------------------------------------------------------------------------------------------- |109| -------------------------------- | --------------------------------------------------------------------------------------------- |

107| `ANTHROPIC_DEFAULT_OPUS_MODEL` | The model to use for `opus`, or for `opusplan` when Plan Mode is active. |110| `ANTHROPIC_DEFAULT_OPUS_MODEL` | The model to use for `opus`, or for `opusplan` when Plan Mode is active. |

108| `ANTHROPIC_DEFAULT_SONNET_MODEL` | The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. |111| `ANTHROPIC_DEFAULT_SONNET_MODEL` | The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. |

109| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | The model to use for `haiku`, or [background functionality](/en/docs/claude-code/costs#background-token-usage) |112| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | The model to use for `haiku`, or [background functionality](/en/costs#background-token-usage) |

110| `CLAUDE_CODE_SUBAGENT_MODEL` | The model to use for [subagents](/en/docs/claude-code/sub-agents) |113| `CLAUDE_CODE_SUBAGENT_MODEL` | The model to use for [subagents](/en/sub-agents) |

111 114 

112Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of115Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of

113`ANTHROPIC_DEFAULT_HAIKU_MODEL`.116`ANTHROPIC_DEFAULT_HAIKU_MODEL`.

114 117 

115### Prompt caching configuration118### Prompt caching configuration

116 119 

117Claude Code automatically uses [prompt caching](/en/docs/build-with-claude/prompt-caching) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers:120Claude Code automatically uses [prompt caching](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers:

118 121 

119| Env var | Description |122| Env var | Description |

120| ------------------------------- | ---------------------------------------------------------------------------------------------- |123| ------------------------------- | ---------------------------------------------------------------------------------------------- |


124| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models only |127| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models only |

125 128 

126These environment variables give you fine-grained control over prompt caching behavior. The global `DISABLE_PROMPT_CACHING` setting takes precedence over the model-specific settings, allowing you to quickly disable all caching when needed. The per-model settings are useful for selective control, such as when debugging specific models or working with cloud providers that may have different caching implementations.129These environment variables give you fine-grained control over prompt caching behavior. The global `DISABLE_PROMPT_CACHING` setting takes precedence over the model-specific settings, allowing you to quickly disable all caching when needed. The per-model settings are useful for selective control, such as when debugging specific models or working with cloud providers that may have different caching implementations.

130 

131 

132---

133 

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

Details

6 6 

7All metrics are time series data exported via OpenTelemetry's standard metrics protocol, and events are exported via OpenTelemetry's logs/events protocol. It is the user's responsibility to ensure their metrics and logs backends are properly configured and that the aggregation granularity meets their monitoring requirements.7All metrics are time series data exported via OpenTelemetry's standard metrics protocol, and events are exported via OpenTelemetry's logs/events protocol. It is the user's responsibility to ensure their metrics and logs backends are properly configured and that the aggregation granularity meets their monitoring requirements.

8 8 

9<Note>

10 OpenTelemetry support is currently in beta and details are subject to change.

11</Note>

12 

13## Quick Start9## Quick Start

14 10 

15Configure OpenTelemetry using environment variables:11Configure OpenTelemetry using environment variables:


45 41 

46## Administrator Configuration42## Administrator Configuration

47 43 

48Administrators can configure OpenTelemetry settings for all users through the managed settings file. This allows for centralized control of telemetry settings across an organization. See the [settings precedence](/en/docs/claude-code/settings#settings-precedence) for more information about how settings are applied.44Administrators can configure OpenTelemetry settings for all users through the managed settings file. This allows for centralized control of telemetry settings across an organization. See the [settings precedence](/en/settings#settings-precedence) for more information about how settings are applied.

49 45 

50The managed settings file is located at:46The managed settings file is located at:

51 47 


295**Attributes**:291**Attributes**:

296 292 

297* All [standard attributes](#standard-attributes)293* All [standard attributes](#standard-attributes)

298* `model`: Model identifier (e.g., "claude-3-5-sonnet-20241022")294* `model`: Model identifier (e.g., "claude-sonnet-4-5-20250929")

299 295 

300#### Token Counter296#### Token Counter

301 297 


305 301 

306* All [standard attributes](#standard-attributes)302* All [standard attributes](#standard-attributes)

307* `type`: (`"input"`, `"output"`, `"cacheRead"`, `"cacheCreation"`)303* `type`: (`"input"`, `"output"`, `"cacheRead"`, `"cacheCreation"`)

308* `model`: Model identifier (e.g., "claude-3-5-sonnet-20241022")304* `model`: Model identifier (e.g., "claude-sonnet-4-5-20250929")

309 305 

310#### Code Edit Tool Decision Counter306#### Code Edit Tool Decision Counter

311 307 


375* All [standard attributes](#standard-attributes)371* All [standard attributes](#standard-attributes)

376* `event.name`: `"api_request"`372* `event.name`: `"api_request"`

377* `event.timestamp`: ISO 8601 timestamp373* `event.timestamp`: ISO 8601 timestamp

378* `model`: Model used (e.g., "claude-3-5-sonnet-20241022")374* `model`: Model used (e.g., "claude-sonnet-4-5-20250929")

379* `cost_usd`: Estimated cost in USD375* `cost_usd`: Estimated cost in USD

380* `duration_ms`: Request duration in milliseconds376* `duration_ms`: Request duration in milliseconds

381* `input_tokens`: Number of input tokens377* `input_tokens`: Number of input tokens


394* All [standard attributes](#standard-attributes)390* All [standard attributes](#standard-attributes)

395* `event.name`: `"api_error"`391* `event.name`: `"api_error"`

396* `event.timestamp`: ISO 8601 timestamp392* `event.timestamp`: ISO 8601 timestamp

397* `model`: Model used (e.g., "claude-3-5-sonnet-20241022")393* `model`: Model used (e.g., "claude-sonnet-4-5-20250929")

398* `error`: Error message394* `error`: Error message

399* `status_code`: HTTP status code (if applicable)395* `status_code`: HTTP status code (if applicable)

400* `duration_ms`: Request duration in milliseconds396* `duration_ms`: Request duration in milliseconds


505## Monitoring Claude Code on Amazon Bedrock501## Monitoring Claude Code on Amazon Bedrock

506 502 

507For detailed Claude Code usage monitoring guidance for Amazon Bedrock, see [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md).503For detailed Claude Code usage monitoring guidance for Amazon Bedrock, see [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md).

504 

505 

506---

507 

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

Details

5Claude Code supports various enterprise network and security configurations through environment variables. This includes routing traffic through corporate proxy servers, trusting custom Certificate Authorities (CA), and authenticating with mutual Transport Layer Security (mTLS) certificates for enhanced security.5Claude Code supports various enterprise network and security configurations through environment variables. This includes routing traffic through corporate proxy servers, trusting custom Certificate Authorities (CA), and authenticating with mutual Transport Layer Security (mTLS) certificates for enhanced security.

6 6 

7<Note>7<Note>

8 All environment variables shown on this page can also be configured in [`settings.json`](/en/docs/claude-code/settings).8 All environment variables shown on this page can also be configured in [`settings.json`](/en/settings).

9</Note>9</Note>

10 10 

11## Proxy configuration11## Proxy configuration


85 85 

86## Additional resources86## Additional resources

87 87 

88* [Claude Code settings](/en/docs/claude-code/settings)88* [Claude Code settings](/en/settings)

89* [Environment variables reference](/en/docs/claude-code/settings#environment-variables)89* [Environment variables reference](/en/settings#environment-variables)

90* [Troubleshooting guide](/en/docs/claude-code/troubleshooting)90* [Troubleshooting guide](/en/troubleshooting)

91 

92 

93---

94 

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

output-styles.md +38 −23

Details

27 27 

28Output styles directly modify Claude Code's system prompt.28Output styles directly modify Claude Code's system prompt.

29 29 

30* Non-default output styles exclude instructions specific to code generation and30* All output styles exclude instructions for efficient output (such as

31 efficient output normally built into Claude Code (such as responding concisely31 responding concisely).

32 and verifying code with tests).32* Custom output styles exclude instructions for coding (such as verifying code

33* Instead, these output styles have their own custom instructions added to the33 with tests), unless `keep-coding-instructions` is true.

34* All output styles have their own custom instructions added to the end of the

34 system prompt.35 system prompt.

36* All output styles trigger reminders for Claude to adhere to the output style

37 instructions during the conversation.

35 38 

36## Change your output style39## Change your output style

37 40 

38You can either:41You can either:

39 42 

40* Run `/output-style` to access the menu and select your output style (this can43* Run `/output-style` to access a menu and select your output style (this can

41 also be accessed from the `/config` menu)44 also be accessed from the `/config` menu)

42 45 

43* Run `/output-style [style]`, such as `/output-style explanatory`, to directly46* Run `/output-style [style]`, such as `/output-style explanatory`, to directly

44 switch to a style47 switch to a style

45 48 

46These changes apply to the [local project level](/en/docs/claude-code/settings)49These changes apply to the [local project level](/en/settings) and are saved in

47and are saved in `.claude/settings.local.json`.50`.claude/settings.local.json`. You can also directly edit the `outputStyle`

51field in a settings file at a different level.

48 52 

49## Create a custom output style53## Create a custom output style

50 54 

51To set up a new output style with Claude's help, run55Custom output styles are Markdown files with frontmatter and the text that will

52`/output-style:new I want an output style that ...`56be added to the system prompt:

53 

54By default, output styles created through `/output-style:new` are saved as

55markdown files at the user level in `~/.claude/output-styles` and can be used

56across projects. They have the following structure:

57 57 

58```markdown theme={null}58```markdown theme={null}

59---59---


72[Define how the assistant should behave in this style...]72[Define how the assistant should behave in this style...]

73```73```

74 74 

75You can also create your own output style Markdown files and save them either at75You can save these files at the user level (`~/.claude/output-styles`) or

76the user level (`~/.claude/output-styles`) or the project level76project level (`.claude/output-styles`).

77(`.claude/output-styles`).77 

78### Frontmatter

79 

80Output style files support frontmatter, useful for specifying metadata about the

81command:

82 

83| Frontmatter | Purpose | Default |

84| :------------------------- | :-------------------------------------------------------------------------- | :---------------------- |

85| `name` | Name of the output style, if not the file name | Inherits from file name |

86| `description` | Description of the output style. Used only in the UI of `/output-style` | None |

87| `keep-coding-instructions` | Whether to keep the parts of Claude Code's system prompt related to coding. | false |

78 88 

79## Comparisons to related features89## Comparisons to related features

80 90 

81### Output Styles vs. CLAUDE.md vs. --append-system-prompt91### Output Styles vs. CLAUDE.md vs. --append-system-prompt

82 92 

83Output styles completely turn off the parts of Claude Codes default system93Output styles completely "turn off" the parts of Claude Code's default system

84prompt specific to software engineering. Neither CLAUDE.md nor94prompt specific to software engineering. Neither CLAUDE.md nor

85`--append-system-prompt` edit Claude Codes default system prompt. CLAUDE.md95`--append-system-prompt` edit Claude Code's default system prompt. CLAUDE.md

86adds the contents as a user message *following* Claude Codes default system96adds the contents as a user message *following* Claude Code's default system

87prompt. `--append-system-prompt` appends the content to the system prompt.97prompt. `--append-system-prompt` appends the content to the system prompt.

88 98 

89### Output Styles vs. [Agents](/en/docs/claude-code/sub-agents)99### Output Styles vs. [Agents](/en/sub-agents)

90 100 

91Output styles directly affect the main agent loop and only affect the system101Output styles directly affect the main agent loop and only affect the system

92prompt. Agents are invoked to handle specific tasks and can include additional102prompt. Agents are invoked to handle specific tasks and can include additional

93settings 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

94about when to use the agent.104about when to use the agent.

95 105 

96### Output Styles vs. [Custom Slash Commands](/en/docs/claude-code/slash-commands)106### Output Styles vs. [Custom Slash Commands](/en/slash-commands)

107 

108You can think of output styles as "stored system prompts" and custom slash

109commands as "stored prompts".

110 

111 

112---

97 113 

98You can think of output styles as “stored system prompts” and custom slash114> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://code.claude.com/docs/llms.txt

99commands as “stored prompts”.

overview.md +58 −23

Details

6 6 

7Prerequisites:7Prerequisites:

8 8 

9* [Node.js 18 or newer](https://nodejs.org/en/download/)

10* A [Claude.ai](https://claude.ai) (recommended) or [Claude Console](https://console.anthropic.com/) account9* A [Claude.ai](https://claude.ai) (recommended) or [Claude Console](https://console.anthropic.com/) account

11 10 

12```bash theme={null}11**Install Claude Code:**

13# Install Claude Code12 

14npm install -g @anthropic-ai/claude-code13<Tabs>

14 <Tab title="macOS/Linux">

15 ```bash theme={null}

16 curl -fsSL https://claude.ai/install.sh | bash

17 ```

18 </Tab>

19 

20 <Tab title="Homebrew">

21 ```bash theme={null}

22 brew install --cask claude-code

23 ```

24 </Tab>

25 

26 <Tab title="Windows">

27 ```powershell theme={null}

28 irm https://claude.ai/install.ps1 | iex

29 ```

30 </Tab>

31 

32 <Tab title="NPM">

33 ```bash theme={null}

34 npm install -g @anthropic-ai/claude-code

35 ```

36 

37 Requires [Node.js 18+](https://nodejs.org/en/download/)

38 </Tab>

39</Tabs>

15 40 

16# Navigate to your project41**Start using Claude Code:**

17cd your-awesome-project

18 42 

19# Start coding with Claude43```bash theme={null}

44cd your-project

20claude45claude

21# You'll be prompted to log in on first use

22```46```

23 47 

24That's it! You're ready to start coding with Claude. [Continue with Quickstart (5 mins) →](/en/docs/claude-code/quickstart)48You'll be prompted to log in on first use. That's it! [Continue with Quickstart (5 mins) →](/en/quickstart)

25 49 

26(Got specific setup needs or hit issues? See [advanced setup](/en/docs/claude-code/setup) or [troubleshooting](/en/docs/claude-code/troubleshooting).)50<Tip>

51 See [advanced setup](/en/setup) for installation options or [troubleshooting](/en/troubleshooting) if you hit issues.

52</Tip>

27 53 

28<Note>54<Note>

29 **New VS Code Extension (Beta)**: Prefer a graphical interface? Our new [VS Code extension](/en/docs/claude-code/vs-code) provides an easy-to-use native IDE experience without requiring terminal familiarity. Simply install from the marketplace and start coding with Claude directly in your sidebar.55 **New VS Code Extension (Beta)**: Prefer a graphical interface? Our new [VS Code extension](/en/vs-code) provides an easy-to-use native IDE experience without requiring terminal familiarity. Simply install from the marketplace and start coding with Claude directly in your sidebar.

30</Note>56</Note>

31 57 

32## What Claude Code does for you58## What Claude Code does for you

33 59 

34* **Build features from descriptions**: Tell Claude what you want to build in plain English. It will make a plan, write the code, and ensure it works.60* **Build features from descriptions**: Tell Claude what you want to build in plain English. It will make a plan, write the code, and ensure it works.

35* **Debug and fix issues**: Describe a bug or paste an error message. Claude Code will analyze your codebase, identify the problem, and implement a fix.61* **Debug and fix issues**: Describe a bug or paste an error message. Claude Code will analyze your codebase, identify the problem, and implement a fix.

36* **Navigate any codebase**: Ask anything about your team's codebase, and get a thoughtful answer back. Claude Code maintains awareness of your entire project structure, can find up-to-date information from the web, and with [MCP](/en/docs/claude-code/mcp) can pull from external datasources like Google Drive, Figma, and Slack.62* **Navigate any codebase**: Ask anything about your team's codebase, and get a thoughtful answer back. Claude Code maintains awareness of your entire project structure, can find up-to-date information from the web, and with [MCP](/en/mcp) can pull from external datasources like Google Drive, Figma, and Slack.

37* **Automate tedious tasks**: Fix fiddly lint issues, resolve merge conflicts, and write release notes. Do all this in a single command from your developer machines, or automatically in CI.63* **Automate tedious tasks**: Fix fiddly lint issues, resolve merge conflicts, and write release notes. Do all this in a single command from your developer machines, or automatically in CI.

38 64 

39## Why developers love Claude Code65## Why developers love Claude Code

40 66 

41* **Works in your terminal**: Not another chat window. Not another IDE. Claude Code meets you where you already work, with the tools you already love.67* **Works in your terminal**: Not another chat window. Not another IDE. Claude Code meets you where you already work, with the tools you already love.

42* **Takes action**: Claude Code can directly edit files, run commands, and create commits. Need more? [MCP](/en/docs/claude-code/mcp) lets Claude read your design docs in Google Drive, update your tickets in Jira, or use *your* custom developer tooling.68* **Takes action**: Claude Code can directly edit files, run commands, and create commits. Need more? [MCP](/en/mcp) lets Claude read your design docs in Google Drive, update your tickets in Jira, or use *your* custom developer tooling.

43* **Unix philosophy**: Claude Code is composable and scriptable. `tail -f app.log | claude -p "Slack me if you see any anomalies appear in this log stream"` *works*. Your CI can run `claude -p "If there are new text strings, translate them into French and raise a PR for @lang-fr-team to review"`.69* **Unix philosophy**: Claude Code is composable and scriptable. `tail -f app.log | claude -p "Slack me if you see any anomalies appear in this log stream"` *works*. Your CI can run `claude -p "If there are new text strings, translate them into French and raise a PR for @lang-fr-team to review"`.

44* **Enterprise-ready**: Use the Claude API, or host on AWS or GCP. Enterprise-grade [security](/en/docs/claude-code/security), [privacy](/en/docs/claude-code/data-usage), and [compliance](https://trust.anthropic.com/) is built-in.70* **Enterprise-ready**: Use the Claude API, or host on AWS or GCP. Enterprise-grade [security](/en/security), [privacy](/en/data-usage), and [compliance](https://trust.anthropic.com/) is built-in.

45 71 

46## Next steps72## Next steps

47 73 

48<CardGroup>74<CardGroup>

49 <Card title="Quickstart" icon="rocket" href="/en/docs/claude-code/quickstart">75 <Card title="Quickstart" icon="rocket" href="/en/quickstart">

50 See Claude Code in action with practical examples76 See Claude Code in action with practical examples

51 </Card>77 </Card>

52 78 

53 <Card title="Common workflows" icon="graduation-cap" href="/en/docs/claude-code/common-workflows">79 <Card title="Common workflows" icon="graduation-cap" href="/en/common-workflows">

54 Step-by-step guides for common workflows80 Step-by-step guides for common workflows

55 </Card>81 </Card>

56 82 

57 <Card title="Troubleshooting" icon="wrench" href="/en/docs/claude-code/troubleshooting">83 <Card title="Troubleshooting" icon="wrench" href="/en/troubleshooting">

58 Solutions for common issues with Claude Code84 Solutions for common issues with Claude Code

59 </Card>85 </Card>

60 86 

61 <Card title="IDE setup" icon="laptop" href="/en/docs/claude-code/ide-integrations">87 <Card title="IDE setup" icon="laptop" href="/en/vs-code">

62 Add Claude Code to your IDE88 Add Claude Code to your IDE

63 </Card>89 </Card>

64</CardGroup>90</CardGroup>


66## Additional resources92## Additional resources

67 93 

68<CardGroup>94<CardGroup>

69 <Card title="Host on AWS or GCP" icon="cloud" href="/en/docs/claude-code/third-party-integrations">95 <Card title="Build with the Agent SDK" icon="code-branch" href="https://docs.claude.com/en/docs/agent-sdk/overview">

96 Create custom AI agents with the Claude Agent SDK

97 </Card>

98 

99 <Card title="Host on AWS or GCP" icon="cloud" href="/en/third-party-integrations">

70 Configure Claude Code with Amazon Bedrock or Google Vertex AI100 Configure Claude Code with Amazon Bedrock or Google Vertex AI

71 </Card>101 </Card>

72 102 

73 <Card title="Settings" icon="gear" href="/en/docs/claude-code/settings">103 <Card title="Settings" icon="gear" href="/en/settings">

74 Customize Claude Code for your workflow104 Customize Claude Code for your workflow

75 </Card>105 </Card>

76 106 

77 <Card title="Commands" icon="terminal" href="/en/docs/claude-code/cli-reference">107 <Card title="Commands" icon="terminal" href="/en/cli-reference">

78 Learn about CLI commands and controls108 Learn about CLI commands and controls

79 </Card>109 </Card>

80 110 


82 Clone our development container reference implementation112 Clone our development container reference implementation

83 </Card>113 </Card>

84 114 

85 <Card title="Security" icon="shield" href="/en/docs/claude-code/security">115 <Card title="Security" icon="shield" href="/en/security">

86 Discover Claude Code's safeguards and best practices for safe usage116 Discover Claude Code's safeguards and best practices for safe usage

87 </Card>117 </Card>

88 118 

89 <Card title="Privacy and data usage" icon="lock" href="/en/docs/claude-code/data-usage">119 <Card title="Privacy and data usage" icon="lock" href="/en/data-usage">

90 Understand how Claude Code handles your data120 Understand how Claude Code handles your data

91 </Card>121 </Card>

92</CardGroup>122</CardGroup>

123 

124 

125---

126 

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

Details

692. **Browse plugins**: Use `/plugin` to see available plugins from your marketplace692. **Browse plugins**: Use `/plugin` to see available plugins from your marketplace

703. **Test installation**: Try installing a plugin to verify the marketplace works correctly703. **Test installation**: Try installing a plugin to verify the marketplace works correctly

71 71 

72### Example plugin marketplace

73 

74Claude Code maintains a marketplace of [demo plugins](https://github.com/anthropics/claude-code/tree/main/plugins). These plugins are examples of what's possible with the plugin system.

75 

76```shell Add the marketplace theme={null}

77/plugin marketplace add anthropics/claude-code

78```

79 

72## Configure team marketplaces80## Configure team marketplaces

73 81 

74Set up automatic marketplace installation for team projects by specifying required marketplaces in `.claude/settings.json`:82Set up automatic marketplace installation for team projects by specifying required marketplaces in `.claude/settings.json`:


160### Plugin entries168### Plugin entries

161 169 

162<Note>170<Note>

163 Plugin entries are based on the *plugin manifest schema* (with all fields made optional) plus marketplace-specific fields (`source`, `category`, `tags`, `strict`), with `name` being required.171 Plugin entries are based on the *plugin manifest schema* (with all fields made

172 optional) plus marketplace-specific fields (`source`, `category`, `tags`,

173 `strict`), with `name` being required.

164</Note>174</Note>

165 175 

166**Required fields:**176**Required fields:**


237 247 

238#### Advanced plugin entries248#### Advanced plugin entries

239 249 

240Plugin entries can override default component locations and provide additional metadata. Note that `${CLAUDE_PLUGIN_ROOT}` is an environment variable that resolves to the plugin's installation directory (for details see [Environment variables](/en/docs/claude-code/plugins-reference#environment-variables)):250Plugin entries can override default component locations and provide additional metadata. Note that `${CLAUDE_PLUGIN_ROOT}` is an environment variable that resolves to the plugin's installation directory (for details see [Environment variables](/en/plugins-reference#environment-variables)):

241 251 

242```json theme={null}252```json theme={null}

243{253{


262 "./commands/enterprise/",272 "./commands/enterprise/",

263 "./commands/experimental/preview.md"273 "./commands/experimental/preview.md"

264 ],274 ],

265 "agents": [275 "agents": ["./agents/security-reviewer.md", "./agents/compliance-checker.md"],

266 "./agents/security-reviewer.md",

267 "./agents/compliance-checker.md"

268 ],

269 "hooks": {276 "hooks": {

270 "PostToolUse": [277 "PostToolUse": [

271 {278 {

272 "matcher": "Write|Edit",279 "matcher": "Write|Edit",

273 "hooks": [{"type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh"}]280 "hooks": [

281 {

282 "type": "command",

283 "command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh"

284 }

285 ]

274 }286 }

275 ]287 ]

276 },288 },


285```297```

286 298 

287<Note>299<Note>

288 **Schema relationship**: Plugin entries use the plugin manifest schema with all fields made optional, plus marketplace-specific fields (`source`, `strict`, `category`, `tags`). This means any field valid in a `plugin.json` file can also be used in a marketplace entry. When `strict: false`, the marketplace entry serves as the complete plugin manifest if no `plugin.json` exists. When `strict: true` (default), marketplace fields supplement the plugin's own manifest file.300 **Schema relationship**: Plugin entries use the plugin manifest schema with

301 all fields made optional, plus marketplace-specific fields (`source`,

302 `strict`, `category`, `tags`). This means any field valid in a `plugin.json`

303 file can also be used in a marketplace entry. When `strict: false`, the

304 marketplace entry serves as the complete plugin manifest if no `plugin.json`

305 exists. When `strict: true` (default), marketplace fields supplement the

306 plugin's own manifest file.

289</Note>307</Note>

290 308 

291***309***


400/plugin install test-plugin@marketplace-name418/plugin install test-plugin@marketplace-name

401```419```

402 420 

403For complete plugin testing workflows, see [Test your plugins locally](/en/docs/claude-code/plugins#test-your-plugins-locally). For technical troubleshooting, see [Plugins reference](/en/docs/claude-code/plugins-reference).421For complete plugin testing workflows, see [Test your plugins locally](/en/plugins#test-your-plugins-locally). For technical troubleshooting, see [Plugins reference](/en/plugins-reference).

404 422 

405***423***

406 424 


427 445 

428## See also446## See also

429 447 

430* [Plugins](/en/docs/claude-code/plugins) - Installing and using plugins448* [Plugins](/en/plugins) - Installing and using plugins

431* [Plugins reference](/en/docs/claude-code/plugins-reference) - Complete technical specifications and schemas449* [Plugins reference](/en/plugins-reference) - Complete technical specifications and schemas

432* [Plugin development](/en/docs/claude-code/plugins#develop-more-complex-plugins) - Creating your own plugins450* [Plugin development](/en/plugins#develop-more-complex-plugins) - Creating your own plugins

433* [Settings](/en/docs/claude-code/settings#plugin-configuration) - Plugin configuration options451* [Settings](/en/settings#plugin-configuration) - Plugin configuration options

452 

453 

454---

455 

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

plugins.md +40 −21

Details

1# Plugins1# Plugins

2 2 

3> Extend Claude Code with custom commands, agents, hooks, and MCP servers through the plugin system.3> Extend Claude Code with custom commands, agents, hooks, Skills, and MCP servers through the plugin system.

4 4 

5<Tip>5<Tip>

6 For complete technical specifications and schemas, see [Plugins reference](/en/docs/claude-code/plugins-reference). For marketplace management, see [Plugin marketplaces](/en/docs/claude-code/plugin-marketplaces).6 For complete technical specifications and schemas, see [Plugins reference](/en/plugins-reference). For marketplace management, see [Plugin marketplaces](/en/plugin-marketplaces).

7</Tip>7</Tip>

8 8 

9Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. Install plugins from [marketplaces](/en/docs/claude-code/plugin-marketplaces) to add pre-built commands, agents, hooks, and MCP servers, or create your own to automate your workflows.9Plugins let you extend Claude Code with custom functionality that can be shared across projects and teams. Install plugins from [marketplaces](/en/plugin-marketplaces) to add pre-built commands, agents, hooks, Skills, and MCP servers, or create your own to automate your workflows.

10 10 

11## Quickstart11## Quickstart

12 12 


129│ └── hello.md129│ └── hello.md

130├── agents/ # Custom agents (optional)130├── agents/ # Custom agents (optional)

131│ └── helper.md131│ └── helper.md

132├── skills/ # Agent Skills (optional)

133│ └── my-skill/

134│ └── SKILL.md

132└── hooks/ # Event handlers (optional)135└── hooks/ # Event handlers (optional)

133 └── hooks.json136 └── hooks.json

134```137```


137 140 

138* **Commands**: Create markdown files in `commands/` directory141* **Commands**: Create markdown files in `commands/` directory

139* **Agents**: Create agent definitions in `agents/` directory142* **Agents**: Create agent definitions in `agents/` directory

143* **Skills**: Create `SKILL.md` files in `skills/` directory

140* **Hooks**: Create `hooks/hooks.json` for event handling144* **Hooks**: Create `hooks/hooks.json` for event handling

141* **MCP servers**: Create `.mcp.json` for external tool integration145* **MCP servers**: Create `.mcp.json` for external tool integration

142 146 

143<Note>147<Note>

144 **Next steps**: Ready to add more features? Jump to [Develop more complex plugins](#develop-more-complex-plugins) to add agents, hooks, and MCP servers. For complete technical specifications of all plugin components, see [Plugins reference](/en/docs/claude-code/plugins-reference).148 **Next steps**: Ready to add more features? Jump to [Develop more complex plugins](#develop-more-complex-plugins) to add agents, hooks, and MCP servers. For complete technical specifications of all plugin components, see [Plugins reference](/en/plugins-reference).

145</Note>149</Note>

146 150 

147***151***


167/plugin171/plugin

168```172```

169 173 

170For detailed marketplace management including Git repositories, local development, and team distribution, see [Plugin marketplaces](/en/docs/claude-code/plugin-marketplaces).174For detailed marketplace management including Git repositories, local development, and team distribution, see [Plugin marketplaces](/en/plugin-marketplaces).

171 175 

172### Install plugins176### Install plugins

173 177 


2152. Team members trust the repository folder2192. Team members trust the repository folder

2163. Plugins install automatically for all team members2203. Plugins install automatically for all team members

217 221 

218For complete instructions including configuration examples, marketplace setup, and rollout best practices, see [Configure team marketplaces](/en/docs/claude-code/plugin-marketplaces#how-to-configure-team-marketplaces).222For complete instructions including configuration examples, marketplace setup, and rollout best practices, see [Configure team marketplaces](/en/plugin-marketplaces#how-to-configure-team-marketplaces).

219 223 

220***224***

221 225 


223 227 

224Once you're comfortable with basic plugins, you can create more sophisticated extensions.228Once you're comfortable with basic plugins, you can create more sophisticated extensions.

225 229 

230### Add Skills to your plugin

231 

232Plugins can include [Agent Skills](/en/skills) to extend Claude's capabilities. Skills are model-invoked—Claude autonomously uses them based on the task context.

233 

234To add Skills to your plugin, create a `skills/` directory at your plugin root and add Skill folders with `SKILL.md` files. Plugin Skills are automatically available when the plugin is installed.

235 

236For complete Skill authoring guidance, see [Agent Skills](/en/skills).

237 

226### Organize complex plugins238### Organize complex plugins

227 239 

228For plugins with many components, organize your directory structure by functionality. For complete directory layouts and organization patterns, see [Plugin directory structure](/en/docs/claude-code/plugins-reference#plugin-directory-structure).240For plugins with many components, organize your directory structure by functionality. For complete directory layouts and organization patterns, see [Plugin directory structure](/en/plugins-reference#plugin-directory-structure).

229 241 

230### Test your plugins locally242### Test your plugins locally

231 243 


312</Steps>324</Steps>

313 325 

314<Note>326<Note>

315 **For multiple plugins**: Organize plugins in subdirectories like `./plugins/plugin-name` and update your marketplace.json accordingly. See [Plugin sources](/en/docs/claude-code/plugin-marketplaces#plugin-sources) for organization patterns.327 **For multiple plugins**: Organize plugins in subdirectories like `./plugins/plugin-name` and update your marketplace.json accordingly. See [Plugin sources](/en/plugin-marketplaces#plugin-sources) for organization patterns.

316</Note>328</Note>

317 329 

318### Debug plugin issues330### Debug plugin issues


321 333 

3221. **Check the structure**: Ensure your directories are at the plugin root, not inside `.claude-plugin/`3341. **Check the structure**: Ensure your directories are at the plugin root, not inside `.claude-plugin/`

3232. **Test components individually**: Check each command, agent, and hook separately3352. **Test components individually**: Check each command, agent, and hook separately

3243. **Use validation and debugging tools**: See [Debugging and development tools](/en/docs/claude-code/plugins-reference#debugging-and-development-tools) for CLI commands and troubleshooting techniques3363. **Use validation and debugging tools**: See [Debugging and development tools](/en/plugins-reference#debugging-and-development-tools) for CLI commands and troubleshooting techniques

325 337 

326### Share your plugins338### Share your plugins

327 339 


3334. **Test with others**: Have team members test the plugin before wider distribution3454. **Test with others**: Have team members test the plugin before wider distribution

334 346 

335<Note>347<Note>

336 For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](/en/docs/claude-code/plugins-reference).348 For complete technical specifications, debugging techniques, and distribution strategies, see [Plugins reference](/en/plugins-reference).

337</Note>349</Note>

338 350 

339***351***


351 363 

352### For plugin developers364### For plugin developers

353 365 

354* **Create your first marketplace**: [Plugin marketplaces guide](/en/docs/claude-code/plugin-marketplaces)366* **Create your first marketplace**: [Plugin marketplaces guide](/en/plugin-marketplaces)

355* **Advanced components**: Dive deeper into specific plugin components:367* **Advanced components**: Dive deeper into specific plugin components:

356 * [Slash commands](/en/docs/claude-code/slash-commands) - Command development details368 * [Slash commands](/en/slash-commands) - Command development details

357 * [Subagents](/en/docs/claude-code/sub-agents) - Agent configuration and capabilities369 * [Subagents](/en/sub-agents) - Agent configuration and capabilities

358 * [Hooks](/en/docs/claude-code/hooks) - Event handling and automation370 * [Agent Skills](/en/skills) - Extend Claude's capabilities

359 * [MCP](/en/docs/claude-code/mcp) - External tool integration371 * [Hooks](/en/hooks) - Event handling and automation

372 * [MCP](/en/mcp) - External tool integration

360* **Distribution strategies**: Package and share your plugins effectively373* **Distribution strategies**: Package and share your plugins effectively

361* **Community contribution**: Consider contributing to community plugin collections374* **Community contribution**: Consider contributing to community plugin collections

362 375 


369 382 

370## See also383## See also

371 384 

372* [Plugin marketplaces](/en/docs/claude-code/plugin-marketplaces) - Creating and managing plugin catalogs385* [Plugin marketplaces](/en/plugin-marketplaces) - Creating and managing plugin catalogs

373* [Slash commands](/en/docs/claude-code/slash-commands) - Understanding custom commands386* [Slash commands](/en/slash-commands) - Understanding custom commands

374* [Subagents](/en/docs/claude-code/sub-agents) - Creating and using specialized agents387* [Subagents](/en/sub-agents) - Creating and using specialized agents

375* [Hooks](/en/docs/claude-code/hooks) - Automating workflows with event handlers388* [Agent Skills](/en/skills) - Extend Claude's capabilities

376* [MCP](/en/docs/claude-code/mcp) - Connecting to external tools and services389* [Hooks](/en/hooks) - Automating workflows with event handlers

377* [Settings](/en/docs/claude-code/settings) - Configuration options for plugins390* [MCP](/en/mcp) - Connecting to external tools and services

391* [Settings](/en/settings) - Configuration options for plugins

392 

393 

394---

395 

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

Details

3> Complete technical reference for Claude Code plugin system, including schemas, CLI commands, and component specifications.3> Complete technical reference for Claude Code plugin system, including schemas, CLI commands, and component specifications.

4 4 

5<Tip>5<Tip>

6 For hands-on tutorials and practical usage, see [Plugins](/en/docs/claude-code/plugins). For plugin management across teams and communities, see [Plugin marketplaces](/en/docs/claude-code/plugin-marketplaces).6 For hands-on tutorials and practical usage, see [Plugins](/en/plugins). For plugin management across teams and communities, see [Plugin marketplaces](/en/plugin-marketplaces).

7</Tip>7</Tip>

8 8 

9This reference provides complete technical specifications for the Claude Code plugin system, including component schemas, CLI commands, and development tools.9This reference provides complete technical specifications for the Claude Code plugin system, including component schemas, CLI commands, and development tools.

10 10 

11## Plugin components reference11## Plugin components reference

12 12 

13This section documents the four types of components that plugins can provide.13This section documents the five types of components that plugins can provide.

14 14 

15### Commands15### Commands

16 16 


20 20 

21**File format**: Markdown files with frontmatter21**File format**: Markdown files with frontmatter

22 22 

23For complete details on plugin command structure, invocation patterns, and features, see [Plugin commands](/en/docs/claude-code/slash-commands#plugin-commands).23For complete details on plugin command structure, invocation patterns, and features, see [Plugin commands](/en/slash-commands#plugin-commands).

24 24 

25### Agents25### Agents

26 26 


58* Agents can be invoked manually by users58* Agents can be invoked manually by users

59* Plugin agents work alongside built-in Claude agents59* Plugin agents work alongside built-in Claude agents

60 60 

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 

61### Hooks92### Hooks

62 93 

63Plugins can provide event handlers that respond to Claude Code events automatically.94Plugins can provide event handlers that respond to Claude Code events automatically.


89**Available events**:120**Available events**:

90 121 

91* `PreToolUse`: Before Claude uses any tool122* `PreToolUse`: Before Claude uses any tool

123* `PermissionRequest`: When a permission dialog is shown

92* `PostToolUse`: After Claude uses any tool124* `PostToolUse`: After Claude uses any tool

93* `UserPromptSubmit`: When user submits a prompt125* `UserPromptSubmit`: When user submits a prompt

94* `Notification`: When Claude Code sends notifications126* `Notification`: When Claude Code sends notifications


260│ ├── security-reviewer.md292│ ├── security-reviewer.md

261│ ├── performance-tester.md293│ ├── performance-tester.md

262│ └── compliance-checker.md294│ └── compliance-checker.md

295├── skills/ # Agent Skills

296│ ├── code-reviewer/

297│ │ └── SKILL.md

298│ └── pdf-processor/

299│ ├── SKILL.md

300│ └── scripts/

263├── hooks/ # Hook configurations301├── hooks/ # Hook configurations

264│ ├── hooks.json # Main hook config302│ ├── hooks.json # Main hook config

265│ └── security-hooks.json # Additional hooks303│ └── security-hooks.json # Additional hooks


273```311```

274 312 

275<Warning>313<Warning>

276 The `.claude-plugin/` directory contains the `plugin.json` file. All other directories (commands/, agents/, hooks/) must be at the plugin root, not inside `.claude-plugin/`.314 The `.claude-plugin/` directory contains the `plugin.json` file. All other directories (commands/, agents/, skills/, hooks/) must be at the plugin root, not inside `.claude-plugin/`.

277</Warning>315</Warning>

278 316 

279### File locations reference317### File locations reference

280 318 

281| Component | Default Location | Purpose |319| Component | Default Location | Purpose |

282| :-------------- | :--------------------------- | :--------------------------- |320| :-------------- | :--------------------------- | :------------------------------- |

283| **Manifest** | `.claude-plugin/plugin.json` | Required metadata file |321| **Manifest** | `.claude-plugin/plugin.json` | Required metadata file |

284| **Commands** | `commands/` | Slash command markdown files |322| **Commands** | `commands/` | Slash command markdown files |

285| **Agents** | `agents/` | Subagent markdown files |323| **Agents** | `agents/` | Subagent markdown files |

324| **Skills** | `skills/` | Agent Skills with SKILL.md files |

286| **Hooks** | `hooks/hooks.json` | Hook configuration |325| **Hooks** | `hooks/hooks.json` | Hook configuration |

287| **MCP servers** | `.mcp.json` | MCP server definitions |326| **MCP servers** | `.mcp.json` | MCP server definitions |

288 327 


327 366 

328## See also367## See also

329 368 

330- [Plugins](/en/docs/claude-code/plugins) - Tutorials and practical usage369- [Plugins](/en/plugins) - Tutorials and practical usage

331- [Plugin marketplaces](/en/docs/claude-code/plugin-marketplaces) - Creating and managing marketplaces370- [Plugin marketplaces](/en/plugin-marketplaces) - Creating and managing marketplaces

332- [Slash commands](/en/docs/claude-code/slash-commands) - Command development details371- [Slash commands](/en/slash-commands) - Command development details

333- [Subagents](/en/docs/claude-code/sub-agents) - Agent configuration and capabilities372- [Subagents](/en/sub-agents) - Agent configuration and capabilities

334- [Hooks](/en/docs/claude-code/hooks) - Event handling and automation373- [Agent Skills](/en/skills) - Extend Claude's capabilities

335- [MCP](/en/docs/claude-code/mcp) - External tool integration374- [Hooks](/en/hooks) - Event handling and automation

336- [Settings](/en/docs/claude-code/settings) - Configuration options for plugins375- [MCP](/en/mcp) - External tool integration

376- [Settings](/en/settings) - Configuration options for plugins

337```377```

378 

379 

380---

381 

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

quickstart.md +41 −32

Details

14 14 

15## Step 1: Install Claude Code15## Step 1: Install Claude Code

16 16 

17### NPM Install17To install Claude Code, use one of the following methods:

18 18 

19If you have [Node.js 18 or newer installed](https://nodejs.org/en/download/):19<Tabs>

20 <Tab title="Native Install (Recommended)">

21 **Homebrew (macOS, Linux):**

20 22 

21```sh theme={null}23 ```sh theme={null}

22npm install -g @anthropic-ai/claude-code24 brew install --cask claude-code

23```25 ```

24 

25### Native Install

26 

27<Tip>

28 Alternatively, try our new native install, now in beta.

29</Tip>

30 26 

31**Homebrew (macOS, Linux):**27 **macOS, Linux, WSL:**

32 28 

33```sh theme={null}29 ```bash theme={null}

34brew install --cask claude-code30 curl -fsSL https://claude.ai/install.sh | bash

35```31 ```

36 32 

37**macOS, Linux, WSL:**33 **Windows PowerShell:**

38 34 

39```bash theme={null}35 ```powershell theme={null}

40curl -fsSL https://claude.ai/install.sh | bash36 irm https://claude.ai/install.ps1 | iex

41```37 ```

42 38 

43**Windows PowerShell:**39 **Windows CMD:**

44 40 

45```powershell theme={null}41 ```batch theme={null}

46irm https://claude.ai/install.ps1 | iex42 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

47```43 ```

44 </Tab>

48 45 

49**Windows CMD:**46 <Tab title="NPM">

47 If you have [Node.js 18 or newer installed](https://nodejs.org/en/download/):

50 48 

51```batch theme={null}49 ```sh theme={null}

52curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd50 npm install -g @anthropic-ai/claude-code

53```51 ```

52 </Tab>

53</Tabs>

54 54 

55## Step 2: Log in to your account55## Step 2: Log in to your account

56 56 


93You'll see the Claude Code welcome screen with your session information, recent conversations, and latest updates. Type `/help` for available commands or `/resume` to continue a previous conversation.93You'll see the Claude Code welcome screen with your session information, recent conversations, and latest updates. Type `/help` for available commands or `/resume` to continue a previous conversation.

94 94 

95<Tip>95<Tip>

96 After logging in (Step 2), your credentials are stored on your system. Learn more in [Credential Management](/en/docs/claude-code/iam#credential-management).96 After logging in (Step 2), your credentials are stored on your system. Learn more in [Credential Management](/en/iam#credential-management).

97</Tip>97</Tip>

98 98 

99## Step 4: Ask your first question99## Step 4: Ask your first question


252| `/help` | Show available commands | `> /help` |252| `/help` | Show available commands | `> /help` |

253| `exit` or Ctrl+C | Exit Claude Code | `> exit` |253| `exit` or Ctrl+C | Exit Claude Code | `> exit` |

254 254 

255See the [CLI reference](/en/docs/claude-code/cli-reference) for a complete list of commands.255See the [CLI reference](/en/cli-reference) for a complete list of commands.

256 256 

257## Pro tips for beginners257## Pro tips for beginners

258 258 


304Now that you've learned the basics, explore more advanced features:304Now that you've learned the basics, explore more advanced features:

305 305 

306<CardGroup cols={3}>306<CardGroup cols={3}>

307 <Card title="Common workflows" icon="graduation-cap" href="/en/docs/claude-code/common-workflows">307 <Card title="Common workflows" icon="graduation-cap" href="/en/common-workflows">

308 Step-by-step guides for common tasks308 Step-by-step guides for common tasks

309 </Card>309 </Card>

310 310 

311 <Card title="CLI reference" icon="terminal" href="/en/docs/claude-code/cli-reference">311 <Card title="CLI reference" icon="terminal" href="/en/cli-reference">

312 Master all commands and options312 Master all commands and options

313 </Card>313 </Card>

314 314 

315 <Card title="Configuration" icon="gear" href="/en/docs/claude-code/settings">315 <Card title="Configuration" icon="gear" href="/en/settings">

316 Customize Claude Code for your workflow316 Customize Claude Code for your workflow

317 </Card>317 </Card>

318 

319 <Card title="Claude Code on the web" icon="cloud" href="/en/claude-code-on-the-web">

320 Run tasks asynchronously in the cloud

321 </Card>

318</CardGroup>322</CardGroup>

319 323 

320## Getting help324## Getting help


322* **In Claude Code**: Type `/help` or ask "how do I..."326* **In Claude Code**: Type `/help` or ask "how do I..."

323* **Documentation**: You're here! Browse other guides327* **Documentation**: You're here! Browse other guides

324* **Community**: Join our [Discord](https://www.anthropic.com/discord) for tips and support328* **Community**: Join our [Discord](https://www.anthropic.com/discord) for tips and support

329 

330 

331---

332 

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

sandboxing.md +210 −0 added

Details

1# Sandboxing

2 

3> Learn how Claude Code's sandboxed bash tool provides filesystem and network isolation for safer, more autonomous agent execution.

4 

5## Overview

6 

7Claude Code features native sandboxing to provide a more secure environment for agent execution while reducing the need for constant permission prompts. Instead of asking permission for each bash command, sandboxing creates defined boundaries upfront where Claude Code can work more freely with reduced risk.

8 

9The sandboxed bash tool uses OS-level primitives to enforce both filesystem and network isolation.

10 

11## Why sandboxing matters

12 

13Traditional permission-based security requires constant user approval for bash commands. While this provides control, it can lead to:

14 

15* **Approval fatigue**: Repeatedly clicking "approve" can cause users to pay less attention to what they're approving

16* **Reduced productivity**: Constant interruptions slow down development workflows

17* **Limited autonomy**: Claude Code cannot work as efficiently when waiting for approvals

18 

19Sandboxing addresses these challenges by:

20 

211. **Defining clear boundaries**: Specify exactly which directories and network hosts Claude Code can access

222. **Reducing permission prompts**: Safe commands within the sandbox don't require approval

233. **Maintaining security**: Attempts to access resources outside the sandbox trigger immediate notifications

244. **Enabling autonomy**: Claude Code can run more independently within defined limits

25 

26<Warning>

27 Effective sandboxing requires **both** filesystem and network isolation. Without network isolation, a compromised agent could exfiltrate sensitive files like SSH keys. Without filesystem isolation, a compromised agent could backdoor system resources to gain network access. When configuring sandboxing it is important to ensure that your configured settings do not create bypasses in these systems.

28</Warning>

29 

30## How it works

31 

32### Filesystem isolation

33 

34The sandboxed bash tool restricts file system access to specific directories:

35 

36* **Default writes behavior**: Read and write access to the current working directory and its subdirectories

37* **Default read behavior**: Read access to the entire computer, except certain denied directories

38* **Blocked access**: Cannot modify files outside the current working directory without explicit permission

39* **Configurable**: Define custom allowed and denied paths through settings

40 

41### Network isolation

42 

43Network access is controlled through a proxy server running outside the sandbox:

44 

45* **Domain restrictions**: Only approved domains can be accessed

46* **User confirmation**: New domain requests trigger permission prompts

47* **Custom proxy support**: Advanced users can implement custom rules on outgoing traffic

48* **Comprehensive coverage**: Restrictions apply to all scripts, programs, and subprocesses spawned by commands

49 

50### OS-level enforcement

51 

52The sandboxed bash tool leverages operating system security primitives:

53 

54* **Linux**: Uses [bubblewrap](https://github.com/containers/bubblewrap) for isolation

55* **macOS**: Uses Seatbelt for sandbox enforcement

56 

57These OS-level restrictions ensure that all child processes spawned by Claude Code's commands inherit the same security boundaries.

58 

59## Getting started

60 

61### Enable sandboxing

62 

63You can enable sandboxing by running the `/sandbox` slash command:

64 

65```

66> /sandbox

67```

68 

69This activates the sandboxed bash tool with default settings, allowing access to your current working directory while blocking access to sensitive system locations.

70 

71### Configure sandboxing

72 

73Customize sandbox behavior through your `settings.json` file. See [Settings](/en/settings#sandbox-settings) for complete configuration reference.

74 

75<Tip>

76 Not all commands are compatible with sandboxing out of the box. Some notes that may help you make the most out of the sandbox:

77 

78 * Many CLI tools require accessing certain hosts. As you use these tools, they will request permission to access certain hosts. Granting permission will allow them to access these hosts now and in the future, enabling them to safely execute inside the sandbox.

79 * `watchman` is incompatible with running in the sandbox. If you're running `jest`, consider using `jest --no-watchman`

80 * `docker` is incompatible with running in the sandbox. Consider specifying `docker` in `excludedCommands` to force it to run outside of the sandbox.

81</Tip>

82 

83<Note>

84 Claude Code includes an intentional escape hatch mechanism that allows commands to run outside the sandbox when necessary. When a command fails due to sandbox restrictions (such as network connectivity issues or incompatible tools), Claude is prompted to analyze the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. Commands that use this parameter go through the normal Claude Code permissions flow requiring user permission to execute. This allows Claude Code to handle edge cases where certain tools or network operations cannot function within sandbox constraints.

85 

86 You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](/en/settings#sandbox-settings). When disabled, the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`.

87</Note>

88 

89## Security benefits

90 

91### Protection against prompt injection

92 

93Even if an attacker successfully manipulates Claude Code's behavior through prompt injection, the sandbox ensures your system remains secure:

94 

95**Filesystem protection:**

96 

97* Cannot modify critical config files such as `~/.bashrc`

98* Cannot modify system-level files in `/bin/`

99* Cannot read files that are denied in your [Claude permission settings](/en/iam#configuring-permissions)

100 

101**Network protection:**

102 

103* Cannot exfiltrate data to attacker-controlled servers

104* Cannot download malicious scripts from unauthorized domains

105* Cannot make unexpected API calls to unapproved services

106* Cannot contact any domains not explicitly allowed

107 

108**Monitoring and control:**

109 

110* All access attempts outside the sandbox are blocked at the OS level

111* You receive immediate notifications when boundaries are tested

112* You can choose to deny, allow once, or permanently update your configuration

113 

114### Reduced attack surface

115 

116Sandboxing limits the potential damage from:

117 

118* **Malicious dependencies**: NPM packages or other dependencies with harmful code

119* **Compromised scripts**: Build scripts or tools with security vulnerabilities

120* **Social engineering**: Attacks that trick users into running dangerous commands

121* **Prompt injection**: Attacks that trick Claude into running dangerous commands

122 

123### Transparent operation

124 

125When Claude Code attempts to access network resources outside the sandbox:

126 

1271. The operation is blocked at the OS level

1282. You receive an immediate notification

1293. You can choose to:

130 * Deny the request

131 * Allow it once

132 * Update your sandbox configuration to permanently allow it

133 

134## Security Limitations

135 

136* Network Sandboxing Limitations: The network filtering system operates by restricting the domains that processes are allowed to connect to. It does not otherwise inspect the traffic passing through the proxy and users are responsible for ensuring they only allow trusted domains in their policy.

137 

138<Warning>

139 Users should be aware of potential risks that come from allowing broad domains like `github.com` that may allow for data exfiltration. Also, in some cases it may be possible to bypass the network filtering through [domain fronting](https://en.wikipedia.org/wiki/Domain_fronting).

140</Warning>

141 

142* Privilege Escalation via Unix Sockets: The `allowUnixSockets` configuration can inadvertently grant access to powerful system services that could lead to sandbox bypasses. For example, if it is used to allow access to `/var/run/docker.sock` this would effectively grant access to the host system through exploiting the docker socket. Users are encouraged to carefully consider any unix sockets that they allow through the sandbox.

143* Filesystem Permission Escalation: Overly broad filesystem write permissions can enable privilege escalation attacks. Allowing writes to directories containing executables in `$PATH`, system configuration directories, or user shell configuration files (`.bashrc`, `.zshrc`) can lead to code execution in different security contexts when other users or system processes access these files.

144* Linux Sandbox Strength: The Linux implementation provides strong filesystem and network isolation but includes an `enableWeakerNestedSandbox` mode that enables it to work inside of Docker environments without privileged namespaces. This option considerably weakens security and should only be used incases where additional isolation is otherwise enforced.

145 

146## Advanced usage

147 

148### Custom proxy configuration

149 

150For organizations requiring advanced network security, you can implement a custom proxy to:

151 

152* Decrypt and inspect HTTPS traffic

153* Apply custom filtering rules

154* Log all network requests

155* Integrate with existing security infrastructure

156 

157```json theme={null}

158{

159 "sandbox": {

160 "network": {

161 "httpProxyPort": 8080,

162 "socksProxyPort": 8081

163 }

164 }

165}

166```

167 

168### Integration with existing security tools

169 

170The sandboxed bash tool works alongside:

171 

172* **IAM policies**: Combine with [permission settings](/en/iam) for defense-in-depth

173* **Development containers**: Use with [devcontainers](/en/devcontainer) for additional isolation

174* **Enterprise policies**: Enforce sandbox configurations through [managed settings](/en/settings#settings-precedence)

175 

176## Best practices

177 

1781. **Start restrictive**: Begin with minimal permissions and expand as needed

1792. **Monitor logs**: Review sandbox violation attempts to understand Claude Code's needs

1803. **Use environment-specific configs**: Different sandbox rules for development vs. production contexts

1814. **Combine with permissions**: Use sandboxing alongside IAM policies for comprehensive security

1825. **Test configurations**: Verify your sandbox settings don't block legitimate workflows

183 

184## Open source

185 

186The sandbox runtime is available as an open source npm package for use in your own agent projects. This enables the broader AI agent community to build safer, more secure autonomous systems. This can also be used to sandbox other programs you may wish to run. For example, to sandbox an MCP server you could run:

187 

188```bash theme={null}

189npx @anthropic-ai/sandbox-runtime <command-to-sandbox>

190```

191 

192For implementation details and source code, visit the [GitHub repository](https://github.com/anthropic-experimental/sandbox-runtime).

193 

194## Limitations

195 

196* **Performance overhead**: Minimal, but some filesystem operations may be slightly slower

197* **Compatibility**: Some tools that require specific system access patterns may need configuration adjustments, or may even need to be run outside of the sandbox

198* **Platform support**: Currently supports Linux and macOS; Windows support planned

199 

200## See also

201 

202* [Security](/en/security) - Comprehensive security features and best practices

203* [IAM](/en/iam) - Permission configuration and access control

204* [Settings](/en/settings) - Complete configuration reference

205* [CLI reference](/en/cli-reference) - Command-line options including `-sb`

206 

207 

208---

209 

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

Details

1# Migrate to Claude Agent SDK1# Migrate to Claude Agent SDK

2 2 

3> Guide for migrating the Claude Code TypeScript and Python SDKs to the Claude Agent SDK3Guide for migrating the Claude Code TypeScript and Python SDKs to the Claude Agent SDK

4 

5---

4 6 

5## Overview7## Overview

6 8 


9## What's Changed11## What's Changed

10 12 

11| Aspect | Old | New |13| Aspect | Old | New |

12| :------------------------- | :----------------------------- | :------------------------------- |14| :----------------------- | :-------------------------- | :------------------------------- |

13| **Package Name (TS/JS)** | `@anthropic-ai/claude-code` | `@anthropic-ai/claude-agent-sdk` |15| **Package Name (TS/JS)** | `@anthropic-ai/claude-code` | `@anthropic-ai/claude-agent-sdk` |

14| **Python Package** | `claude-code-sdk` | `claude-agent-sdk` |16| **Python Package** | `claude-code-sdk` | `claude-agent-sdk` |

15| **Documentation Location** | Claude Code docs → SDK section | API Guide → Agent SDK section |17| **Documentation Location** | Claude Code docs | API Guide → Agent SDK section |

16 18 

17<Note>19<Note>

18 **Documentation Changes:** The Agent SDK documentation has moved from the Claude Code docs to the API Guide under a dedicated [Agent SDK](/en/api/agent-sdk/overview) section. The Claude Code docs now focus on the CLI tool and automation features.20**Documentation Changes:** The Agent SDK documentation has moved from the Claude Code docs to the API Guide under a dedicated [Agent SDK](/docs/en/agent-sdk/overview) section. The Claude Code docs now focus on the CLI tool and automation features.

19</Note>21</Note>

20 22 

21## Migration Steps23## Migration Steps


24 26 

25**1. Uninstall the old package:**27**1. Uninstall the old package:**

26 28 

27```bash theme={null}29```bash

28npm uninstall @anthropic-ai/claude-code30npm uninstall @anthropic-ai/claude-code

29```31```

30 32 

31**2. Install the new package:**33**2. Install the new package:**

32 34 

33```bash theme={null}35```bash

34npm install @anthropic-ai/claude-agent-sdk36npm install @anthropic-ai/claude-agent-sdk

35```37```

36 38 


38 40 

39Change all imports from `@anthropic-ai/claude-code` to `@anthropic-ai/claude-agent-sdk`:41Change all imports from `@anthropic-ai/claude-code` to `@anthropic-ai/claude-agent-sdk`:

40 42 

41```typescript theme={null}43```typescript

42// Before44// Before

43import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-code";45import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-code";

44 46 


54 56 

55If you have the package listed in your `package.json`, update it:57If you have the package listed in your `package.json`, update it:

56 58 

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

58// Before60// Before

59{61{

60 "dependencies": {62 "dependencies": {


76 78 

77**1. Uninstall the old package:**79**1. Uninstall the old package:**

78 80 

79```bash theme={null}81```bash

80pip uninstall claude-code-sdk82pip uninstall claude-code-sdk

81```83```

82 84 

83**2. Install the new package:**85**2. Install the new package:**

84 86 

85```bash theme={null}87```bash

86pip install claude-agent-sdk88pip install claude-agent-sdk

87```89```

88 90 


90 92 

91Change all imports from `claude_code_sdk` to `claude_agent_sdk`:93Change all imports from `claude_code_sdk` to `claude_agent_sdk`:

92 94 

93```python theme={null}95```python

94# Before96# Before

95from claude_code_sdk import query, ClaudeCodeOptions97from claude_code_sdk import query, ClaudeCodeOptions

96 98 


102 104 

103Change `ClaudeCodeOptions` to `ClaudeAgentOptions`:105Change `ClaudeCodeOptions` to `ClaudeAgentOptions`:

104 106 

105```python theme={null}107```python

106# Before108# Before

107from claude_agent_sdk import query, ClaudeCodeOptions109from claude_agent_sdk import query, ClaudeCodeOptions

108 110 


125## Breaking changes127## Breaking changes

126 128 

127<Warning>129<Warning>

128 To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK. Review this section carefully before migrating.130To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK. Review this section carefully before migrating.

129</Warning>131</Warning>

130 132 

131### Python: ClaudeCodeOptions renamed to ClaudeAgentOptions133### Python: ClaudeCodeOptions renamed to ClaudeAgentOptions


134 136 

135**Migration:**137**Migration:**

136 138 

137```python theme={null}139```python

138# BEFORE (v0.0.x)140# BEFORE (v0.0.x)

139from claude_agent_sdk import query, ClaudeCodeOptions141from claude_agent_sdk import query, ClaudeCodeOptions

140 142 


161**Migration:**163**Migration:**

162 164 

163<CodeGroup>165<CodeGroup>

164 ```typescript TypeScript theme={null}

165 // BEFORE (v0.0.x) - Used Claude Code's system prompt by default

166 const result = query({ prompt: "Hello" });

167 166 

168 // AFTER (v0.1.0) - Uses empty system prompt by default167```typescript TypeScript

169 // To get the old behavior, explicitly request Claude Code's preset:168// BEFORE (v0.0.x) - Used Claude Code's system prompt by default

170 const result = query({169const result = query({ prompt: "Hello" });

170 

171// AFTER (v0.1.0) - Uses empty system prompt by default

172// To get the old behavior, explicitly request Claude Code's preset:

173const result = query({

171 prompt: "Hello",174 prompt: "Hello",

172 options: {175 options: {

173 systemPrompt: { type: "preset", preset: "claude_code" }176 systemPrompt: { type: "preset", preset: "claude_code" }

174 }177 }

175 });178});

176 179 

177 // Or use a custom system prompt:180// Or use a custom system prompt:

178 const result = query({181const result = query({

179 prompt: "Hello",182 prompt: "Hello",

180 options: {183 options: {

181 systemPrompt: "You are a helpful coding assistant"184 systemPrompt: "You are a helpful coding assistant"

182 }185 }

183 });186});

184 ```187```

185 188 

186 ```python Python theme={null}189```python Python

187 # BEFORE (v0.0.x) - Used Claude Code's system prompt by default190# BEFORE (v0.0.x) - Used Claude Code's system prompt by default

188 async for message in query(prompt="Hello"):191async for message in query(prompt="Hello"):

189 print(message)192 print(message)

190 193 

191 # AFTER (v0.1.0) - Uses empty system prompt by default194# AFTER (v0.1.0) - Uses empty system prompt by default

192 # To get the old behavior, explicitly request Claude Code's preset:195# To get the old behavior, explicitly request Claude Code's preset:

193 from claude_agent_sdk import query, ClaudeAgentOptions196from claude_agent_sdk import query, ClaudeAgentOptions

194 197 

195 async for message in query(198async for message in query(

196 prompt="Hello",199 prompt="Hello",

197 options=ClaudeAgentOptions(200 options=ClaudeAgentOptions(

198 system_prompt={"type": "preset", "preset": "claude_code"} # Use the preset201 system_prompt={"type": "preset", "preset": "claude_code"} # Use the preset

199 )202 )

200 ):203):

201 print(message)204 print(message)

202 205 

203 # Or use a custom system prompt:206# Or use a custom system prompt:

204 async for message in query(207async for message in query(

205 prompt="Hello",208 prompt="Hello",

206 options=ClaudeAgentOptions(209 options=ClaudeAgentOptions(

207 system_prompt="You are a helpful coding assistant"210 system_prompt="You are a helpful coding assistant"

208 )211 )

209 ):212):

210 print(message)213 print(message)

211 ```214```

215 

212</CodeGroup>216</CodeGroup>

213 217 

214**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code's CLI-focused instructions.218**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code's CLI-focused instructions.


220**Migration:**224**Migration:**

221 225 

222<CodeGroup>226<CodeGroup>

223 ```typescript TypeScript theme={null}227 

224 // BEFORE (v0.0.x) - Loaded all settings automatically228```typescript TypeScript

225 const result = query({ prompt: "Hello" });229// BEFORE (v0.0.x) - Loaded all settings automatically

226 // Would read from:230const result = query({ prompt: "Hello" });

227 // - ~/.claude/settings.json (user)231// Would read from:

228 // - .claude/settings.json (project)232// - ~/.claude/settings.json (user)

229 // - .claude/settings.local.json (local)233// - .claude/settings.json (project)

230 // - CLAUDE.md files234// - .claude/settings.local.json (local)

231 // - Custom slash commands235// - CLAUDE.md files

232 236// - Custom slash commands

233 // AFTER (v0.1.0) - No settings loaded by default237 

234 // To get the old behavior:238// AFTER (v0.1.0) - No settings loaded by default

235 const result = query({239// To get the old behavior:

240const result = query({

236 prompt: "Hello",241 prompt: "Hello",

237 options: {242 options: {

238 settingSources: ["user", "project", "local"]243 settingSources: ["user", "project", "local"]

239 }244 }

240 });245});

241 246 

242 // Or load only specific sources:247// Or load only specific sources:

243 const result = query({248const result = query({

244 prompt: "Hello",249 prompt: "Hello",

245 options: {250 options: {

246 settingSources: ["project"] // Only project settings251 settingSources: ["project"] // Only project settings

247 }252 }

248 });253});

249 ```254```

250 255 

251 ```python Python theme={null}256```python Python

252 # BEFORE (v0.0.x) - Loaded all settings automatically257# BEFORE (v0.0.x) - Loaded all settings automatically

253 async for message in query(prompt="Hello"):258async for message in query(prompt="Hello"):

254 print(message)259 print(message)

255 # Would read from:260# Would read from:

256 # - ~/.claude/settings.json (user)261# - ~/.claude/settings.json (user)

257 # - .claude/settings.json (project)262# - .claude/settings.json (project)

258 # - .claude/settings.local.json (local)263# - .claude/settings.local.json (local)

259 # - CLAUDE.md files264# - CLAUDE.md files

260 # - Custom slash commands265# - Custom slash commands

261 266 

262 # AFTER (v0.1.0) - No settings loaded by default267# AFTER (v0.1.0) - No settings loaded by default

263 # To get the old behavior:268# To get the old behavior:

264 from claude_agent_sdk import query, ClaudeAgentOptions269from claude_agent_sdk import query, ClaudeAgentOptions

265 270 

266 async for message in query(271async for message in query(

267 prompt="Hello",272 prompt="Hello",

268 options=ClaudeAgentOptions(273 options=ClaudeAgentOptions(

269 setting_sources=["user", "project", "local"]274 setting_sources=["user", "project", "local"]

270 )275 )

271 ):276):

272 print(message)277 print(message)

273 278 

274 # Or load only specific sources:279# Or load only specific sources:

275 async for message in query(280async for message in query(

276 prompt="Hello",281 prompt="Hello",

277 options=ClaudeAgentOptions(282 options=ClaudeAgentOptions(

278 setting_sources=["project"] # Only project settings283 setting_sources=["project"] # Only project settings

279 )284 )

280 ):285):

281 print(message)286 print(message)

282 ```287```

288 

283</CodeGroup>289</CodeGroup>

284 290 

285**Why this changed:** Ensures SDK applications have predictable behavior independent of local filesystem configurations. This is especially important for:291**Why this changed:** Ensures SDK applications have predictable behavior independent of local filesystem configurations. This is especially important for:

286 292- **CI/CD environments** - Consistent behavior without local customizations

287* **CI/CD environments** - Consistent behavior without local customizations293- **Deployed applications** - No dependency on filesystem settings

288* **Deployed applications** - No dependency on filesystem settings294- **Testing** - Isolated test environments

289* **Testing** - Isolated test environments295- **Multi-tenant systems** - Prevent settings leakage between users

290* **Multi-tenant systems** - Prevent settings leakage between users

291 296 

292<Note>297<Note>

293 **Backward compatibility:** If your application relied on filesystem settings (custom slash commands, CLAUDE.md instructions, etc.), add `settingSources: ['user', 'project', 'local']` to your options.298**Backward compatibility:** If your application relied on filesystem settings (custom slash commands, CLAUDE.md instructions, etc.), add `settingSources: ['user', 'project', 'local']` to your options.

294</Note>299</Note>

295 300 

296## Why the Rename?301## Why the Rename?

297 302 

298The Claude Code SDK was originally designed for coding tasks, but it has evolved into a powerful framework for building all types of AI agents. The new name "Claude Agent SDK" better reflects its capabilities:303The Claude Code SDK was originally designed for coding tasks, but it has evolved into a powerful framework for building all types of AI agents. The new name "Claude Agent SDK" better reflects its capabilities:

299 304 

300* Building business agents (legal assistants, finance advisors, customer support)305- Building business agents (legal assistants, finance advisors, customer support)

301* Creating specialized coding agents (SRE bots, security reviewers, code review agents)306- Creating specialized coding agents (SRE bots, security reviewers, code review agents)

302* Developing custom agents for any domain with tool use, MCP integration, and more307- Developing custom agents for any domain with tool use, MCP integration, and more

303 308 

304## Getting Help309## Getting Help

305 310 


3172. Verify your requirements.txt or pyproject.toml has the new package name3222. Verify your requirements.txt or pyproject.toml has the new package name

3183. Run `pip install claude-agent-sdk` to ensure the package is installed3233. Run `pip install claude-agent-sdk` to ensure the package is installed

319 324 

320See the [Troubleshooting](/en/docs/claude-code/troubleshooting) guide for common issues.

321 

322## Next Steps325## Next Steps

323 326 

324* Explore the [Agent SDK Overview](/en/api/agent-sdk/overview) to learn about available features327- Explore the [Agent SDK Overview](/docs/en/agent-sdk/overview) to learn about available features

325* Check out the [TypeScript SDK Reference](/en/api/agent-sdk/typescript) for detailed API documentation328- Check out the [TypeScript SDK Reference](/docs/en/agent-sdk/typescript) for detailed API documentation

326* Review the [Python SDK Reference](/en/api/agent-sdk/python) for Python-specific documentation329- Review the [Python SDK Reference](/docs/en/agent-sdk/python) for Python-specific documentation

327* Learn about [Custom Tools](/en/api/agent-sdk/custom-tools) and [MCP Integration](/en/api/agent-sdk/mcp)330- Learn about [Custom Tools](/docs/en/agent-sdk/custom-tools) and [MCP Integration](/docs/en/agent-sdk/mcp)

security.md +34 −10

Details

14 14 

15We designed Claude Code to be transparent and secure. For example, we require approval for bash commands before executing them, giving you direct control. This approach enables users and organizations to configure permissions directly.15We designed Claude Code to be transparent and secure. For example, we require approval for bash commands before executing them, giving you direct control. This approach enables users and organizations to configure permissions directly.

16 16 

17For detailed permission configuration, see [Identity and Access Management](/en/docs/claude-code/iam).17For detailed permission configuration, see [Identity and Access Management](/en/iam).

18 18 

19### Built-in protections19### Built-in protections

20 20 

21To mitigate risks in agentic systems:21To mitigate risks in agentic systems:

22 22 

23* **Sandboxed bash tool**: [Sandbox](/en/sandboxing) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Enable with `/sandbox` to define boundaries where Claude Code can work autonomously

23* **Write access restriction**: Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary24* **Write access restriction**: Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary

24* **Prompt fatigue mitigation**: Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization25* **Prompt fatigue mitigation**: Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization

25* **Accept Edits mode**: Batch accept multiple edits while maintaining permission prompts for commands with side effects26* **Accept Edits mode**: Batch accept multiple edits while maintaining permission prompts for commands with side effects


37* **Permission system**: Sensitive operations require explicit approval38* **Permission system**: Sensitive operations require explicit approval

38* **Context-aware analysis**: Detects potentially harmful instructions by analyzing the full request39* **Context-aware analysis**: Detects potentially harmful instructions by analyzing the full request

39* **Input sanitization**: Prevents command injection by processing user inputs40* **Input sanitization**: Prevents command injection by processing user inputs

40* **Command blocklist**: Blocks risky commands that fetch arbitrary content from the web like `curl` and `wget` by default. When explicitly allowed, be aware of [permission pattern limitations](/en/docs/claude-code/iam#tool-specific-permission-rules)41* **Command blocklist**: Blocks risky commands that fetch arbitrary content from the web like `curl` and `wget` by default. When explicitly allowed, be aware of [permission pattern limitations](/en/iam#tool-specific-permission-rules)

41 42 

42### Privacy safeguards43### Privacy safeguards

43 44 


58* **Command injection detection**: Suspicious bash commands require manual approval even if previously allowlisted59* **Command injection detection**: Suspicious bash commands require manual approval even if previously allowlisted

59* **Fail-closed matching**: Unmatched commands default to requiring manual approval60* **Fail-closed matching**: Unmatched commands default to requiring manual approval

60* **Natural language descriptions**: Complex bash commands include explanations for user understanding61* **Natural language descriptions**: Complex bash commands include explanations for user understanding

61* **Secure credential storage**: API keys and tokens are encrypted. See [Credential Management](/en/docs/claude-code/iam#credential-management)62* **Secure credential storage**: API keys and tokens are encrypted. See [Credential Management](/en/iam#credential-management)

63 

64<Warning>

65 **Windows WebDAV security risk**: When running Claude Code on Windows, we recommend against enabling WebDAV or allowing Claude Code to access paths such as `\\*` that may contain WebDAV subdirectories. [WebDAV has been deprecated by Microsoft](https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#:~:text=The%20Webclient%20\(WebDAV\)%20service%20is%20deprecated) due to security risks. Enabling WebDAV may allow Claude Code to trigger network requests to remote hosts, bypassing the permission system.

66</Warning>

62 67 

63**Best practices for working with untrusted content**:68**Best practices for working with untrusted content**:

64 69 


82 87 

83## IDE security88## IDE security

84 89 

85See [here](/en/docs/claude-code/ide-integrations#security) for more information on the security of running Claude Code in an IDE.90See [here](/en/vs-code#security) for more information on the security of running Claude Code in an IDE.

91 

92## Cloud execution security

93 

94When using [Claude Code on the web](/en/claude-code-on-the-web), additional security controls are in place:

95 

96* **Isolated virtual machines**: Each cloud session runs in an isolated, Anthropic-managed VM

97* **Network access controls**: Network access is limited by default and can be configured to be disabled or allow only specific domains

98* **Credential protection**: Authentication is handled through a secure proxy that uses a scoped credential inside the sandbox, which is then translated to your actual GitHub authentication token

99* **Branch restrictions**: Git push operations are restricted to the current working branch

100* **Audit logging**: All operations in cloud environments are logged for compliance and audit purposes

101* **Automatic cleanup**: Cloud environments are automatically terminated after session completion

102 

103For more details on cloud execution, see [Claude Code on the web](/en/claude-code-on-the-web).

86 104 

87## Security best practices105## Security best practices

88 106 


90 108 

91* Review all suggested changes before approval109* Review all suggested changes before approval

92* Use project-specific permission settings for sensitive repositories110* Use project-specific permission settings for sensitive repositories

93* Consider using [devcontainers](/en/docs/claude-code/devcontainer) for additional isolation111* Consider using [devcontainers](/en/devcontainer) for additional isolation

94* Regularly audit your permission settings with `/permissions`112* Regularly audit your permission settings with `/permissions`

95 113 

96### Team security114### Team security

97 115 

98* Use [enterprise managed policies](/en/docs/claude-code/iam#enterprise-managed-policy-settings) to enforce organizational standards116* Use [enterprise managed policies](/en/iam#enterprise-managed-policy-settings) to enforce organizational standards

99* Share approved permission configurations through version control117* Share approved permission configurations through version control

100* Train team members on security best practices118* Train team members on security best practices

101* Monitor Claude Code usage through [OpenTelemetry metrics](/en/docs/claude-code/monitoring-usage)119* Monitor Claude Code usage through [OpenTelemetry metrics](/en/monitoring-usage)

102 120 

103### Reporting security issues121### Reporting security issues

104 122 


111 129 

112## Related resources130## Related resources

113 131 

114* [Identity and Access Management](/en/docs/claude-code/iam) - Configure permissions and access controls132* [Sandboxing](/en/sandboxing) - Filesystem and network isolation for bash commands

115* [Monitoring usage](/en/docs/claude-code/monitoring-usage) - Track and audit Claude Code activity133* [Identity and Access Management](/en/iam) - Configure permissions and access controls

116* [Development containers](/en/docs/claude-code/devcontainer) - Secure, isolated environments134* [Monitoring usage](/en/monitoring-usage) - Track and audit Claude Code activity

135* [Development containers](/en/devcontainer) - Secure, isolated environments

117* [Anthropic Trust Center](https://trust.anthropic.com) - Security certifications and compliance136* [Anthropic Trust Center](https://trust.anthropic.com) - Security certifications and compliance

137 

138 

139---

140 

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

settings.md +179 −42

Details

21 * Linux and WSL: `/etc/claude-code/managed-settings.json`21 * Linux and WSL: `/etc/claude-code/managed-settings.json`

22 * Windows: `C:\ProgramData\ClaudeCode\managed-settings.json`22 * Windows: `C:\ProgramData\ClaudeCode\managed-settings.json`

23* Enterprise deployments can also configure **managed MCP servers** that override23* Enterprise deployments can also configure **managed MCP servers** that override

24 user-configured servers. See [Enterprise MCP configuration](/en/docs/claude-code/mcp#enterprise-mcp-configuration):24 user-configured servers. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration):

25 * macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`25 * macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`

26 * Linux and WSL: `/etc/claude-code/managed-mcp.json`26 * Linux and WSL: `/etc/claude-code/managed-mcp.json`

27 * Windows: `C:\ProgramData\ClaudeCode\managed-mcp.json`27 * Windows: `C:\ProgramData\ClaudeCode\managed-mcp.json`

28* **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`.

28 29 

29```JSON Example settings.json theme={null}30```JSON Example settings.json theme={null}

30{31{


44 "env": {45 "env": {

45 "CLAUDE_CODE_ENABLE_TELEMETRY": "1",46 "CLAUDE_CODE_ENABLE_TELEMETRY": "1",

46 "OTEL_METRICS_EXPORTER": "otlp"47 "OTEL_METRICS_EXPORTER": "otlp"

47 }48 },

49 "companyAnnouncements": [

50 "Welcome to Acme Corp! Review our code guidelines at docs.acme.com",

51 "Reminder: Code reviews required for all PRs",

52 "New security policy in effect"

53 ]

48}54}

49```55```

50 56 


53`settings.json` supports a number of options:59`settings.json` supports a number of options:

54 60 

55| Key | Description | Example |61| Key | Description | Example |

56| :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |62| :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |

57| `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` |63| `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` |

58| `cleanupPeriodDays` | How long to locally retain chat transcripts based on last activity date (default: 30 days) | `20` |64| `cleanupPeriodDays` | Sessions inactive for longer than this period are deleted at startup. Setting to `0` immediately deletes all sessions. (default: 30 days) | `20` |

65| `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"]` |

59| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |66| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |

60| `includeCoAuthoredBy` | Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |67| `includeCoAuthoredBy` | Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |

61| `permissions` | See table below for structure of permissions. | |68| `permissions` | See table below for structure of permissions. | |

62| `hooks` | Configure custom commands to run before or after tool executions. See [hooks documentation](hooks) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |69| `hooks` | Configure custom commands to run before or after tool executions. See [hooks documentation](/en/hooks) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |

63| `disableAllHooks` | Disable all [hooks](hooks) | `true` |70| `disableAllHooks` | Disable all [hooks](/en/hooks) | `true` |

64| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |71| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |

65| `statusLine` | Configure a custom status line to display context. See [statusLine documentation](statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |72| `statusLine` | Configure a custom status line to display context. See [statusLine documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |

66| `outputStyle` | Configure an output style to adjust the system prompt. See [output styles documentation](output-styles) | `"Explanatory"` |73| `outputStyle` | Configure an output style to adjust the system prompt. See [output styles documentation](/en/output-styles) | `"Explanatory"` |

67| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |74| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |

68| `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"` |75| `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"` |

69| `enableAllProjectMcpServers` | Automatically approve all MCP servers defined in project `.mcp.json` files | `true` |76| `enableAllProjectMcpServers` | Automatically approve all MCP servers defined in project `.mcp.json` files | `true` |

70| `enabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to approve | `["memory", "github"]` |77| `enabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to approve | `["memory", "github"]` |

71| `disabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to reject | `["filesystem"]` |78| `disabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to reject | `["filesystem"]` |

72| `useEnterpriseMcpConfigOnly` | When set in managed-settings.json, restricts MCP servers to only those defined in managed-mcp.json. See [Enterprise MCP configuration](/en/docs/claude-code/mcp#enterprise-mcp-configuration) | `true` |79| `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" }]` |

73| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/docs/claude-code/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |80| `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" }]` |

74| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/docs/claude-code/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |81| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |

82| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |

75 83 

76### Permission settings84### Permission settings

77 85 

78| Keys | Description | Example |86| Keys | Description | Example |

79| :----------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------- |87| :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------- |

80| `allow` | Array of [permission rules](/en/docs/claude-code/iam#configuring-permissions) to allow tool use. **Note:** Bash rules use prefix matching, not regex | `[ "Bash(git diff:*)" ]` |88| `allow` | Array of [permission rules](/en/iam#configuring-permissions) to allow tool use. **Note:** Bash rules use prefix matching, not regex | `[ "Bash(git diff:*)" ]` |

81| `ask` | Array of [permission rules](/en/docs/claude-code/iam#configuring-permissions) to ask for confirmation upon tool use. | `[ "Bash(git push:*)" ]` |89| `ask` | Array of [permission rules](/en/iam#configuring-permissions) to ask for confirmation upon tool use. | `[ "Bash(git push:*)" ]` |

82| `deny` | Array of [permission rules](/en/docs/claude-code/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/docs/claude-code/iam#tool-specific-permission-rules)) | `[ "WebFetch", "Bash(curl:*)", "Read(./.env)", "Read(./secrets/**)" ]` |90| `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/**)" ]` |

83| `additionalDirectories` | Additional [working directories](iam#working-directories) that Claude has access to | `[ "../docs/" ]` |91| `additionalDirectories` | Additional [working directories](/en/iam#working-directories) that Claude has access to | `[ "../docs/" ]` |

84| `defaultMode` | Default [permission mode](iam#permission-modes) when opening Claude Code | `"acceptEdits"` |92| `defaultMode` | Default [permission mode](/en/iam#permission-modes) when opening Claude Code | `"acceptEdits"` |

85| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. See [managed policy settings](iam#enterprise-managed-policy-settings) | `"disable"` |93| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed policy settings](/en/iam#enterprise-managed-policy-settings) | `"disable"` |

94 

95### Sandbox settings

96 

97Configure advanced sandboxing behavior. Sandboxing isolates bash commands from your filesystem and network. See [Sandboxing](/en/sandboxing) for details.

98 

99**Filesystem and network restrictions** are configured via Read, Edit, and WebFetch permission rules, not via these sandbox settings.

100 

101| Keys | Description | Example |

102| :-------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------ |

103| `enabled` | Enable bash sandboxing (macOS/Linux only). Default: false | `true` |

104| `autoAllowBashIfSandboxed` | Auto-approve bash commands when sandboxed. Default: true | `true` |

105| `excludedCommands` | Commands that should run outside of the sandbox | `["git", "docker"]` |

106| `allowUnsandboxedCommands` | Allow commands to run outside the sandbox via the `dangerouslyDisableSandbox` parameter. When set to `false`, the `dangerouslyDisableSandbox` escape hatch is completely disabled and all commands must run sandboxed (or be in `excludedCommands`). Useful for enterprise policies that require strict sandboxing. Default: true | `false` |

107| `network.allowUnixSockets` | Unix socket paths accessible in sandbox (for SSH agents, etc.) | `["~/.ssh/agent-socket"]` |

108| `network.allowLocalBinding` | Allow binding to localhost ports (MacOS only). Default: false | `true` |

109| `network.httpProxyPort` | HTTP proxy port used if you wish to bring your own proxy. If not specified, Claude will run its own proxy. | `8080` |

110| `network.socksProxyPort` | SOCKS5 proxy port used if you wish to bring your own proxy. If not specified, Claude will run its own proxy. | `8081` |

111| `enableWeakerNestedSandbox` | Enable weaker sandbox for unprivileged Docker environments (Linux only). **Reduces security.** Default: false | `true` |

112 

113**Configuration example:**

114 

115```json theme={null}

116{

117 "sandbox": {

118 "enabled": true,

119 "autoAllowBashIfSandboxed": true,

120 "excludedCommands": ["docker"],

121 "network": {

122 "allowUnixSockets": [

123 "/var/run/docker.sock"

124 ],

125 "allowLocalBinding": true

126 }

127 },

128 "permissions": {

129 "deny": [

130 "Read(.envrc)",

131 "Read(~/.aws/**)"

132 ]

133 }

134}

135```

136 

137**Filesystem access** is controlled via Read/Edit permissions:

138 

139* Read deny rules block file reads in sandbox

140* Edit allow rules permit file writes (in addition to the defaults, e.g. the current working directory)

141* Edit deny rules block writes within allowed paths

142 

143**Network access** is controlled via WebFetch permissions:

144 

145* WebFetch allow rules permit network domains

146* WebFetch deny rules block network domains

86 147 

87### Settings precedence148### Settings precedence

88 149 


148* **User subagents**: `~/.claude/agents/` - Available across all your projects209* **User subagents**: `~/.claude/agents/` - Available across all your projects

149* **Project subagents**: `.claude/agents/` - Specific to your project and can be shared with your team210* **Project subagents**: `.claude/agents/` - Specific to your project and can be shared with your team

150 211 

151Subagent files define specialized AI assistants with custom prompts and tool permissions. Learn more about creating and using subagents in the [subagents documentation](/en/docs/claude-code/sub-agents).212Subagent files define specialized AI assistants with custom prompts and tool permissions. Learn more about creating and using subagents in the [subagents documentation](/en/sub-agents).

152 213 

153## Plugin configuration214## Plugin configuration

154 215 


244* View plugin details (commands, agents, hooks provided)305* View plugin details (commands, agents, hooks provided)

245* Add/remove marketplaces306* Add/remove marketplaces

246 307 

247Learn more about the plugin system in the [plugins documentation](/en/docs/claude-code/plugins).308Learn more about the plugin system in the [plugins documentation](/en/plugins).

248 309 

249## Environment variables310## Environment variables

250 311 


255</Note>316</Note>

256 317 

257| Variable | Purpose |318| Variable | Purpose |

258| :----------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |319| :----------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

259| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) |320| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) |

260| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |321| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |

261| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |322| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |

262| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | See [Model configuration](/en/docs/claude-code/model-config#environment-variables) |323| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | See [Model configuration](/en/model-config#environment-variables) |

263| `ANTHROPIC_DEFAULT_OPUS_MODEL` | See [Model configuration](/en/docs/claude-code/model-config#environment-variables) |324| `ANTHROPIC_DEFAULT_OPUS_MODEL` | See [Model configuration](/en/model-config#environment-variables) |

264| `ANTHROPIC_DEFAULT_SONNET_MODEL` | See [Model configuration](/en/docs/claude-code/model-config#environment-variables) |325| `ANTHROPIC_DEFAULT_SONNET_MODEL` | See [Model configuration](/en/model-config#environment-variables) |

265| `ANTHROPIC_MODEL` | Name of the model setting to use (see [Model Configuration](/en/docs/claude-code/model-config#environment-variables)) |326| `ANTHROPIC_FOUNDRY_API_KEY` | API key for Microsoft Foundry authentication (see [Microsoft Foundry](/en/microsoft-foundry)) |

266| `ANTHROPIC_SMALL_FAST_MODEL` | \[DEPRECATED] Name of [Haiku-class model for background tasks](/en/docs/claude-code/costs) |327| `ANTHROPIC_MODEL` | Name of the model setting to use (see [Model Configuration](/en/model-config#environment-variables)) |

328| `ANTHROPIC_SMALL_FAST_MODEL` | \[DEPRECATED] Name of [Haiku-class model for background tasks](/en/costs) |

267| `ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION` | Override AWS region for the Haiku-class model when using Bedrock |329| `ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION` | Override AWS region for the Haiku-class model when using Bedrock |

268| `AWS_BEARER_TOKEN_BEDROCK` | Bedrock API key for authentication (see [Bedrock API keys](https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/)) |330| `AWS_BEARER_TOKEN_BEDROCK` | Bedrock API key for authentication (see [Bedrock API keys](https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/)) |

269| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |331| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |


274| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |336| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |

275| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) |337| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) |

276| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |338| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |

339| `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 |

277| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |340| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |

278| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |341| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |

279| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |342| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |

280| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests |343| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests |

344| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (e.g., for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` |

281| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (e.g. when using an LLM gateway) |345| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (e.g. when using an LLM gateway) |

346| `CLAUDE_CODE_SKIP_FOUNDRY_AUTH` | Skip Azure authentication for Microsoft Foundry (e.g. when using an LLM gateway) |

282| `CLAUDE_CODE_SKIP_VERTEX_AUTH` | Skip Google authentication for Vertex (e.g. when using an LLM gateway) |347| `CLAUDE_CODE_SKIP_VERTEX_AUTH` | Skip Google authentication for Vertex (e.g. when using an LLM gateway) |

283| `CLAUDE_CODE_SUBAGENT_MODEL` | See [Model configuration](/en/docs/claude-code/model-config) |348| `CLAUDE_CODE_SUBAGENT_MODEL` | See [Model configuration](/en/model-config) |

284| `CLAUDE_CODE_USE_BEDROCK` | Use [Bedrock](/en/docs/claude-code/amazon-bedrock) |349| `CLAUDE_CODE_USE_BEDROCK` | Use [Bedrock](/en/amazon-bedrock) |

285| `CLAUDE_CODE_USE_VERTEX` | Use [Vertex](/en/docs/claude-code/google-vertex-ai) |350| `CLAUDE_CODE_USE_FOUNDRY` | Use [Microsoft Foundry](/en/microsoft-foundry) |

286| `DISABLE_AUTOUPDATER` | Set to `1` to disable automatic updates. This takes precedence over the `autoUpdates` configuration setting. |351| `CLAUDE_CODE_USE_VERTEX` | Use [Vertex](/en/google-vertex-ai) |

352| `CLAUDE_CONFIG_DIR` | Customize where Claude Code stores its configuration and data files |

353| `DISABLE_AUTOUPDATER` | Set to `1` to disable automatic updates. |

287| `DISABLE_BUG_COMMAND` | Set to `1` to disable the `/bug` command |354| `DISABLE_BUG_COMMAND` | Set to `1` to disable the `/bug` command |

288| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |355| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |

289| `DISABLE_ERROR_REPORTING` | Set to `1` to opt out of Sentry error reporting |356| `DISABLE_ERROR_REPORTING` | Set to `1` to opt out of Sentry error reporting |


296| `HTTP_PROXY` | Specify HTTP proxy server for network connections |363| `HTTP_PROXY` | Specify HTTP proxy server for network connections |

297| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |364| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |

298| `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) |365| `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) |

299| `MAX_THINKING_TOKENS` | Enable [extended thinking](/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](/en/docs/build-with-claude/prompt-caching#caching-with-thinking-blocks). Disabled by default. |366| `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. |

300| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |367| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |

301| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |368| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |

302| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |369| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |

303| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for slash command metadata shown to [SlashCommand tool](/en/docs/claude-code/slash-commands#slashcommand-tool) (default: 15000) |370| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for slash command metadata shown to [SlashCommand tool](/en/slash-commands#slashcommand-tool) (default: 15000) |

304| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` intead of `rg` included with Claude Code |371| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` intead of `rg` included with Claude Code |

305| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI |372| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI |

306| `VERTEX_REGION_CLAUDE_3_5_SONNET` | Override region for Claude Sonnet 3.5 when using Vertex AI |

307| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI |373| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI |

308| `VERTEX_REGION_CLAUDE_4_0_OPUS` | Override region for Claude 4.0 Opus when using Vertex AI |374| `VERTEX_REGION_CLAUDE_4_0_OPUS` | Override region for Claude 4.0 Opus when using Vertex AI |

309| `VERTEX_REGION_CLAUDE_4_0_SONNET` | Override region for Claude 4.0 Sonnet when using Vertex AI |375| `VERTEX_REGION_CLAUDE_4_0_SONNET` | Override region for Claude 4.0 Sonnet when using Vertex AI |


314Claude Code has access to a set of powerful tools that help it understand and modify your codebase:380Claude Code has access to a set of powerful tools that help it understand and modify your codebase:

315 381 

316| Tool | Description | Permission Required |382| Tool | Description | Permission Required |

317| :--------------- | :----------------------------------------------------------------------------------- | :------------------ |383| :------------------ | :------------------------------------------------------------------------------------------------ | :------------------ |

318| **Bash** | Executes shell commands in your environment | Yes |384| **AskUserQuestion** | Asks the user multiple choice questions to gather information or clarify ambiguity | No |

385| **Bash** | Executes shell commands in your environment (see [Bash tool behavior](#bash-tool-behavior) below) | Yes |

386| **BashOutput** | Retrieves output from a background bash shell | No |

319| **Edit** | Makes targeted edits to specific files | Yes |387| **Edit** | Makes targeted edits to specific files | Yes |

388| **ExitPlanMode** | Prompts the user to exit plan mode and start coding | Yes |

320| **Glob** | Finds files based on pattern matching | No |389| **Glob** | Finds files based on pattern matching | No |

321| **Grep** | Searches for patterns in file contents | No |390| **Grep** | Searches for patterns in file contents | No |

391| **KillShell** | Kills a running background bash shell by its ID | No |

322| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |392| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |

323| **NotebookRead** | Reads and displays Jupyter notebook contents | No |

324| **Read** | Reads the contents of files | No |393| **Read** | Reads the contents of files | No |

325| **SlashCommand** | Runs a [custom slash command](/en/docs/claude-code/slash-commands#slashcommand-tool) | Yes |394| **Skill** | Executes a skill within the main conversation | Yes |

395| **SlashCommand** | Runs a [custom slash command](/en/slash-commands#slashcommand-tool) | Yes |

326| **Task** | Runs a sub-agent to handle complex, multi-step tasks | No |396| **Task** | Runs a sub-agent to handle complex, multi-step tasks | No |

327| **TodoWrite** | Creates and manages structured task lists | No |397| **TodoWrite** | Creates and manages structured task lists | No |

328| **WebFetch** | Fetches content from a specified URL | Yes |398| **WebFetch** | Fetches content from a specified URL | Yes |

329| **WebSearch** | Performs web searches with domain filtering | Yes |399| **WebSearch** | Performs web searches with domain filtering | Yes |

330| **Write** | Creates or overwrites files | Yes |400| **Write** | Creates or overwrites files | Yes |

331 401 

332Permission rules can be configured using `/allowed-tools` or in [permission settings](/en/docs/claude-code/settings#available-settings). Also see [Tool-specific permission rules](/en/docs/claude-code/iam#tool-specific-permission-rules).402Permission rules can be configured using `/allowed-tools` or in [permission settings](/en/settings#available-settings). Also see [Tool-specific permission rules](/en/iam#tool-specific-permission-rules).

403 

404### Bash tool behavior

405 

406The Bash tool executes shell commands with the following persistence behavior:

407 

408* **Working directory persists**: When Claude changes the working directory (e.g., `cd /path/to/dir`), subsequent Bash commands will execute in that directory. You can use `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1` to reset to the project directory after each command.

409* **Environment variables do NOT persist**: Environment variables set in one Bash command (e.g., `export MY_VAR=value`) are **not** available in subsequent Bash commands. Each Bash command runs in a fresh shell environment.

410 

411To make environment variables available in Bash commands, you have **three options**:

412 

413**Option 1: Activate environment before starting Claude Code** (simplest approach)

414 

415Activate your virtual environment in your terminal before launching Claude Code:

416 

417```bash theme={null}

418conda activate myenv

419# or: source /path/to/venv/bin/activate

420claude

421```

422 

423This works for shell environments but environment variables set within Claude's Bash commands will not persist between commands.

424 

425**Option 2: Set CLAUDE\_ENV\_FILE before starting Claude Code** (persistent environment setup)

426 

427Export the path to a shell script containing your environment setup:

428 

429```bash theme={null}

430export CLAUDE_ENV_FILE=/path/to/env-setup.sh

431claude

432```

433 

434Where `/path/to/env-setup.sh` contains:

435 

436```bash theme={null}

437conda activate myenv

438# or: source /path/to/venv/bin/activate

439# or: export MY_VAR=value

440```

441 

442Claude Code will source this file before each Bash command, making the environment persistent across all commands.

443 

444**Option 3: Use a SessionStart hook** (project-specific configuration)

445 

446Configure in `.claude/settings.json`:

447 

448```json theme={null}

449{

450 "hooks": {

451 "SessionStart": [{

452 "matcher": "startup",

453 "hooks": [{

454 "type": "command",

455 "command": "echo 'conda activate myenv' >> \"$CLAUDE_ENV_FILE\""

456 }]

457 }]

458 }

459}

460```

461 

462The hook writes to `$CLAUDE_ENV_FILE`, which is then sourced before each Bash command. This is ideal for team-shared project configurations.

463 

464See [SessionStart hooks](/en/hooks#persisting-environment-variables) for more details on Option 3.

333 465 

334### Extending tools with hooks466### Extending tools with hooks

335 467 

336You can run custom commands before or after any tool executes using468You can run custom commands before or after any tool executes using

337[Claude Code hooks](/en/docs/claude-code/hooks-guide).469[Claude Code hooks](/en/hooks-guide).

338 470 

339For example, you could automatically run a Python formatter after Claude471For example, you could automatically run a Python formatter after Claude

340modifies Python files, or prevent modifications to production configuration472modifies Python files, or prevent modifications to production configuration


342 474 

343## See also475## See also

344 476 

345* [Identity and Access Management](/en/docs/claude-code/iam#configuring-permissions) - Learn about Claude Code's permission system477* [Identity and Access Management](/en/iam#configuring-permissions) - Learn about Claude Code's permission system

346* [IAM and access control](/en/docs/claude-code/iam#enterprise-managed-policy-settings) - Enterprise policy management478* [IAM and access control](/en/iam#enterprise-managed-policy-settings) - Enterprise policy management

347* [Troubleshooting](/en/docs/claude-code/troubleshooting#auto-updater-issues) - Solutions for common configuration issues479* [Troubleshooting](/en/troubleshooting#auto-updater-issues) - Solutions for common configuration issues

480 

481 

482---

483 

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

setup.md +77 −39

Details

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 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL 1, WSL 2, or Git for Windows)

8* **Hardware**: 4GB+ RAM8* **Hardware**: 4GB+ RAM

9* **Software**: [Node.js 18+](https://nodejs.org/en/download)9* **Software**: [Node.js 18+](https://nodejs.org/en/download) (only required for NPM installation)

10* **Network**: Internet connection required for authentication and AI processing10* **Network**: Internet connection required for authentication and AI processing

11* **Shell**: Works best in Bash, Zsh or Fish11* **Shell**: Works best in Bash, Zsh or Fish

12* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)12* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)

13 13 

14### Additional dependencies14### Additional dependencies

15 15 

16* **ripgrep**: Usually included with Claude Code. If search functionality fails, see [search troubleshooting](/en/docs/claude-code/troubleshooting#search-and-discovery-issues).16* **ripgrep**: Usually included with Claude Code. If search functionality fails, see [search troubleshooting](/en/troubleshooting#search-and-discovery-issues).

17 17 

18## Standard installation18## Standard installation

19 19 

20To install Claude Code, run the following command:20To install Claude Code, use one of the following methods:

21 21 

22```sh theme={null}22<Tabs>

23npm install -g @anthropic-ai/claude-code23 <Tab title="Native Install (Recommended)">

24```24 **Homebrew (macOS, Linux):**

25 25 

26<Warning>26 ```sh theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

27 Do NOT use `sudo npm install -g` as this can lead to permission issues and security risks.27 brew install --cask claude-code

28 If you encounter permission errors, see [configure Claude Code](/en/docs/claude-code/troubleshooting#linux-permission-issues) for recommended solutions.28 ```

29</Warning>29 

30 **macOS, Linux, WSL:**

31 

32 ```bash theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

33 curl -fsSL https://claude.ai/install.sh | bash

34 ```

35 

36 **Windows PowerShell:**

37 

38 ```powershell theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

39 irm https://claude.ai/install.ps1 | iex

40 ```

41 

42 **Windows CMD:**

43 

44 ```batch theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

45 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

46 ```

47 </Tab>

48 

49 <Tab title="NPM">

50 If you have [Node.js 18 or newer installed](https://nodejs.org/en/download/):

51 

52 ```sh theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

53 npm install -g @anthropic-ai/claude-code

54 ```

55 </Tab>

56</Tabs>

30 57 

31<Note>58<Note>

32 Some users may be automatically migrated to an improved installation method.59 Some users may be automatically migrated to an improved installation method.

33 Run `claude doctor` after installation to check your installation type.

34</Note>60</Note>

35 61 

36After the installation process completes, navigate to your project and start Claude Code:62After the installation process completes, navigate to your project and start Claude Code:


44 70 

451. **Claude Console**: The default option. Connect through the Claude Console and complete the OAuth process. Requires active billing at [console.anthropic.com](https://console.anthropic.com). A "Claude Code" workspace will be automatically created for usage tracking and cost management. Note that you cannot create API keys for the Claude Code workspace - it is dedicated exclusively for Claude Code usage.711. **Claude Console**: The default option. Connect through the Claude Console and complete the OAuth process. Requires active billing at [console.anthropic.com](https://console.anthropic.com). A "Claude Code" workspace will be automatically created for usage tracking and cost management. Note that you cannot create API keys for the Claude Code workspace - it is dedicated exclusively for Claude Code usage.

462. **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.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.

473. **Enterprise platforms**: Configure Claude Code to use [Amazon Bedrock or Google Vertex AI](/en/docs/claude-code/third-party-integrations) for enterprise deployments with your existing cloud infrastructure.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.

48 74 

49<Note>75<Note>

50 Claude Code securely stores your credentials. See [Credential Management](/en/docs/claude-code/iam#credential-management) for details.76 Claude Code securely stores your credentials. See [Credential Management](/en/iam#credential-management) for details.

51</Note>77</Note>

52 78 

53## Windows setup79## Windows setup


68 94 

69Claude Code offers multiple installation methods to suit different environments.95Claude Code offers multiple installation methods to suit different environments.

70 96 

71If you encounter any issues during installation, consult the [troubleshooting guide](/en/docs/claude-code/troubleshooting#linux-permission-issues).97If you encounter any issues during installation, consult the [troubleshooting guide](/en/troubleshooting#linux-permission-issues).

72 98 

73<Tip>99<Tip>

74 Run `claude doctor` after installation to check your installation type and version.100 Run `claude doctor` after installation to check your installation type and version.

75</Tip>101</Tip>

76 102 

77### Global npm installation103### Native installation options

78 

79Traditional method shown in the [install steps above](#standard-installation)

80 

81### Native binary installation (Beta)

82 104 

83If you have an existing installation of Claude Code, use `claude install` to start the native binary installation.105The native installation is the recommended method and offers several benefits:

84 106 

85For a fresh install, run one of the following commands:107* One self-contained executable

108* No Node.js dependency

109* Improved auto-updater stability

86 110 

87**Homebrew (macOS, Linux):**111If you have an existing installation of Claude Code, use `claude install` to migrate to the native binary installation.

88 112 

89```sh theme={null}113For advanced installation options with the native installer:

90brew install --cask claude-code

91```

92 

93<Note>

94 Claude Code installed via Homebrew will auto-update outside of the brew directory unless explicitly disabled with the `DISABLE_AUTOUPDATER` environment variable (see [Auto updates](#auto-updates) section).

95</Note>

96 114 

97**macOS, Linux, WSL:**115**macOS, Linux, WSL:**

98 116 


111 **Alpine Linux and other musl/uClibc-based distributions**: The native build requires you to install `libgcc`, `libstdc++`, and `ripgrep`. Install (Alpine: `apk add libgcc libstdc++ ripgrep`) and set `USE_BUILTIN_RIPGREP=0`.129 **Alpine Linux and other musl/uClibc-based distributions**: The native build requires you to install `libgcc`, `libstdc++`, and `ripgrep`. Install (Alpine: `apk add libgcc libstdc++ ripgrep`) and set `USE_BUILTIN_RIPGREP=0`.

112</Note>130</Note>

113 131 

132<Note>

133 Claude Code installed via Homebrew will auto-update outside of the brew directory unless explicitly disabled with the `DISABLE_AUTOUPDATER` environment variable (see [Auto updates](#auto-updates) section).

134</Note>

135 

114**Windows PowerShell:**136**Windows PowerShell:**

115 137 

116```powershell theme={null}138```powershell theme={null}


137curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 1.0.58 && del install.cmd159curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 1.0.58 && del install.cmd

138```160```

139 161 

140The native Claude Code installer is supported on macOS, Linux, and Windows.

141 

142<Tip>162<Tip>

143 Make sure that you remove any outdated aliases or symlinks.163 Make sure that you remove any outdated aliases or symlinks before installing.

144 Once your installation is complete, run `claude doctor` to verify the installation.

145</Tip>164</Tip>

146 165 

147### Local installation166**Binary integrity and code signing**

167 

168* 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`)

169* Signed binaries are distributed for the following platforms:

170 * macOS: Signed by "Anthropic PBC" and notarized by Apple

171 * Windows: Signed by "Anthropic, PBC"

172 

173### NPM installation

148 174 

149* After global install via npm, use `claude migrate-installer` to move to local175For environments where NPM is preferred or required:

150* Avoids autoupdater npm permission issues176 

151* Some users may be automatically migrated to this method177```sh theme={null}

178npm install -g @anthropic-ai/claude-code

179```

180 

181<Warning>

182 Do NOT use `sudo npm install -g` as this can lead to permission issues and security risks.

183 If you encounter permission errors, see [configure Claude Code](/en/troubleshooting#linux-permission-issues) for recommended solutions.

184</Warning>

152 185 

153## Running on AWS or GCP186## Running on AWS or GCP

154 187 

155By default, Claude Code uses the Claude API.188By default, Claude Code uses the Claude API.

156 189 

157For details on running Claude Code on AWS or GCP, see [third-party integrations](/en/docs/claude-code/third-party-integrations).190For details on running Claude Code on AWS or GCP, see [third-party integrations](/en/third-party-integrations).

158 191 

159## Update Claude Code192## Update Claude Code

160 193 


169 202 

170**Disable auto-updates:**203**Disable auto-updates:**

171 204 

172Set the `DISABLE_AUTOUPDATER` environment variable in your shell or [settings.json file](/en/docs/claude-code/settings):205Set the `DISABLE_AUTOUPDATER` environment variable in your shell or [settings.json file](/en/settings):

173 206 

174```bash theme={null}207```bash theme={null}

175export DISABLE_AUTOUPDATER=1208export DISABLE_AUTOUPDATER=1


180```bash theme={null}213```bash theme={null}

181claude update214claude update

182```215```

216 

217 

218---

219 

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

skills.md +612 −0 added

Details

1# Agent Skills

2 

3> Create, manage, and share Skills to extend Claude's capabilities in Claude Code.

4 

5This guide shows you how to create, use, and manage Agent Skills in Claude Code. Skills are modular capabilities that extend Claude's functionality through organized folders containing instructions, scripts, and resources.

6 

7## Prerequisites

8 

9* Claude Code version 1.0 or later

10* Basic familiarity with [Claude Code](/en/quickstart)

11 

12## What are Agent Skills?

13 

14Agent Skills package expertise into discoverable capabilities. Each Skill consists of a `SKILL.md` file with instructions that Claude reads when relevant, plus optional supporting files like scripts and templates.

15 

16**How Skills are invoked**: Skills are **model-invoked**—Claude autonomously decides when to use them based on your request and the Skill's description. This is different from slash commands, which are **user-invoked** (you explicitly type `/command` to trigger them).

17 

18**Benefits**:

19 

20* Extend Claude's capabilities for your specific workflows

21* Share expertise across your team via git

22* Reduce repetitive prompting

23* Compose multiple Skills for complex tasks

24 

25Learn more in the [Agent Skills overview](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview).

26 

27<Note>

28 For a deep dive into the architecture and real-world applications of Agent Skills, read our engineering blog: [Equipping agents for the real world with Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills).

29</Note>

30 

31## Create a Skill

32 

33Skills are stored as directories containing a `SKILL.md` file.

34 

35### Personal Skills

36 

37Personal Skills are available across all your projects. Store them in `~/.claude/skills/`:

38 

39```bash theme={null}

40mkdir -p ~/.claude/skills/my-skill-name

41```

42 

43**Use personal Skills for**:

44 

45* Your individual workflows and preferences

46* Experimental Skills you're developing

47* Personal productivity tools

48 

49### Project Skills

50 

51Project Skills are shared with your team. Store them in `.claude/skills/` within your project:

52 

53```bash theme={null}

54mkdir -p .claude/skills/my-skill-name

55```

56 

57**Use project Skills for**:

58 

59* Team workflows and conventions

60* Project-specific expertise

61* Shared utilities and scripts

62 

63Project Skills are checked into git and automatically available to team members.

64 

65### Plugin Skills

66 

67Skills can also come from [Claude Code plugins](/en/plugins). Plugins may bundle Skills that are automatically available when the plugin is installed. These Skills work the same way as personal and project Skills.

68 

69## Write SKILL.md

70 

71Create a `SKILL.md` file with YAML frontmatter and Markdown content:

72 

73```yaml theme={null}

74---

75name: your-skill-name

76description: Brief description of what this Skill does and when to use it

77---

78 

79# Your Skill Name

80 

81## Instructions

82Provide clear, step-by-step guidance for Claude.

83 

84## Examples

85Show concrete examples of using this Skill.

86```

87 

88**Field requirements**:

89 

90* `name`: Must use lowercase letters, numbers, and hyphens only (max 64 characters)

91* `description`: Brief description of what the Skill does and when to use it (max 1024 characters)

92 

93The `description` field is critical for Claude to discover when to use your Skill. It should include both what the Skill does and when Claude should use it.

94 

95See the [best practices guide](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices) for complete authoring guidance including validation rules.

96 

97## Add supporting files

98 

99Create additional files alongside SKILL.md:

100 

101```

102my-skill/

103├── SKILL.md (required)

104├── reference.md (optional documentation)

105├── examples.md (optional examples)

106├── scripts/

107│ └── helper.py (optional utility)

108└── templates/

109 └── template.txt (optional template)

110```

111 

112Reference these files from SKILL.md:

113 

114````markdown theme={null}

115For advanced usage, see [reference.md](reference.md).

116 

117Run the helper script:

118```bash

119python scripts/helper.py input.txt

120```

121````

122 

123Claude reads these files only when needed, using progressive disclosure to manage context efficiently.

124 

125## Restrict tool access with allowed-tools

126 

127Use the `allowed-tools` frontmatter field to limit which tools Claude can use when a Skill is active:

128 

129```yaml theme={null}

130---

131name: safe-file-reader

132description: Read files without making changes. Use when you need read-only file access.

133allowed-tools: Read, Grep, Glob

134---

135 

136# Safe File Reader

137 

138This Skill provides read-only file access.

139 

140## Instructions

1411. Use Read to view file contents

1422. Use Grep to search within files

1433. Use Glob to find files by pattern

144```

145 

146When this Skill is active, Claude can only use the specified tools (Read, Grep, Glob) without needing to ask for permission. This is useful for:

147 

148* Read-only Skills that shouldn't modify files

149* Skills with limited scope (e.g., only data analysis, no file writing)

150* Security-sensitive workflows where you want to restrict capabilities

151 

152If `allowed-tools` is not specified, Claude will ask for permission to use tools as normal, following the standard permission model.

153 

154<Note>

155 `allowed-tools` is only supported for Skills in Claude Code.

156</Note>

157 

158## View available Skills

159 

160Skills are automatically discovered by Claude from three sources:

161 

162* Personal Skills: `~/.claude/skills/`

163* Project Skills: `.claude/skills/`

164* Plugin Skills: bundled with installed plugins

165 

166**To view all available Skills**, ask Claude directly:

167 

168```

169What Skills are available?

170```

171 

172or

173 

174```

175List all available Skills

176```

177 

178This will show all Skills from all sources, including plugin Skills.

179 

180**To inspect a specific Skill**, you can also check the filesystem:

181 

182```bash theme={null}

183# List personal Skills

184ls ~/.claude/skills/

185 

186# List project Skills (if in a project directory)

187ls .claude/skills/

188 

189# View a specific Skill's content

190cat ~/.claude/skills/my-skill/SKILL.md

191```

192 

193## Test a Skill

194 

195After creating a Skill, test it by asking questions that match your description.

196 

197**Example**: If your description mentions "PDF files":

198 

199```

200Can you help me extract text from this PDF?

201```

202 

203Claude autonomously decides to use your Skill if it matches the request—you don't need to explicitly invoke it. The Skill activates automatically based on the context of your question.

204 

205## Debug a Skill

206 

207If Claude doesn't use your Skill, check these common issues:

208 

209### Make description specific

210 

211**Too vague**:

212 

213```yaml theme={null}

214description: Helps with documents

215```

216 

217**Specific**:

218 

219```yaml theme={null}

220description: 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.

221```

222 

223Include both what the Skill does and when to use it in the description.

224 

225### Verify file path

226 

227**Personal Skills**: `~/.claude/skills/skill-name/SKILL.md`

228**Project Skills**: `.claude/skills/skill-name/SKILL.md`

229 

230Check the file exists:

231 

232```bash theme={null}

233# Personal

234ls ~/.claude/skills/my-skill/SKILL.md

235 

236# Project

237ls .claude/skills/my-skill/SKILL.md

238```

239 

240### Check YAML syntax

241 

242Invalid YAML prevents the Skill from loading. Verify the frontmatter:

243 

244```bash theme={null}

245cat SKILL.md | head -n 10

246```

247 

248Ensure:

249 

250* Opening `---` on line 1

251* Closing `---` before Markdown content

252* Valid YAML syntax (no tabs, correct indentation)

253 

254### View errors

255 

256Run Claude Code with debug mode to see Skill loading errors:

257 

258```bash theme={null}

259claude --debug

260```

261 

262## Share Skills with your team

263 

264**Recommended approach**: Distribute Skills through [plugins](/en/plugins).

265 

266To share Skills via plugin:

267 

2681. Create a plugin with Skills in the `skills/` directory

2692. Add the plugin to a marketplace

2703. Team members install the plugin

271 

272For complete instructions, see [Add Skills to your plugin](/en/plugins#add-skills-to-your-plugin).

273 

274You can also share Skills directly through project repositories:

275 

276### Step 1: Add Skill to your project

277 

278Create a project Skill:

279 

280```bash theme={null}

281mkdir -p .claude/skills/team-skill

282# Create SKILL.md

283```

284 

285### Step 2: Commit to git

286 

287```bash theme={null}

288git add .claude/skills/

289git commit -m "Add team Skill for PDF processing"

290git push

291```

292 

293### Step 3: Team members get Skills automatically

294 

295When team members pull the latest changes, Skills are immediately available:

296 

297```bash theme={null}

298git pull

299claude # Skills are now available

300```

301 

302## Update a Skill

303 

304Edit SKILL.md directly:

305 

306```bash theme={null}

307# Personal Skill

308code ~/.claude/skills/my-skill/SKILL.md

309 

310# Project Skill

311code .claude/skills/my-skill/SKILL.md

312```

313 

314Changes take effect the next time you start Claude Code. If Claude Code is already running, restart it to load the updates.

315 

316## Remove a Skill

317 

318Delete the Skill directory:

319 

320```bash theme={null}

321# Personal

322rm -rf ~/.claude/skills/my-skill

323 

324# Project

325rm -rf .claude/skills/my-skill

326git commit -m "Remove unused Skill"

327```

328 

329## Best practices

330 

331### Keep Skills focused

332 

333One Skill should address one capability:

334 

335**Focused**:

336 

337* "PDF form filling"

338* "Excel data analysis"

339* "Git commit messages"

340 

341**Too broad**:

342 

343* "Document processing" (split into separate Skills)

344* "Data tools" (split by data type or operation)

345 

346### Write clear descriptions

347 

348Help Claude discover when to use Skills by including specific triggers in your description:

349 

350**Clear**:

351 

352```yaml theme={null}

353description: Analyze Excel spreadsheets, create pivot tables, and generate charts. Use when working with Excel files, spreadsheets, or analyzing tabular data in .xlsx format.

354```

355 

356**Vague**:

357 

358```yaml theme={null}

359description: For files

360```

361 

362### Test with your team

363 

364Have teammates use Skills and provide feedback:

365 

366* Does the Skill activate when expected?

367* Are the instructions clear?

368* Are there missing examples or edge cases?

369 

370### Document Skill versions

371 

372You can document Skill versions in your SKILL.md content to track changes over time. Add a version history section:

373 

374```markdown theme={null}

375# My Skill

376 

377## Version History

378- v2.0.0 (2025-10-01): Breaking changes to API

379- v1.1.0 (2025-09-15): Added new features

380- v1.0.0 (2025-09-01): Initial release

381```

382 

383This helps team members understand what changed between versions.

384 

385## Troubleshooting

386 

387### Claude doesn't use my Skill

388 

389**Symptom**: You ask a relevant question but Claude doesn't use your Skill.

390 

391**Check**: Is the description specific enough?

392 

393Vague descriptions make discovery difficult. Include both what the Skill does and when to use it, with key terms users would mention.

394 

395**Too generic**:

396 

397```yaml theme={null}

398description: Helps with data

399```

400 

401**Specific**:

402 

403```yaml theme={null}

404description: Analyze Excel spreadsheets, generate pivot tables, create charts. Use when working with Excel files, spreadsheets, or .xlsx files.

405```

406 

407**Check**: Is the YAML valid?

408 

409Run validation to check for syntax errors:

410 

411```bash theme={null}

412# View frontmatter

413cat .claude/skills/my-skill/SKILL.md | head -n 15

414 

415# Check for common issues

416# - Missing opening or closing ---

417# - Tabs instead of spaces

418# - Unquoted strings with special characters

419```

420 

421**Check**: Is the Skill in the correct location?

422 

423```bash theme={null}

424# Personal Skills

425ls ~/.claude/skills/*/SKILL.md

426 

427# Project Skills

428ls .claude/skills/*/SKILL.md

429```

430 

431### Skill has errors

432 

433**Symptom**: The Skill loads but doesn't work correctly.

434 

435**Check**: Are dependencies available?

436 

437Claude will automatically install required dependencies (or ask for permission to install them) when it needs them.

438 

439**Check**: Do scripts have execute permissions?

440 

441```bash theme={null}

442chmod +x .claude/skills/my-skill/scripts/*.py

443```

444 

445**Check**: Are file paths correct?

446 

447Use forward slashes (Unix style) in all paths:

448 

449**Correct**: `scripts/helper.py`

450**Wrong**: `scripts\helper.py` (Windows style)

451 

452### Multiple Skills conflict

453 

454**Symptom**: Claude uses the wrong Skill or seems confused between similar Skills.

455 

456**Be specific in descriptions**: Help Claude choose the right Skill by using distinct trigger terms in your descriptions.

457 

458Instead of:

459 

460```yaml theme={null}

461# Skill 1

462description: For data analysis

463 

464# Skill 2

465description: For analyzing data

466```

467 

468Use:

469 

470```yaml theme={null}

471# Skill 1

472description: Analyze sales data in Excel files and CRM exports. Use for sales reports, pipeline analysis, and revenue tracking.

473 

474# Skill 2

475description: Analyze log files and system metrics data. Use for performance monitoring, debugging, and system diagnostics.

476```

477 

478## Examples

479 

480### Simple Skill (single file)

481 

482```

483commit-helper/

484└── SKILL.md

485```

486 

487```yaml theme={null}

488---

489name: generating-commit-messages

490description: Generates clear commit messages from git diffs. Use when writing commit messages or reviewing staged changes.

491---

492 

493# Generating Commit Messages

494 

495## Instructions

496 

4971. Run `git diff --staged` to see changes

4982. I'll suggest a commit message with:

499 - Summary under 50 characters

500 - Detailed description

501 - Affected components

502 

503## Best practices

504 

505- Use present tense

506- Explain what and why, not how

507```

508 

509### Skill with tool permissions

510 

511```

512code-reviewer/

513└── SKILL.md

514```

515 

516```yaml theme={null}

517---

518name: code-reviewer

519description: Review code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality.

520allowed-tools: Read, Grep, Glob

521---

522 

523# Code Reviewer

524 

525## Review checklist

526 

5271. Code organization and structure

5282. Error handling

5293. Performance considerations

5304. Security concerns

5315. Test coverage

532 

533## Instructions

534 

5351. Read the target files using Read tool

5362. Search for patterns using Grep

5373. Find related files using Glob

5384. Provide detailed feedback on code quality

539```

540 

541### Multi-file Skill

542 

543```

544pdf-processing/

545├── SKILL.md

546├── FORMS.md

547├── REFERENCE.md

548└── scripts/

549 ├── fill_form.py

550 └── validate.py

551```

552 

553**SKILL.md**:

554 

555````yaml theme={null}

556---

557name: pdf-processing

558description: Extract text, fill forms, merge PDFs. Use when working with PDF files, forms, or document extraction. Requires pypdf and pdfplumber packages.

559---

560 

561# PDF Processing

562 

563## Quick start

564 

565Extract text:

566```python

567import pdfplumber

568with pdfplumber.open("doc.pdf") as pdf:

569 text = pdf.pages[0].extract_text()

570```

571 

572For form filling, see [FORMS.md](FORMS.md).

573For detailed API reference, see [REFERENCE.md](REFERENCE.md).

574 

575## Requirements

576 

577Packages must be installed in your environment:

578```bash

579pip install pypdf pdfplumber

580```

581````

582 

583<Note>

584 List required packages in the description. Packages must be installed in your environment before Claude can use them.

585</Note>

586 

587Claude loads additional files only when needed.

588 

589## Next steps

590 

591<CardGroup cols={2}>

592 <Card title="Authoring best practices" icon="lightbulb" href="https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices">

593 Write Skills that Claude can use effectively

594 </Card>

595 

596 <Card title="Agent Skills overview" icon="book" href="https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview">

597 Learn how Skills work across Claude products

598 </Card>

599 

600 <Card title="Use Skills in the Agent SDK" icon="cube" href="https://docs.claude.com/en/docs/agent-sdk/skills">

601 Use Skills programmatically with TypeScript and Python

602 </Card>

603 

604 <Card title="Get started with Agent Skills" icon="rocket" href="https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart">

605 Create your first Skill

606 </Card>

607</CardGroup>

608 

609 

610---

611 

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

slash-commands.md +130 −16

Details

5## Built-in slash commands5## Built-in slash commands

6 6 

7| Command | Purpose |7| Command | Purpose |

8| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------- |8| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |

9| `/add-dir` | Add additional working directories |9| `/add-dir` | Add additional working directories |

10| `/agents` | Manage custom AI subagents for specialized tasks |10| `/agents` | Manage custom AI subagents for specialized tasks |

11| `/bashes` | List and manage background tasks |

11| `/bug` | Report bugs (sends conversation to Anthropic) |12| `/bug` | Report bugs (sends conversation to Anthropic) |

12| `/clear` | Clear conversation history |13| `/clear` | Clear conversation history |

13| `/compact [instructions]` | Compact conversation with optional focus instructions |14| `/compact [instructions]` | Compact conversation with optional focus instructions |

14| `/config` | Open the Settings interface (Config tab) |15| `/config` | Open the Settings interface (Config tab) |

15| `/cost` | Show token usage statistics (see [cost tracking guide](/en/docs/claude-code/costs#using-the-cost-command) for subscription-specific details) |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) |

16| `/doctor` | Checks the health of your Claude Code installation |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 |

17| `/help` | Get usage help |21| `/help` | Get usage help |

22| `/hooks` | Manage hook configurations for tool events |

23| `/ide` | Manage IDE integrations and show status |

18| `/init` | Initialize project with CLAUDE.md guide |24| `/init` | Initialize project with CLAUDE.md guide |

25| `/install-github-app` | Set up Claude GitHub Actions for a repository |

19| `/login` | Switch Anthropic accounts |26| `/login` | Switch Anthropic accounts |

20| `/logout` | Sign out from your Anthropic account |27| `/logout` | Sign out from your Anthropic account |

21| `/mcp` | Manage MCP server connections and OAuth authentication |28| `/mcp` | Manage MCP server connections and OAuth authentication |

22| `/memory` | Edit CLAUDE.md memory files |29| `/memory` | Edit CLAUDE.md memory files |

23| `/model` | Select or change the AI model |30| `/model` | Select or change the AI model |

24| `/permissions` | View or update [permissions](/en/docs/claude-code/iam#configuring-permissions) |31| `/output-style [style]` | Set the output style directly or from a selection menu |

25| `/pr_comments` | View pull request comments |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| `/resume` | Resume a conversation |

26| `/review` | Request code review |38| `/review` | Request code review |

27| `/rewind` | Rewind the conversation and/or code |39| `/rewind` | Rewind the conversation and/or code |

40| `/sandbox` | Enable sandboxed bash tool with filesystem and network isolation for safer, more autonomous execution |

41| `/security-review` | Complete a security review of pending changes on the current branch |

28| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |42| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |

43| `/statusline` | Set up Claude Code's status line UI |

29| `/terminal-setup` | Install Shift+Enter key binding for newlines (iTerm2 and VSCode only) |44| `/terminal-setup` | Install Shift+Enter key binding for newlines (iTerm2 and VSCode only) |

45| `/todos` | List current todo items |

30| `/usage` | Show plan usage limits and rate limit status (subscription plans only) |46| `/usage` | Show plan usage limits and rate limit status (subscription plans only) |

31| `/vim` | Enter vim mode for alternating insert and command modes |47| `/vim` | Enter vim mode for alternating insert and command modes |

32 48 


150 166 

151#### File references167#### File references

152 168 

153Include file contents in commands using the `@` prefix to [reference files](/en/docs/claude-code/common-workflows#reference-files-and-directories).169Include file contents in commands using the `@` prefix to [reference files](/en/common-workflows#reference-files-and-directories).

154 170 

155For example:171For example:

156 172 


166 182 

167#### Thinking mode183#### Thinking mode

168 184 

169Slash commands can trigger extended thinking by including [extended thinking keywords](/en/docs/claude-code/common-workflows#use-extended-thinking).185Slash commands can trigger extended thinking by including [extended thinking keywords](/en/common-workflows#use-extended-thinking).

170 186 

171### Frontmatter187### Frontmatter

172 188 


177| `allowed-tools` | List of tools the command can use | Inherits from the conversation |193| `allowed-tools` | List of tools the command can use | Inherits from the conversation |

178| `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 |194| `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 |

179| `description` | Brief description of the command | Uses the first line from the prompt |195| `description` | Brief description of the command | Uses the first line from the prompt |

180| `model` | Specific model string (see [Models overview](/en/docs/about-claude/models/overview)) | Inherits from the conversation |196| `model` | Specific model string (see [Models overview](https://docs.claude.com/en/docs/about-claude/models/overview)) | Inherits from the conversation |

181| `disable-model-invocation` | Whether to prevent `SlashCommand` tool from calling this command | false |197| `disable-model-invocation` | Whether to prevent `SlashCommand` tool from calling this command | false |

182 198 

183For example:199For example:


207 223 

208## Plugin commands224## Plugin commands

209 225 

210[Plugins](/en/docs/claude-code/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/docs/claude-code/plugin-marketplaces).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).

211 227 

212### How plugin commands work228### How plugin commands work

213 229 


310 326 

311### MCP permissions and wildcards327### MCP permissions and wildcards

312 328 

313When configuring [permissions for MCP tools](/en/docs/claude-code/iam#tool-specific-permission-rules), note that **wildcards are not supported**:329When configuring [permissions for MCP tools](/en/iam#tool-specific-permission-rules), note that **wildcards are not supported**:

314 330 

315* ✅ **Correct**: `mcp__github` (approves ALL tools from the github server)331* ✅ **Correct**: `mcp__github` (approves ALL tools from the github server)

316* ✅ **Correct**: `mcp__github__get_issue` (approves specific tool)332* ✅ **Correct**: `mcp__github__get_issue` (approves specific tool)


320 336 

321## `SlashCommand` tool337## `SlashCommand` tool

322 338 

323The `SlashCommand` tool allows Claude to execute [custom slash commands](/en/docs/claude-code/slash-commands#custom-slash-commands) programmatically339The `SlashCommand` tool allows Claude to execute [custom slash commands](/en/slash-commands#custom-slash-commands) programmatically

324during a conversation. This gives Claude the ability to invoke custom commands340during a conversation. This gives Claude the ability to invoke custom commands

325on your behalf when appropriate.341on your behalf when appropriate.

326 342 


386When the character budget is exceeded, Claude will see only a subset of the402When the character budget is exceeded, Claude will see only a subset of the

387available commands. In `/context`, a warning will show with "M of N commands".403available commands. In `/context`, a warning will show with "M of N commands".

388 404 

405## Skills vs slash commands

406 

407**Slash commands** and **Agent Skills** serve different purposes in Claude Code:

408 

409### Use slash commands for

410 

411**Quick, frequently-used prompts**:

412 

413* Simple prompt snippets you use often

414* Quick reminders or templates

415* Frequently-used instructions that fit in one file

416 

417**Examples**:

418 

419* `/review` → "Review this code for bugs and suggest improvements"

420* `/explain` → "Explain this code in simple terms"

421* `/optimize` → "Analyze this code for performance issues"

422 

423### Use Skills for

424 

425**Comprehensive capabilities with structure**:

426 

427* Complex workflows with multiple steps

428* Capabilities requiring scripts or utilities

429* Knowledge organized across multiple files

430* Team workflows you want to standardize

431 

432**Examples**:

433 

434* PDF processing Skill with form-filling scripts and validation

435* Data analysis Skill with reference docs for different data types

436* Documentation Skill with style guides and templates

437 

438### Key differences

439 

440| Aspect | Slash Commands | Agent Skills |

441| -------------- | -------------------------------- | ----------------------------------- |

442| **Complexity** | Simple prompts | Complex capabilities |

443| **Structure** | Single .md file | Directory with SKILL.md + resources |

444| **Discovery** | Explicit invocation (`/command`) | Automatic (based on context) |

445| **Files** | One file only | Multiple files, scripts, templates |

446| **Scope** | Project or personal | Project or personal |

447| **Sharing** | Via git | Via git |

448 

449### Example comparison

450 

451**As a slash command**:

452 

453```markdown theme={null}

454# .claude/commands/review.md

455Review this code for:

456- Security vulnerabilities

457- Performance issues

458- Code style violations

459```

460 

461Usage: `/review` (manual invocation)

462 

463**As a Skill**:

464 

465```

466.claude/skills/code-review/

467├── SKILL.md (overview and workflows)

468├── SECURITY.md (security checklist)

469├── PERFORMANCE.md (performance patterns)

470├── STYLE.md (style guide reference)

471└── scripts/

472 └── run-linters.sh

473```

474 

475Usage: "Can you review this code?" (automatic discovery)

476 

477The Skill provides richer context, validation scripts, and organized reference material.

478 

479### When to use each

480 

481**Use slash commands**:

482 

483* You invoke the same prompt repeatedly

484* The prompt fits in a single file

485* You want explicit control over when it runs

486 

487**Use Skills**:

488 

489* Claude should discover the capability automatically

490* Multiple files or scripts are needed

491* Complex workflows with validation steps

492* Team needs standardized, detailed guidance

493 

494Both slash commands and Skills can coexist. Use the approach that fits your needs.

495 

496Learn more about [Agent Skills](/en/skills).

497 

389## See also498## See also

390 499 

391* [Plugins](/en/docs/claude-code/plugins) - Extend Claude Code with custom commands through plugins500* [Plugins](/en/plugins) - Extend Claude Code with custom commands through plugins

392* [Identity and Access Management](/en/docs/claude-code/iam) - Complete guide to permissions, including MCP tool permissions501* [Identity and Access Management](/en/iam) - Complete guide to permissions, including MCP tool permissions

393* [Interactive mode](/en/docs/claude-code/interactive-mode) - Shortcuts, input modes, and interactive features502* [Interactive mode](/en/interactive-mode) - Shortcuts, input modes, and interactive features

394* [CLI reference](/en/docs/claude-code/cli-reference) - Command-line flags and options503* [CLI reference](/en/cli-reference) - Command-line flags and options

395* [Settings](/en/docs/claude-code/settings) - Configuration options504* [Settings](/en/settings) - Configuration options

396* [Memory management](/en/docs/claude-code/memory) - Managing Claude's memory across sessions505* [Memory management](/en/memory) - Managing Claude's memory across sessions

506 

507 

508---

509 

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

statusline.md +5 −0

Details

200 200 

201* If your status line doesn't appear, check that your script is executable (`chmod +x`)201* If your status line doesn't appear, check that your script is executable (`chmod +x`)

202* Ensure your script outputs to stdout (not stderr)202* Ensure your script outputs to stdout (not stderr)

203 

204 

205---

206 

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

sub-agents.md +194 −11

Details

84 84 

85### Plugin agents85### Plugin agents

86 86 

87[Plugins](/en/docs/claude-code/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.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.

88 88 

89**Plugin agent locations**: Plugins include agents in their `agents/` directory (or custom paths specified in the plugin manifest).89**Plugin agent locations**: Plugins include agents in their `agents/` directory (or custom paths specified in the plugin manifest).

90 90 


95* Can be invoked automatically by Claude when appropriate95* Can be invoked automatically by Claude when appropriate

96* Can be managed (viewed, inspected) through `/agents` interface96* Can be managed (viewed, inspected) through `/agents` interface

97 97 

98See the [plugin components reference](/en/docs/claude-code/plugins-reference#agents) for details on creating plugin agents.98See the [plugin components reference](/en/plugins-reference#agents) for details on creating plugin agents.

99 99 

100### CLI-based configuration100### CLI-based configuration

101 101 


121* Automation scripts that need custom subagents121* Automation scripts that need custom subagents

122* Sharing subagent definitions in documentation or scripts122* Sharing subagent definitions in documentation or scripts

123 123 

124For detailed information about the JSON format and all available options, see the [CLI reference documentation](/en/docs/claude-code/cli-reference#agents-flag-format).124For detailed information about the JSON format and all available options, see the [CLI reference documentation](/en/cli-reference#agents-flag-format).

125 125 

126### File format126### File format

127 127 


133description: Description of when this subagent should be invoked133description: Description of when this subagent should be invoked

134tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted134tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted

135model: sonnet # Optional - specify model alias or 'inherit'135model: sonnet # Optional - specify model alias or 'inherit'

136permissionMode: default # Optional - permission mode for the subagent

137skills: skill1, skill2 # Optional - skills to auto-load

136---138---

137 139 

138Your subagent's system prompt goes here. This can be multiple paragraphs140Your subagent's system prompt goes here. This can be multiple paragraphs


146#### Configuration fields148#### Configuration fields

147 149 

148| Field | Required | Description |150| Field | Required | Description |

149| :------------ | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |151| :--------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

150| `name` | Yes | Unique identifier using lowercase letters and hyphens |152| `name` | Yes | Unique identifier using lowercase letters and hyphens |

151| `description` | Yes | Natural language description of the subagent's purpose |153| `description` | Yes | Natural language description of the subagent's purpose |

152| `tools` | No | Comma-separated list of specific tools. If omitted, inherits all tools from the main thread |154| `tools` | No | Comma-separated list of specific tools. If omitted, inherits all tools from the main thread |

153| `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/docs/claude-code/model-config) |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) |

156| `permissionMode` | No | Permission mode for the subagent. Valid values: `default`, `acceptEdits`, `bypassPermissions`, `plan`, `ignore`. Controls how the subagent handles permission requests |

157| `skills` | No | Comma-separated list of skill names to auto-load when the subagent starts. Skills are loaded into the subagent's context automatically |

154 158 

155### Model selection159### Model selection

156 160 

157The `model` field allows you to control which [AI model](/en/docs/claude-code/model-config) the subagent uses:161The `model` field allows you to control which [AI model](/en/model-config) the subagent uses:

158 162 

159* **Model alias**: Use one of the available aliases: `sonnet`, `opus`, or `haiku`163* **Model alias**: Use one of the available aliases: `sonnet`, `opus`, or `haiku`

160* **`'inherit'`**: Use the same model as the main conversation (useful for consistency)164* **`'inherit'`**: Use the same model as the main conversation (useful for consistency)


166 170 

167### Available tools171### Available tools

168 172 

169Subagents can be granted access to any of Claude Code's internal tools. See the [tools documentation](/en/docs/claude-code/settings#tools-available-to-claude) for a complete list of available tools.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.

170 174 

171<Tip>175<Tip>

172 **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.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.


217# ... create subagent file221# ... create subagent file

218```222```

219 223 

224<Note>

225 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.

226</Note>

227 

220## Using subagents effectively228## Using subagents effectively

221 229 

222### Automatic delegation230### Automatic delegation


241> Ask the debugger subagent to investigate this error249> Ask the debugger subagent to investigate this error

242```250```

243 251 

252## Built-in subagents

253 

254Claude Code includes built-in subagents that are available out of the box:

255 

256### General-purpose subagent

257 

258The 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.

259 

260**Key characteristics:**

261 

262* **Model**: Uses Sonnet for more capable reasoning

263* **Tools**: Has access to all tools

264* **Mode**: Can read and write files, execute commands, make changes

265* **Purpose**: Complex research tasks, multi-step operations, code modifications

266 

267**When Claude uses it:**

268 

269Claude delegates to the general-purpose subagent when:

270 

271* The task requires both exploration and modification

272* Complex reasoning is needed to interpret search results

273* Multiple strategies may be needed if initial searches fail

274* The task has multiple steps that depend on each other

275 

276**Example scenario:**

277 

278```

279User: Find all the places where we handle authentication and update them to use the new token format

280 

281Claude: [Invokes general-purpose subagent]

282[Agent searches for auth-related code across codebase]

283[Agent reads and analyzes multiple files]

284[Agent makes necessary edits]

285[Returns detailed writeup of changes made]

286```

287 

288### Plan subagent

289 

290The 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.

291 

292**Key characteristics:**

293 

294* **Model**: Uses Sonnet for more capable analysis

295* **Tools**: Has access to Read, Glob, Grep, and Bash tools for codebase exploration

296* **Purpose**: Searches files, analyzes code structure, and gathers context

297* **Automatic invocation**: Claude automatically uses this agent when in plan mode and needs to research the codebase

298 

299**How it works:**

300When 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.

301 

302**Example scenario:**

303 

304```

305User: [In plan mode] Help me refactor the authentication module

306 

307Claude: Let me research your authentication implementation first...

308[Internally invokes Plan subagent to explore auth-related files]

309[Plan subagent searches codebase and returns findings]

310Claude: Based on my research, here's my proposed plan...

311```

312 

313<Tip>

314 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.

315</Tip>

316 

317### Explore subagent

318 

319The 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.

320 

321**Key characteristics:**

322 

323* **Model**: Uses Haiku for fast, low-latency searches

324* **Mode**: Strictly read-only - cannot create, modify, or delete files

325* **Tools available**:

326 * Glob - File pattern matching

327 * Grep - Content searching with regex

328 * Read - Reading file contents

329 * Bash - Read-only commands only (ls, git status, git log, git diff, find, cat, head, tail)

330 

331**When Claude uses it:**

332 

333Claude 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.

334 

335**Thoroughness levels:**

336 

337When invoking the Explore subagent, Claude specifies a thoroughness level:

338 

339* **Quick** - Basic searches, fastest results. Good for simple lookups.

340* **Medium** - Moderate exploration. Balances speed and thoroughness.

341* **Very thorough** - Comprehensive analysis across multiple locations and naming conventions. Used when the target might be in unexpected places.

342 

343**Example scenarios:**

344 

345```

346User: Where are errors from the client handled?

347 

348Claude: [Invokes Explore subagent with "medium" thoroughness]

349[Explore uses Grep to search for error handling patterns]

350[Explore uses Read to examine promising files]

351[Returns findings with absolute file paths]

352Claude: Client errors are handled in src/services/process.ts:712...

353```

354 

355```

356User: What's the codebase structure?

357 

358Claude: [Invokes Explore subagent with "quick" thoroughness]

359[Explore uses Glob and ls to map directory structure]

360[Returns overview of key directories and their purposes]

361```

362 

244## Example subagents363## Example subagents

245 364 

246### Code reviewer365### Code reviewer


374 493 

375Claude Code intelligently selects subagents based on context. Make your `description` fields specific and action-oriented for best results.494Claude Code intelligently selects subagents based on context. Make your `description` fields specific and action-oriented for best results.

376 495 

496### Resumable subagents

497 

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.

499 

500**How it works:**

501 

502* Each subagent execution is assigned a unique `agentId`

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 

507**Example workflow:**

508 

509Initial invocation:

510 

511```

512> Use the code-analyzer agent to start reviewing the authentication module

513 

514[Agent completes initial analysis and returns agentId: "abc123"]

515```

516 

517Resume the agent:

518 

519```

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 

531**Technical details:**

532 

533* Agent transcripts are stored in your project directory

534* Recording is disabled during resume to avoid duplicating messages

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```

550 

551<Tip>

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 

377## Performance considerations555## Performance considerations

378 556 

379* **Context efficiency**: Agents help preserve main context, enabling longer overall sessions557* **Context efficiency**: Agents help preserve main context, enabling longer overall sessions


381 559 

382## Related documentation560## Related documentation

383 561 

384* [Plugins](/en/docs/claude-code/plugins) - Extend Claude Code with custom agents through plugins562* [Plugins](/en/plugins) - Extend Claude Code with custom agents through plugins

385* [Slash commands](/en/docs/claude-code/slash-commands) - Learn about other built-in commands563* [Slash commands](/en/slash-commands) - Learn about other built-in commands

386* [Settings](/en/docs/claude-code/settings) - Configure Claude Code behavior564* [Settings](/en/settings) - Configure Claude Code behavior

387* [Hooks](/en/docs/claude-code/hooks) - Automate workflows with event handlers565* [Hooks](/en/hooks) - Automate workflows with event handlers

566 

567 

568---

569 

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

Details

6 6 

7Claude cannot control the theme of your terminal. That's handled by your terminal application. You can match Claude Code's theme to your terminal any time via the `/config` command.7Claude cannot control the theme of your terminal. That's handled by your terminal application. You can match Claude Code's theme to your terminal any time via the `/config` command.

8 8 

9For additional customization of the Claude Code interface itself, you can configure a [custom status line](/en/docs/claude-code/statusline) to display contextual information like the current model, working directory, or git branch at the bottom of your terminal.9For additional customization of the Claude Code interface itself, you can configure a [custom status line](/en/statusline) to display contextual information like the current model, working directory, or git branch at the bottom of your terminal.

10 10 

11### Line breaks11### Line breaks

12 12 


48 48 

49#### Custom notification hooks49#### Custom notification hooks

50 50 

51For advanced notification handling, you can create [notification hooks](/en/docs/claude-code/hooks#notification) to run your own logic.51For advanced notification handling, you can create [notification hooks](/en/hooks#notification) to run your own logic.

52 52 

53### Handling large inputs53### Handling large inputs

54 54 


67* Mode switching: `Esc` (to NORMAL), `i`/`I`, `a`/`A`, `o`/`O` (to INSERT)67* 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`68* Navigation: `h`/`j`/`k`/`l`, `w`/`e`/`b`, `0`/`$`/`^`, `gg`/`G`

69* Editing: `x`, `dw`/`de`/`db`/`dd`/`D`, `cw`/`ce`/`cb`/`cc`/`C`, `.` (repeat)69* Editing: `x`, `dw`/`de`/`db`/`dd`/`D`, `cw`/`ce`/`cb`/`cc`/`C`, `.` (repeat)

70 

71 

72---

73 

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

Details

13 <th>Anthropic</th>13 <th>Anthropic</th>

14 <th>Amazon Bedrock</th>14 <th>Amazon Bedrock</th>

15 <th>Google Vertex AI</th>15 <th>Google Vertex AI</th>

16 <th>Microsoft Foundry</th>

16 </tr>17 </tr>

17 </thead>18 </thead>

18 19 


22 <td>Supported [countries](https://www.anthropic.com/supported-countries)</td>23 <td>Supported [countries](https://www.anthropic.com/supported-countries)</td>

23 <td>Multiple AWS [regions](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html)</td>24 <td>Multiple AWS [regions](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html)</td>

24 <td>Multiple GCP [regions](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations)</td>25 <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>

25 </tr>27 </tr>

26 28 

27 <tr>29 <tr>


29 <td>Enabled by default</td>31 <td>Enabled by default</td>

30 <td>Enabled by default</td>32 <td>Enabled by default</td>

31 <td>Enabled by default</td>33 <td>Enabled by default</td>

34 <td>Enabled by default</td>

32 </tr>35 </tr>

33 36 

34 <tr>37 <tr>

35 <td>Authentication</td>38 <td>Authentication</td>

36 <td>API key</td>39 <td>API key</td>

37 <td>AWS credentials (IAM)</td>40 <td>API key or AWS credentials</td>

38 <td>GCP credentials (OAuth/Service Account)</td>41 <td>GCP credentials</td>

42 <td>API key or Microsoft Entra ID</td>

39 </tr>43 </tr>

40 44 

41 <tr>45 <tr>


43 <td>Dashboard</td>47 <td>Dashboard</td>

44 <td>AWS Cost Explorer</td>48 <td>AWS Cost Explorer</td>

45 <td>GCP Billing</td>49 <td>GCP Billing</td>

50 <td>Azure Cost Management</td>

46 </tr>51 </tr>

47 52 

48 <tr>53 <tr>


50 <td>Teams, usage monitoring</td>55 <td>Teams, usage monitoring</td>

51 <td>IAM policies, CloudTrail</td>56 <td>IAM policies, CloudTrail</td>

52 <td>IAM roles, Cloud Audit Logs</td>57 <td>IAM roles, Cloud Audit Logs</td>

58 <td>RBAC policies, Azure Monitor</td>

53 </tr>59 </tr>

54 </tbody>60 </tbody>

55</table>61</table>

56 62 

57## Cloud providers63## Cloud providers

58 64 

59<CardGroup cols={2}>65<CardGroup cols={3}>

60 <Card title="Amazon Bedrock" icon="aws" href="/en/docs/claude-code/amazon-bedrock">66 <Card title="Amazon Bedrock" icon="aws" href="/en/amazon-bedrock">

61 Use Claude models through AWS infrastructure with IAM-based authentication and AWS-native monitoring67 Use Claude models through AWS infrastructure with API key or IAM-based authentication and AWS-native monitoring

62 </Card>68 </Card>

63 69 

64 <Card title="Google Vertex AI" icon="google" href="/en/docs/claude-code/google-vertex-ai">70 <Card title="Google Vertex AI" icon="google" href="/en/google-vertex-ai">

65 Access Claude models via Google Cloud Platform with enterprise-grade security and compliance71 Access Claude models via Google Cloud Platform with enterprise-grade security and compliance

66 </Card>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>

67</CardGroup>77</CardGroup>

68 78 

69## Corporate infrastructure79## Corporate infrastructure

70 80 

71<CardGroup cols={2}>81<CardGroup cols={2}>

72 <Card title="Enterprise Network" icon="shield" href="/en/docs/claude-code/network-config">82 <Card title="Enterprise Network" icon="shield" href="/en/network-config">

73 Configure Claude Code to work with your organization's proxy servers and SSL/TLS requirements83 Configure Claude Code to work with your organization's proxy servers and SSL/TLS requirements

74 </Card>84 </Card>

75 85 

76 <Card title="LLM Gateway" icon="server" href="/en/docs/claude-code/llm-gateway">86 <Card title="LLM Gateway" icon="server" href="/en/llm-gateway">

77 Deploy centralized model access with usage tracking, budgeting, and audit logging87 Deploy centralized model access with usage tracking, budgeting, and audit logging

78 </Card>88 </Card>

79</CardGroup>89</CardGroup>


117export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1 # If gateway handles AWS auth127export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1 # If gateway handles AWS auth

118```128```

119 129 

130### Using Foundry with corporate proxy

131 

132Route Azure traffic through a corporate HTTP/HTTPS proxy:

133 

134```bash theme={null}

135# Enable Microsoft Foundry

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 

140# Configure corporate proxy

141export HTTPS_PROXY='https://proxy.example.com:8080'

142```

143 

144### Using Foundry with LLM Gateway

145 

146Use a gateway service that provides Azure-compatible endpoints:

147 

148```bash theme={null}

149# Enable Microsoft Foundry

150export CLAUDE_CODE_USE_FOUNDRY=1

151 

152# Configure LLM gateway

153export ANTHROPIC_FOUNDRY_BASE_URL='https://your-llm-gateway.com'

154export CLAUDE_CODE_SKIP_FOUNDRY_AUTH=1 # If gateway handles Azure auth

155```

156 

120### Using Vertex AI with corporate proxy157### Using Vertex AI with corporate proxy

121 158 

122Route Vertex AI traffic through a corporate HTTP/HTTPS proxy:159Route Vertex AI traffic through a corporate HTTP/HTTPS proxy:


181 218 

182When debugging your deployment:219When debugging your deployment:

183 220 

184* Use the `claude /status` [slash command](/en/docs/claude-code/slash-commands). This command provides observability into any applied authentication, proxy, and URL settings.221* Use the `claude /status` [slash command](/en/slash-commands). This command provides observability into any applied authentication, proxy, and URL settings.

185* Set environment variable `export ANTHROPIC_LOG=debug` to log requests.222* Set environment variable `export ANTHROPIC_LOG=debug` to log requests.

186 223 

187## Best practices for organizations224## Best practices for organizations


193* **Organization-wide**: Deploy to system directories like `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS) for company-wide standards230* **Organization-wide**: Deploy to system directories like `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS) for company-wide standards

194* **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 benefit231* **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

195 232 

196 [Learn more](/en/docs/claude-code/memory).233 [Learn more](/en/memory).

197 234 

198### 2. Simplify deployment235### 2. Simplify deployment

199 236 


205 242 

206### 4. Configure security policies243### 4. Configure security policies

207 244 

208Security 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/docs/claude-code/security).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).

209 246 

210### 5. Leverage MCP for integrations247### 5. Leverage MCP for integrations

211 248 

212MCP 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/docs/claude-code/mcp).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).

213 250 

214At Anthropic, we trust Claude Code to power development across every Anthropic codebase. We hope you enjoy using Claude Code as much as we do!251At Anthropic, we trust Claude Code to power development across every Anthropic codebase. We hope you enjoy using Claude Code as much as we do!

215 252 

216## Next steps253## Next steps

217 254 

218* [Set up Amazon Bedrock](/en/docs/claude-code/amazon-bedrock) for AWS-native deployment255* [Set up Amazon Bedrock](/en/amazon-bedrock) for AWS-native deployment

219* [Configure Google Vertex AI](/en/docs/claude-code/google-vertex-ai) for GCP deployment256* [Configure Google Vertex AI](/en/google-vertex-ai) for GCP deployment

220* [Configure Enterprise Network](/en/docs/claude-code/network-config) for network requirements257* [Set up Microsoft Foundry](/en/microsoft-foundry) for Azure deployment

221* [Deploy LLM Gateway](/en/docs/claude-code/llm-gateway) for enterprise management258* [Configure Enterprise Network](/en/network-config) for network requirements

222* [Settings](/en/docs/claude-code/settings) for configuration options and environment variables259* [Deploy LLM Gateway](/en/llm-gateway) for enterprise management

260* [Settings](/en/settings) for configuration options and environment variables

261 

262 

263---

264 

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

troubleshooting.md +53 −30

Details

101 Make sure that you have the installation directory in your system PATH.101 Make sure that you have the installation directory in your system PATH.

102</Tip>102</Tip>

103 103 

104#### Alternative solution: Migrate to local installation

105 

106Alternatively, if Claude Code will run, you can migrate to a local installation:

107 

108```bash theme={null}

109claude migrate-installer

110```

111 

112This moves Claude Code to `~/.claude/local/` and sets up an alias in your shell configuration. No `sudo` is required for future updates.

113 

114After migration, restart your shell, and then verify your installation:

115 

116On macOS/Linux/WSL:

117 

118```bash theme={null}

119which claude # Should show an alias to ~/.claude/local/claude

120```

121 

122On Windows:

123 

124```powershell theme={null}

125where claude # Should show path to claude executable

126```

127 

128Verify installation:104Verify installation:

129 105 

130```bash theme={null}106```bash theme={null}


136### Repeated permission prompts112### Repeated permission prompts

137 113 

138If you find yourself repeatedly approving the same commands, you can allow specific tools114If you find yourself repeatedly approving the same commands, you can allow specific tools

139to run without approval using the `/permissions` command. See [Permissions docs](/en/docs/claude-code/iam#configuring-permissions).115to run without approval using the `/permissions` command. See [Permissions docs](/en/iam#configuring-permissions).

140 116 

141### Authentication issues117### Authentication issues

142 118 


155 131 

156This removes your stored authentication information and forces a clean login.132This removes your stored authentication information and forces a clean login.

157 133 

134## Configuration file locations

135 

136Claude Code stores configuration in several locations:

137 

138| File | Purpose |

139| :---------------------------- | :--------------------------------------------------------------------- |

140| `~/.claude/settings.json` | User settings (permissions, hooks, model overrides) |

141| `.claude/settings.json` | Project settings (checked into source control) |

142| `.claude/settings.local.json` | Local project settings (gitignored) |

143| `~/.claude.json` | Global state (theme, OAuth, MCP servers, allowed tools) |

144| `.mcp.json` | Project MCP servers (checked into source control) |

145| `managed-settings.json` | [Enterprise managed settings](/en/settings#settings-files) |

146| `managed-mcp.json` | [Enterprise managed MCP servers](/en/mcp#enterprise-mcp-configuration) |

147 

148On Windows, `~` refers to your user home directory (e.g., `C:\Users\YourName`).

149 

150**Enterprise managed file locations:**

151 

152* macOS: `/Library/Application Support/ClaudeCode/`

153* Linux/WSL: `/etc/claude-code/`

154* Windows: `C:\ProgramData\ClaudeCode\`

155 

156For details on configuring these files, see [Settings](/en/settings) and [MCP](/en/mcp).

157 

158### Resetting configuration

159 

160To reset Claude Code to default settings, you can remove the configuration files:

161 

162```bash theme={null}

163# Reset all user settings and state

164rm ~/.claude.json

165rm -rf ~/.claude/

166 

167# Reset project-specific settings

168rm -rf .claude/

169rm .mcp.json

170```

171 

172<Warning>

173 This will remove all your settings, allowed tools, MCP server configurations, and session history.

174</Warning>

175 

158## Performance and stability176## Performance and stability

159 177 

160### High CPU or memory usage178### High CPU or memory usage


193pacman -S ripgrep211pacman -S ripgrep

194```212```

195 213 

196Then set `USE_BUILTIN_RIPGREP=0` in your [environment](/en/docs/claude-code/settings#environment-variables).214Then set `USE_BUILTIN_RIPGREP=0` in your [environment](/en/settings#environment-variables).

197 215 

198### Slow or incomplete search results on WSL216### Slow or incomplete search results on WSL

199 217 


252 These networking issues only affect WSL2. WSL1 uses the host's network directly and doesn't require these configurations.270 These networking issues only affect WSL2. WSL1 uses the host's network directly and doesn't require these configurations.

253</Note>271</Note>

254 272 

255For additional JetBrains configuration tips, see our [IDE integration guide](/en/docs/claude-code/ide-integrations#jetbrains-plugin-settings).273For additional JetBrains configuration tips, see our [JetBrains IDE guide](/en/jetbrains#plugin-settings).

256 274 

257### Reporting Windows IDE integration issues (both native and WSL)275### Reporting Windows IDE integration issues (both native and WSL)

258 276 


302 320 

3031. **Ask Claude to add language tags**: Simply request "Please add appropriate language tags to all code blocks in this markdown file."3211. **Ask Claude to add language tags**: Simply request "Please add appropriate language tags to all code blocks in this markdown file."

304 322 

3052. **Use post-processing hooks**: Set up automatic formatting hooks to detect and add missing language tags. See the [markdown formatting hook example](/en/docs/claude-code/hooks-guide#markdown-formatting-hook) for implementation details.3232. **Use post-processing hooks**: Set up automatic formatting hooks to detect and add missing language tags. See the [markdown formatting hook example](/en/hooks-guide#markdown-formatting-hook) for implementation details.

306 324 

3073. **Manual verification**: After generating markdown files, review them for proper code block formatting and request corrections if needed.3253. **Manual verification**: After generating markdown files, review them for proper code block formatting and request corrections if needed.

308 326 


316 334 

3172. **Use formatting tools**: Set up hooks to run markdown formatters like `prettier` or custom formatting scripts on generated markdown files.3352. **Use formatting tools**: Set up hooks to run markdown formatters like `prettier` or custom formatting scripts on generated markdown files.

318 336 

3193. **Specify formatting preferences**: Include formatting requirements in your prompts or project [memory](/en/docs/claude-code/memory) files.3373. **Specify formatting preferences**: Include formatting requirements in your prompts or project [memory](/en/memory) files.

320 338 

321### Best practices for markdown generation339### Best practices for markdown generation

322 340 

323To minimize formatting issues:341To minimize formatting issues:

324 342 

325* **Be explicit in requests**: Ask for "properly formatted markdown with language-tagged code blocks"343* **Be explicit in requests**: Ask for "properly formatted markdown with language-tagged code blocks"

326* **Use project conventions**: Document your preferred markdown style in [CLAUDE.md](/en/docs/claude-code/memory)344* **Use project conventions**: Document your preferred markdown style in [CLAUDE.md](/en/memory)

327* **Set up validation hooks**: Use post-processing hooks to automatically verify and fix common formatting issues345* **Set up validation hooks**: Use post-processing hooks to automatically verify and fix common formatting issues

328 346 

329## Getting more help347## Getting more help


3342. Check the [GitHub repository](https://github.com/anthropics/claude-code) for known issues3522. Check the [GitHub repository](https://github.com/anthropics/claude-code) for known issues

3353. Run `/doctor` to check the health of your Claude Code installation3533. Run `/doctor` to check the health of your Claude Code installation

3364. Ask Claude directly about its capabilities and features - Claude has built-in access to its documentation3544. Ask Claude directly about its capabilities and features - Claude has built-in access to its documentation

355 

356 

357---

358 

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

vs-code.md +36 −21

Details

2 2 

3> Use Claude Code with Visual Studio Code through our native extension or CLI integration3> Use Claude Code with Visual Studio Code through our native extension or CLI integration

4 4 

5<img src="https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=300652d5678c63905e6b0ea9e50835f8" alt="Claude Code VS Code Extension Interface" data-og-width="2500" width="2500" data-og-height="1155" height="1155" data-path="images/vs-code-extension-interface.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?w=280&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=87630c671517a3d52e9aee627041696e 280w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?w=560&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=716b093879204beec8d952649ef75292 560w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?w=840&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=c1525d1a01513acd9d83d8b5a8fe2fc8 840w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?w=1100&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=1d90021d58bbb51f871efec13af955c3 1100w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?w=1650&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=7babdd25440099886f193cfa99af88ae 1650w, https://mintcdn.com/claude-code/-YhHHmtSxwr7W8gy/images/vs-code-extension-interface.jpg?w=2500&fit=max&auto=format&n=-YhHHmtSxwr7W8gy&q=85&s=08c92eedfb56fe61a61e480fb63784b6 2500w" />

6 

5## VS Code Extension (Beta)7## VS Code Extension (Beta)

6 8 

7The VS Code extension, available in beta, lets you see Claude's changes in real-time through a native graphical interface integrated directly into your IDE. The VS Code extension makes it easier to access and interact with Claude Code for users who prefer a visual interface over the terminal.9The VS Code extension, available in beta, lets you see Claude's changes in real-time through a native graphical interface integrated directly into your IDE. The VS Code extension makes it easier to access and interact with Claude Code for users who prefer a visual interface over the terminal.


13* **Native IDE experience**: Dedicated Claude Code sidebar panel accessed via the Spark icon15* **Native IDE experience**: Dedicated Claude Code sidebar panel accessed via the Spark icon

14* **Plan mode with editing**: Review and edit Claude's plans before accepting them16* **Plan mode with editing**: Review and edit Claude's plans before accepting them

15* **Auto-accept edits mode**: Automatically apply Claude's changes as they're made17* **Auto-accept edits mode**: Automatically apply Claude's changes as they're made

18* **Extended thinking**: Toggle extended thinking on/off using the Extended Thinking button in the bottom-right corner of the prompt input

16* **File management**: @-mention files or attach files and images using the system file picker19* **File management**: @-mention files or attach files and images using the system file picker

17* **MCP server usage**: Use Model Context Protocol servers configured through the CLI20* **MCP server usage**: Use Model Context Protocol servers configured through the CLI

18* **Conversation history**: Easy access to past conversations21* **Conversation history**: Easy access to past conversations


28 31 

29Download and install the extension from the [Visual Studio Code Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code).32Download and install the extension from the [Visual Studio Code Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code).

30 33 

31### Updating

32 

33To update the VS Code extension:

34 

351. Open the VS Code command palette with `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux)

362. Search for "Claude Code: Update"

373. Select the command to update to the latest version

38 

39### How It Works34### How It Works

40 35 

41Once installed, you can start using Claude Code through the VS Code interface:36Once installed, you can start using Claude Code through the VS Code interface:


464. Review and accept edits directly in the interface414. Review and accept edits directly in the interface

47 * **Tip**: Drag the sidebar wider to see inline diffs, then click on them to expand for full details42 * **Tip**: Drag the sidebar wider to see inline diffs, then click on them to expand for full details

48 43 

49### Using Third-Party Providers (Vertex and Bedrock)44### Using Third-Party Providers

50 45 

51The VS Code extension supports using Claude Code with third-party providers like Amazon Bedrock and Google Vertex AI. When configured with these providers, the extension will not prompt for login. To use third-party providers, configure environment variables in the VS Code extension settings:46The VS Code extension supports using Claude Code with third-party providers like Amazon Bedrock, Microsoft Foundry, and Google Vertex AI. When configured with these providers, the extension will not prompt for login. To use third-party providers, configure environment variables in the VS Code extension settings:

52 47 

531. Open VS Code settings481. Open VS Code settings

542. Search for "Claude Code: Environment Variables"492. Search for "Claude Code: Environment Variables"


57#### Environment Variables52#### Environment Variables

58 53 

59| Variable | Description | Required | Example |54| Variable | Description | Required | Example |

60| :---------------------------- | :------------------------------------- | :--------------------- | :----------------------------------------------- |55| :---------------------------- | :------------------------------------- | :----------------------------- | :----------------------------------------------- |

61| `CLAUDE_CODE_USE_BEDROCK` | Enable Amazon Bedrock integration | Required for Bedrock | `"1"` or `"true"` |56| `CLAUDE_CODE_USE_BEDROCK` | Enable Amazon Bedrock integration | Required for Bedrock | `"1"` or `"true"` |

57| `CLAUDE_CODE_USE_FOUNDRY` | Enable Microsoft Foundry integration | Required for Foundry | `"1"` or `"true"` |

62| `CLAUDE_CODE_USE_VERTEX` | Enable Google Vertex AI integration | Required for Vertex AI | `"1"` or `"true"` |58| `CLAUDE_CODE_USE_VERTEX` | Enable Google Vertex AI integration | Required for Vertex AI | `"1"` or `"true"` |

63| `ANTHROPIC_API_KEY` | API key for third-party access | Required | `"your-api-key"` |

64| `AWS_REGION` | AWS region for Bedrock | | `"us-east-2"` |59| `AWS_REGION` | AWS region for Bedrock | | `"us-east-2"` |

65| `AWS_PROFILE` | AWS profile for Bedrock authentication | | `"your-profile"` |60| `AWS_PROFILE` | AWS profile for Bedrock authentication | | `"your-profile"` |

66| `CLOUD_ML_REGION` | Region for Vertex AI | | `"global"` or `"us-east5"` |61| `CLOUD_ML_REGION` | Region for Vertex AI | | `"global"` or `"us-east5"` |

67| `ANTHROPIC_VERTEX_PROJECT_ID` | GCP project ID for Vertex AI | | `"your-project-id"` |62| `ANTHROPIC_VERTEX_PROJECT_ID` | GCP project ID for Vertex AI | | `"your-project-id"` |

68| `ANTHROPIC_MODEL` | Override primary model | Override model ID | `"us.anthropic.claude-3-7-sonnet-20250219-v1:0"` |63| `ANTHROPIC_FOUNDRY_RESOURCE` | Azure resource name for Foundry | Required for Microsoft Foundry | `"your-resource"` |

64| `ANTHROPIC_FOUNDRY_API_KEY` | API key for Microsoft Foundry | Optional for Microsoft Foundry | `"your-api-key"` |

65| `ANTHROPIC_MODEL` | Override primary model | Override model ID | `"us.anthropic.claude-sonnet-4-5-20250929-v1:0"` |

69| `ANTHROPIC_SMALL_FAST_MODEL` | Override small/fast model | Optional | `"us.anthropic.claude-3-5-haiku-20241022-v1:0"` |66| `ANTHROPIC_SMALL_FAST_MODEL` | Override small/fast model | Optional | `"us.anthropic.claude-3-5-haiku-20241022-v1:0"` |

67| `CLAUDE_CODE_SKIP_AUTH_LOGIN` | Disable all prompts to login | Optional | `"1"` or `"true"` |

70 68 

71For detailed setup instructions and additional configuration options, see:69For detailed setup instructions and additional configuration options, see:

72 70 

73* [Claude Code on Amazon Bedrock](/en/docs/claude-code/amazon-bedrock)71* [Claude Code on Amazon Bedrock](/en/amazon-bedrock)

74* [Claude Code on Google Vertex AI](/en/docs/claude-code/google-vertex-ai)72* [Claude Code on Microsoft Foundry](/en/microsoft-foundry)

73* [Claude Code on Google Vertex AI](/en/google-vertex-ai)

75 74 

76### Not Yet Implemented75### Not Yet Implemented

77 76 

78The following features are not yet available in the VS Code extension:77The following features are not yet available in the VS Code extension:

79 78 

80* **Full MCP server configuration**: You need to [configure MCP servers through the CLI](/en/docs/claude-code/mcp) first, then the extension will use them79* **MCP server and Plugin configuration UI**: Type `/mcp` to open the terminal-based MCP server configuration, or `/plugin` for Plugin configuration. Once configured, MCP servers and Plugins will work in the extension. You can also [configure MCP servers through the CLI](/en/mcp) first, then the extension will use them.

81* **Subagents configuration**: Configure [subagents through the CLI](/en/docs/claude-code/sub-agents) to use them in VS Code80* **Subagents configuration**: Configure [subagents through the CLI](/en/sub-agents) to use them in VS Code

82* **Checkpoints**: Save and restore conversation state at specific points81* **Checkpoints**: Save and restore conversation state at specific points

82* **Conversation rewinding**: The `/rewind` command is coming soon

83* **Advanced shortcuts**:83* **Advanced shortcuts**:

84 * `#` shortcut to add to memory84 * `#` shortcut to add to memory (not supported)

85 * `!` shortcut to run bash commands directly85 * `!` shortcut to run bash commands directly (not supported)

86* **Tab completion**: File path completion with tab key86* **Tab completion**: File path completion with tab key

87* **Model selection UI for older models**: To use older model versions like `claude-sonnet-4-20250514`, open VS Code settings for Claude Code (the `/General Config` command) and insert the model string directly into the 'Selected Model' field

87 88 

88We are working on adding these features in future updates.89We are working on adding these features in future updates.

89 90 


111 112 

112* Ensure you have a compatible version of VS Code (1.85.0 or later)113* Ensure you have a compatible version of VS Code (1.85.0 or later)

113* Check that VS Code has permission to install extensions114* Check that VS Code has permission to install extensions

114* Try installing directly from the marketplace website115* Try installing directly from the Marketplace website

116 

117### Claude Code Never Responds

118 

119If Claude Code is not responding to your prompts:

120 

1211. **Check your internet connection**: Ensure you have a stable internet connection

1222. **Start a new conversation**: Try starting a fresh conversation to see if the issue persists

1233. **Try the CLI**: Run `claude` from the terminal to see if you get more detailed error messages

1244. **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

115 125 

116### Legacy Integration Not Working126### Legacy Integration Not Working

117 127 


125 1. Open command palette with `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux)135 1. Open command palette with `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux)

126 2. Search for "Shell Command: Install 'code' command in PATH" (or equivalent for your IDE)136 2. Search for "Shell Command: Install 'code' command in PATH" (or equivalent for your IDE)

127 137 

128For additional help, see our [troubleshooting guide](/en/docs/claude-code/troubleshooting).138For additional help, see our [troubleshooting guide](/en/troubleshooting).

139 

140 

141---

142 

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