SpyBara
Go Premium Account
2026
31 Jan 2026, 03:42
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
9 Feb 2026, 15:17
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
Sun 1 18:02 Sun 1 21:03 Tue 3 03:46 Tue 3 09:10 Tue 3 18:14 Tue 3 21:08 Wed 4 00:06 Wed 4 03:45 Wed 4 18:11 Wed 4 21:07 Thu 5 00:07 Thu 5 03:46 Thu 5 18:13 Thu 5 21:06 Fri 6 00:05 Fri 6 21:06 Sat 7 03:43 Sat 7 18:03 Sat 7 21:05 Mon 9 00:08 Mon 9 15:17 Tue 10 00:11 Tue 10 03:56 Tue 10 21:13 Wed 11 00:11 Wed 11 21:10 Thu 12 00:06 Fri 13 21:09 Sat 14 03:44 Mon 16 21:05 Tue 17 00:08 Tue 17 21:08 Wed 18 03:48 Thu 19 00:08 Thu 19 03:48 Thu 19 21:06 Fri 20 00:07 Fri 20 06:14 Fri 20 21:03 Sat 21 06:08 Sat 21 18:03 Mon 23 21:13 Tue 24 18:15 Tue 24 21:08 Wed 25 00:09 Wed 25 03:47 Thu 26 00:07 Thu 26 06:17 Thu 26 09:14 Thu 26 18:12 Thu 26 21:08 Fri 27 00:08 Fri 27 06:13 Fri 27 09:11 Fri 27 18:07 Fri 27 21:05 Sat 28 00:05 Sat 28 21:01

agent-teams.md +387 −0 added

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Orchestrate teams of Claude Code sessions

6 

7> Coordinate multiple Claude Code instances working together as a team, with shared tasks, inter-agent messaging, and centralized management.

8 

9<Warning>

10 Agent teams are experimental and disabled by default. Enable them by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` to your [settings.json](/en/settings) or environment. Agent teams have [known limitations](#limitations) around session resumption, task coordination, and shutdown behavior.

11</Warning>

12 

13Agent teams let you coordinate multiple Claude Code instances working together. One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results. Teammates work independently, each in its own context window, and communicate directly with each other.

14 

15Unlike [subagents](/en/sub-agents), which run within a single session and can only report back to the main agent, you can also interact with individual teammates directly without going through the lead.

16 

17This page covers:

18 

19* [When to use agent teams](#when-to-use-agent-teams), including best use cases and how they compare with subagents

20* [Starting a team](#start-your-first-agent-team)

21* [Controlling teammates](#control-your-agent-team), including display modes, task assignment, and delegation

22* [Best practices for parallel work](#best-practices)

23 

24## When to use agent teams

25 

26Agent teams are most effective for tasks where parallel exploration adds real value. See [use case examples](#use-case-examples) for full scenarios. The strongest use cases are:

27 

28* **Research and review**: multiple teammates can investigate different aspects of a problem simultaneously, then share and challenge each other's findings

29* **New modules or features**: teammates can each own a separate piece without stepping on each other

30* **Debugging with competing hypotheses**: teammates test different theories in parallel and converge on the answer faster

31* **Cross-layer coordination**: changes that span frontend, backend, and tests, each owned by a different teammate

32 

33Agent teams add coordination overhead and use significantly more tokens than a single session. They work best when teammates can operate independently. For sequential tasks, same-file edits, or work with many dependencies, a single session or [subagents](/en/sub-agents) are more effective.

34 

35### Compare with subagents

36 

37Both agent teams and [subagents](/en/sub-agents) let you parallelize work, but they operate differently. Choose based on whether your workers need to communicate with each other:

38 

39| | Subagents | Agent teams |

40| :---------------- | :----------------------------------------------- | :-------------------------------------------------- |

41| **Context** | Own context window; results return to the caller | Own context window; fully independent |

42| **Communication** | Report results back to the main agent only | Teammates message each other directly |

43| **Coordination** | Main agent manages all work | Shared task list with self-coordination |

44| **Best for** | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |

45| **Token cost** | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |

46 

47Use subagents when you need quick, focused workers that report back. Use agent teams when teammates need to share findings, challenge each other, and coordinate on their own.

48 

49## Enable agent teams

50 

51Agent teams are disabled by default. Enable them by setting the `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` environment variable to `1`, either in your shell environment or through [settings.json](/en/settings):

52 

53```json settings.json theme={null}

54{

55 "env": {

56 "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"

57 }

58}

59```

60 

61## Start your first agent team

62 

63After enabling agent teams, tell Claude to create an agent team and describe the task and the team structure you want in natural language. Claude creates the team, spawns teammates, and coordinates work based on your prompt.

64 

65This example works well because the three roles are independent and can explore the problem without waiting on each other:

66 

67```

68I'm designing a CLI tool that helps developers track TODO comments across

69their codebase. Create an agent team to explore this from different angles: one

70teammate on UX, one on technical architecture, one playing devil's advocate.

71```

72 

73From there, Claude creates a team with a [shared task list](/en/interactive-mode#task-list), spawns teammates for each perspective, has them explore the problem, synthesizes findings, and attempts to [clean up the team](#clean-up-the-team) when finished.

74 

75The lead's terminal lists all teammates and what they're working on. Use Shift+Up/Down to select a teammate and message them directly.

76 

77If you want each teammate in its own split pane, see [Choose a display mode](#choose-a-display-mode).

78 

79## Control your agent team

80 

81Tell the lead what you want in natural language. It handles team coordination, task assignment, and delegation based on your instructions.

82 

83### Choose a display mode

84 

85Agent teams support two display modes:

86 

87* **In-process**: all teammates run inside your main terminal. Use Shift+Up/Down to select a teammate and type to message them directly. Works in any terminal, no extra setup required.

88* **Split panes**: each teammate gets its own pane. You can see everyone's output at once and click into a pane to interact directly. Requires tmux, or iTerm2.

89 

90<Note>

91 `tmux` has known limitations on certain operating systems and traditionally works best on macOS. Using `tmux -CC` in iTerm2 is the suggested entrypoint into `tmux`.

92</Note>

93 

94The default is `"auto"`, which uses split panes if you're already running inside a tmux session, and in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. To override, set `teammateMode` in your [settings.json](/en/settings):

95 

96```json theme={null}

97{

98 "teammateMode": "in-process"

99}

100```

101 

102To force in-process mode for a single session, pass it as a flag:

103 

104```bash theme={null}

105claude --teammate-mode in-process

106```

107 

108Split-pane mode requires either [tmux](https://github.com/tmux/tmux/wiki) or iTerm2 with the [`it2` CLI](https://github.com/mkusaka/it2). To install manually:

109 

110* **tmux**: install through your system's package manager. See the [tmux wiki](https://github.com/tmux/tmux/wiki/Installing) for platform-specific instructions.

111* **iTerm2**: install the [`it2` CLI](https://github.com/mkusaka/it2), then enable the Python API in **iTerm2 → Settings → General → Magic → Enable Python API**.

112 

113### Specify teammates and models

114 

115Claude decides the number of teammates to spawn based on your task, or you can specify exactly what you want:

116 

117```

118Create a team with 4 teammates to refactor these modules in parallel.

119Use Sonnet for each teammate.

120```

121 

122### Require plan approval for teammates

123 

124For complex or risky tasks, you can require teammates to plan before implementing. The teammate works in read-only plan mode until the lead approves their approach:

125 

126```

127Spawn an architect teammate to refactor the authentication module.

128Require plan approval before they make any changes.

129```

130 

131When a teammate finishes planning, it sends a plan approval request to the lead. The lead reviews the plan and either approves it or rejects it with feedback. If rejected, the teammate stays in plan mode, revises based on the feedback, and resubmits. Once approved, the teammate exits plan mode and begins implementation.

132 

133The lead makes approval decisions autonomously. To influence the lead's judgment, give it criteria in your prompt, such as "only approve plans that include test coverage" or "reject plans that modify the database schema."

134 

135### Use delegate mode

136 

137Without delegate mode, the lead sometimes starts implementing tasks itself instead of waiting for teammates. Delegate mode prevents this by restricting the lead to coordination-only tools: spawning, messaging, shutting down teammates, and managing tasks.

138 

139This is useful when you want the lead to focus entirely on orchestration, such as breaking down work, assigning tasks, and synthesizing results, without touching code directly.

140 

141To enable it, start a team first, then press Shift+Tab to cycle into delegate mode.

142 

143### Talk to teammates directly

144 

145Each teammate is a full, independent Claude Code session. You can message any teammate directly to give additional instructions, ask follow-up questions, or redirect their approach.

146 

147* **In-process mode**: use Shift+Up/Down to select a teammate, then type to send them a message. Press Enter to view a teammate's session, then Escape to interrupt their current turn. Press Ctrl+T to toggle the task list.

148* **Split-pane mode**: click into a teammate's pane to interact with their session directly. Each teammate has a full view of their own terminal.

149 

150### Assign and claim tasks

151 

152The shared task list coordinates work across the team. The lead creates tasks and teammates work through them. Tasks have three states: pending, in progress, and completed. Tasks can also depend on other tasks: a pending task with unresolved dependencies cannot be claimed until those dependencies are completed.

153 

154The lead can assign tasks explicitly, or teammates can self-claim:

155 

156* **Lead assigns**: tell the lead which task to give to which teammate

157* **Self-claim**: after finishing a task, a teammate picks up the next unassigned, unblocked task on its own

158 

159Task claiming uses file locking to prevent race conditions when multiple teammates try to claim the same task simultaneously.

160 

161### Shut down teammates

162 

163To gracefully end a teammate's session:

164 

165```

166Ask the researcher teammate to shut down

167```

168 

169The lead sends a shutdown request. The teammate can approve, exiting gracefully, or reject with an explanation.

170 

171### Clean up the team

172 

173When you're done, ask the lead to clean up:

174 

175```

176Clean up the team

177```

178 

179This removes the shared team resources. When the lead runs cleanup, it checks for active teammates and fails if any are still running, so shut them down first.

180 

181<Warning>

182 Always use the lead to clean up. Teammates should not run cleanup because their team context may not resolve correctly, potentially leaving resources in an inconsistent state.

183</Warning>

184 

185### Enforce quality gates with hooks

186 

187Use [hooks](/en/hooks) to enforce rules when teammates finish work or tasks complete:

188 

189* [`TeammateIdle`](/en/hooks#teammateidle): runs when a teammate is about to go idle. Exit with code 2 to send feedback and keep the teammate working.

190* [`TaskCompleted`](/en/hooks#taskcompleted): runs when a task is being marked complete. Exit with code 2 to prevent completion and send feedback.

191 

192## How agent teams work

193 

194This section covers the architecture and mechanics behind agent teams. If you want to start using them, see [Control your agent team](#control-your-agent-team) above.

195 

196### How Claude starts agent teams

197 

198There are two ways agent teams get started:

199 

200* **You request a team**: give Claude a task that benefits from parallel work and explicitly ask for an agent team. Claude creates one based on your instructions.

201* **Claude proposes a team**: if Claude determines your task would benefit from parallel work, it may suggest creating a team. You confirm before it proceeds.

202 

203In both cases, you stay in control. Claude won't create a team without your approval.

204 

205### Architecture

206 

207An agent team consists of:

208 

209| Component | Role |

210| :------------ | :----------------------------------------------------------------------------------------- |

211| **Team lead** | The main Claude Code session that creates the team, spawns teammates, and coordinates work |

212| **Teammates** | Separate Claude Code instances that each work on assigned tasks |

213| **Task list** | Shared list of work items that teammates claim and complete |

214| **Mailbox** | Messaging system for communication between agents |

215 

216See [Choose a display mode](#choose-a-display-mode) for display configuration options. Teammate messages arrive at the lead automatically.

217 

218The system manages task dependencies automatically. When a teammate completes a task that other tasks depend on, blocked tasks unblock without manual intervention.

219 

220Teams and tasks are stored locally:

221 

222* **Team config**: `~/.claude/teams/{team-name}/config.json`

223* **Task list**: `~/.claude/tasks/{team-name}/`

224 

225The team config contains a `members` array with each teammate's name, agent ID, and agent type. Teammates can read this file to discover other team members.

226 

227### Permissions

228 

229Teammates start with the lead's permission settings. If the lead runs with `--dangerously-skip-permissions`, all teammates do too. After spawning, you can change individual teammate modes, but you can't set per-teammate modes at spawn time.

230 

231### Context and communication

232 

233Each teammate has its own context window. When spawned, a teammate loads the same project context as a regular session: CLAUDE.md, MCP servers, and skills. It also receives the spawn prompt from the lead. The lead's conversation history does not carry over.

234 

235**How teammates share information:**

236 

237* **Automatic message delivery**: when teammates send messages, they're delivered automatically to recipients. The lead doesn't need to poll for updates.

238* **Idle notifications**: when a teammate finishes and stops, they automatically notify the lead.

239* **Shared task list**: all agents can see task status and claim available work.

240 

241**Teammate messaging:**

242 

243* **message**: send a message to one specific teammate

244* **broadcast**: send to all teammates simultaneously. Use sparingly, as costs scale with team size.

245 

246### Token usage

247 

248Agent teams use significantly more tokens than a single session. Each teammate has its own context window, and token usage scales with the number of active teammates. For research, review, and new feature work, the extra tokens are usually worthwhile. For routine tasks, a single session is more cost-effective. See [agent team token costs](/en/costs#agent-team-token-costs) for usage guidance.

249 

250## Use case examples

251 

252These examples show how agent teams handle tasks where parallel exploration adds value.

253 

254### Run a parallel code review

255 

256A single reviewer tends to gravitate toward one type of issue at a time. Splitting review criteria into independent domains means security, performance, and test coverage all get thorough attention simultaneously. The prompt assigns each teammate a distinct lens so they don't overlap:

257 

258```

259Create an agent team to review PR #142. Spawn three reviewers:

260- One focused on security implications

261- One checking performance impact

262- One validating test coverage

263Have them each review and report findings.

264```

265 

266Each reviewer works from the same PR but applies a different filter. The lead synthesizes findings across all three after they finish.

267 

268### Investigate with competing hypotheses

269 

270When the root cause is unclear, a single agent tends to find one plausible explanation and stop looking. The prompt fights this by making teammates explicitly adversarial: each one's job is not only to investigate its own theory but to challenge the others'.

271 

272```

273Users report the app exits after one message instead of staying connected.

274Spawn 5 agent teammates to investigate different hypotheses. Have them talk to

275each other to try to disprove each other's theories, like a scientific

276debate. Update the findings doc with whatever consensus emerges.

277```

278 

279The debate structure is the key mechanism here. Sequential investigation suffers from anchoring: once one theory is explored, subsequent investigation is biased toward it.

280 

281With multiple independent investigators actively trying to disprove each other, the theory that survives is much more likely to be the actual root cause.

282 

283## Best practices

284 

285### Give teammates enough context

286 

287Teammates load project context automatically, including CLAUDE.md, MCP servers, and skills, but they don't inherit the lead's conversation history. See [Context and communication](#context-and-communication) for details. Include task-specific details in the spawn prompt:

288 

289```

290Spawn a security reviewer teammate with the prompt: "Review the authentication module

291at src/auth/ for security vulnerabilities. Focus on token handling, session

292management, and input validation. The app uses JWT tokens stored in

293httpOnly cookies. Report any issues with severity ratings."

294```

295 

296### Size tasks appropriately

297 

298* **Too small**: coordination overhead exceeds the benefit

299* **Too large**: teammates work too long without check-ins, increasing risk of wasted effort

300* **Just right**: self-contained units that produce a clear deliverable, such as a function, a test file, or a review

301 

302<Tip>

303 The lead breaks work into tasks and assigns them to teammates automatically. If it isn't creating enough tasks, ask it to split the work into smaller pieces. Having 5-6 tasks per teammate keeps everyone productive and lets the lead reassign work if someone gets stuck.

304</Tip>

305 

306### Wait for teammates to finish

307 

308Sometimes the lead starts implementing tasks itself instead of waiting for teammates. If you notice this:

309 

310```

311Wait for your teammates to complete their tasks before proceeding

312```

313 

314### Start with research and review

315 

316If you're new to agent teams, start with tasks that have clear boundaries and don't require writing code: reviewing a PR, researching a library, or investigating a bug. These tasks show the value of parallel exploration without the coordination challenges that come with parallel implementation.

317 

318### Avoid file conflicts

319 

320Two teammates editing the same file leads to overwrites. Break the work so each teammate owns a different set of files.

321 

322### Monitor and steer

323 

324Check in on teammates' progress, redirect approaches that aren't working, and synthesize findings as they come in. Letting a team run unattended for too long increases the risk of wasted effort.

325 

326## Troubleshooting

327 

328### Teammates not appearing

329 

330If teammates aren't appearing after you ask Claude to create a team:

331 

332* In in-process mode, teammates may already be running but not visible. Press Shift+Down to cycle through active teammates.

333* Check that the task you gave Claude was complex enough to warrant a team. Claude decides whether to spawn teammates based on the task.

334* If you explicitly requested split panes, ensure tmux is installed and available in your PATH:

335 ```bash theme={null}

336 which tmux

337 ```

338* For iTerm2, verify the `it2` CLI is installed and the Python API is enabled in iTerm2 preferences.

339 

340### Too many permission prompts

341 

342Teammate permission requests bubble up to the lead, which can create friction. Pre-approve common operations in your [permission settings](/en/permissions) before spawning teammates to reduce interruptions.

343 

344### Teammates stopping on errors

345 

346Teammates may stop after encountering errors instead of recovering. Check their output using Shift+Up/Down in in-process mode or by clicking the pane in split mode, then either:

347 

348* Give them additional instructions directly

349* Spawn a replacement teammate to continue the work

350 

351### Lead shuts down before work is done

352 

353The lead may decide the team is finished before all tasks are actually complete. If this happens, tell it to keep going. You can also tell the lead to wait for teammates to finish before proceeding if it starts doing work instead of delegating.

354 

355### Orphaned tmux sessions

356 

357If a tmux session persists after the team ends, it may not have been fully cleaned up. List sessions and kill the one created by the team:

358 

359```bash theme={null}

360tmux ls

361tmux kill-session -t <session-name>

362```

363 

364## Limitations

365 

366Agent teams are experimental. Current limitations to be aware of:

367 

368* **No session resumption with in-process teammates**: `/resume` and `/rewind` do not restore in-process teammates. After resuming a session, the lead may attempt to message teammates that no longer exist. If this happens, tell the lead to spawn new teammates.

369* **Task status can lag**: teammates sometimes fail to mark tasks as completed, which blocks dependent tasks. If a task appears stuck, check whether the work is actually done and update the task status manually or tell the lead to nudge the teammate.

370* **Shutdown can be slow**: teammates finish their current request or tool call before shutting down, which can take time.

371* **One team per session**: a lead can only manage one team at a time. Clean up the current team before starting a new one.

372* **No nested teams**: teammates cannot spawn their own teams or teammates. Only the lead can manage the team.

373* **Lead is fixed**: the session that creates the team is the lead for its lifetime. You can't promote a teammate to lead or transfer leadership.

374* **Permissions set at spawn**: all teammates start with the lead's permission mode. You can change individual teammate modes after spawning, but you can't set per-teammate modes at spawn time.

375* **Split panes require tmux or iTerm2**: the default in-process mode works in any terminal. Split-pane mode isn't supported in VS Code's integrated terminal, Windows Terminal, or Ghostty.

376 

377<Tip>

378 **`CLAUDE.md` works normally**: teammates read `CLAUDE.md` files from their working directory. Use this to provide project-specific guidance to all teammates.

379</Tip>

380 

381## Next steps

382 

383Explore related approaches for parallel work and delegation:

384 

385* **Lightweight delegation**: [subagents](/en/sub-agents) spawn helper agents for research or verification within your session, better for tasks that don't need inter-agent coordination

386* **Manual parallel sessions**: [Git worktrees](/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees) let you run multiple Claude Code sessions yourself without automated team coordination

387* **Compare approaches**: see the [subagent vs agent team](/en/features-overview#compare-similar-features) comparison for a side-by-side breakdown

Details

147export DISABLE_PROMPT_CACHING=1147export DISABLE_PROMPT_CACHING=1

148```148```

149 149 

150<Note>[Prompt caching](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) may not be available in all regions.</Note>150<Note>[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) may not be available in all regions.</Note>

151 

152### 5. Output token configuration

153 

154These are the recommended token settings for Claude Code with Amazon Bedrock:

155 

156```bash theme={null}

157# Recommended output token settings for Bedrock

158export CLAUDE_CODE_MAX_OUTPUT_TOKENS=4096

159export MAX_THINKING_TOKENS=1024

160```

161 

162**Why these values:**

163 

164* **`CLAUDE_CODE_MAX_OUTPUT_TOKENS=4096`**: Bedrock's burndown throttling logic sets a minimum of 4096 tokens as the `max_token` penalty. Setting this lower won't reduce costs but may cut off long tool uses, causing the Claude Code agent loop to fail persistently. Claude Code typically uses less than 4096 output tokens without extended thinking, but may need this headroom for tasks involving significant file creation or Write tool usage.

165 

166* **`MAX_THINKING_TOKENS=1024`**: This provides space for extended thinking without cutting off tool use responses, while still maintaining focused reasoning chains. This balance helps prevent trajectory changes that aren't always helpful for coding tasks specifically.

167 151 

168## IAM configuration152## IAM configuration

169 153 

analytics.md +5 −1

Details

34 34 

35You need the Owner role to configure analytics settings. A GitHub admin must install the GitHub app.35You need the Owner role to configure analytics settings. A GitHub admin must install the GitHub app.

36 36 

37<Warning>

38 Contribution metrics are not available for organizations with [Zero Data Retention](/en/data-usage#data-retention) enabled. The analytics dashboard will show usage metrics only.

39</Warning>

40 

37<Steps>41<Steps>

38 <Step title="Install the GitHub app">42 <Step title="Install the GitHub app">

39 A GitHub admin installs the Claude GitHub app on your organization's GitHub account at [github.com/apps/claude](https://github.com/apps/claude).43 A GitHub admin installs the Claude GitHub app on your organization's GitHub account at [github.com/apps/claude](https://github.com/apps/claude).


217 221 

218* [Monitoring with OpenTelemetry](/en/monitoring-usage): export real-time metrics and events to your observability stack222* [Monitoring with OpenTelemetry](/en/monitoring-usage): export real-time metrics and events to your observability stack

219* [Manage costs effectively](/en/costs): set spend limits and optimize token usage223* [Manage costs effectively](/en/costs): set spend limits and optimize token usage

220* [Identity and access management](/en/iam): configure roles and permissions224* [Permissions](/en/permissions): configure roles and permissions

authentication.md +104 −0 added

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Authentication

6 

7> Learn how to configure user authentication and credential management for Claude Code in your organization.

8 

9## Authentication methods

10 

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

12 

13* [Claude for Teams or Enterprise](#claude-for-teams-or-enterprise) (recommended)

14* [Claude Console](#claude-console-authentication)

15* [Amazon Bedrock](/en/amazon-bedrock)

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

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

18 

19### Claude for Teams or Enterprise

20 

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

22 

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

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

25 

26<Steps>

27 <Step title="Subscribe">

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

29 </Step>

30 

31 <Step title="Invite team members">

32 Invite team members from the admin dashboard.

33 </Step>

34 

35 <Step title="Install and log in">

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

37 </Step>

38</Steps>

39 

40### Claude Console authentication

41 

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

43 

44<Steps>

45 <Step title="Create or use a Console account">

46 Use your existing Claude Console account or create a new one.

47 </Step>

48 

49 <Step title="Add users">

50 You can add users through either method:

51 

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

53 * [Set up SSO](https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso)

54 </Step>

55 

56 <Step title="Assign roles">

57 When inviting users, assign one of:

58 

59 * **Claude Code** role: users can only create Claude Code API keys

60 * **Developer** role: users can create any kind of API key

61 </Step>

62 

63 <Step title="Users complete setup">

64 Each invited user needs to:

65 

66 * Accept the Console invite

67 * [Check system requirements](/en/setup#system-requirements)

68 * [Install Claude Code](/en/setup#installation)

69 * Log in with Console account credentials

70 </Step>

71</Steps>

72 

73### Cloud provider authentication

74 

75For teams using Amazon Bedrock, Google Vertex AI, or Microsoft Azure:

76 

77<Steps>

78 <Step title="Follow provider setup">

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

80 </Step>

81 

82 <Step title="Distribute configuration">

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

84 </Step>

85 

86 <Step title="Install Claude Code">

87 Users can [install Claude Code](/en/setup#installation).

88 </Step>

89</Steps>

90 

91## Credential management

92 

93Claude Code securely manages your authentication credentials:

94 

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

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

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

98* **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.

99 

100## See also

101 

102* [Permissions](/en/permissions): configure what Claude Code can access and do

103* [Settings](/en/settings): complete configuration reference

104* [Security](/en/security): security safeguards and best practices

Details

20 20 

21Claude's context window holds your entire conversation, including every message, every file Claude reads, and every command output. However, this can fill up fast. A single debugging session or codebase exploration might generate and consume tens of thousands of tokens.21Claude's context window holds your entire conversation, including every message, every file Claude reads, and every command output. However, this can fill up fast. A single debugging session or codebase exploration might generate and consume tens of thousands of tokens.

22 22 

23This matters since LLM performance degrades as context fills. When the context window is getting full, Claude may start "forgetting" earlier instructions or making more mistakes. The context window is the most important resource to manage. For detailed strategies on reducing token usage, see [Reduce token usage](/en/costs#reduce-token-usage).23This matters since LLM performance degrades as context fills. When the context window is getting full, Claude may start "forgetting" earlier instructions or making more mistakes. The context window is the most important resource to manage. Track context usage continuously with a [custom status line](/en/statusline), and see [Reduce token usage](/en/costs#reduce-token-usage) for strategies on reducing token usage.

24 24 

25***25***

26 26 


40| **Verify UI changes visually** | *"make the dashboard look better"* | *"\[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them"* |40| **Verify UI changes visually** | *"make the dashboard look better"* | *"\[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them"* |

41| **Address root causes, not symptoms** | *"the build is failing"* | *"the build fails with this error: \[paste error]. fix it and verify the build succeeds. address the root cause, don't suppress the error"* |41| **Address root causes, not symptoms** | *"the build is failing"* | *"the build fails with this error: \[paste error]. fix it and verify the build succeeds. address the root cause, don't suppress the error"* |

42 42 

43UI changes can be verified using the [Claude in Chrome extension](/en/chrome). It opens a browser, tests the UI, and iterates until the code works.43UI changes can be verified using the [Claude in Chrome extension](/en/chrome). It opens new tabs in your browser, tests the UI, and iterates until the code works.

44 44 

45Your verification can also be a test suite, a linter, or a Bash command that checks output. Invest in making your verification rock-solid.45Your verification can also be a test suite, a linter, or a Bash command that checks output. Invest in making your verification rock-solid.

46 46 


381The best results come from tight feedback loops. Though Claude occasionally solves problems perfectly on the first attempt, correcting it quickly generally produces better solutions faster.381The best results come from tight feedback loops. Though Claude occasionally solves problems perfectly on the first attempt, correcting it quickly generally produces better solutions faster.

382 382 

383* **`Esc`**: Stop Claude mid-action with the `Esc` key. Context is preserved, so you can redirect.383* **`Esc`**: Stop Claude mid-action with the `Esc` key. Context is preserved, so you can redirect.

384* **`Esc + Esc` or `/rewind`**: Press `Esc` twice or run `/rewind` to open the rewind menu and restore previous conversation and code state.384* **`Esc + Esc` or `/rewind`**: Press `Esc` twice or run `/rewind` to open the rewind menu and restore previous conversation and code state, or summarize from a selected message.

385* **`"Undo that"`**: Have Claude revert its changes.385* **`"Undo that"`**: Have Claude revert its changes.

386* **`/clear`**: Reset context between unrelated tasks. Long sessions with irrelevant context can reduce performance.386* **`/clear`**: Reset context between unrelated tasks. Long sessions with irrelevant context can reduce performance.

387 387 


400* Use `/clear` frequently between tasks to reset the context window entirely400* Use `/clear` frequently between tasks to reset the context window entirely

401* When auto compaction triggers, Claude summarizes what matters most, including code patterns, file states, and key decisions401* When auto compaction triggers, Claude summarizes what matters most, including code patterns, file states, and key decisions

402* For more control, run `/compact <instructions>`, like `/compact Focus on the API changes`402* For more control, run `/compact <instructions>`, like `/compact Focus on the API changes`

403* To compact only part of the conversation, use `Esc + Esc` or `/rewind`, select a message checkpoint, and choose **Summarize from here**. This condenses messages from that point forward while keeping earlier context intact.

403* Customize compaction behavior in CLAUDE.md with instructions like `"When compacting, always preserve the full list of modified files and any test commands"` to ensure critical context survives summarization404* Customize compaction behavior in CLAUDE.md with instructions like `"When compacting, always preserve the full list of modified files and any test commands"` to ensure critical context survives summarization

404 405 

405### Use subagents for investigation406### Use subagents for investigation


429 Every action Claude makes creates a checkpoint. You can restore conversation, code, or both to any previous checkpoint.430 Every action Claude makes creates a checkpoint. You can restore conversation, code, or both to any previous checkpoint.

430</Tip>431</Tip>

431 432 

432Claude automatically checkpoints before changes. Double-tap `Escape` or run `/rewind` to open the checkpoint menu. You can restore conversation only (keep code changes), restore code only (keep conversation), or restore both.433Claude automatically checkpoints before changes. Double-tap `Escape` or run `/rewind` to open the rewind menu. You can restore conversation only, restore code only, restore both, or summarize from a selected message. See [Checkpointing](/en/checkpointing) for details.

433 434 

434Instead of carefully planning every move, you can tell Claude to try something risky. If it doesn't work, rewind and try a different approach. Checkpoints persist across sessions, so you can close your terminal and still rewind later.435Instead of carefully planning every move, you can tell Claude to try something risky. If it doesn't work, rewind and try a different approach. Checkpoints persist across sessions, so you can close your terminal and still rewind later.

435 436 


485 Run multiple Claude sessions in parallel to speed up development, run isolated experiments, or start complex workflows.486 Run multiple Claude sessions in parallel to speed up development, run isolated experiments, or start complex workflows.

486</Tip>487</Tip>

487 488 

488There are two main ways to run parallel sessions:489There are three main ways to run parallel sessions:

489 490 

490* [Claude Desktop](/en/desktop): Manage multiple local sessions visually. Each session gets its own isolated worktree.491* [Claude Desktop](/en/desktop): Manage multiple local sessions visually. Each session gets its own isolated worktree.

491* [Claude Code on the web](/en/claude-code-on-the-web): Run on Anthropic's secure cloud infrastructure in isolated VMs.492* [Claude Code on the web](/en/claude-code-on-the-web): Run on Anthropic's secure cloud infrastructure in isolated VMs.

493* [Agent teams](/en/agent-teams): Automated coordination of multiple sessions with shared tasks, messaging, and a team lead.

492 494 

493Beyond parallelizing work, multiple sessions enable quality-focused workflows. A fresh context improves code review since Claude won't be biased toward code it just wrote.495Beyond parallelizing work, multiple sessions enable quality-focused workflows. A fresh context improves code review since Claude won't be biased toward code it just wrote.

494 496 

checkpointing.md +29 −9

Details

4 4 

5# Checkpointing5# Checkpointing

6 6 

7> Automatically track and rewind Claude's edits to quickly recover from unwanted changes.7> Track, rewind, and summarize Claude's edits and conversation to manage session state.

8 8 

9Claude Code automatically tracks Claude's file edits as you work, allowing you to quickly undo changes and rewind to previous states if anything gets off track.9Claude Code automatically tracks Claude's file edits as you work, allowing you to quickly undo changes and rewind to previous states if anything gets off track.

10 10 


20* Checkpoints persist across sessions, so you can access them in resumed conversations20* Checkpoints persist across sessions, so you can access them in resumed conversations

21* Automatically cleaned up along with sessions after 30 days (configurable)21* Automatically cleaned up along with sessions after 30 days (configurable)

22 22 

23### Rewinding changes23### Rewind and summarize

24 24 

25Press `Esc` twice (`Esc` + `Esc`) or use the `/rewind` command to open up the rewind menu. You can choose to restore:25Press `Esc` twice (`Esc` + `Esc`) or use the `/rewind` command to open the rewind menu. A scrollable list shows each of your prompts from the session. Select the point you want to act on, then choose an action:

26 26 

27* **Conversation only**: Rewind to a user message while keeping code changes27* **Restore code and conversation**: revert both code and conversation to that point

28* **Code only**: Revert file changes while keeping the conversation28* **Restore conversation**: rewind to that message while keeping current code

29* **Both code and conversation**: Restore both to a prior point in the session29* **Restore code**: revert file changes while keeping the conversation

30* **Summarize from here**: compress the conversation from this point forward into a summary, freeing context window space

31* **Never mind**: return to the message list without making changes

32 

33After restoring the conversation or summarizing, the original prompt from the selected message is restored into the input field so you can re-send or edit it.

34 

35#### Restore vs. summarize

36 

37The three restore options revert state: they undo code changes, conversation history, or both. "Summarize from here" works differently:

38 

39* Messages before the selected message stay intact

40* The selected message and all subsequent messages get replaced with a compact AI-generated summary

41* No files on disk are changed

42* The original messages are preserved in the session transcript, so Claude can reference the details if needed

43 

44This is similar to `/compact`, but targeted: instead of summarizing the entire conversation, you keep early context in full detail and only compress the parts that are using up space. You can type optional instructions to guide what the summary focuses on.

45 

46<Note>

47 Summarize keeps you in the same session and compresses context. If you want to branch off and try a different approach while preserving the original session intact, use [fork](/en/how-claude-code-works#resume-or-fork-sessions) instead (`claude --continue --fork-session`).

48</Note>

30 49 

31## Common use cases50## Common use cases

32 51 

33Checkpoints are particularly useful when:52Checkpoints are particularly useful when:

34 53 

35* **Exploring alternatives**: Try different implementation approaches without losing your starting point54* **Exploring alternatives**: try different implementation approaches without losing your starting point

36* **Recovering from mistakes**: Quickly undo changes that introduced bugs or broke functionality55* **Recovering from mistakes**: quickly undo changes that introduced bugs or broke functionality

37* **Iterating on features**: Experiment with variations knowing you can revert to working states56* **Iterating on features**: experiment with variations knowing you can revert to working states

57* **Freeing context space**: summarize a verbose debugging session from the midpoint forward, keeping your initial instructions intact

38 58 

39## Limitations59## Limitations

40 60 

chrome.md +87 −83

Details

4 4 

5# Use Claude Code with Chrome (beta)5# Use Claude Code with Chrome (beta)

6 6 

7> Connect Claude Code to your browser to test web apps, debug with console logs, and automate browser tasks.7> Connect Claude Code to your Chrome browser to test web apps, debug with console logs, automate form filling, and extract data from web pages.

8 

9Claude Code integrates with the Claude in Chrome browser extension to give you browser automation capabilities from the CLI or the [VS Code extension](/en/vs-code#automate-browser-tasks-with-chrome). Build your code, then test and debug in the browser without switching contexts.

10 

11Claude opens new tabs for browser tasks and shares your browser's login state, so it can access any site you're already signed into. Browser actions run in a visible Chrome window in real time. When Claude encounters a login page or CAPTCHA, it pauses and asks you to handle it manually.

8 12 

9<Note>13<Note>

10 Chrome integration is in beta and currently works with Google Chrome only. It is not yet supported on Brave, Arc, or other Chromium-based browsers. WSL (Windows Subsystem for Linux) is also not supported.14 Chrome integration is in beta and currently works with Google Chrome only. It is not yet supported on Brave, Arc, or other Chromium-based browsers. WSL (Windows Subsystem for Linux) is also not supported.

11</Note>15</Note>

12 16 

13Claude Code integrates with the Claude in Chrome browser extension to give you browser automation capabilities directly from your terminal. Build in your terminal, then test and debug in your browser without switching contexts.17## Capabilities

14 

15## What the integration enables

16 18 

17With Chrome connected, you can chain browser actions with terminal commands in a single workflow. For example: scrape documentation from a website, analyze it, generate code based on what you learned, and commit the result.19With Chrome connected, you can chain browser actions with coding tasks in a single workflow:

18 20 

19Key capabilities include:21* **Live debugging**: read console errors and DOM state directly, then fix the code that caused them

20 22* **Design verification**: build a UI from a Figma mock, then open it in the browser to verify it matches

21* **Live debugging**: Claude reads console errors and DOM state directly, then fixes the code that caused them23* **Web app testing**: test form validation, check for visual regressions, or verify user flows

22* **Design verification**: Build a UI from a Figma mock, then have Claude open it in the browser and verify it matches24* **Authenticated web apps**: interact with Google Docs, Gmail, Notion, or any app you're logged into without API connectors

23* **Web app testing**: Test form validation, check for visual regressions, or verify user flows work correctly25* **Data extraction**: pull structured information from web pages and save it locally

24* **Authenticated web apps**: Interact with Google Docs, Gmail, Notion, or any app you're logged into without needing API connectors26* **Task automation**: automate repetitive browser tasks like data entry, form filling, or multi-site workflows

25* **Data extraction**: Pull structured information from web pages and save it locally27* **Session recording**: record browser interactions as GIFs to document or share what happened

26* **Task automation**: Automate repetitive browser tasks like data entry, form filling, or multi-site workflows

27* **Session recording**: Record browser interactions as GIFs to document or share what happened

28 28 

29## Prerequisites29## Prerequisites

30 30 


32 32 

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

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

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

36* A paid Claude plan (Pro, Team, or Enterprise)36* A direct Anthropic plan (Pro, Max, Team, or Enterprise)

37 

38## How the integration works

39 

40Claude Code communicates with Chrome through the Claude in Chrome browser extension. The extension uses Chrome's [Native Messaging API](https://developer.chrome.com/docs/extensions/develop/concepts/native-messaging) to receive commands from Claude Code and execute them in your browser. This architecture lets Claude Code control browser tabs, read page content, and perform actions while you continue working in your terminal.

41 

42When Claude encounters a login page, CAPTCHA, or other blocker, it pauses and asks you to handle it. You can provide credentials for Claude to enter, or log in manually in the browser. Once you're past the blocker, tell Claude to continue and it picks up where it left off.

43 

44Claude opens new tabs for browser tasks rather than taking over existing ones. However, it shares your browser's login state, so if you're already signed into a site in Chrome, Claude can access it without re-authenticating.

45 37 

46<Note>38<Note>

47 The Chrome integration requires a visible browser window. When Claude performs browser actions, you'll see Chrome open and navigate in real time. There's no headless mode since the integration relies on your actual browser session with its login state.39 Chrome integration is not available through third-party providers like Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature.

48</Note>40</Note>

49 41 

50## Set up the integration42## Get started in the CLI

51 43 

52<Steps>44<Steps>

53 <Step title="Update Claude Code">45 <Step title="Launch Claude Code with Chrome">

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

55 47 

56 ```bash theme={null}48 ```bash theme={null}

57 claude update49 claude --chrome

58 ```50 ```

51 

52 You can also enable Chrome from within an existing session by running `/chrome`.

59 </Step>53 </Step>

60 54 

61 <Step title="Start Claude Code with Chrome enabled">55 <Step title="Ask Claude to use the browser">

62 Launch Claude Code with the `--chrome` flag:56 This example navigates to a page, interacts with it, and reports what it finds, all from your terminal or editor:

63 57 

64 ```bash theme={null}58 ```text theme={null}

65 claude --chrome59 Go to code.claude.com/docs, click on the search box,

60 type "hooks", and tell me what results appear

66 ```61 ```

67 </Step>62 </Step>

68 

69 <Step title="Verify the connection">

70 Run `/chrome` to check the connection status and manage settings. If the extension isn't detected, you'll see a warning with a link to install it.

71 </Step>

72</Steps>63</Steps>

73 64 

74You can also enable Chrome integration from within an existing session using the `/chrome` command.65Run `/chrome` at any time to check the connection status, manage permissions, or reconnect the extension.

75 66 

76## Try it out67For VS Code, see [browser automation in VS Code](/en/vs-code#automate-browser-tasks-with-chrome).

77 68 

78Once connected, type this into Claude to see the integration in action:69### Enable Chrome by default

79 70 

80```71To avoid passing `--chrome` each session, run `/chrome` and select "Enabled by default".

81Go to code.claude.com/docs, click on the search box,

82type "hooks", and tell me what results appear

83```

84 72 

85Claude opens the page, clicks into the search field, types the query, and reports the autocomplete results. This shows navigation, clicking, and typing in a single workflow.73In the [VS Code extension](/en/vs-code#automate-browser-tasks-with-chrome), Chrome is available whenever the Chrome extension is installed. No additional flag is needed.

86 74 

87## Example workflows75<Note>

76 Enabling Chrome by default in the CLI increases context usage since browser tools are always loaded. If you notice increased context consumption, disable this setting and use `--chrome` only when needed.

77</Note>

88 78 

89Claude can navigate pages, click and type, fill forms, scroll, read console logs and network requests, manage tabs, resize windows, and record GIFs. Run `/mcp` and click into `claude-in-chrome` to see the full list of available tools.79### Manage site permissions

90 80 

91The following examples show common patterns for browser automation.81Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on.

82 

83## Example workflows

84 

85These examples show common ways to combine browser actions with coding tasks. Run `/mcp` and select `claude-in-chrome` to see the full list of available browser tools.

92 86 

93### Test a local web application87### Test a local web application

94 88 

95When developing a web app, ask Claude to verify your changes work correctly:89When developing a web app, ask Claude to verify your changes work correctly:

96 90 

97```91```text theme={null}

98I just updated the login form validation. Can you open localhost:3000,92I just updated the login form validation. Can you open localhost:3000,

99try submitting the form with invalid data, and check if the error93try submitting the form with invalid data, and check if the error

100messages appear correctly?94messages appear correctly?


104 98 

105### Debug with console logs99### Debug with console logs

106 100 

107If your app has issues, Claude can read console output to help diagnose problems:101Claude can read console output to help diagnose problems. Tell Claude what patterns to look for rather than asking for all console output, since logs can be verbose:

108 102 

109```103```text theme={null}

110Open the dashboard page and check the console for any errors when104Open the dashboard page and check the console for any errors when

111the page loads.105the page loads.

112```106```


117 111 

118Speed up repetitive data entry tasks:112Speed up repetitive data entry tasks:

119 113 

120```114```text theme={null}

121I have a spreadsheet of customer contacts in contacts.csv. For each row,115I have a spreadsheet of customer contacts in contacts.csv. For each row,

122go to our CRM at crm.example.com, click "Add Contact", and fill in the116go to the CRM at crm.example.com, click "Add Contact", and fill in the

123name, email, and phone fields.117name, email, and phone fields.

124```118```

125 119 


129 123 

130Use Claude to write directly in your documents without API setup:124Use Claude to write directly in your documents without API setup:

131 125 

132```126```text theme={null}

133Draft a project update based on our recent commits and add it to my127Draft a project update based on the recent commits and add it to my

134Google Doc at docs.google.com/document/d/abc123128Google Doc at docs.google.com/document/d/abc123

135```129```

136 130 


140 134 

141Pull structured information from websites:135Pull structured information from websites:

142 136 

143```137```text theme={null}

144Go to the product listings page and extract the name, price, and138Go to the product listings page and extract the name, price, and

145availability for each item. Save the results as a CSV file.139availability for each item. Save the results as a CSV file.

146```140```


151 145 

152Coordinate tasks across multiple websites:146Coordinate tasks across multiple websites:

153 147 

154```148```text theme={null}

155Check my calendar for meetings tomorrow, then for each meeting with149Check my calendar for meetings tomorrow, then for each meeting with

156an external attendee, look up their company on LinkedIn and add a150an external attendee, look up their company website and add a note

157note about what they do.151about what they do.

158```152```

159 153 

160Claude works across tabs to gather information and complete the workflow.154Claude works across tabs to gather information and complete the workflow.


163 157 

164Create shareable recordings of browser interactions:158Create shareable recordings of browser interactions:

165 159 

166```160```text theme={null}

167Record a GIF showing how to complete the checkout flow, from adding161Record a GIF showing how to complete the checkout flow, from adding

168an item to the cart through to the confirmation page.162an item to the cart through to the confirmation page.

169```163```

170 164 

171Claude records the interaction sequence and saves it as a GIF file.165Claude records the interaction sequence and saves it as a GIF file.

172 166 

173## Best practices

174 

175When using browser automation, keep these guidelines in mind:

176 

177* **Modal dialogs can interrupt the flow**: JavaScript alerts, confirms, and prompts block browser events and prevent Claude from receiving commands. If a dialog appears, dismiss it manually and tell Claude to continue.

178* **Use fresh tabs**: Claude creates new tabs for each session. If a tab becomes unresponsive, ask Claude to create a new one.

179* **Filter console output**: Console logs can be verbose. When debugging, tell Claude what patterns to look for rather than asking for all console output.

180 

181## Troubleshooting167## Troubleshooting

182 168 

183### Extension not detected169### Extension not detected

184 170 

185If Claude Code shows "Chrome extension not detected":171If Claude Code shows "Chrome extension not detected":

186 172 

1871. Verify the Chrome extension (version 1.0.36 or higher) is installed1731. Verify the Chrome extension is installed and enabled in `chrome://extensions`

1882. Verify Claude Code is version 2.0.73 or higher by running `claude --version`1742. Verify Claude Code is up to date by running `claude --version`

1893. Check that Chrome is running1753. Check that Chrome is running

1904. Run `/chrome` and select "Reconnect extension" to re-establish the connection1764. Run `/chrome` and select "Reconnect extension" to re-establish the connection

1915. If the issue persists, restart both Claude Code and Chrome1775. If the issue persists, restart both Claude Code and Chrome

192 178 

179The first time you enable Chrome integration, Claude Code installs a native messaging host configuration file. Chrome reads this file on startup, so if the extension isn't detected on your first attempt, restart Chrome to pick up the new configuration.

180 

181If the connection still fails, verify the host configuration file exists at:

182 

183* **macOS**: `~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json`

184* **Linux**: `~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json`

185* **Windows**: check `HKCU\Software\Google\Chrome\NativeMessagingHosts\` in the Windows Registry

186 

193### Browser not responding187### Browser not responding

194 188 

195If Claude's browser commands stop working:189If Claude's browser commands stop working:

196 190 

1971. Check if a modal dialog (alert, confirm, prompt) is blocking the page1911. Check if a modal dialog (alert, confirm, prompt) is blocking the page. JavaScript dialogs block browser events and prevent Claude from receiving commands. Dismiss the dialog manually, then tell Claude to continue.

1982. Ask Claude to create a new tab and try again1922. Ask Claude to create a new tab and try again

1993. Restart the Chrome extension by disabling and re-enabling it1933. Restart the Chrome extension by disabling and re-enabling it in `chrome://extensions`

200 194 

201### First-time setup195### Connection drops during long sessions

202 196 

203The first time you use the integration, Claude Code installs a native messaging host that allows communication between the CLI and Chrome. If you encounter permission errors, you may need to restart Chrome for the installation to take effect.197The Chrome extension's service worker can go idle during extended sessions, which breaks the connection. If browser tools stop working after a period of inactivity, run `/chrome` and select "Reconnect extension".

204 198 

205## Enable by default199### Windows-specific issues

206 200 

207Chrome integration requires the `--chrome` flag each time you start Claude Code. To enable it by default, run `/chrome` and select "Enabled by default".201On Windows, you may encounter:

208 202 

209<Note>203* **Named pipe conflicts (EADDRINUSE)**: if another process is using the same named pipe, restart Claude Code. Close any other Claude Code sessions that might be using Chrome.

210 Enabling Chrome by default increases context usage since browser tools are always loaded. If you notice increased context consumption, disable this setting and use `--chrome` only when needed.204* **Native messaging host errors**: if the native messaging host crashes on startup, try reinstalling Claude Code to regenerate the host configuration.

211</Note>205 

206### Common error messages

207 

208These are the most frequently encountered errors and how to resolve them:

212 209 

213Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on. Run `/chrome` to see current permission settings.210| Error | Cause | Fix |

211| ------------------------------------ | ------------------------------------------------ | --------------------------------------------------------------- |

212| "Browser extension is not connected" | Native messaging host cannot reach the extension | Restart Chrome and Claude Code, then run `/chrome` to reconnect |

213| "Extension not detected" | Chrome extension is not installed or is disabled | Install or enable the extension in `chrome://extensions` |

214| "No tab available" | Claude tried to act before a tab was ready | Ask Claude to create a new tab and retry |

215| "Receiving end does not exist" | Extension service worker went idle | Run `/chrome` and select "Reconnect extension" |

214 216 

215## See also217## See also

216 218 

217* [CLI reference](/en/cli-reference) - Command-line flags including `--chrome`219* [Use Claude Code in VS Code](/en/vs-code#automate-browser-tasks-with-chrome): browser automation in the VS Code extension

218* [Common workflows](/en/common-workflows) - More ways to use Claude Code220* [CLI reference](/en/cli-reference): command-line flags including `--chrome`

219* [Getting started with Claude for Chrome](https://support.anthropic.com/en/articles/12012173-getting-started-with-claude-for-chrome) - Full documentation for the Chrome extension, including shortcuts, scheduling, and permissions221* [Common workflows](/en/common-workflows): more ways to use Claude Code

222* [Data and privacy](/en/data-usage): how Claude Code handles your data

223* [Getting started with Claude in Chrome](https://support.claude.com/en/articles/12012173-getting-started-with-claude-in-chrome): full documentation for the Chrome extension, including shortcuts, scheduling, and permissions

Details

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

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

141 141 

142### Sharing sessions

143 

144To share a session, toggle its visibility according to the account

145types below. After that, share the session link as-is. Recipients who open your

146shared session will see the latest state of the session upon load, but the

147recipient's page will not update in real time.

148 

149#### Sharing from an Enterprise or Teams account

150 

151For Enterprise and Teams accounts, the two visibility options are **Private**

152and **Team**. Team visibility makes the session visible to other members of your

153Claude.ai organization. Repository access verification is enabled by default,

154based on the GitHub account connected to the recipient's account. Your account's

155display name is visible to all recipients with access. [Claude in Slack](/en/slack)

156sessions are automatically shared with Team visibility.

157 

158#### Sharing from a Max or Pro account

159 

160For Max and Pro accounts, the two visibility options are **Private**

161and **Public**. Public visibility makes the session visible to any user logged

162into claude.ai.

163 

164Check your session for sensitive content before sharing. Sessions may contain

165code and credentials from private GitHub repositories. Repository access

166verification is not enabled by default.

167 

168Enable repository access verification and/or withhold your name from your shared

169sessions by going to Settings > Claude Code > Sharing settings.

170 

142## Cloud environment171## Cloud environment

143 172 

144### Default image173### Default image


216 245 

217### Dependency management246### Dependency management

218 247 

219Configure automatic dependency installation using [SessionStart hooks](/en/hooks#sessionstart). This can be configured in your repository's `.claude/settings.json` file:248Custom environment images and snapshots are not yet supported. As a workaround, you can use [SessionStart hooks](/en/hooks#sessionstart) to install packages when a session starts. This approach has [known limitations](#dependency-management-limitations).

249 

250To configure automatic dependency installation, add a SessionStart hook to your repository's `.claude/settings.json` file:

220 251 

221```json theme={null}252```json theme={null}

222{253{


240 271 

241```bash theme={null}272```bash theme={null}

242#!/bin/bash273#!/bin/bash

243npm install

244pip install -r requirements.txt

245exit 0

246```

247 274 

248Make it executable: `chmod +x scripts/install_pkgs.sh`275# Only run in remote environments

249 

250#### Local vs remote execution

251 

252By 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.

253 

254```bash theme={null}

255#!/bin/bash

256 

257# Example: Only run in remote environments

258if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then276if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then

259 exit 0277 exit 0

260fi278fi

261 279 

262npm install280npm install

263pip install -r requirements.txt281pip install -r requirements.txt

282exit 0

264```283```

265 284 

266#### Persisting environment variables285Make it executable: `chmod +x scripts/install_pkgs.sh`

286 

287#### Persist environment variables

288 

289SessionStart 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.

290 

291#### Dependency management limitations

267 292 

268SessionStart 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.293* **Hooks fire for all sessions**: SessionStart hooks run in both local and remote environments. There is no hook configuration to scope a hook to remote sessions only. To skip local execution, check the `CLAUDE_CODE_REMOTE` environment variable in your script as shown above.

294* **Requires network access**: Install commands need network access to reach package registries. If your environment is configured with "No internet" access, these hooks will fail. Use "Limited" (the default) or "Full" network access. The [default allowlist](#default-allowed-domains) includes common registries like npm, PyPI, RubyGems, and crates.io.

295* **Proxy compatibility**: All outbound traffic in remote environments passes through a [security proxy](#security-proxy). Some package managers do not work correctly with this proxy. Bun is a known example.

296* **Runs on every session start**: Hooks run each time a session starts or resumes, adding startup latency. Keep install scripts fast by checking whether dependencies are already present before reinstalling.

269 297 

270## Network access and security298## Network access and security

271 299 


301 329 

302* api.anthropic.com330* api.anthropic.com

303* statsig.anthropic.com331* statsig.anthropic.com

304* docs.claude.com332* platform.claude.com

305* code.claude.com333* code.claude.com

306* claude.ai334* claude.ai

307 335 

cli-reference.md +12 −7

Details

48| `--init-only` | Run initialization hooks and exit (no interactive session) | `claude --init-only` |48| `--init-only` | Run initialization hooks and exit (no interactive session) | `claude --init-only` |

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

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

51| `--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"` |51| `--json-schema` | Get validated JSON output matching a JSON Schema after agent completes its workflow (print mode only, see [structured outputs](https://platform.claude.com/docs/en/agent-sdk/structured-outputs)) | `claude -p --json-schema '{"type":"object","properties":{...}}' "query"` |

52| `--maintenance` | Run maintenance hooks and exit | `claude --maintenance` |52| `--maintenance` | Run maintenance hooks and exit | `claude --maintenance` |

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

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


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

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

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

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

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

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

63| `--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"` |63| `--print`, `-p` | Print response without interactive mode (see [Agent SDK documentation](https://platform.claude.com/docs/en/agent-sdk/overview) for programmatic usage details) | `claude -p "query"` |

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

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

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


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

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

72| `--teleport` | Resume a [web session](/en/claude-code-on-the-web) in your local terminal | `claude --teleport` |72| `--teleport` | Resume a [web session](/en/claude-code-on-the-web) in your local terminal | `claude --teleport` |

73| `--teammate-mode` | Set how [agent team](/en/agent-teams) teammates display: `auto` (default), `in-process`, or `tmux`. See [set up agent teams](/en/agent-teams#set-up-agent-teams) | `claude --teammate-mode in-process` |

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

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

75| `--version`, `-v` | Output the version number | `claude -v` |76| `--version`, `-v` | Output the version number | `claude -v` |


84The `--agents` flag accepts a JSON object that defines one or more custom subagents. Each subagent requires a unique name (as the key) and a definition object with the following fields:85The `--agents` flag accepts a JSON object that defines one or more custom subagents. Each subagent requires a unique name (as the key) and a definition object with the following fields:

85 86 

86| Field | Required | Description |87| Field | Required | Description |

87| :------------ | :------- | :---------------------------------------------------------------------------------------------------------------------------------- |88| :---------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

88| `description` | Yes | Natural language description of when the subagent should be invoked |89| `description` | Yes | Natural language description of when the subagent should be invoked |

89| `prompt` | Yes | The system prompt that guides the subagent's behavior |90| `prompt` | Yes | The system prompt that guides the subagent's behavior |

90| `tools` | No | Array of specific tools the subagent can use (for example, `["Read", "Edit", "Bash"]`). If omitted, inherits all tools |91| `tools` | No | Array of specific tools the subagent can use, for example `["Read", "Edit", "Bash"]`. If omitted, inherits all tools. Supports [`Task(agent_type)`](/en/sub-agents#restrict-which-subagents-can-be-spawned) syntax |

91| `model` | No | Model alias to use: `sonnet`, `opus`, `haiku`, or `inherit`. If omitted, defaults to `inherit` (uses the main conversation's model) |92| `disallowedTools` | No | Array of tool names to explicitly deny for this subagent |

93| `model` | No | Model alias to use: `sonnet`, `opus`, `haiku`, or `inherit`. If omitted, defaults to `inherit` |

94| `skills` | No | Array of [skill](/en/skills) names to preload into the subagent's context |

95| `mcpServers` | No | Array of [MCP servers](/en/mcp) for this subagent. Each entry is a server name string or a `{name: config}` object |

96| `maxTurns` | No | Maximum number of agentic turns before the subagent stops |

92 97 

93Example:98Example:

94 99 


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

154* [Common workflows](/en/common-workflows) - Advanced workflows and patterns159* [Common workflows](/en/common-workflows) - Advanced workflows and patterns

155* [Settings](/en/settings) - Configuration options160* [Settings](/en/settings) - Configuration options

156* [SDK documentation](https://docs.claude.com/en/docs/agent-sdk) - Programmatic usage and integrations161* [Agent SDK documentation](https://platform.claude.com/docs/en/agent-sdk/overview) - Programmatic usage and integrations

Details

240 240 

241You can switch into Plan Mode during a session using **Shift+Tab** to cycle through permission modes.241You can switch into Plan Mode during a session using **Shift+Tab** to cycle through permission modes.

242 242 

243If you are in Normal Mode, **Shift+Tab** first switches into Auto-Accept Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** will switch into Plan Mode, indicated by `⏸ plan mode on`.243If you are in Normal Mode, **Shift+Tab** first switches into Auto-Accept Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** will switch into Plan Mode, indicated by `⏸ plan mode on`. When an [agent team](/en/agent-teams) is active, the cycle also includes Delegate Mode.

244 244 

245**Start a new session in Plan Mode**245**Start a new session in Plan Mode**

246 246 


509 509 

510## Use extended thinking (thinking mode)510## Use extended thinking (thinking mode)

511 511 

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

513 513 

514Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches. It provides more space for exploring multiple solutions, analyzing edge cases, and self-correcting mistakes.514Additionally, Opus 4.6 introduces adaptive reasoning: instead of a fixed thinking token budget, the model dynamically allocates thinking based on your [effort level](/en/model-config#adjust-effort-level) setting. Extended thinking and adaptive reasoning work together to give you control over how deeply Claude reasons before responding.

515 

516Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches.

515 517 

516<Note>518<Note>

517 Phrases like "think", "think hard", "ultrathink", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.519 Phrases like "think", "think hard", "ultrathink", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.


522Thinking is enabled by default, but you can adjust or disable it.524Thinking is enabled by default, but you can adjust or disable it.

523 525 

524| Scope | How to configure | Details |526| Scope | How to configure | Details |

525| ---------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |527| ---------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |

526| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off for the current session. May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |528| **Effort level** | Adjust in `/model` or set [`CLAUDE_CODE_EFFORT_LEVEL`](/en/settings#environment-variables) | Control thinking depth for Opus 4.6: low, medium, high (default). See [Adjust effort level](/en/model-config#adjust-effort-level) |

527| **Global default** | Use `/config` to toggle thinking mode | Sets your default across all projects.<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |529| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off for the current session (all models). May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |

528| **Limit token budget** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | Limit the thinking budget to a specific number of tokens. Example: `export MAX_THINKING_TOKENS=10000` |530| **Global default** | Use `/config` to toggle thinking mode | Sets your default across all projects (all models).<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |

531| **Limit token budget** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | Limit the thinking budget to a specific number of tokens (ignored on Opus 4.6 unless set to 0). Example: `export MAX_THINKING_TOKENS=10000` |

529 532 

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

531 534 

532### How extended thinking token budgets work535### How extended thinking works

533 

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

535 

536A larger thinking token budget provides:

537 536 

538* More space to explore multiple solution approaches step-by-step537Extended thinking controls how much internal reasoning Claude performs before responding. More thinking provides more space to explore solutions, analyze edge cases, and self-correct mistakes.

539* Room to analyze edge cases and evaluate tradeoffs thoroughly

540* Ability to revise reasoning and self-correct mistakes

541 538 

542Token budgets for thinking mode:539**With Opus 4.6**, thinking uses adaptive reasoning: the model dynamically allocates thinking tokens based on the [effort level](/en/model-config#adjust-effort-level) you select (low, medium, high). This is the recommended way to tune the tradeoff between speed and reasoning depth.

543 540 

544* When thinking is **enabled**, Claude can use up to **31,999 tokens** from your output budget for internal reasoning541**With other models**, thinking uses a fixed budget of up to 31,999 tokens from your output budget. You can limit this with the [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable, or disable thinking entirely via `/config` or the `Option+T`/`Alt+T` toggle.

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

546 542 

547**Limit the thinking budget:**543`MAX_THINKING_TOKENS` is ignored when using Opus 4.6, since adaptive reasoning controls thinking depth instead. The one exception: setting `MAX_THINKING_TOKENS=0` still disables thinking entirely on any model.

548 

549* Use the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) to cap the thinking budget

550* When set, this value limits the maximum tokens Claude can use for thinking

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

552 544 

553<Warning>545<Warning>

554 You're charged for all thinking tokens used, even though Claude 4 models show summarized thinking546 You're charged for all thinking tokens used, even though Claude 4 models show summarized thinking


715 * Other languages: Following your project's standard setup process707 * Other languages: Following your project's standard setup process

716</Tip>708</Tip>

717 709 

710For automated coordination of parallel sessions with shared tasks and messaging, see [agent teams](/en/agent-teams).

711 

718***712***

719 713 

720## Use Claude as a unix-style utility714## Use Claude as a unix-style utility

costs.md +19 −3

Details

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

38</Note>38</Note>

39 39 

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

41 41 

42### Rate limit recommendations42### Rate limit recommendations

43 43 


54 54 

55For example, if you have 200 users, you might request 20k TPM for each user, or 4 million total TPM (200\*20,000 = 4 million).55For example, if you have 200 users, you might request 20k TPM for each user, or 4 million total TPM (200\*20,000 = 4 million).

56 56 

57The TPM per user decreases as team size grows because we expect fewer users to use Claude Code concurrently in larger organizations. These rate limits apply at the organization level, not per individual user, which means individual users can temporarily consume more than their calculated share when others aren't actively using the service.57The TPM per user decreases as team size grows because fewer users tend to use Claude Code concurrently in larger organizations. These rate limits apply at the organization level, not per individual user, which means individual users can temporarily consume more than their calculated share when others aren't actively using the service.

58 58 

59<Note>59<Note>

60 If you anticipate scenarios with unusually high concurrent usage (such as live training sessions with large groups), you may need higher TPM allocations per user.60 If you anticipate scenarios with unusually high concurrent usage (such as live training sessions with large groups), you may need higher TPM allocations per user.

61</Note>61</Note>

62 62 

63### Agent team token costs

64 

65[Agent teams](/en/agent-teams) spawn multiple Claude Code instances, each with its own context window. Token usage scales with the number of active teammates and how long each one runs.

66 

67To keep agent team costs manageable:

68 

69* Use Sonnet for teammates. It balances capability and cost for coordination tasks.

70* Keep teams small. Each teammate runs its own context window, so token usage is roughly proportional to team size.

71* Keep spawn prompts focused. Teammates load CLAUDE.md, MCP servers, and skills automatically, but everything in the spawn prompt adds to their context from the start.

72* Clean up teams when work is done. Active teammates continue consuming tokens even if idle.

73* Agent teams are disabled by default. Set `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your [settings.json](/en/settings) or environment to enable them. See [enable agent teams](/en/agent-teams#enable-agent-teams).

74 

63## Reduce token usage75## Reduce token usage

64 76 

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


153 165 

154### Adjust extended thinking166### Adjust extended thinking

155 167 

156Extended thinking is enabled by default with a budget of 31,999 tokens because it significantly improves performance on complex planning and reasoning tasks. However, thinking tokens are billed as output tokens, so for simpler tasks where deep reasoning isn't needed, you can reduce costs by disabling it in `/config` or lowering the budget (for example, `MAX_THINKING_TOKENS=8000`).168Extended thinking is enabled by default with a budget of 31,999 tokens because it significantly improves performance on complex planning and reasoning tasks. However, thinking tokens are billed as output tokens, so for simpler tasks where deep reasoning isn't needed, you can reduce costs by lowering the [effort level](/en/model-config#adjust-effort-level) in `/model` for Opus 4.6, disabling thinking in `/config`, or lowering the budget (for example, `MAX_THINKING_TOKENS=8000`).

157 169 

158### Delegate verbose operations to subagents170### Delegate verbose operations to subagents

159 171 

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

161 173 

174### Manage agent team costs

175 

176Agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, because each teammate maintains its own context window and runs as a separate Claude instance. Keep team tasks small and self-contained to limit per-teammate token usage. See [agent teams](/en/agent-teams) for details.

177 

162### Write specific prompts178### Write specific prompts

163 179 

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

data-usage.md +9 −6

Details

27 27 

28When 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.28When 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 29 

30To disable these surveys, set `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1`. The survey is also automatically disabled when using third-party providers (Bedrock, Vertex, Foundry) or when telemetry is disabled.

31 

30### Data retention32### Data retention

31 33 

32Anthropic retains Claude Code data based on your account type and preferences.34Anthropic retains Claude Code data based on your account type and preferences.


82 84 

83## Default behaviors by API provider85## Default behaviors by API provider

84 86 

85By default, we disable all non-essential traffic (including error reporting, telemetry, and bug reporting functionality) when using Bedrock or Vertex. You can also opt out of all of these at once by setting the `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` environment variable. Here are the full default behaviors:87By default, we disable all non-essential traffic (including error reporting, telemetry, bug reporting functionality, and session quality surveys) when using Bedrock, Vertex, or Foundry. You can also opt out of all of these at once by setting the `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` environment variable. Here are the full default behaviors:

86 88 

87| Service | Claude API | Vertex API | Bedrock API |89| Service | Claude API | Vertex API | Bedrock API | Foundry API |

88| ------------------------------- | -------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------ |90| ------------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------ |

89| **Statsig (Metrics)** | Default on.<br />`DISABLE_TELEMETRY=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. |91| **Statsig (Metrics)** | Default on.<br />`DISABLE_TELEMETRY=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off.<br />`CLAUDE_CODE_USE_FOUNDRY` must be 1. |

90| **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. |92| **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. | Default off.<br />`CLAUDE_CODE_USE_FOUNDRY` must be 1. |

91| **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. |93| **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. | Default off.<br />`CLAUDE_CODE_USE_FOUNDRY` must be 1. |

94| **Session quality surveys** | Default on.<br />`CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default off.<br />`CLAUDE_CODE_USE_VERTEX` must be 1. | Default off.<br />`CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off.<br />`CLAUDE_CODE_USE_FOUNDRY` must be 1. |

92 95 

93All environment variables can be checked into `settings.json` ([read more](/en/settings)).96All environment variables can be checked into `settings.json` ([read more](/en/settings)).

desktop.md +1 −1

Details

116 116 

117To stop Claude mid-task, click the stop button.117To stop Claude mid-task, click the stop button.

118 118 

119Remote sessions only support **Code** and **Plan** modes because they continue running in the background without requiring your active participation. See [permission modes](/en/iam#permission-modes) for details on how these work internally.119Remote sessions only support **Code** and **Plan** modes because they continue running in the background without requiring your active participation. See [permission modes](/en/permissions#permission-modes) for details on how these work internally.

120 120 

121### Work in parallel with sessions121### Work in parallel with sessions

122 122 

fast-mode.md +131 −0 added

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Speed up responses with fast mode

6 

7> Get faster Opus 4.6 responses in Claude Code by toggling fast mode.

8 

9<Note>

10 Fast mode is in [research preview](#research-preview). The feature, pricing, and availability may change based on feedback.

11</Note>

12 

13Fast mode delivers faster Opus 4.6 responses at a higher cost per token. Toggle it on with `/fast` when you need speed for interactive work like rapid iteration or live debugging, and toggle it off when cost matters more than latency.

14 

15Fast mode is not a different model. It uses the same Opus 4.6 with a different API configuration that prioritizes speed over cost efficiency. You get identical quality and capabilities, just faster responses.

16 

17What to know:

18 

19* Use `/fast` to toggle on fast mode in Claude Code CLI. Also available via `/fast` in Claude Code VS Code Extension.

20* Fast mode for Opus 4.6 pricing starts at \$30/150 MTok. Fast mode is available at a 50% discount for all plans until 11:59pm PT on February 16.

21* Available to all Claude Code users on subscription plans (Pro/Max/Team/Enterprise) and Claude Console.

22* For Claude Code users on subscription plans (Pro/Max/Team/Enterprise), fast mode is available via extra usage only and not included in the subscription rate limits.

23 

24This page covers how to [toggle fast mode](#toggle-fast-mode), its [cost tradeoff](#understand-the-cost-tradeoff), [when to use it](#decide-when-to-use-fast-mode), [requirements](#requirements), and [rate limit behavior](#handle-rate-limits).

25 

26## Toggle fast mode

27 

28Toggle fast mode in either of these ways:

29 

30* Type `/fast` and press Tab to toggle on or off

31* Set `"fastMode": true` in your [user settings file](/en/settings)

32 

33Fast mode persists across sessions. For the best cost efficiency, enable fast mode at the start of a session rather than switching mid-conversation. See [understand the cost tradeoff](#understand-the-cost-tradeoff) for details.

34 

35When you enable fast mode:

36 

37* If you're on a different model, Claude Code automatically switches to Opus 4.6

38* You'll see a confirmation message: "Fast mode ON"

39* A small `↯` icon appears next to the prompt while fast mode is active

40* Run `/fast` again at any time to check whether fast mode is on or off

41 

42When you disable fast mode with `/fast` again, you remain on Opus 4.6. The model does not revert to your previous model. To switch to a different model, use `/model`.

43 

44## Understand the cost tradeoff

45 

46Fast mode has higher per-token pricing than standard Opus 4.6:

47 

48| Mode | Input (MTok) | Output (MTok) |

49| ------------------------------ | ------------ | ------------- |

50| Fast mode on Opus 4.6 (\<200K) | \$30 | \$150 |

51| Fast mode on Opus 4.6 (>200K) | \$60 | \$225 |

52 

53Fast mode is compatible with the 1M token extended context window.

54 

55When you switch into fast mode mid-conversation, you pay the full fast mode uncached input token price for the entire conversation context. This costs more than if you had enabled fast mode from the start.

56 

57## Decide when to use fast mode

58 

59Fast mode is best for interactive work where response latency matters more than cost:

60 

61* Rapid iteration on code changes

62* Live debugging sessions

63* Time-sensitive work with tight deadlines

64 

65Standard mode is better for:

66 

67* Long autonomous tasks where speed matters less

68* Batch processing or CI/CD pipelines

69* Cost-sensitive workloads

70 

71### Fast mode vs effort level

72 

73Fast mode and effort level both affect response speed, but differently:

74 

75| Setting | Effect |

76| ---------------------- | -------------------------------------------------------------------------------- |

77| **Fast mode** | Same model quality, lower latency, higher cost |

78| **Lower effort level** | Less thinking time, faster responses, potentially lower quality on complex tasks |

79 

80You can combine both: use fast mode with a lower [effort level](/en/model-config#adjust-effort-level) for maximum speed on straightforward tasks.

81 

82## Requirements

83 

84Fast mode requires all of the following:

85 

86* **Not available on third-party cloud providers**: fast mode is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Azure Foundry. Fast mode is available through the Anthropic Console API and for Claude subscription plans using extra usage.

87* **Extra usage enabled**: your account must have extra usage enabled, which allows billing beyond your plan's included usage. For individual accounts, enable this in your [Console billing settings](https://platform.claude.com/settings/organization/billing). For Teams and Enterprise, an admin must enable extra usage for the organization.

88 

89<Note>

90 Fast mode usage is billed directly to extra usage, even if you have remaining usage on your plan. This means fast mode tokens do not count against your plan's included usage and are charged at the fast mode rate from the first token.

91</Note>

92 

93* **Admin enablement for Teams and Enterprise**: fast mode is disabled by default for Teams and Enterprise organizations. An admin must explicitly [enable fast mode](#enable-fast-mode-for-your-organization) before users can access it.

94 

95<Note>

96 If your admin has not enabled fast mode for your organization, the `/fast` command will show "Fast mode has been disabled by your organization."

97</Note>

98 

99### Enable fast mode for your organization

100 

101Admins can enable fast mode in:

102 

103* **Console** (API customers): [Claude Code preferences](https://platform.claude.com/claude-code/preferences)

104* **Claude AI** (Teams and Enterprise): [Admin Settings > Claude Code](https://claude.ai/admin-settings/claude-code)

105 

106## Handle rate limits

107 

108Fast mode has separate rate limits from standard Opus 4.6. When you hit the fast mode rate limit or run out of extra usage credits:

109 

1101. Fast mode automatically falls back to standard Opus 4.6

1112. The `↯` icon turns gray to indicate cooldown

1123. You continue working at standard speed and pricing

1134. When the cooldown expires, fast mode automatically re-enables

114 

115To disable fast mode manually instead of waiting for cooldown, run `/fast` again.

116 

117## Research preview

118 

119Fast mode is a research preview feature. This means:

120 

121* The feature may change based on feedback

122* Availability and pricing are subject to change

123* The underlying API configuration may evolve

124 

125Report issues or feedback through your usual Anthropic support channels.

126 

127## See also

128 

129* [Model configuration](/en/model-config): switch models and adjust effort levels

130* [Manage costs effectively](/en/costs): track token usage and reduce costs

131* [Status line configuration](/en/statusline): display model and context information

Details

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

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

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

25* **[Agent teams](/en/agent-teams)** coordinate multiple independent sessions with shared tasks and peer-to-peer messaging

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

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

27 28 


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

33 34 

34| Feature | What it does | When to use it | Example |35| Feature | What it does | When to use it | Example |

35| ------------- | ---------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- |36| ---------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |

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

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

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

40| **[Agent teams](/en/agent-teams)** | Coordinate multiple independent Claude Code sessions | Parallel research, new feature development, debugging with competing hypotheses | Spawn reviewers to check security, performance, and tests simultaneously |

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

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

41 43 


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

83 </Tab>85 </Tab>

84 86 

87 <Tab title="Subagent vs Agent team">

88 Both parallelize work, but they're architecturally different:

89 

90 * **Subagents** run inside your session and report results back to your main context

91 * **Agent teams** are independent Claude Code sessions that communicate with each other

92 

93 | Aspect | Subagent | Agent team |

94 | ----------------- | ------------------------------------------------ | --------------------------------------------------- |

95 | **Context** | Own context window; results return to the caller | Own context window; fully independent |

96 | **Communication** | Reports results back to the main agent only | Teammates message each other directly |

97 | **Coordination** | Main agent manages all work | Shared task list with self-coordination |

98 | **Best for** | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |

99 | **Token cost** | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |

100 

101 **Use a subagent** when you need a quick, focused worker: research a question, verify a claim, review a file. The subagent does the work and returns a summary. Your main conversation stays clean.

102 

103 **Use an agent team** when teammates need to share findings, challenge each other, and coordinate independently. Agent teams are best for research with competing hypotheses, parallel code review, and new feature development where each teammate owns a separate piece.

104 

105 **Transition point:** If you're running parallel subagents but hitting context limits, or if your subagents need to communicate with each other, agent teams are the natural next step.

106 

107 <Note>

108 Agent teams are experimental and disabled by default. See [agent teams](/en/agent-teams) for setup and current limitations.

109 </Note>

110 </Tab>

111 

85 <Tab title="MCP vs Skill">112 <Tab title="MCP vs Skill">

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

87 114 


229 Offload work to isolated context256 Offload work to isolated context

230 </Card>257 </Card>

231 258 

259 <Card title="Agent teams" icon="network" href="/en/agent-teams">

260 Coordinate multiple sessions working in parallel

261 </Card>

262 

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

233 Connect Claude to external services264 Connect Claude to external services

234 </Card>265 </Card>

Details

9Claude Code GitHub Actions brings AI-powered automation to your GitHub workflow. With a simple `@claude` mention in any PR or issue, Claude can analyze your code, create pull requests, implement features, and fix bugs - all while following your project's standards.9Claude Code GitHub Actions brings AI-powered automation to your GitHub workflow. With a simple `@claude` mention in any PR or issue, Claude can analyze your code, create pull requests, implement features, and fix bugs - all while following your project's standards.

10 10 

11<Note>11<Note>

12 Claude Code GitHub Actions is built on top of the [Claude Code12 Claude Code GitHub Actions is built on top of the [Claude

13 SDK](https://docs.claude.com/en/docs/agent-sdk), which enables programmatic integration of13 Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview), which enables programmatic integration of

14 Claude Code into your applications. You can use the SDK to build custom14 Claude Code into your applications. You can use the SDK to build custom

15 automation workflows beyond GitHub Actions.15 automation workflows beyond GitHub Actions.

16</Note>16</Note>

17 17 

18<Info>18<Info>

19 **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`.19 **Claude Opus 4.6 is now available.** Claude Code GitHub Actions default to Sonnet. To use Opus 4.6, configure the [model parameter](#breaking-changes-reference) to use `claude-opus-4-6`.

20</Info>20</Info>

21 21 

22## Why use Claude Code GitHub Actions?22## Why use Claude Code GitHub Actions?


193 with:193 with:

194 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}194 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

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

196 claude_args: "--model claude-opus-4-5-20251101"196 claude_args: "--model opus"

197```197```

198 198 

199### Common use cases199### Common use cases

gitlab-ci-cd.md +2 −2

Details

13</Info>13</Info>

14 14 

15<Note>15<Note>

16 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.16 This integration is built on top of the [Claude Code CLI and Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview), enabling programmatic use of Claude in your CI/CD jobs and custom automation workflows.

17</Note>17</Note>

18 18 

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


408* **API costs**:408* **API costs**:

409 * Each Claude interaction consumes tokens based on prompt and response size409 * Each Claude interaction consumes tokens based on prompt and response size

410 * Token usage varies by task complexity and codebase size410 * Token usage varies by task complexity and codebase size

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

412 412 

413* **Cost optimization tips**:413* **Cost optimization tips**:

414 * Use specific `@claude` commands to reduce unnecessary turns414 * Use specific `@claude` commands to reduce unnecessary turns

Details

86```86```

87 87 

88<Note>88<Note>

89 [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.89 [Prompt caching](https://platform.claude.com/docs/en/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.

90</Note>90</Note>

91 91 

92<Note>92<Note>


109To customize models:109To customize models:

110 110 

111```bash theme={null}111```bash theme={null}

112export ANTHROPIC_MODEL='claude-opus-4-1@20250805'112export ANTHROPIC_MODEL='claude-opus-4-6'

113export ANTHROPIC_SMALL_FAST_MODEL='claude-haiku-4-5@20251001'113export ANTHROPIC_SMALL_FAST_MODEL='claude-haiku-4-5@20251001'

114```114```

115 115 


131 131 

132## 1M token context window132## 1M token context window

133 133 

134Claude 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.134Claude Sonnet 4 and Sonnet 4.5 support the [1M token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window) on Vertex AI.

135 135 

136<Note>136<Note>

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

hooks.md +184 −29

Details

18 18 

19<div style={{maxWidth: "500px", margin: "0 auto"}}>19<div style={{maxWidth: "500px", margin: "0 auto"}}>

20 <Frame>20 <Frame>

21 <img src="https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=5c25fedbc3db6f8882af50c3cc478c32" alt="Hook lifecycle diagram showing the sequence of hooks from SessionStart through the agentic loop to SessionEnd" data-og-width="8876" width="8876" data-og-height="12492" height="12492" data-path="images/hooks-lifecycle.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?w=280&fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=62406fcd5d4a189cc8842ee1bd946b84 280w, https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?w=560&fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=fa3049022a6973c5f974e0f95b28169d 560w, https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?w=840&fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=bd2890897db61a03160b93d4f972ff8e 840w, https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?w=1100&fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=7ae8e098340479347135e39df4a13454 1100w, https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?w=1650&fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=848a8606aab22c2ccaa16b6a18431e32 1650w, https://mintcdn.com/claude-code/z2YM37Ycg6eMbID3/images/hooks-lifecycle.png?w=2500&fit=max&auto=format&n=z2YM37Ycg6eMbID3&q=85&s=f3a9ef7feb61fa8fe362005aa185efbc 2500w" />21 <img src="https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=7a351ea1cc3d5da7a2176bf51196bc1a" alt="Hook lifecycle diagram showing the sequence of hooks from SessionStart through the agentic loop to SessionEnd" data-og-width="520" width="520" data-og-height="960" height="960" data-path="images/hooks-lifecycle.svg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?w=280&fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=8f32c67d025f0a318d5ed10a4f8ff2e6 280w, https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?w=560&fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=896fc424e39ff8d590720331a77e3d80 560w, https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?w=840&fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=a1c1c9739cde965e1eade843cee567c5 840w, https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?w=1100&fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=5bb083988de020e7d568e8dd8f1422fc 1100w, https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?w=1650&fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=343e9883c1e3172f08096c352aa46f12 1650w, https://mintcdn.com/claude-code/tpQvD9DKENFo4zX_/images/hooks-lifecycle.svg?w=2500&fit=max&auto=format&n=tpQvD9DKENFo4zX_&q=85&s=4de37b29de0f6df8b0c3e937a76c3bc6 2500w" />

22 </Frame>22 </Frame>

23</div>23</div>

24 24 

25The table below summarizes when each event fires. The [Hook events](#hook-events) section documents the full input schema and decision control options for each one.25The table below summarizes when each event fires. The [Hook events](#hook-events) section documents the full input schema and decision control options for each one.

26 26 

27| Event | When it fires |27| Event | When it fires |

28| :------------------- | :--------------------------------------------------- |28| :------------------- | :----------------------------------------------------------------- |

29| `SessionStart` | When a session begins or resumes |29| `SessionStart` | When a session begins or resumes |

30| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |30| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |

31| `PreToolUse` | Before a tool call executes. Can block it |31| `PreToolUse` | Before a tool call executes. Can block it |


36| `SubagentStart` | When a subagent is spawned |36| `SubagentStart` | When a subagent is spawned |

37| `SubagentStop` | When a subagent finishes |37| `SubagentStop` | When a subagent finishes |

38| `Stop` | When Claude finishes responding |38| `Stop` | When Claude finishes responding |

39| `TeammateIdle` | When an [agent team](/en/agent-teams) teammate is about to go idle |

40| `TaskCompleted` | When a task is being marked as completed |

39| `PreCompact` | Before context compaction |41| `PreCompact` | Before context compaction |

40| `SessionEnd` | When a session terminates |42| `SessionEnd` | When a session terminates |

41 43 


61}63}

62```64```

63 65 

64The script reads the JSON input from stdin, extracts the command, and blocks it if it contains `rm -rf`:66The script reads the JSON input from stdin, extracts the command, and returns a `permissionDecision` of `"deny"` if it contains `rm -rf`:

65 67 

66```bash theme={null}68```bash theme={null}

67#!/bin/bash69#!/bin/bash


69COMMAND=$(jq -r '.tool_input.command')71COMMAND=$(jq -r '.tool_input.command')

70 72 

71if echo "$COMMAND" | grep -q 'rm -rf'; then73if echo "$COMMAND" | grep -q 'rm -rf'; then

72 echo '{"decision":"block","reason":"Destructive command blocked by hook"}'74 jq -n '{

75 hookSpecificOutput: {

76 hookEventName: "PreToolUse",

77 permissionDecision: "deny",

78 permissionDecisionReason: "Destructive command blocked by hook"

79 }

80 }'

73else81else

74 exit 0 # allow the command82 exit 0 # allow the command

75fi83fi


98 The script extracts `"rm -rf /tmp/build"` from the input and finds `rm -rf`, so it prints a decision to stdout:106 The script extracts `"rm -rf /tmp/build"` from the input and finds `rm -rf`, so it prints a decision to stdout:

99 107 

100 ```json theme={null}108 ```json theme={null}

101 { "decision": "block", "reason": "Destructive command blocked by hook" }109 {

110 "hookSpecificOutput": {

111 "hookEventName": "PreToolUse",

112 "permissionDecision": "deny",

113 "permissionDecisionReason": "Destructive command blocked by hook"

114 }

115 }

102 ```116 ```

103 117 

104 If the command had been safe (like `npm test`), the script would hit `exit 0` instead, which tells Claude Code to allow the tool call with no further action.118 If the command had been safe (like `npm test`), the script would hit `exit 0` instead, which tells Claude Code to allow the tool call with no further action.


153| `SubagentStart` | agent type | `Bash`, `Explore`, `Plan`, or custom agent names |167| `SubagentStart` | agent type | `Bash`, `Explore`, `Plan`, or custom agent names |

154| `PreCompact` | what triggered compaction | `manual`, `auto` |168| `PreCompact` | what triggered compaction | `manual`, `auto` |

155| `SubagentStop` | agent type | same values as `SubagentStart` |169| `SubagentStop` | agent type | same values as `SubagentStart` |

156| `UserPromptSubmit`, `Stop` | no matcher support | always fires on every occurrence |170| `UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCompleted` | no matcher support | always fires on every occurrence |

157 171 

158The matcher is a regex, so `Edit|Write` matches either tool and `Notebook.*` matches any tool starting with Notebook. The matcher runs against a field from the [JSON input](#hook-input-and-output) that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each [hook event](#hook-events) section lists the full set of matcher values and the input schema for that event.172The matcher is a regex, so `Edit|Write` matches either tool and `Notebook.*` matches any tool starting with Notebook. The matcher runs against a field from the [JSON input](#hook-input-and-output) that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each [hook event](#hook-events) section lists the full set of matcher values and the input schema for that event.

159 173 


374All hook events receive these fields via stdin as JSON, in addition to event-specific fields documented in each [hook event](#hook-events) section:388All hook events receive these fields via stdin as JSON, in addition to event-specific fields documented in each [hook event](#hook-events) section:

375 389 

376| Field | Description |390| Field | Description |

377| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------- |391| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |

378| `session_id` | Current session identifier |392| `session_id` | Current session identifier |

379| `transcript_path` | Path to conversation JSON |393| `transcript_path` | Path to conversation JSON |

380| `cwd` | Current working directory when the hook is invoked |394| `cwd` | Current working directory when the hook is invoked |

381| `permission_mode` | Current [permission mode](/en/iam#permission-modes): `"default"`, `"plan"`, `"acceptEdits"`, `"dontAsk"`, or `"bypassPermissions"` |395| `permission_mode` | Current [permission mode](/en/permissions#permission-modes): `"default"`, `"plan"`, `"acceptEdits"`, `"dontAsk"`, or `"bypassPermissions"` |

382| `hook_event_name` | Name of the event that fired |396| `hook_event_name` | Name of the event that fired |

383 397 

384For example, a `PreToolUse` hook for a Bash command receives this on stdin:398For example, a `PreToolUse` hook for a Bash command receives this on stdin:


403 417 

404The exit code from your hook command tells Claude Code whether the action should proceed, be blocked, or be ignored.418The exit code from your hook command tells Claude Code whether the action should proceed, be blocked, or be ignored.

405 419 

406**Exit 0** means success. Claude Code parses stdout for [JSON output fields](#json-output) like `decision` or `reason`. JSON output is only processed on exit 0. For most events, stdout is only shown in verbose mode (`Ctrl+O`). The exceptions are `UserPromptSubmit` and `SessionStart`, where stdout is added as context that Claude can see and act on.420**Exit 0** means success. Claude Code parses stdout for [JSON output fields](#json-output). JSON output is only processed on exit 0. For most events, stdout is only shown in verbose mode (`Ctrl+O`). The exceptions are `UserPromptSubmit` and `SessionStart`, where stdout is added as context that Claude can see and act on.

407 421 

408**Exit 2** means a blocking error. Claude Code ignores stdout and any JSON in it. Instead, stderr text is fed back to Claude as an error message. The effect depends on the event: `PreToolUse` blocks the tool call, `UserPromptSubmit` rejects the prompt, and so on. See [exit code 2 behavior](#exit-code-2-behavior-per-event) for the full list.422**Exit 2** means a blocking error. Claude Code ignores stdout and any JSON in it. Instead, stderr text is fed back to Claude as an error message. The effect depends on the event: `PreToolUse` blocks the tool call, `UserPromptSubmit` rejects the prompt, and so on. See [exit code 2 behavior](#exit-code-2-behavior-per-event) for the full list.

409 423 


429Exit code 2 is the way a hook signals "stop, don't do this." The effect depends on the event, because some events represent actions that can be blocked (like a tool call that hasn't happened yet) and others represent things that already happened or can't be prevented.443Exit code 2 is the way a hook signals "stop, don't do this." The effect depends on the event, because some events represent actions that can be blocked (like a tool call that hasn't happened yet) and others represent things that already happened or can't be prevented.

430 444 

431| Hook event | Can block? | What happens on exit 2 |445| Hook event | Can block? | What happens on exit 2 |

432| :------------------- | :--------- | :-------------------------------------------------------- |446| :------------------- | :--------- | :----------------------------------------------------------------- |

433| `PreToolUse` | Yes | Blocks the tool call |447| `PreToolUse` | Yes | Blocks the tool call |

434| `PermissionRequest` | Yes | Denies the permission |448| `PermissionRequest` | Yes | Denies the permission |

435| `UserPromptSubmit` | Yes | Blocks prompt processing and erases the prompt |449| `UserPromptSubmit` | Yes | Blocks prompt processing and erases the prompt |

436| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |450| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |

437| `SubagentStop` | Yes | Prevents the subagent from stopping |451| `SubagentStop` | Yes | Prevents the subagent from stopping |

452| `TeammateIdle` | Yes | Prevents the teammate from going idle (teammate continues working) |

453| `TaskCompleted` | Yes | Prevents the task from being marked as completed |

438| `PostToolUse` | No | Shows stderr to Claude (tool already ran) |454| `PostToolUse` | No | Shows stderr to Claude (tool already ran) |

439| `PostToolUseFailure` | No | Shows stderr to Claude (tool already failed) |455| `PostToolUseFailure` | No | Shows stderr to Claude (tool already failed) |

440| `Notification` | No | Shows stderr to user only |456| `Notification` | No | Shows stderr to user only |


445 461 

446### JSON output462### JSON output

447 463 

448You must choose one approach per hook, not both: either use exit codes alone for signaling, or exit 0 and print JSON for structured control. Claude Code only processes JSON on exit 0. If you exit 2, any JSON is ignored.464Exit codes let you allow or block, but JSON output gives you finer-grained control. Instead of exiting with code 2 to block, exit 0 and print a JSON object to stdout. Claude Code reads specific fields from that JSON to control behavior, including [decision control](#decision-control) for blocking, allowing, or escalating to the user.

449 465 

450Instead of relying on exit codes alone, hooks can print JSON to stdout on exit 0. Claude Code reads specific fields from this JSON to decide what to do next.466<Note>

467 You must choose one approach per hook, not both: either use exit codes alone for signaling, or exit 0 and print JSON for structured control. Claude Code only processes JSON on exit 0. If you exit 2, any JSON is ignored.

468</Note>

451 469 

452Your hook's stdout must contain only the JSON object. If your shell profile prints text on startup, it can interfere with JSON parsing. See [JSON validation failed](/en/hooks-guide#json-validation-failed) in the troubleshooting guide.470Your hook's stdout must contain only the JSON object. If your shell profile prints text on startup, it can interfere with JSON parsing. See [JSON validation failed](/en/hooks-guide#json-validation-failed) in the troubleshooting guide.

453 471 

454The JSON object has two parts:472The JSON object supports three kinds of fields:

455 473 

456* **Top-level fields** like `continue` and `decision` work across all events. These are listed in the table below.474* **Universal fields** like `continue` work across all events. These are listed in the table below.

457* **`hookSpecificOutput`** is a nested object for event-specific fields like `permissionDecision` or `additionalContext`. It requires a `hookEventName` field set to the event name, like `"PreToolUse"` or `"Stop"`. Each event's decision control section under [Hook events](#hook-events) documents what fields go here.475* **Top-level `decision` and `reason`** are used by some events to block or provide feedback.

476* **`hookSpecificOutput`** is a nested object for events that need richer control. It requires a `hookEventName` field set to the event name.

458 477 

459| Field | Default | Description |478| Field | Default | Description |

460| :--------------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------- |479| :--------------- | :------ | :------------------------------------------------------------------------------------------------------------------------- |

461| `continue` | `true` | If `false`, Claude stops processing entirely after the hook runs. Takes precedence over event-specific fields like `decision` or `permissionDecision` |480| `continue` | `true` | If `false`, Claude stops processing entirely after the hook runs. Takes precedence over any event-specific decision fields |

462| `stopReason` | none | Message shown to the user when `continue` is `false`. Not shown to Claude |481| `stopReason` | none | Message shown to the user when `continue` is `false`. Not shown to Claude |

463| `suppressOutput` | `false` | If `true`, hides stdout from verbose mode output |482| `suppressOutput` | `false` | If `true`, hides stdout from verbose mode output |

464| `systemMessage` | none | Warning message shown to the user |483| `systemMessage` | none | Warning message shown to the user |

465 484 

466This example uses a top-level field to stop Claude:485To stop Claude entirely regardless of event type:

467 486 

468```json theme={null}487```json theme={null}

469{ "continue": false, "stopReason": "Build failed, fix errors before continuing" }488{ "continue": false, "stopReason": "Build failed, fix errors before continuing" }

470```489```

471 490 

472This example uses `hookSpecificOutput` to deny a PreToolUse tool call:491#### Decision control

473 492 

474```json theme={null}493Not every event supports blocking or controlling behavior through JSON. The events that do each use a different set of fields to express that decision. Use this table as a quick reference before writing a hook:

475{494 

495| Events | Decision pattern | Key fields |

496| :-------------------------------------------------------------------- | :------------------- | :---------------------------------------------------------------- |

497| UserPromptSubmit, PostToolUse, PostToolUseFailure, Stop, SubagentStop | Top-level `decision` | `decision: "block"`, `reason` |

498| TeammateIdle, TaskCompleted | Exit code only | Exit code 2 blocks the action, stderr is fed back as feedback |

499| PreToolUse | `hookSpecificOutput` | `permissionDecision` (allow/deny/ask), `permissionDecisionReason` |

500| PermissionRequest | `hookSpecificOutput` | `decision.behavior` (allow/deny) |

501 

502Here are examples of each pattern in action:

503 

504<Tabs>

505 <Tab title="Top-level decision">

506 Used by `UserPromptSubmit`, `PostToolUse`, `PostToolUseFailure`, `Stop`, and `SubagentStop`. The only value is `"block"`. To allow the action to proceed, omit `decision` from your JSON, or exit 0 without any JSON at all:

507 

508 ```json theme={null}

509 {

510 "decision": "block",

511 "reason": "Test suite must pass before proceeding"

512 }

513 ```

514 </Tab>

515 

516 <Tab title="PreToolUse">

517 Uses `hookSpecificOutput` for richer control: allow, deny, or escalate to the user. You can also modify tool input before it runs or inject additional context for Claude. See [PreToolUse decision control](#pretooluse-decision-control) for the full set of options.

518 

519 ```json theme={null}

520 {

476 "hookSpecificOutput": {521 "hookSpecificOutput": {

477 "hookEventName": "PreToolUse",522 "hookEventName": "PreToolUse",

478 "permissionDecision": "deny",523 "permissionDecision": "deny",

479 "permissionDecisionReason": "Database writes are not allowed"524 "permissionDecisionReason": "Database writes are not allowed"

480 }525 }

481}526 }

482```527 ```

528 </Tab>

529 

530 <Tab title="PermissionRequest">

531 Uses `hookSpecificOutput` to allow or deny a permission request on behalf of the user. When allowing, you can also modify the tool's input or apply permission rules so the user isn't prompted again. See [PermissionRequest decision control](#permissionrequest-decision-control) for the full set of options.

532 

533 ```json theme={null}

534 {

535 "hookSpecificOutput": {

536 "hookEventName": "PermissionRequest",

537 "decision": {

538 "behavior": "allow",

539 "updatedInput": {

540 "command": "npm run lint"

541 }

542 }

543 }

544 }

545 ```

546 </Tab>

547</Tabs>

483 548 

484For extended examples including Bash command validation, prompt filtering, and auto-approval scripts, see [What you can automate](/en/hooks-guide#what-you-can-automate) in the guide and the [Bash command validator reference implementation](https://github.com/anthropics/claude-code/blob/main/examples/hooks/bash_command_validator_example.py).549For extended examples including Bash command validation, prompt filtering, and auto-approval scripts, see [What you can automate](/en/hooks-guide#what-you-can-automate) in the guide and the [Bash command validator reference implementation](https://github.com/anthropics/claude-code/blob/main/examples/hooks/bash_command_validator_example.py).

485 550 


739 804 

740#### PreToolUse decision control805#### PreToolUse decision control

741 806 

742`PreToolUse` hooks can control whether a tool call proceeds. In addition to the [JSON output fields](#json-output) available to all hooks, your hook script can return a `hookSpecificOutput` object with these event-specific fields:807`PreToolUse` hooks can control whether a tool call proceeds. Unlike other hooks that use a top-level `decision` field, PreToolUse returns its decision inside a `hookSpecificOutput` object. This gives it richer control: three outcomes (allow, deny, or ask) plus the ability to modify tool input before execution.

743 808 

744| Field | Description |809| Field | Description |

745| :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |810| :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |


763```828```

764 829 

765<Note>830<Note>

766 The `decision` and `reason` fields are deprecated for PreToolUse hooks.831 PreToolUse previously used top-level `decision` and `reason` fields, but these are deprecated for this event. Use `hookSpecificOutput.permissionDecision` and `hookSpecificOutput.permissionDecisionReason` instead. The deprecated values `"approve"` and `"block"` map to `"allow"` and `"deny"` respectively. Other events like PostToolUse and Stop continue to use top-level `decision` and `reason` as their current format.

767 Use `hookSpecificOutput.permissionDecision` and

768 `hookSpecificOutput.permissionDecisionReason` instead. The deprecated fields

769 `"approve"` and `"block"` map to `"allow"` and `"deny"` respectively.

770</Note>832</Note>

771 833 

772### PermissionRequest834### PermissionRequest


1077}1139}

1078```1140```

1079 1141 

1142### TeammateIdle

1143 

1144Runs when an [agent team](/en/agent-teams) teammate is about to go idle after finishing its turn. Use this to enforce quality gates before a teammate stops working, such as requiring passing lint checks or verifying that output files exist.

1145 

1146When a `TeammateIdle` hook exits with code 2, the teammate receives the stderr message as feedback and continues working instead of going idle. TeammateIdle hooks do not support matchers and fire on every occurrence.

1147 

1148#### TeammateIdle input

1149 

1150In addition to the [common input fields](#common-input-fields), TeammateIdle hooks receive `teammate_name` and `team_name`.

1151 

1152```json theme={null}

1153{

1154 "session_id": "abc123",

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

1156 "cwd": "/Users/...",

1157 "permission_mode": "default",

1158 "hook_event_name": "TeammateIdle",

1159 "teammate_name": "researcher",

1160 "team_name": "my-project"

1161}

1162```

1163 

1164| Field | Description |

1165| :-------------- | :-------------------------------------------- |

1166| `teammate_name` | Name of the teammate that is about to go idle |

1167| `team_name` | Name of the team |

1168 

1169#### TeammateIdle decision control

1170 

1171TeammateIdle hooks use exit codes only, not JSON decision control. This example checks that a build artifact exists before allowing a teammate to go idle:

1172 

1173```bash theme={null}

1174#!/bin/bash

1175 

1176if [ ! -f "./dist/output.js" ]; then

1177 echo "Build artifact missing. Run the build before stopping." >&2

1178 exit 2

1179fi

1180 

1181exit 0

1182```

1183 

1184### TaskCompleted

1185 

1186Runs when a task is being marked as completed. This fires in two situations: when any agent explicitly marks a task as completed through the TaskUpdate tool, or when an [agent team](/en/agent-teams) teammate finishes its turn with in-progress tasks. Use this to enforce completion criteria like passing tests or lint checks before a task can close.

1187 

1188When a `TaskCompleted` hook exits with code 2, the task is not marked as completed and the stderr message is fed back to the model as feedback. TaskCompleted hooks do not support matchers and fire on every occurrence.

1189 

1190#### TaskCompleted input

1191 

1192In addition to the [common input fields](#common-input-fields), TaskCompleted hooks receive `task_id`, `task_subject`, and optionally `task_description`, `teammate_name`, and `team_name`.

1193 

1194```json theme={null}

1195{

1196 "session_id": "abc123",

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

1198 "cwd": "/Users/...",

1199 "permission_mode": "default",

1200 "hook_event_name": "TaskCompleted",

1201 "task_id": "task-001",

1202 "task_subject": "Implement user authentication",

1203 "task_description": "Add login and signup endpoints",

1204 "teammate_name": "implementer",

1205 "team_name": "my-project"

1206}

1207```

1208 

1209| Field | Description |

1210| :----------------- | :------------------------------------------------------ |

1211| `task_id` | Identifier of the task being completed |

1212| `task_subject` | Title of the task |

1213| `task_description` | Detailed description of the task. May be absent |

1214| `teammate_name` | Name of the teammate completing the task. May be absent |

1215| `team_name` | Name of the team. May be absent |

1216 

1217#### TaskCompleted decision control

1218 

1219TaskCompleted hooks use exit codes only, not JSON decision control. This example runs tests and blocks task completion if they fail:

1220 

1221```bash theme={null}

1222#!/bin/bash

1223INPUT=$(cat)

1224TASK_SUBJECT=$(echo "$INPUT" | jq -r '.task_subject')

1225 

1226# Run the test suite

1227if ! npm test 2>&1; then

1228 echo "Tests not passing. Fix failing tests before completing: $TASK_SUBJECT" >&2

1229 exit 2

1230fi

1231 

1232exit 0

1233```

1234 

1080### PreCompact1235### PreCompact

1081 1236 

1082Runs before Claude Code is about to run a compact operation.1237Runs before Claude Code is about to run a compact operation.


1138 1293 

1139## Prompt-based hooks1294## Prompt-based hooks

1140 1295 

1141In 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 work with the following events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `UserPromptSubmit`, `Stop`, and `SubagentStop`.1296In 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 work with the following events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `UserPromptSubmit`, `Stop`, `SubagentStop`, and `TaskCompleted`. `TeammateIdle` does not support prompt-based or agent-based hooks.

1142 1297 

1143### How prompt-based hooks work1298### How prompt-based hooks work

1144 1299 

hooks-guide.md +11 −7

Details

267Hook events fire at specific lifecycle points in Claude Code. When an event fires, all matching hooks run in parallel, and identical hook commands are automatically deduplicated. The table below shows each event and when it triggers:267Hook events fire at specific lifecycle points in Claude Code. When an event fires, all matching hooks run in parallel, and identical hook commands are automatically deduplicated. The table below shows each event and when it triggers:

268 268 

269| Event | When it fires |269| Event | When it fires |

270| :------------------- | :--------------------------------------------------- |270| :------------------- | :----------------------------------------------------------------- |

271| `SessionStart` | When a session begins or resumes |271| `SessionStart` | When a session begins or resumes |

272| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |272| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |

273| `PreToolUse` | Before a tool call executes. Can block it |273| `PreToolUse` | Before a tool call executes. Can block it |


278| `SubagentStart` | When a subagent is spawned |278| `SubagentStart` | When a subagent is spawned |

279| `SubagentStop` | When a subagent finishes |279| `SubagentStop` | When a subagent finishes |

280| `Stop` | When Claude finishes responding |280| `Stop` | When Claude finishes responding |

281| `TeammateIdle` | When an [agent team](/en/agent-teams) teammate is about to go idle |

282| `TaskCompleted` | When a task is being marked as completed |

281| `PreCompact` | Before context compaction |283| `PreCompact` | Before context compaction |

282| `SessionEnd` | When a session terminates |284| `SessionEnd` | When a session terminates |

283 285 


348}350}

349```351```

350 352 

351Claude Code reads `permissionDecision` and cancels the tool call, then feeds `permissionDecisionReason` back to Claude as feedback. The three options are:353Claude Code reads `permissionDecision` and cancels the tool call, then feeds `permissionDecisionReason` back to Claude as feedback. These three options are specific to `PreToolUse`:

352 354 

353* `"allow"`: proceed without showing a permission prompt355* `"allow"`: proceed without showing a permission prompt

354* `"deny"`: cancel the tool call and send the reason to Claude356* `"deny"`: cancel the tool call and send the reason to Claude

355* `"ask"`: show the permission prompt to the user as normal357* `"ask"`: show the permission prompt to the user as normal

356 358 

357For `UserPromptSubmit` hooks, use `additionalContext` instead to inject text into Claude's context. See [Control behavior with JSON output](/en/hooks#json-output) in the reference for the full JSON schema. Prompt-based hooks (`type: "prompt"`) handle output differently: see [Prompt-based hooks](#prompt-based-hooks).359Other events use different decision patterns. For example, `PostToolUse` and `Stop` hooks use a top-level `decision: "block"` field, while `PermissionRequest` uses `hookSpecificOutput.decision.behavior`. See the [summary table](/en/hooks#decision-control) in the reference for a full breakdown by event.

360 

361For `UserPromptSubmit` hooks, use `additionalContext` instead to inject text into Claude's context. Prompt-based hooks (`type: "prompt"`) handle output differently: see [Prompt-based hooks](#prompt-based-hooks).

358 362 

359### Filter hooks with matchers363### Filter hooks with matchers

360 364 


380Each event type matches on a specific field. Matchers support exact strings and regex patterns:384Each event type matches on a specific field. Matchers support exact strings and regex patterns:

381 385 

382| Event | What the matcher filters | Example matcher values |386| Event | What the matcher filters | Example matcher values |

383| :--------------------------------------------------------------------- | :------------------------ | :----------------------------------------------------------------------- |387| :--------------------------------------------------------------------- | :------------------------ | :----------------------------------------------------------------------------- |

384| `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest` | tool name | `Bash`, `Edit\|Write`, `mcp__.*` |388| `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest` | tool name | `Bash`, `Edit\|Write`, `mcp__.*` |

385| `SessionStart` | how the session started | `startup`, `resume`, `clear`, `compact` |389| `SessionStart` | how the session started | `startup`, `resume`, `clear`, `compact` |

386| `SessionEnd` | why the session ended | `clear`, `logout`, `prompt_input_exit`, `other` |390| `SessionEnd` | why the session ended | `clear`, `logout`, `prompt_input_exit`, `bypass_permissions_disabled`, `other` |

387| `Notification` | notification type | `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog` |391| `Notification` | notification type | `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog` |

388| `SubagentStart` | agent type | `Bash`, `Explore`, `Plan`, or custom agent names |392| `SubagentStart` | agent type | `Bash`, `Explore`, `Plan`, or custom agent names |

389| `PreCompact` | what triggered compaction | `manual`, `auto` |393| `PreCompact` | what triggered compaction | `manual`, `auto` |

390| `UserPromptSubmit`, `Stop` | no matcher support | always fires on every occurrence |394| `UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCompleted` | no matcher support | always fires on every occurrence |

391| `SubagentStop` | agent type | same values as `SubagentStart` |395| `SubagentStop` | agent type | same values as `SubagentStart` |

392 396 

393A few more examples showing matchers on different event types:397A few more examples showing matchers on different event types:


604 608 

605```609```

606Shell ready on arm64610Shell ready on arm64

607{"decision": "allow"}611{"decision": "block", "reason": "Not allowed"}

608```612```

609 613 

610Claude Code tries to parse this as JSON and fails. To fix this, wrap echo statements in your shell profile so they only run in interactive shells:614Claude Code tries to parse this as JSON and fails. To fix this, wrap echo statements in your shell profile so they only run in interactive shells:

Details

77 77 

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

79 79 

80**Sessions are ephemeral.** Unlike claude.ai, Claude Code has no persistent memory between sessions. Each new session starts fresh. Claude doesn't "learn" your preferences over time or remember what you worked on last week. If you want Claude to know something across sessions, put it in your [CLAUDE.md](/en/memory).80**Sessions are independent.** Each new session starts with a fresh context window, without the conversation history from previous sessions. Claude can persist learnings across sessions using [auto memory](/en/memory#auto-memory), and you can add your own persistent instructions in [CLAUDE.md](/en/memory).

81 81 

82### Work across branches82### Work across branches

83 83 


142* **Default**: Claude asks before file edits and shell commands142* **Default**: Claude asks before file edits and shell commands

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

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

145* **Delegate mode**: Claude coordinates work through [agent teammates](/en/agent-teams) only, with no direct implementation. Only available when an agent team is active.

145 146 

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

147 148 

148***149***

149 150 

iam.md +0 −239 deleted

File DeletedView Diff

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Identity and Access Management

6 

7> Learn how to configure user authentication, authorization, and access controls for Claude Code in your organization.

8 

9## Authentication methods

10 

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

12 

13* [Claude for Teams or Enterprise](/en/setup#for-teams-and-organizations) (recommended)

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

15* [Amazon Bedrock](/en/amazon-bedrock)

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

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

18 

19### Claude for Teams or Enterprise (recommended)

20 

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

22 

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

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

25 

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

27 

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

292. Invite team members from the admin dashboard

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

31 

32### Claude Console authentication

33 

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

35 

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

37 

381. Use your existing Claude Console account or create a new Claude Console account

392. You can add users through either method below:

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

41 * [Set up SSO](https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso)

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

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

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

454. Each invited user needs to complete these steps:

46 * Accept the Console invite

47 * [Check system requirements](/en/setup#system-requirements)

48 * [Install Claude Code](/en/setup#installation)

49 * Login with Console account credentials

50 

51### Cloud provider authentication

52 

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

54 

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

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

573. Users can [install Claude Code](/en/setup#installation)

58 

59## Access control and permissions

60 

61We support fine-grained permissions so that you're able to specify exactly what the agent is allowed to do (e.g. run tests, run linter) and what it is not allowed to do (e.g. update cloud infrastructure). These permission settings can be checked into version control and distributed to all developers in your organization, as well as customized by individual developers.

62 

63### Permission system

64 

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

66 

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

68| :---------------- | :--------------- | :---------------- | :-------------------------------------------- |

69| Read-only | File reads, Grep | No | N/A |

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

71| File Modification | Edit/write files | Yes | Until session end |

72 

73### Configuring permissions

74 

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

76 

77* **Allow** rules let Claude Code use the specified tool without manual approval.

78* **Ask** rules prompt for confirmation whenever Claude Code tries to use the specified tool.

79* **Deny** rules prevent Claude Code from using the specified tool.

80 

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

82 

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

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

85 

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

87 

88A rule that is just the tool name matches any use of that tool. For example, adding `Bash` to the allow list allows Claude Code to use the Bash tool without requiring user approval. `Bash(*)` is equivalent to `Bash` and can be used interchangeably.

89 

90<Note>

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

92</Note>

93 

94#### Permission modes

95 

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

97 

98| Mode | Description |

99| :------------------ | :------------------------------------------------------------------------------------------------------------------------ |

100| `default` | Standard behavior - prompts for permission on first use of each tool |

101| `acceptEdits` | Automatically accepts file edit permissions for the session |

102| `plan` | Plan Mode - Claude can analyze but not modify files or execute commands |

103| `dontAsk` | Auto-denies tools unless pre-approved via `/permissions` or [`permissions.allow`](/en/settings#permission-settings) rules |

104| `bypassPermissions` | Skips all permission prompts (requires safe environment - see warning below) |

105 

106#### Working directories

107 

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

109 

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

111* **During session**: Use `/add-dir` command

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

113 

114Files 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.

115 

116#### Tool-specific permission rules

117 

118Some tools support more fine-grained permission controls:

119 

120**Bash**

121 

122Bash permission rules support wildcard matching with `*`. Wildcards can appear at any position in the command, including at the beginning, middle, or end:

123 

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

125* `Bash(npm run test *)` Matches Bash commands starting with `npm run test`

126* `Bash(npm *)` Matches any command starting with `npm ` (e.g., `npm install`, `npm run build`)

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

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

129* `Bash(* --help *)` Matches any command with `--help` followed by additional arguments

130 

131When `*` appears at the end with a space before it (like `Bash(ls *)`), it enforces a word boundary, requiring the prefix to be followed by a space or end-of-string. For example, `Bash(ls *)` matches `ls -la` but not `lsof`. In contrast, `Bash(ls*)` without a space matches both `ls -la` and `lsof` because there's no word boundary constraint. The legacy `:*` suffix syntax is equivalent to ` *` but is deprecated.

132 

133<Tip>

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

135</Tip>

136 

137<Warning>

138 Important limitations of Bash permission patterns:

139 

140 1. The space before `*` matters: `Bash(ls *)` matches `ls -la` but not `lsof`, while `Bash(ls*)` matches both

141 2. The `*` wildcard can appear at any position and matches any sequence of characters

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

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

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

145 * Redirects: `curl -L http://bit.ly/xyz` (redirects to github)

146 * Variables: `URL=http://github.com && curl $URL` won't match

147 * Extra spaces: `curl http://github.com` won't match

148 

149 For more reliable URL filtering, consider:

150 

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

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

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

154 

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

156</Warning>

157 

158**Read & Edit**

159 

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

161 

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

163 

164| Pattern | Meaning | Example | Matches |

165| ------------------ | -------------------------------------- | -------------------------------- | ---------------------------------- |

166| `//path` | **Absolute** path from filesystem root | `Read(//Users/alice/secrets/**)` | `/Users/alice/secrets/**` |

167| `~/path` | Path from **home** directory | `Read(~/Documents/*.pdf)` | `/Users/alice/Documents/*.pdf` |

168| `/path` | Path **relative to settings file** | `Edit(/src/**/*.ts)` | `<settings file path>/src/**/*.ts` |

169| `path` or `./path` | Path **relative to current directory** | `Read(*.env)` | `<cwd>/*.env` |

170 

171<Warning>

172 A pattern like `/Users/alice/file` is NOT an absolute path - it's relative to your settings file! Use `//Users/alice/file` for absolute paths.

173</Warning>

174 

175* `Edit(/docs/**)` - Edits in `<project>/docs/` (NOT `/docs/`!)

176* `Read(~/.zshrc)` - Reads your home directory's `.zshrc`

177* `Edit(//tmp/scratch.txt)` - Edits the absolute path `/tmp/scratch.txt`

178* `Read(src/**)` - Reads from `<current-directory>/src/`

179 

180<Note>

181 In gitignore patterns, `*` matches files in a single directory while `**` matches recursively across directories. To allow all file access, use just the tool name without parentheses: `Read`, `Edit`, or `Write`.

182</Note>

183 

184**WebFetch**

185 

186* `WebFetch(domain:example.com)` Matches fetch requests to example.com

187 

188**MCP**

189 

190* `mcp__puppeteer` Matches any tool provided by the `puppeteer` server (name configured in Claude Code)

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

192* `mcp__puppeteer__puppeteer_navigate` Matches the `puppeteer_navigate` tool provided by the `puppeteer` server

193 

194**Task (Subagents)**

195 

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

197 

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

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

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

201 

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

203 

204```json theme={null}

205{

206 "permissions": {

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

208 }

209}

210```

211 

212### Additional permission control with hooks

213 

214[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.

215 

216### Managed settings

217 

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

219 

220### Settings precedence

221 

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

223 

2241. Managed settings (`managed-settings.json`)

2252. Command line arguments

2263. Local project settings (`.claude/settings.local.json`)

2274. Shared project settings (`.claude/settings.json`)

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

229 

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

231 

232## Credential management

233 

234Claude Code securely manages your authentication credentials:

235 

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

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

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

239* **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.

Details

23### General controls23### General controls

24 24 

25| Shortcut | Description | Context |25| Shortcut | Description | Context |

26| :------------------------------------------------ | :--------------------------------- | :-------------------------------------------------------------------------------------------- |26| :------------------------------------------------ | :--------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |

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

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

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


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

33| `Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows) | Paste image from clipboard | Pastes an image or path to an image file |33| `Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows) | Paste image from clipboard | Pastes an image or path to an image file |

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

35| `Ctrl+T` | Toggle task list | Show or hide the [task list](#task-list) in the terminal status area |

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

36| `Up/Down arrows` | Navigate command history | Recall previous inputs |37| `Up/Down arrows` | Navigate command history | Recall previous inputs |

37| `Esc` + `Esc` | Rewind the code/conversation | Restore the code and/or conversation to a previous point |38| `Esc` + `Esc` | Rewind or summarize | Restore code and/or conversation to a previous point, or summarize from a selected message |

38| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode |39| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode. When an [agent team](/en/agent-teams) is active, the cycle also includes Delegate Mode. |

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

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

41 42 


89To create your own commands you can invoke with `/`, see [skills](/en/skills).90To create your own commands you can invoke with `/`, see [skills](/en/skills).

90 91 

91| Command | Purpose |92| Command | Purpose |

92| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |93| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

93| `/clear` | Clear conversation history |94| `/clear` | Clear conversation history |

94| `/compact [instructions]` | Compact conversation with optional focus instructions |95| `/compact [instructions]` | Compact conversation with optional focus instructions |

95| `/config` | Open the Settings interface (Config tab) |96| `/config` | Open the Settings interface (Config tab) |

96| `/context` | Visualize current context usage as a colored grid |97| `/context` | Visualize current context usage as a colored grid |

97| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |98| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |

99| `/debug [description]` | Troubleshoot the current session by reading the session debug log. Optionally describe the issue |

98| `/doctor` | Checks the health of your Claude Code installation |100| `/doctor` | Checks the health of your Claude Code installation |

99| `/exit` | Exit the REPL |101| `/exit` | Exit the REPL |

100| `/export [filename]` | Export the current conversation to a file or clipboard |102| `/export [filename]` | Export the current conversation to a file or clipboard |


102| `/init` | Initialize project with `CLAUDE.md` guide |104| `/init` | Initialize project with `CLAUDE.md` guide |

103| `/mcp` | Manage MCP server connections and OAuth authentication |105| `/mcp` | Manage MCP server connections and OAuth authentication |

104| `/memory` | Edit `CLAUDE.md` memory files |106| `/memory` | Edit `CLAUDE.md` memory files |

105| `/model` | Select or change the AI model |107| `/model` | Select or change the AI model. With Opus 4.6, use left/right arrows to [adjust effort level](/en/model-config#adjust-effort-level). The change takes effect immediately without waiting for the current response to finish |

106| `/permissions` | View or update [permissions](/en/iam#configuring-permissions) |108| `/permissions` | View or update [permissions](/en/permissions#manage-permissions) |

107| `/plan` | Enter plan mode directly from the prompt |109| `/plan` | Enter plan mode directly from the prompt |

108| `/rename <name>` | Rename the current session for easier identification |110| `/rename <name>` | Rename the current session for easier identification |

109| `/resume [session]` | Resume a conversation by ID or name, or open the session picker |111| `/resume [session]` | Resume a conversation by ID or name, or open the session picker |

110| `/rewind` | Rewind the conversation and/or code |112| `/rewind` | Rewind the conversation and/or code, or summarize from a selected message |

111| `/stats` | Visualize daily usage, session history, streaks, and model preferences |113| `/stats` | Visualize daily usage, session history, streaks, and model preferences |

112| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |114| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |

113| `/statusline` | Set up Claude Code's status line UI |115| `/statusline` | Set up Claude Code's status line UI |


270 272 

271This is useful for quick shell operations while maintaining conversation context.273This is useful for quick shell operations while maintaining conversation context.

272 274 

275## Prompt suggestions

276 

277When you first open a session, a grayed-out example command appears in the prompt input to help you get started. Claude Code picks this from your project's git history, so it reflects files you've been working on recently.

278 

279After Claude responds, suggestions continue to appear based on your conversation history, such as a follow-up step from a multi-part request or a natural continuation of your workflow.

280 

281* Press **Tab** to accept the suggestion, or press **Enter** to accept and submit

282* Start typing to dismiss it

283 

284The suggestion runs as a background request that reuses the parent conversation's prompt cache, so the additional cost is minimal. Claude Code skips suggestion generation when the cache is cold to avoid unnecessary cost.

285 

286Suggestions are automatically skipped after the first turn of a conversation, in non-interactive mode, and in plan mode.

287 

288To disable prompt suggestions entirely, set the environment variable or toggle the setting in `/config`:

289 

290```bash theme={null}

291export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false

292```

293 

273## Task list294## Task list

274 295 

275When working on complex, multi-step work, Claude creates a task list to track progress. Tasks appear in the status area of your terminal with indicators showing what's pending, in progress, or complete.296When working on complex, multi-step work, Claude creates a task list to track progress. Tasks appear in the status area of your terminal with indicators showing what's pending, in progress, or complete.

keybindings.md +2 −2

Details

24 24 

25```json theme={null}25```json theme={null}

26{26{

27 "$schema": "https://platform.claude.com/docs/schemas/claude-code/keybindings.json",27 "$schema": "https://www.schemastore.org/claude-code-keybindings.json",

28 "$docs": "https://code.claude.com/docs/en/keybindings",28 "$docs": "https://code.claude.com/docs/en/keybindings",

29 "bindings": [29 "bindings": [

30 {30 {


57| `ThemePicker` | Theme picker dialog |57| `ThemePicker` | Theme picker dialog |

58| `Attachments` | Image/attachment bar navigation |58| `Attachments` | Image/attachment bar navigation |

59| `Footer` | Footer indicator navigation (tasks, teams, diff) |59| `Footer` | Footer indicator navigation (tasks, teams, diff) |

60| `MessageSelector` | Rewind dialog message selection |60| `MessageSelector` | Rewind and summarize dialog message selection |

61| `DiffDialog` | Diff viewer navigation |61| `DiffDialog` | Diff viewer navigation |

62| `ModelPicker` | Model picker effort level |62| `ModelPicker` | Model picker effort level |

63| `Select` | Generic select/list components |63| `Select` | Generic select/list components |

mcp.md +64 −0

Details

413 * OAuth authentication works with HTTP servers413 * OAuth authentication works with HTTP servers

414</Tip>414</Tip>

415 415 

416### Use pre-configured OAuth credentials

417 

418Some MCP servers don't support automatic OAuth setup. If you see an error like "Incompatible auth server: does not support dynamic client registration," the server requires pre-configured credentials. Register an OAuth app through the server's developer portal first, then provide the credentials when adding the server.

419 

420<Steps>

421 <Step title="Register an OAuth app with the server">

422 Create an app through the server's developer portal and note your client ID and client secret.

423 

424 Many servers also require a redirect URI. If so, choose a port and register a redirect URI in the format `http://localhost:PORT/callback`. Use that same port with `--callback-port` in the next step.

425 </Step>

426 

427 <Step title="Add the server with your credentials">

428 Choose one of the following methods. The port used for `--callback-port` can be any available port. It just needs to match the redirect URI you registered in the previous step.

429 

430 <Tabs>

431 <Tab title="claude mcp add">

432 Use `--client-id` to pass your app's client ID. The `--client-secret` flag prompts for the secret with masked input:

433 

434 ```bash theme={null}

435 claude mcp add --transport http \

436 --client-id your-client-id --client-secret --callback-port 8080 \

437 my-server https://mcp.example.com/mcp

438 ```

439 </Tab>

440 

441 <Tab title="claude mcp add-json">

442 Include the `oauth` object in the JSON config and pass `--client-secret` as a separate flag:

443 

444 ```bash theme={null}

445 claude mcp add-json my-server \

446 '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' \

447 --client-secret

448 ```

449 </Tab>

450 

451 <Tab title="CI / env var">

452 Set the secret via environment variable to skip the interactive prompt:

453 

454 ```bash theme={null}

455 MCP_CLIENT_SECRET=your-secret claude mcp add --transport http \

456 --client-id your-client-id --client-secret --callback-port 8080 \

457 my-server https://mcp.example.com/mcp

458 ```

459 </Tab>

460 </Tabs>

461 </Step>

462 

463 <Step title="Authenticate in Claude Code">

464 Run `/mcp` in Claude Code and follow the browser login flow.

465 </Step>

466</Steps>

467 

468<Tip>

469 Tips:

470 

471 * The client secret is stored securely in your system keychain (macOS) or a credentials file, not in your config

472 * If the server uses a public OAuth client with no secret, use only `--client-id` without `--client-secret`

473 * These flags only apply to HTTP and SSE transports. They have no effect on stdio servers

474 * Use `claude mcp get <name>` to verify that OAuth credentials are configured for a server

475</Tip>

476 

416## Add MCP servers from JSON configuration477## Add MCP servers from JSON configuration

417 478 

418If you have a JSON configuration for an MCP server, you can add it directly:479If you have a JSON configuration for an MCP server, you can add it directly:


428 489 

429 # Example: Adding a stdio server with JSON configuration490 # Example: Adding a stdio server with JSON configuration

430 claude mcp add-json local-weather '{"type":"stdio","command":"/path/to/weather-cli","args":["--api-key","abc123"],"env":{"CACHE_DIR":"/tmp"}}'491 claude mcp add-json local-weather '{"type":"stdio","command":"/path/to/weather-cli","args":["--api-key","abc123"],"env":{"CACHE_DIR":"/tmp"}}'

492 

493 # Example: Adding an HTTP server with pre-configured OAuth credentials

494 claude mcp add-json my-server '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' --client-secret

431 ```495 ```

432 </Step>496 </Step>

433 497 

memory.md +68 −4

Details

6 6 

7> Learn how to manage Claude Code's memory across sessions with different memory locations and best practices.7> Learn how to manage Claude Code's memory across sessions with different memory locations and best practices.

8 8 

9Claude Code can remember your preferences across sessions, like style guidelines and common commands in your workflow.9Claude Code has two kinds of memory that persist across sessions:

10 

11* **Auto memory**: Claude automatically saves useful context like project patterns, key commands, and your preferences. This persists across sessions.

12* **CLAUDE.md files**: Markdown files you write and maintain with instructions, rules, and preferences for Claude to follow.

13 

14Both are loaded into Claude's context at the start of every session, though auto memory loads only the first 200 lines of its main file.

10 15 

11## Determine memory type16## Determine memory type

12 17 

13Claude Code offers four memory locations in a hierarchical structure, each serving a different purpose:18Claude Code offers several memory locations in a hierarchical structure, each serving a different purpose:

14 19 

15| Memory Type | Location | Purpose | Use Case Examples | Shared With |20| Memory Type | Location | Purpose | Use Case Examples | Shared With |

16| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------- |21| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------- |


19| **Project rules** | `./.claude/rules/*.md` | Modular, topic-specific project instructions | Language-specific guidelines, testing conventions, API standards | Team members via source control |24| **Project rules** | `./.claude/rules/*.md` | Modular, topic-specific project instructions | Language-specific guidelines, testing conventions, API standards | Team members via source control |

20| **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |25| **User memory** | `~/.claude/CLAUDE.md` | Personal preferences for all projects | Code styling preferences, personal tooling shortcuts | Just you (all projects) |

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

27| **Auto memory** | `~/.claude/projects/<project>/memory/` | Claude's automatic notes and learnings | Project patterns, debugging insights, architecture notes | Just you (per project) |

22 28 

23All 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.29CLAUDE.md files in the directory hierarchy above the working directory are loaded in full at launch. CLAUDE.md files in child directories load on demand when Claude reads files in those directories. Auto memory loads only the first 200 lines of `MEMORY.md`. More specific instructions take precedence over broader ones.

24 30 

25<Note>31<Note>

26 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.32 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.

27</Note>33</Note>

28 34 

35## Auto memory

36 

37Auto memory is a persistent directory where Claude records learnings, patterns, and insights as it works. Unlike CLAUDE.md files that contain instructions you write for Claude, auto memory contains notes Claude writes for itself based on what it discovers during sessions.

38 

39<Note>

40 Auto memory is being rolled out gradually. If you aren't seeing auto memory, you can opt in by setting `CLAUDE_CODE_DISABLE_AUTO_MEMORY=0` in your environment.

41</Note>

42 

43### What Claude remembers

44 

45As Claude works, it may save things like:

46 

47* Project patterns: build commands, test conventions, code style preferences

48* Debugging insights: solutions to tricky problems, common error causes

49* Architecture notes: key files, module relationships, important abstractions

50* Your preferences: communication style, workflow habits, tool choices

51 

52### Where auto memory is stored

53 

54Each project gets its own memory directory at `~/.claude/projects/<project>/memory/`. The `<project>` path is derived from the git repository root, so all subdirectories within the same repo share one auto memory directory. Git worktrees get separate memory directories. Outside a git repo, the working directory is used instead.

55 

56The directory contains a `MEMORY.md` entrypoint and optional topic files:

57 

58```text theme={null}

59~/.claude/projects/<project>/memory/

60├── MEMORY.md # Concise index, loaded into every session

61├── debugging.md # Detailed notes on debugging patterns

62├── api-conventions.md # API design decisions

63└── ... # Any other topic files Claude creates

64```

65 

66`MEMORY.md` acts as an index of the memory directory. Claude reads and writes files in this directory throughout your session, using `MEMORY.md` to keep track of what's stored where.

67 

68### How it works

69 

70* The first 200 lines of `MEMORY.md` are loaded into Claude's system prompt at the start of every session. Content beyond 200 lines is not loaded automatically, and Claude is instructed to keep it concise by moving detailed notes into separate topic files.

71* Topic files like `debugging.md` or `patterns.md` are not loaded at startup. Claude reads them on demand using its standard file tools when it needs the information.

72* Claude reads and writes memory files during your session, so you'll see memory updates happen as you work.

73 

74### Manage auto memory

75 

76Auto memory files are markdown files you can edit at any time. Use `/memory` to open the file selector, which includes your auto memory entrypoint alongside your CLAUDE.md files.

77 

78To ask Claude to save something specific, tell it directly: "remember that we use pnpm, not npm" or "save to memory that the API tests require a local Redis instance".

79 

80When neither variable is set, auto memory follows the gradual rollout. The variable name uses double-negative logic: `DISABLE=0` means "don't disable" and forces auto memory on.

81 

82```bash theme={null}

83export CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 # Force off

84export CLAUDE_CODE_DISABLE_AUTO_MEMORY=0 # Force on

85```

86 

29## CLAUDE.md imports87## CLAUDE.md imports

30 88 

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


37- git workflow @docs/git-instructions.md95- git workflow @docs/git-instructions.md

38```96```

39 97 

40Both 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.98Both relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. For private per-project preferences that shouldn't be checked into version control, prefer `CLAUDE.local.md`: it is automatically loaded and added to `.gitignore`.

99 

100If you work across multiple git worktrees, `CLAUDE.local.md` only exists in one. Use a home-directory import instead so all worktrees share the same personal instructions:

41 101 

42```102```

43# Individual Preferences103# Individual Preferences

44- @~/.claude/my-project-instructions.md104- @~/.claude/my-project-instructions.md

45```105```

46 106 

107<Warning>

108 The first time Claude Code encounters external imports in a project, it shows an approval dialog listing the specific files. Approve to load them; decline to skip them. This is a one-time decision per project: once declined, the dialog does not resurface and the imports remain disabled.

109</Warning>

110 

47To avoid potential collisions, imports are not evaluated inside markdown code spans and code blocks.111To avoid potential collisions, imports are not evaluated inside markdown code spans and code blocks.

48 112 

49```113```

Details

73# Set models to your resource's deployment names73# Set models to your resource's deployment names

74export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-5'74export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-5'

75export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'75export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'

76export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-1'76export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'

77```77```

78 78 

79For more details on model configuration options, see [Model configuration](/en/model-config).79For more details on model configuration options, see [Model configuration](/en/model-config).

model-config.md +40 −14

Details

12 12 

13* A **model alias**13* A **model alias**

14* A **model name**14* A **model name**

15 * Anthropic API: A full **[model name](https://docs.claude.com/en/docs/about-claude/models/overview#model-names)**15 * Anthropic API: A full **[model name](https://platform.claude.com/docs/en/about-claude/models/overview)**

16 * Bedrock: an inference profile ARN16 * Bedrock: an inference profile ARN

17 * Foundry: a deployment name17 * Foundry: a deployment name

18 * Vertex: a version name18 * Vertex: a version name


23remembering exact version numbers:23remembering exact version numbers:

24 24 

25| Model alias | Behavior |25| Model alias | Behavior |

26| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |26| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

27| **`default`** | Recommended model setting, depending on your account type |27| **`default`** | Recommended model setting, depending on your account type |

28| **`sonnet`** | Uses the latest Sonnet model (currently Sonnet 4.5) for daily coding tasks |28| **`sonnet`** | Uses the latest Sonnet model (currently Sonnet 4.5) for daily coding tasks |

29| **`opus`** | Uses Opus model (currently Opus 4.5) for specialized complex reasoning tasks |29| **`opus`** | Uses the latest Opus model (currently Opus 4.6) for complex reasoning tasks |

30| **`haiku`** | Uses the fast and efficient Haiku model for simple tasks |30| **`haiku`** | Uses the fast and efficient Haiku model for simple tasks |

31| **`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 |31| **`sonnet[1m]`** | Uses Sonnet with a [1 million token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window) for long sessions |

32| **`opusplan`** | Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution |32| **`opusplan`** | Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution |

33 33 

34Aliases always point to the latest version. To pin to a specific version, use the full model name (for example, `claude-opus-4-6`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`.

35 

34### Setting your model36### Setting your model

35 37 

36You can configure your model in several ways, listed in order of priority:38You can configure your model in several ways, listed in order of priority:


66 68 

67### `default` model setting69### `default` model setting

68 70 

69The behavior of `default` depends on your account type.71The behavior of `default` depends on your account type:

72 

73* **Max and Teams**: defaults to Opus 4.6

74* **Pro**: defaults to Opus 4.6 in Claude Code

75* **Enterprise**: Opus 4.6 is available but not the default

70 76 

71For certain Max users, Claude Code will automatically fall back to Sonnet if you77Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus.

72hit a usage threshold with Opus.

73 78 

74### `opusplan` model setting79### `opusplan` model setting

75 80 


83This gives you the best of both worlds: Opus's superior reasoning for planning,88This gives you the best of both worlds: Opus's superior reasoning for planning,

84and Sonnet's efficiency for execution.89and Sonnet's efficiency for execution.

85 90 

91### Adjust effort level

92 

93[Effort levels](https://platform.claude.com/docs/en/build-with-claude/effort) control Opus 4.6's adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems.

94 

95Three levels are available: **low**, **medium**, and **high** (default).

96 

97**Setting effort:**

98 

99* **In `/model`**: use left/right arrow keys to adjust the effort slider when selecting a model

100* **Environment variable**: set `CLAUDE_CODE_EFFORT_LEVEL=low|medium|high`

101* **Settings**: set `effortLevel` in your settings file

102 

103Effort is currently supported on Opus 4.6. The effort slider appears in `/model` when a supported model is selected.

104 

86### Extended context with \[1m]105### Extended context with \[1m]

87 106 

88For Console/API users, the `[1m]` suffix can be added to full model names to107The `[1m]` suffix enables a [1 million token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window) for long sessions.

89enable a108 

90[1 million token context window](https://docs.claude.com/en/docs/build-with-claude/context-windows#1m-token-context-window).109<Note>

110 For Opus 4.6, the 1M context window is available for API and Claude Code pay-as-you-go users. Pro, Max, Teams, and Enterprise subscription users do not have access to Opus 4.6 1M context at launch.

111</Note>

112 

113You can use the `[1m]` suffix with model aliases or full model names:

91 114 

92```bash theme={null}115```bash theme={null}

93# Example of using a full model name with the [1m] suffix116# Use the sonnet[1m] alias

94/model anthropic.claude-sonnet-4-5-20250929-v1:0[1m]117/model sonnet[1m]

118 

119# Or append [1m] to a full model name

120/model claude-sonnet-4-5-20250929[1m]

95```121```

96 122 

97Note: Extended context models have123Note: Extended context models have

98[different pricing](https://docs.claude.com/en/docs/about-claude/pricing#long-context-pricing).124[different pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing).

99 125 

100## Checking your current model126## Checking your current model

101 127 


121 147 

122### Prompt caching configuration148### Prompt caching configuration

123 149 

124Claude 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:150Claude Code automatically uses [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers:

125 151 

126| Environment variable | Description |152| Environment variable | Description |

127| ------------------------------- | ---------------------------------------------------------------------------------------------- |153| ------------------------------- | ---------------------------------------------------------------------------------------------- |

Details

71### Common configuration variables71### Common configuration variables

72 72 

73| Environment Variable | Description | Example Values |73| Environment Variable | Description | Example Values |

74| ----------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------ |74| ----------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------ |

75| `CLAUDE_CODE_ENABLE_TELEMETRY` | Enables telemetry collection (required) | `1` |75| `CLAUDE_CODE_ENABLE_TELEMETRY` | Enables telemetry collection (required) | `1` |

76| `OTEL_METRICS_EXPORTER` | Metrics exporter type(s) (comma-separated) | `console`, `otlp`, `prometheus` |76| `OTEL_METRICS_EXPORTER` | Metrics exporter type(s) (comma-separated) | `console`, `otlp`, `prometheus` |

77| `OTEL_LOGS_EXPORTER` | Logs/events exporter type(s) (comma-separated) | `console`, `otlp` |77| `OTEL_LOGS_EXPORTER` | Logs/events exporter type(s) (comma-separated) | `console`, `otlp` |


87| `OTEL_METRIC_EXPORT_INTERVAL` | Export interval in milliseconds (default: 60000) | `5000`, `60000` |87| `OTEL_METRIC_EXPORT_INTERVAL` | Export interval in milliseconds (default: 60000) | `5000`, `60000` |

88| `OTEL_LOGS_EXPORT_INTERVAL` | Logs export interval in milliseconds (default: 5000) | `1000`, `10000` |88| `OTEL_LOGS_EXPORT_INTERVAL` | Logs export interval in milliseconds (default: 5000) | `1000`, `10000` |

89| `OTEL_LOG_USER_PROMPTS` | Enable logging of user prompt content (default: disabled) | `1` to enable |89| `OTEL_LOG_USER_PROMPTS` | Enable logging of user prompt content (default: disabled) | `1` to enable |

90| `OTEL_LOG_TOOL_DETAILS` | Enable logging of MCP server/tool names and skill names in tool events (default: disabled) | `1` to enable |

90| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic headers (default: 1740000ms / 29 minutes) | `900000` |91| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic headers (default: 1740000ms / 29 minutes) | `900000` |

91 92 

92### Metrics cardinality control93### Metrics cardinality control


334* All [standard attributes](#standard-attributes)335* All [standard attributes](#standard-attributes)

335* `event.name`: `"user_prompt"`336* `event.name`: `"user_prompt"`

336* `event.timestamp`: ISO 8601 timestamp337* `event.timestamp`: ISO 8601 timestamp

338* `event.sequence`: monotonically increasing counter for ordering events within a session

337* `prompt_length`: Length of the prompt339* `prompt_length`: Length of the prompt

338* `prompt`: Prompt content (redacted by default, enable with `OTEL_LOG_USER_PROMPTS=1`)340* `prompt`: Prompt content (redacted by default, enable with `OTEL_LOG_USER_PROMPTS=1`)

339 341 


348* All [standard attributes](#standard-attributes)350* All [standard attributes](#standard-attributes)

349* `event.name`: `"tool_result"`351* `event.name`: `"tool_result"`

350* `event.timestamp`: ISO 8601 timestamp352* `event.timestamp`: ISO 8601 timestamp

353* `event.sequence`: monotonically increasing counter for ordering events within a session

351* `tool_name`: Name of the tool354* `tool_name`: Name of the tool

352* `success`: `"true"` or `"false"`355* `success`: `"true"` or `"false"`

353* `duration_ms`: Execution time in milliseconds356* `duration_ms`: Execution time in milliseconds


356* `source`: Decision source - `"config"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`359* `source`: Decision source - `"config"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`

357* `tool_parameters`: JSON string containing tool-specific parameters (when available)360* `tool_parameters`: JSON string containing tool-specific parameters (when available)

358 * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `sandbox`361 * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `sandbox`

362 * For MCP tools (when `OTEL_LOG_TOOL_DETAILS=1`): includes `mcp_server_name`, `mcp_tool_name`

363 * For Skill tool (when `OTEL_LOG_TOOL_DETAILS=1`): includes `skill_name`

359 364 

360#### API request event365#### API request event

361 366 


368* All [standard attributes](#standard-attributes)373* All [standard attributes](#standard-attributes)

369* `event.name`: `"api_request"`374* `event.name`: `"api_request"`

370* `event.timestamp`: ISO 8601 timestamp375* `event.timestamp`: ISO 8601 timestamp

376* `event.sequence`: monotonically increasing counter for ordering events within a session

371* `model`: Model used (for example, "claude-sonnet-4-5-20250929")377* `model`: Model used (for example, "claude-sonnet-4-5-20250929")

372* `cost_usd`: Estimated cost in USD378* `cost_usd`: Estimated cost in USD

373* `duration_ms`: Request duration in milliseconds379* `duration_ms`: Request duration in milliseconds


387* All [standard attributes](#standard-attributes)393* All [standard attributes](#standard-attributes)

388* `event.name`: `"api_error"`394* `event.name`: `"api_error"`

389* `event.timestamp`: ISO 8601 timestamp395* `event.timestamp`: ISO 8601 timestamp

396* `event.sequence`: monotonically increasing counter for ordering events within a session

390* `model`: Model used (for example, "claude-sonnet-4-5-20250929")397* `model`: Model used (for example, "claude-sonnet-4-5-20250929")

391* `error`: Error message398* `error`: Error message

392* `status_code`: HTTP status code (if applicable)399* `status_code`: HTTP status code (if applicable)


404* All [standard attributes](#standard-attributes)411* All [standard attributes](#standard-attributes)

405* `event.name`: `"tool_decision"`412* `event.name`: `"tool_decision"`

406* `event.timestamp`: ISO 8601 timestamp413* `event.timestamp`: ISO 8601 timestamp

414* `event.sequence`: monotonically increasing counter for ordering events within a session

407* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")415* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")

408* `decision`: Either `"accept"` or `"reject"`416* `decision`: Either `"accept"` or `"reject"`

409* `source`: Decision source - `"config"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`417* `source`: Decision source - `"config"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`


493 501 

494* Telemetry is opt-in and requires explicit configuration502* Telemetry is opt-in and requires explicit configuration

495* Sensitive information like API keys or file contents are never included in metrics or events503* Sensitive information like API keys or file contents are never included in metrics or events

496* User prompt content is redacted by default - only prompt length is recorded. To enable user prompt logging, set `OTEL_LOG_USER_PROMPTS=1`504* User prompt content is redacted by default, only prompt length is recorded. To enable user prompt logging, set `OTEL_LOG_USER_PROMPTS=1`

505* MCP server/tool names and skill names are not logged by default because they can reveal user-specific configurations. To enable, set `OTEL_LOG_TOOL_DETAILS=1`

497 506 

498## Monitoring Claude Code on Amazon Bedrock507## Monitoring Claude Code on Amazon Bedrock

499 508 

overview.md +6 −3

Details

4 4 

5# Claude Code overview5# Claude Code overview

6 6 

7> Learn about Claude Code, Anthropic's agentic coding tool that lives in your terminal and helps you turn ideas into code faster than ever before.7> Learn about Claude Code, Anthropic's agentic coding tool that works in your terminal, IDE, desktop app, and browser to help you turn ideas into code faster than ever before.

8 8 

9## Get started in 30 seconds9## Get started in 30 seconds

10 10 

11Prerequisites:11Prerequisites:

12 12 

13* Meet the [system requirements](/en/setup#system-requirements)

13* A [Claude subscription](https://claude.com/pricing) (Pro, Max, Teams, or Enterprise) or [Claude Console](https://console.anthropic.com/) account14* A [Claude subscription](https://claude.com/pricing) (Pro, Max, Teams, or Enterprise) or [Claude Console](https://console.anthropic.com/) account

14 15 

15**Install Claude Code:**16**Install Claude Code:**


75 See [advanced setup](/en/setup) for installation options, manual updates, or uninstallation instructions. Visit [troubleshooting](/en/troubleshooting) if you hit issues.76 See [advanced setup](/en/setup) for installation options, manual updates, or uninstallation instructions. Visit [troubleshooting](/en/troubleshooting) if you hit issues.

76</Tip>77</Tip>

77 78 

79Claude Code also runs in [VS Code](/en/vs-code), [JetBrains IDEs](/en/jetbrains), as a [desktop app](/en/desktop), [on the web](/en/claude-code-on-the-web), and in [Slack](/en/slack). See [all platforms](#use-claude-code-everywhere) below.

80 

78## What Claude Code does for you81## What Claude Code does for you

79 82 

80* **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.83* **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.


84 87 

85## Why developers love Claude Code88## Why developers love Claude Code

86 89 

87* **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.90* **Meets you where you work**: Use Claude Code in your terminal, your IDE, or a standalone desktop app. It integrates with the tools you already use.

88* **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.91* **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.

89* **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"`.92* **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"`.

90* **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.93* **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.


130 Learn more about Claude Code on claude.com133 Learn more about Claude Code on claude.com

131 </Card>134 </Card>

132 135 

133 <Card title="Build with the Agent SDK" icon="code-branch" href="https://docs.claude.com/en/docs/agent-sdk/overview">136 <Card title="Build with the Agent SDK" icon="code-branch" href="https://platform.claude.com/docs/en/agent-sdk/overview">

134 Create custom AI agents with the Claude Agent SDK137 Create custom AI agents with the Claude Agent SDK

135 </Card>138 </Card>

136 139 

permissions.md +258 −0 added

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Configure permissions

6 

7> Control what Claude Code can access and do with fine-grained permission rules, modes, and managed policies.

8 

9Claude Code supports fine-grained permissions so that you can specify exactly what the agent is allowed to do and what it cannot. Permission settings can be checked into version control and distributed to all developers in your organization, as well as customized by individual developers.

10 

11## Permission system

12 

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

14 

15| Tool type | Example | Approval required | "Yes, don't ask again" behavior |

16| :---------------- | :--------------- | :---------------- | :-------------------------------------------- |

17| Read-only | File reads, Grep | No | N/A |

18| Bash commands | Shell execution | Yes | Permanently per project directory and command |

19| File modification | Edit/write files | Yes | Until session end |

20 

21## Manage permissions

22 

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

24 

25* **Allow** rules let Claude Code use the specified tool without manual approval.

26* **Ask** rules prompt for confirmation whenever Claude Code tries to use the specified tool.

27* **Deny** rules prevent Claude Code from using the specified tool.

28 

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

30 

31## Permission modes

32 

33Claude Code supports several permission modes that control how tools are approved. Set the `defaultMode` in your [settings files](/en/settings#settings-files):

34 

35| Mode | Description |

36| :------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

37| `default` | Standard behavior: prompts for permission on first use of each tool |

38| `acceptEdits` | Automatically accepts file edit permissions for the session |

39| `plan` | Plan Mode: Claude can analyze but not modify files or execute commands |

40| `delegate` | Coordination-only mode for agent team leads. Restricts the lead to team management tools, so all implementation work happens through teammates. Only available when an agent team is active. See [delegate mode](/en/agent-teams#delegate-mode) for details. |

41| `dontAsk` | Auto-denies tools unless pre-approved via `/permissions` or `permissions.allow` rules |

42| `bypassPermissions` | Skips all permission prompts (requires safe environment, see warning below) |

43 

44<Warning>

45 `bypassPermissions` mode disables all permission checks. Only use this in isolated environments like containers or VMs where Claude Code cannot cause damage. Administrators can prevent this mode by setting `disableBypassPermissionsMode` to `"disable"` in [managed settings](#managed-settings).

46</Warning>

47 

48## Permission rule syntax

49 

50Permission rules follow the format `Tool` or `Tool(specifier)`.

51 

52### Match all uses of a tool

53 

54To match all uses of a tool, use just the tool name without parentheses:

55 

56| Rule | Effect |

57| :--------- | :----------------------------- |

58| `Bash` | Matches all Bash commands |

59| `WebFetch` | Matches all web fetch requests |

60| `Read` | Matches all file reads |

61 

62`Bash(*)` is equivalent to `Bash` and matches all Bash commands.

63 

64### Use specifiers for fine-grained control

65 

66Add a specifier in parentheses to match specific tool uses:

67 

68| Rule | Effect |

69| :----------------------------- | :------------------------------------------------------- |

70| `Bash(npm run build)` | Matches the exact command `npm run build` |

71| `Read(./.env)` | Matches reading the `.env` file in the current directory |

72| `WebFetch(domain:example.com)` | Matches fetch requests to example.com |

73 

74### Wildcard patterns

75 

76Bash rules support glob patterns with `*`. Wildcards can appear at any position in the command. This configuration allows npm and git commit commands while blocking git push:

77 

78```json theme={null}

79{

80 "permissions": {

81 "allow": [

82 "Bash(npm run *)",

83 "Bash(git commit *)",

84 "Bash(git * main)",

85 "Bash(* --version)",

86 "Bash(* --help *)"

87 ],

88 "deny": [

89 "Bash(git push *)"

90 ]

91 }

92}

93```

94 

95The space before `*` matters: `Bash(ls *)` matches `ls -la` but not `lsof`, while `Bash(ls*)` matches both. The legacy `:*` suffix syntax is equivalent to ` *` but is deprecated.

96 

97## Tool-specific permission rules

98 

99### Bash

100 

101Bash permission rules support wildcard matching with `*`. Wildcards can appear at any position in the command, including at the beginning, middle, or end:

102 

103* `Bash(npm run build)` matches the exact Bash command `npm run build`

104* `Bash(npm run test *)` matches Bash commands starting with `npm run test`

105* `Bash(npm *)` matches any command starting with `npm `

106* `Bash(* install)` matches any command ending with ` install`

107* `Bash(git * main)` matches commands like `git checkout main`, `git merge main`

108 

109When `*` appears at the end with a space before it (like `Bash(ls *)`), it enforces a word boundary, requiring the prefix to be followed by a space or end-of-string. For example, `Bash(ls *)` matches `ls -la` but not `lsof`. In contrast, `Bash(ls*)` without a space matches both `ls -la` and `lsof` because there's no word boundary constraint.

110 

111<Tip>

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

113</Tip>

114 

115<Warning>

116 Bash permission patterns that try to constrain command arguments are fragile. For example, `Bash(curl http://github.com/ *)` intends to restrict curl to GitHub URLs, but won't match variations like:

117 

118 * Options before URL: `curl -X GET http://github.com/...`

119 * Different protocol: `curl https://github.com/...`

120 * Redirects: `curl -L http://bit.ly/xyz` (redirects to github)

121 * Variables: `URL=http://github.com && curl $URL`

122 * Extra spaces: `curl http://github.com`

123 

124 For more reliable URL filtering, consider:

125 

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

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

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

129 

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

131</Warning>

132 

133### Read and Edit

134 

135`Edit` rules apply to all built-in tools that edit files. Claude makes a best-effort attempt to apply `Read` rules to all built-in tools that read files like Grep and Glob.

136 

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

138 

139| Pattern | Meaning | Example | Matches |

140| ------------------ | -------------------------------------- | -------------------------------- | ---------------------------------- |

141| `//path` | **Absolute** path from filesystem root | `Read(//Users/alice/secrets/**)` | `/Users/alice/secrets/**` |

142| `~/path` | Path from **home** directory | `Read(~/Documents/*.pdf)` | `/Users/alice/Documents/*.pdf` |

143| `/path` | Path **relative to settings file** | `Edit(/src/**/*.ts)` | `<settings file path>/src/**/*.ts` |

144| `path` or `./path` | Path **relative to current directory** | `Read(*.env)` | `<cwd>/*.env` |

145 

146<Warning>

147 A pattern like `/Users/alice/file` is NOT an absolute path. It's relative to your settings file. Use `//Users/alice/file` for absolute paths.

148</Warning>

149 

150Examples:

151 

152* `Edit(/docs/**)`: edits in `<project>/docs/` (NOT `/docs/`)

153* `Read(~/.zshrc)`: reads your home directory's `.zshrc`

154* `Edit(//tmp/scratch.txt)`: edits the absolute path `/tmp/scratch.txt`

155* `Read(src/**)`: reads from `<current-directory>/src/`

156 

157<Note>

158 In gitignore patterns, `*` matches files in a single directory while `**` matches recursively across directories. To allow all file access, use just the tool name without parentheses: `Read`, `Edit`, or `Write`.

159</Note>

160 

161### WebFetch

162 

163* `WebFetch(domain:example.com)` matches fetch requests to example.com

164 

165### MCP

166 

167* `mcp__puppeteer` matches any tool provided by the `puppeteer` server (name configured in Claude Code)

168* `mcp__puppeteer__*` wildcard syntax that also matches all tools from the `puppeteer` server

169* `mcp__puppeteer__puppeteer_navigate` matches the `puppeteer_navigate` tool provided by the `puppeteer` server

170 

171### Task (subagents)

172 

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

174 

175* `Task(Explore)` matches the Explore subagent

176* `Task(Plan)` matches the Plan subagent

177* `Task(my-custom-agent)` matches a custom subagent named `my-custom-agent`

178 

179Add these rules to the `deny` array in your settings or use the `--disallowedTools` CLI flag to disable specific agents. To disable the Explore agent:

180 

181```json theme={null}

182{

183 "permissions": {

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

185 }

186}

187```

188 

189## Extend permissions with hooks

190 

191[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, and the hook output can determine whether to approve or deny the tool call in place of the permission system.

192 

193## Working directories

194 

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

196 

197* **During startup**: use `--add-dir <path>` CLI argument

198* **During session**: use `/add-dir` command

199* **Persistent configuration**: add to `additionalDirectories` in [settings files](/en/settings#settings-files)

200 

201Files 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.

202 

203## How permissions interact with sandboxing

204 

205Permissions and [sandboxing](/en/sandboxing) are complementary security layers:

206 

207* **Permissions** control which tools Claude Code can use and which files or domains it can access. They apply to all tools (Bash, Read, Edit, WebFetch, MCP, and others).

208* **Sandboxing** provides OS-level enforcement that restricts the Bash tool's filesystem and network access. It applies only to Bash commands and their child processes.

209 

210Use both for defense-in-depth:

211 

212* Permission deny rules block Claude from even attempting to access restricted resources

213* Sandbox restrictions prevent Bash commands from reaching resources outside defined boundaries, even if a prompt injection bypasses Claude's decision-making

214* Filesystem restrictions in the sandbox use Read and Edit deny rules, not separate sandbox configuration

215* Network restrictions combine WebFetch permission rules with the sandbox's `allowedDomains` list

216 

217## Managed settings

218 

219For organizations that need centralized control over Claude Code configuration, administrators can deploy `managed-settings.json` files to system directories. These policy files follow the same format as regular settings files and cannot be overridden by user or project settings.

220 

221**Managed settings file locations**:

222 

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

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

225* **Windows**: `C:\Program Files\ClaudeCode\managed-settings.json`

226 

227<Note>

228 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.

229</Note>

230 

231### Managed-only settings

232 

233Some settings are only effective in managed settings:

234 

235| Setting | Description |

236| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |

237| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode and the `--dangerously-skip-permissions` flag |

238| `allowManagedPermissionRulesOnly` | When `true`, prevents user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply |

239| `allowManagedHooksOnly` | When `true`, prevents loading of user, project, and plugin hooks. Only managed hooks and SDK hooks are allowed |

240| `strictKnownMarketplaces` | Controls which plugin marketplaces users can add. See [managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) |

241 

242## Settings precedence

243 

244Permission rules follow the same [settings precedence](/en/settings#settings-precedence) as all other Claude Code settings: managed settings have the highest precedence, followed by command line arguments, local project, shared project, and user settings.

245 

246If a permission is allowed in user settings but denied in project settings, the project setting takes precedence and the permission is blocked.

247 

248## Example configurations

249 

250This [repository](https://github.com/anthropics/claude-code/tree/main/examples/settings) includes starter settings configurations for common deployment scenarios. Use these as starting points and adjust them to fit your needs.

251 

252## See also

253 

254* [Settings](/en/settings): complete configuration reference including the permission settings table

255* [Sandboxing](/en/sandboxing): OS-level filesystem and network isolation for Bash commands

256* [Authentication](/en/authentication): set up user access to Claude Code

257* [Security](/en/security): security safeguards and best practices

258* [Hooks](/en/hooks-guide): automate workflows and extend permission evaluation

Details

191**Standard metadata fields:**191**Standard metadata fields:**

192 192 

193| Field | Type | Description |193| Field | Type | Description |

194| :------------ | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |194| :------------ | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

195| `description` | string | Brief plugin description |195| `description` | string | Brief plugin description |

196| `version` | string | Plugin version |196| `version` | string | Plugin version |

197| `author` | object | Plugin author information (`name` required, `email` optional) |197| `author` | object | Plugin author information (`name` required, `email` optional) |


201| `keywords` | array | Tags for plugin discovery and categorization |201| `keywords` | array | Tags for plugin discovery and categorization |

202| `category` | string | Plugin category for organization |202| `category` | string | Plugin category for organization |

203| `tags` | array | Tags for searchability |203| `tags` | array | Tags for searchability |

204| `strict` | boolean | Controls whether plugins need their own `plugin.json` file. When `true` (default), the plugin source must contain a `plugin.json`, and any fields you add here in the marketplace entry get merged with it. When `false`, the plugin doesn't need its own `plugin.json`; the marketplace entry itself defines everything about the plugin. Use `false` when you want to define simple plugins entirely in your marketplace file. |204| `strict` | boolean | When true (default), marketplace component fields merge with plugin.json. When false, the marketplace entry defines the plugin entirely, and plugin.json must not also declare components. |

205 205 

206**Component configuration fields:**206**Component configuration fields:**

207 207 

plugins.md +2 −2

Details

181</Warning>181</Warning>

182 182 

183| Directory | Location | Purpose |183| Directory | Location | Purpose |

184| :---------------- | :---------- | :---------------------------------------------- |184| :---------------- | :---------- | :----------------------------------------------------------------------------- |

185| `.claude-plugin/` | Plugin root | Contains only `plugin.json` manifest (required) |185| `.claude-plugin/` | Plugin root | Contains `plugin.json` manifest (optional if components use default locations) |

186| `commands/` | Plugin root | Skills as Markdown files |186| `commands/` | Plugin root | Skills as Markdown files |

187| `agents/` | Plugin root | Custom agent definitions |187| `agents/` | Plugin root | Custom agent definitions |

188| `skills/` | Plugin root | Agent Skills with `SKILL.md` files |188| `skills/` | Plugin root | Agent Skills with `SKILL.md` files |

Details

56 56 

57```markdown theme={null}57```markdown theme={null}

58---58---

59description: What this agent specializes in59name: agent-name

60capabilities: ["task1", "task2", "task3"]60description: What this agent specializes in and when Claude should invoke it

61---61---

62 62 

63# Agent Name63Detailed system prompt for the agent describing its role, expertise, and behavior.

64 

65Detailed description of the agent's role, expertise, and when Claude should invoke it.

66 

67## Capabilities

68- Specific task the agent excels at

69- Another specialized capability

70- When to use this agent vs others

71 

72## Context and examples

73Provide examples of when this agent should be used and what kinds of problems it solves.

74```64```

75 65 

76**Integration points**:66**Integration points**:


80* Agents can be invoked manually by users70* Agents can be invoked manually by users

81* Plugin agents work alongside built-in Claude agents71* Plugin agents work alongside built-in Claude agents

82 72 

73For complete details, see [Subagents](/en/sub-agents).

74 

83### Hooks75### Hooks

84 76 

85Plugins can provide event handlers that respond to Claude Code events automatically.77Plugins can provide event handlers that respond to Claude Code events automatically.


121* `SubagentStop`: When a subagent attempts to stop113* `SubagentStop`: When a subagent attempts to stop

122* `SessionStart`: At the beginning of sessions114* `SessionStart`: At the beginning of sessions

123* `SessionEnd`: At the end of sessions115* `SessionEnd`: At the end of sessions

116* `TeammateIdle`: When an agent team teammate is about to go idle

117* `TaskCompleted`: When a task is being marked as completed

124* `PreCompact`: Before conversation history is compacted118* `PreCompact`: Before conversation history is compacted

125 119 

126**Hook types**:120**Hook types**:


168### LSP servers162### LSP servers

169 163 

170<Tip>164<Tip>

171 Looking to use LSP plugins? Install them from the official marketplacesearch for "lsp" in the `/plugin` Discover tab. This section documents how to create LSP plugins for languages not covered by the official marketplace.165 Looking to use LSP plugins? Install them from the official marketplace: search for "lsp" in the `/plugin` Discover tab. This section documents how to create LSP plugins for languages not covered by the official marketplace.

172</Tip>166</Tip>

173 167 

174Plugins can provide [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) (LSP) servers to give Claude real-time code intelligence while working on your codebase.168Plugins can provide [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) (LSP) servers to give Claude real-time code intelligence while working on your codebase.


269 263 

270## Plugin manifest schema264## Plugin manifest schema

271 265 

272The `plugin.json` file defines your plugin's metadata and configuration. This section documents all supported fields and options.266The `.claude-plugin/plugin.json` file defines your plugin's metadata and configuration. This section documents all supported fields and options.

267 

268The manifest is optional. If omitted, Claude Code auto-discovers components in [default locations](#file-locations-reference) and derives the plugin name from the directory name. Use a manifest when you need to provide metadata or custom component paths.

273 269 

274### Complete schema270### Complete schema

275 271 


299 295 

300### Required fields296### Required fields

301 297 

298If you include a manifest, `name` is the only required field.

299 

302| Field | Type | Description | Example |300| Field | Type | Description | Example |

303| :----- | :----- | :---------------------------------------- | :------------------- |301| :----- | :----- | :---------------------------------------- | :------------------- |

304| `name` | string | Unique identifier (kebab-case, no spaces) | `"deployment-tools"` |302| `name` | string | Unique identifier (kebab-case, no spaces) | `"deployment-tools"` |

305 303 

304This name is used for namespacing components. For example, in the UI, the

305agent `agent-creator` for the plugin with name `plugin-dev` will appear as

306`plugin-dev:agent-creator`.

307 

306### Metadata fields308### Metadata fields

307 309 

308| Field | Type | Description | Example |310| Field | Type | Description | Example |

309| :------------ | :----- | :---------------------------------- | :------------------------------------------------- |311| :------------ | :----- | :-------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------- |

310| `version` | string | Semantic version | `"2.1.0"` |312| `version` | string | Semantic version. If also set in the marketplace entry, `plugin.json` takes priority. You only need to set it in one place. | `"2.1.0"` |

311| `description` | string | Brief explanation of plugin purpose | `"Deployment automation tools"` |313| `description` | string | Brief explanation of plugin purpose | `"Deployment automation tools"` |

312| `author` | object | Author information | `{"name": "Dev Team", "email": "dev@company.com"}` |314| `author` | object | Author information | `{"name": "Dev Team", "email": "dev@company.com"}` |

313| `homepage` | string | Documentation URL | `"https://docs.example.com"` |315| `homepage` | string | Documentation URL | `"https://docs.example.com"` |


318### Component path fields320### Component path fields

319 321 

320| Field | Type | Description | Example |322| Field | Type | Description | Example |

321| :------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------- |323| :------------- | :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------- |

322| `commands` | string\|array | Additional command files/directories | `"./custom/cmd.md"` or `["./cmd1.md"]` |324| `commands` | string\|array | Additional command files/directories | `"./custom/cmd.md"` or `["./cmd1.md"]` |

323| `agents` | string\|array | Additional agent files | `"./custom/agents/"` |325| `agents` | string\|array | Additional agent files | `"./custom/agents/reviewer.md"` |

324| `skills` | string\|array | Additional skill directories | `"./custom/skills/"` |326| `skills` | string\|array | Additional skill directories | `"./custom/skills/"` |

325| `hooks` | string\|object | Hook config path or inline config | `"./hooks.json"` |327| `hooks` | string\|array\|object | Hook config paths or inline config | `"./my-extra-hooks.json"` |

326| `mcpServers` | string\|object | MCP config path or inline config | `"./mcp-config.json"` |328| `mcpServers` | string\|array\|object | MCP config paths or inline config | `"./my-extra-mcp-config.json"` |

327| `outputStyles` | string\|array | Additional output style files/directories | `"./styles/"` |329| `outputStyles` | string\|array | Additional output style files/directories | `"./styles/"` |

328| `lspServers` | string\|object | [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) config for code intelligence (go to definition, find references, etc.) | `"./.lsp.json"` |330| `lspServers` | string\|array\|object | [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) configs for code intelligence (go to definition, find references, etc.) | `"./.lsp.json"` |

329 331 

330### Path behavior rules332### Path behavior rules

331 333 


380 382 

381### How plugin caching works383### How plugin caching works

382 384 

383When you install a plugin, Claude Code copies the plugin files to a cache directory:385Plugins are specified in one of two ways:

384 386 

385* **For marketplace plugins with relative paths**: The path specified in the `source` field is copied recursively. For example, if your marketplace entry specifies `"source": "./plugins/my-plugin"`, the entire `./plugins` directory is copied.387* Through `claude --plugin-dir`, for the duration of a session.

386* **For plugins with `.claude-plugin/plugin.json`**: The implicit root directory (the directory containing `.claude-plugin/plugin.json`) is copied recursively.388* Through a marketplace, installed to the local plugin cache.

389 

390When you install a plugin, Claude Code locates its marketplace and the plugin's `source` field within that marketplace.

391 

392The source can be one of five types:

393 

394* Relative path: copied recursively to the plugin cache. For example, if your marketplace entry specifies `"source": "./plugins/my-plugin"`, the entire `./plugins/my-plugin` directory is copied.

395* npm - copied to the plugin cache from npm

396* pip - copied to the plugin cache from pip

397* url - any https\:// URL ending in .git

398* github - any owner/repo shorthand

387 399 

388### Path traversal limitations400### Path traversal limitations

389 401 


435 447 

436```448```

437enterprise-plugin/449enterprise-plugin/

438├── .claude-plugin/ # Metadata directory450├── .claude-plugin/ # Metadata directory (optional)

439│ └── plugin.json # Required: plugin manifest451│ └── plugin.json # plugin manifest

440├── commands/ # Default command location452├── commands/ # Default command location

441│ ├── status.md453│ ├── status.md

442│ └── logs.md454│ └── logs.md


471 483 

472| Component | Default Location | Purpose |484| Component | Default Location | Purpose |

473| :-------------- | :--------------------------- | :---------------------------------------------------------- |485| :-------------- | :--------------------------- | :---------------------------------------------------------- |

474| **Manifest** | `.claude-plugin/plugin.json` | Required metadata file |486| **Manifest** | `.claude-plugin/plugin.json` | Plugin metadata and configuration (optional) |

475| **Commands** | `commands/` | Skill Markdown files (legacy; use `skills/` for new skills) |487| **Commands** | `commands/` | Skill Markdown files (legacy; use `skills/` for new skills) |

476| **Agents** | `agents/` | Subagent Markdown files |488| **Agents** | `agents/` | Subagent Markdown files |

477| **Skills** | `skills/` | Skills with `<name>/SKILL.md` structure |489| **Skills** | `skills/` | Skills with `<name>/SKILL.md` structure |


504| `-s, --scope <scope>` | Installation scope: `user`, `project`, or `local` | `user` |516| `-s, --scope <scope>` | Installation scope: `user`, `project`, or `local` | `user` |

505| `-h, --help` | Display help for command | |517| `-h, --help` | Display help for command | |

506 518 

519Scope determines which settings file the installed plugin is added to. For example, --scope project writes to `enabledPlugins` in .claude/settings.json, making the plugin available to everyone who clones the project repository.

520 

507**Examples:**521**Examples:**

508 522 

509```bash theme={null}523```bash theme={null}


601 615 

602### Debugging commands616### Debugging commands

603 617 

604Use `claude --debug` to see plugin loading details:618Use `claude --debug` (or `/debug` within the TUI) to see plugin loading details:

605 

606```bash theme={null}

607claude --debug

608```

609 619 

610This shows:620This shows:

611 621 


637 647 

638* `Warning: No commands found in plugin my-plugin custom directory: ./cmds. Expected .md files or SKILL.md in subdirectories.`: command path exists but contains no valid command files648* `Warning: No commands found in plugin my-plugin custom directory: ./cmds. Expected .md files or SKILL.md in subdirectories.`: command path exists but contains no valid command files

639* `Plugin directory not found at path: ./plugins/my-plugin. Check that the marketplace entry has the correct path.`: the `source` path in marketplace.json points to a non-existent directory649* `Plugin directory not found at path: ./plugins/my-plugin. Check that the marketplace entry has the correct path.`: the `source` path in marketplace.json points to a non-existent directory

640* `Plugin my-plugin has conflicting manifests: both plugin.json and marketplace entry specify components.`: remove duplicate component definitions or set `strict: true` in marketplace entry650* `Plugin my-plugin has conflicting manifests: both plugin.json and marketplace entry specify components.`: remove duplicate component definitions or remove `strict: false` in marketplace entry

641 651 

642### Hook troubleshooting652### Hook troubleshooting

643 653 

quickstart.md +1 −1

Details

104You'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.104You'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.

105 105 

106<Tip>106<Tip>

107 After logging in (Step 2), your credentials are stored on your system. Learn more in [Credential Management](/en/iam#credential-management).107 After logging in (Step 2), your credentials are stored on your system. Learn more in [Credential Management](/en/authentication#credential-management).

108</Tip>108</Tip>

109 109 

110## Step 4: Ask your first question110## Step 4: Ask your first question

sandboxing.md +18 −3

Details

137 137 

138* Cannot modify critical config files such as `~/.bashrc`138* Cannot modify critical config files such as `~/.bashrc`

139* Cannot modify system-level files in `/bin/`139* Cannot modify system-level files in `/bin/`

140* Cannot read files that are denied in your [Claude permission settings](/en/iam#configuring-permissions)140* Cannot read files that are denied in your [Claude permission settings](/en/permissions#manage-permissions)

141 141 

142**Network protection:**142**Network protection:**

143 143 


184* 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.184* 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.

185* 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 in cases where additional isolation is otherwise enforced.185* 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 in cases where additional isolation is otherwise enforced.

186 186 

187## How sandboxing relates to permissions

188 

189Sandboxing and [permissions](/en/permissions) are complementary security layers that work together:

190 

191* **Permissions** control which tools Claude Code can use and are evaluated before any tool runs. They apply to all tools: Bash, Read, Edit, WebFetch, MCP, and others.

192* **Sandboxing** provides OS-level enforcement that restricts what Bash commands can access at the filesystem and network level. It applies only to Bash commands and their child processes.

193 

194Filesystem and network restrictions are configured through permission rules, not sandbox settings:

195 

196* Use `Read` and `Edit` deny rules to block access to specific files or directories

197* Use `WebFetch` allow/deny rules to control domain access

198* Use sandbox `allowedDomains` to control which domains Bash commands can reach

199 

200This [repository](https://github.com/anthropics/claude-code/tree/main/examples/settings) includes starter settings configurations for common deployment scenarios, including sandbox-specific examples. Use these as starting points and adjust them to fit your needs.

201 

187## Advanced usage202## Advanced usage

188 203 

189### Custom proxy configuration204### Custom proxy configuration


210 225 

211The sandboxed bash tool works alongside:226The sandboxed bash tool works alongside:

212 227 

213* **IAM policies**: Combine with [permission settings](/en/iam) for defense-in-depth228* **Permission rules**: Combine with [permission settings](/en/permissions) for defense-in-depth

214* **Development containers**: Use with [devcontainers](/en/devcontainer) for additional isolation229* **Development containers**: Use with [devcontainers](/en/devcontainer) for additional isolation

215* **Enterprise policies**: Enforce sandbox configurations through [managed settings](/en/settings#settings-precedence)230* **Enterprise policies**: Enforce sandbox configurations through [managed settings](/en/settings#settings-precedence)

216 231 


241## See also256## See also

242 257 

243* [Security](/en/security) - Comprehensive security features and best practices258* [Security](/en/security) - Comprehensive security features and best practices

244* [IAM](/en/iam) - Permission configuration and access control259* [Permissions](/en/permissions) - Permission configuration and access control

245* [Settings](/en/settings) - Complete configuration reference260* [Settings](/en/settings) - Complete configuration reference

246* [CLI reference](/en/cli-reference) - Command-line options261* [CLI reference](/en/cli-reference) - Command-line options

security.md +5 −5

Details

18 18 

19We 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.19We 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.

20 20 

21For detailed permission configuration, see [Identity and Access Management](/en/iam).21For detailed permission configuration, see [Permissions](/en/permissions).

22 22 

23### Built-in protections23### Built-in protections

24 24 


42* **Permission system**: Sensitive operations require explicit approval42* **Permission system**: Sensitive operations require explicit approval

43* **Context-aware analysis**: Detects potentially harmful instructions by analyzing the full request43* **Context-aware analysis**: Detects potentially harmful instructions by analyzing the full request

44* **Input sanitization**: Prevents command injection by processing user inputs44* **Input sanitization**: Prevents command injection by processing user inputs

45* **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)45* **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/permissions#tool-specific-permission-rules)

46 46 

47### Privacy safeguards47### Privacy safeguards

48 48 


63* **Command injection detection**: Suspicious bash commands require manual approval even if previously allowlisted63* **Command injection detection**: Suspicious bash commands require manual approval even if previously allowlisted

64* **Fail-closed matching**: Unmatched commands default to requiring manual approval64* **Fail-closed matching**: Unmatched commands default to requiring manual approval

65* **Natural language descriptions**: Complex bash commands include explanations for user understanding65* **Natural language descriptions**: Complex bash commands include explanations for user understanding

66* **Secure credential storage**: API keys and tokens are encrypted. See [Credential Management](/en/iam#credential-management)66* **Secure credential storage**: API keys and tokens are encrypted. See [Credential Management](/en/authentication#credential-management)

67 67 

68<Warning>68<Warning>

69 **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.69 **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.


117 117 

118### Team security118### Team security

119 119 

120* Use [managed settings](/en/iam#managed-settings) to enforce organizational standards120* Use [managed settings](/en/permissions#managed-settings) to enforce organizational standards

121* Share approved permission configurations through version control121* Share approved permission configurations through version control

122* Train team members on security best practices122* Train team members on security best practices

123* Monitor Claude Code usage through [OpenTelemetry metrics](/en/monitoring-usage)123* Monitor Claude Code usage through [OpenTelemetry metrics](/en/monitoring-usage)


134## Related resources134## Related resources

135 135 

136* [Sandboxing](/en/sandboxing) - Filesystem and network isolation for bash commands136* [Sandboxing](/en/sandboxing) - Filesystem and network isolation for bash commands

137* [Identity and Access Management](/en/iam) - Configure permissions and access controls137* [Permissions](/en/permissions) - Configure permissions and access controls

138* [Monitoring usage](/en/monitoring-usage) - Track and audit Claude Code activity138* [Monitoring usage](/en/monitoring-usage) - Track and audit Claude Code activity

139* [Development containers](/en/devcontainer) - Secure, isolated environments139* [Development containers](/en/devcontainer) - Secure, isolated environments

140* [Anthropic Trust Center](https://trust.anthropic.com) - Security certifications and compliance140* [Anthropic Trust Center](https://trust.anthropic.com) - Security certifications and compliance

settings.md +38 −74

Details

93 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.93 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.

94 </Note>94 </Note>

95 95 

96 See [Managed settings](/en/iam#managed-settings) and [Managed MCP configuration](/en/mcp#managed-mcp-configuration) for details.96 See [Managed settings](/en/permissions#managed-settings) and [Managed MCP configuration](/en/mcp#managed-mcp-configuration) for details.

97 97 

98 <Note>98 <Note>

99 Managed deployments can also restrict **plugin marketplace additions** using99 Managed deployments can also restrict **plugin marketplace additions** using


107 107 

108```JSON Example settings.json theme={null}108```JSON Example settings.json theme={null}

109{109{

110 "$schema": "https://json.schemastore.org/claude-code-settings.json",

110 "permissions": {111 "permissions": {

111 "allow": [112 "allow": [

112 "Bash(npm run lint)",113 "Bash(npm run lint)",


132}133}

133```134```

134 135 

136The `$schema` line in the example above points to the [official JSON schema](https://json.schemastore.org/claude-code-settings.json) for Claude Code settings. Adding it to your `settings.json` enables autocomplete and inline validation in VS Code, Cursor, and any other editor that supports JSON schema validation.

137 

135### Available settings138### Available settings

136 139 

137`settings.json` supports a number of options:140`settings.json` supports a number of options:

138 141 

139| Key | Description | Example |142| Key | Description | Example |

140| :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |143| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |

141| `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` |144| `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` |

142| `cleanupPeriodDays` | Sessions inactive for longer than this period are deleted at startup. Setting to `0` immediately deletes all sessions. (default: 30 days) | `20` |145| `cleanupPeriodDays` | Sessions inactive for longer than this period are deleted at startup. Setting to `0` immediately deletes all sessions. (default: 30 days) | `20` |

143| `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"]` |146| `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"]` |


146| `includeCoAuthoredBy` | **Deprecated**: Use `attribution` instead. Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |149| `includeCoAuthoredBy` | **Deprecated**: Use `attribution` instead. Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |

147| `permissions` | See table below for structure of permissions. | |150| `permissions` | See table below for structure of permissions. | |

148| `hooks` | Configure custom commands to run at lifecycle events. See [hooks documentation](/en/hooks) for format | See [hooks](/en/hooks) |151| `hooks` | Configure custom commands to run at lifecycle events. See [hooks documentation](/en/hooks) for format | See [hooks](/en/hooks) |

149| `disableAllHooks` | Disable all [hooks](/en/hooks) | `true` |152| `disableAllHooks` | Disable all [hooks](/en/hooks) and any custom [status line](/en/statusline) | `true` |

150| `allowManagedHooksOnly` | (Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See [Hook configuration](#hook-configuration) | `true` |153| `allowManagedHooksOnly` | (Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See [Hook configuration](#hook-configuration) | `true` |

154| `allowManagedPermissionRulesOnly` | (Managed settings only) Prevent user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply. See [Managed-only settings](/en/permissions#managed-only-settings) | `true` |

151| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |155| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |

152| `otelHeadersHelper` | Script to generate dynamic OpenTelemetry headers. Runs at startup and periodically (see [Dynamic headers](/en/monitoring-usage#dynamic-headers)) | `/bin/generate_otel_headers.sh` |156| `otelHeadersHelper` | Script to generate dynamic OpenTelemetry headers. Runs at startup and periodically (see [Dynamic headers](/en/monitoring-usage#dynamic-headers)) | `/bin/generate_otel_headers.sh` |

153| `statusLine` | Configure a custom status line to display context. See [`statusLine` documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |157| `statusLine` | Configure a custom status line to display context. See [`statusLine` documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |


172| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |176| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |

173| `spinnerTipsEnabled` | Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`) | `false` |177| `spinnerTipsEnabled` | Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`) | `false` |

174| `terminalProgressBarEnabled` | Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: `true`) | `false` |178| `terminalProgressBarEnabled` | Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: `true`) | `false` |

179| `prefersReducedMotion` | Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility | `true` |

180| `teammateMode` | How [agent team](/en/agent-teams) teammates display: `auto` (picks split panes in tmux or iTerm2, in-process otherwise), `in-process`, or `tmux`. See [set up agent teams](/en/agent-teams#set-up-agent-teams) | `"in-process"` |

175 181 

176### Permission settings182### Permission settings

177 183 

178| Keys | Description | Example |184| Keys | Description | Example |

179| :----------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------- |185| :----------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------- |

180| `allow` | Array of permission rules to allow tool use. See [Permission rule syntax](#permission-rule-syntax) below for pattern matching details | `[ "Bash(git diff *)" ]` |186| `allow` | Array of permission rules to allow tool use. See [Permission rule syntax](#permission-rule-syntax) below for pattern matching details | `[ "Bash(git diff *)" ]` |

181| `ask` | Array of permission rules to ask for confirmation upon tool use. See [Permission rule syntax](#permission-rule-syntax) below | `[ "Bash(git push *)" ]` |187| `ask` | Array of permission rules to ask for confirmation upon tool use. See [Permission rule syntax](#permission-rule-syntax) below | `[ "Bash(git push *)" ]` |

182| `deny` | Array of permission rules to deny tool use. Use this to exclude sensitive files from Claude Code access. See [Permission rule syntax](#permission-rule-syntax) and [Bash permission limitations](/en/iam#tool-specific-permission-rules) | `[ "WebFetch", "Bash(curl *)", "Read(./.env)", "Read(./secrets/**)" ]` |188| `deny` | Array of permission rules to deny tool use. Use this to exclude sensitive files from Claude Code access. See [Permission rule syntax](#permission-rule-syntax) and [Bash permission limitations](/en/permissions#tool-specific-permission-rules) | `[ "WebFetch", "Bash(curl *)", "Read(./.env)", "Read(./secrets/**)" ]` |

183| `additionalDirectories` | Additional [working directories](/en/iam#working-directories) that Claude has access to | `[ "../docs/" ]` |189| `additionalDirectories` | Additional [working directories](/en/permissions#working-directories) that Claude has access to | `[ "../docs/" ]` |

184| `defaultMode` | Default [permission mode](/en/iam#permission-modes) when opening Claude Code | `"acceptEdits"` |190| `defaultMode` | Default [permission mode](/en/permissions#permission-modes) when opening Claude Code | `"acceptEdits"` |

185| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed settings](/en/iam#managed-settings) | `"disable"` |191| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed settings](/en/permissions#managed-settings) | `"disable"` |

186 192 

187### Permission rule syntax193### Permission rule syntax

188 194 

189Permission rules follow the format `Tool` or `Tool(specifier)`. Understanding the syntax helps you write rules that match exactly what you intend.195Permission rules follow the format `Tool` or `Tool(specifier)`. Rules are evaluated in order: deny rules first, then ask, then allow. The first matching rule wins.

190 

191#### Rule evaluation order

192 

193When multiple rules could match the same tool use, rules are evaluated in this order:

194 

1951. **Deny** rules are checked first

1962. **Ask** rules are checked second

1973. **Allow** rules are checked last

198 196 

199The first matching rule determines the behavior. This means deny rules always take precedence over allow rules, even if both match the same command.197Quick examples:

200 

201#### Matching all uses of a tool

202 

203To match all uses of a tool, use just the tool name without parentheses:

204 198 

205| Rule | Effect |199| Rule | Effect |

206| :--------- | :--------------------------------- |200| :----------------------------- | :--------------------------------------- |

207| `Bash` | Matches **all** Bash commands |201| `Bash` | Matches all Bash commands |

208| `WebFetch` | Matches **all** web fetch requests |202| `Bash(npm run *)` | Matches commands starting with `npm run` |

209| `Read` | Matches **all** file reads |203| `Read(./.env)` | Matches reading the `.env` file |

210 

211`Bash(*)` is equivalent to `Bash` and matches all Bash commands. Both syntaxes can be used interchangeably.

212 

213#### Using specifiers for fine-grained control

214 

215Add a specifier in parentheses to match specific tool uses:

216 

217| Rule | Effect |

218| :----------------------------- | :------------------------------------------------------- |

219| `Bash(npm run build)` | Matches the exact command `npm run build` |

220| `Read(./.env)` | Matches reading the `.env` file in the current directory |

221| `WebFetch(domain:example.com)` | Matches fetch requests to example.com |204| `WebFetch(domain:example.com)` | Matches fetch requests to example.com |

222 205 

223#### Wildcard patterns206For the complete rule syntax reference, including wildcard behavior, tool-specific patterns for Read, Edit, WebFetch, MCP, and Task rules, and security limitations of Bash patterns, see [Permission rule syntax](/en/permissions#permission-rule-syntax).

224 

225Bash rules support glob patterns with `*`. Wildcards can appear at any position in the command, including at the beginning, middle, or end. The following configuration allows npm and git commit commands while blocking git push:

226 

227```json theme={null}

228{

229 "permissions": {

230 "allow": [

231 "Bash(npm run *)",

232 "Bash(git commit *)",

233 "Bash(git * main)",

234 "Bash(* --version)",

235 "Bash(* --help *)"

236 ],

237 "deny": [

238 "Bash(git push *)"

239 ]

240 }

241}

242```

243 

244The space before `*` matters: `Bash(ls *)` matches `ls -la` but not `lsof`, while `Bash(ls*)` matches both. The legacy `:*` suffix syntax (e.g., `Bash(npm run:*)`) is equivalent to ` *` but is deprecated.

245 

246<Warning>

247 Bash permission patterns that try to constrain command arguments are fragile. For example, `Bash(curl http://github.com/ *)` intends to restrict curl to GitHub URLs, but won't match `curl -X GET http://github.com/...` (flags before URL), `curl https://github.com/...` (different protocol), or commands using shell variables. Do not rely on argument-constraining patterns as a security boundary. See [Bash permission limitations](/en/iam#tool-specific-permission-rules) for alternatives.

248</Warning>

249 

250For detailed information about tool-specific permission patterns—including Read, Edit, WebFetch, MCP, Task rules, and Bash permission limitations—see [Tool-specific permission rules](/en/iam#tool-specific-permission-rules).

251 207 

252### Sandbox settings208### Sandbox settings

253 209 


547 503 

548#### `strictKnownMarketplaces`504#### `strictKnownMarketplaces`

549 505 

550**Managed settings only**: Controls which plugin marketplaces users are allowed to add. This setting can only be configured in [`managed-settings.json`](/en/iam#managed-settings) and provides administrators with strict control over marketplace sources.506**Managed settings only**: Controls which plugin marketplaces users are allowed to add. This setting can only be configured in [`managed-settings.json`](/en/permissions#managed-settings) and provides administrators with strict control over marketplace sources.

551 507 

552**Managed settings file locations**:508**Managed settings file locations**:

553 509 


785</Note>741</Note>

786 742 

787| Variable | Purpose | |743| Variable | Purpose | |

788| :--------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |744| :--------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |

789| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) | |745| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) | |

790| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) | |746| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) | |

791| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers) | |747| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers) | |


805| `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](/en/statusline) | |761| `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](/en/statusline) | |

806| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command | |762| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command | |

807| `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD` | Set to `1` to load CLAUDE.md files from directories specified with `--add-dir`. By default, additional directories do not load memory files | `1` |763| `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD` | Set to `1` to load CLAUDE.md files from directories specified with `--add-dir`. By default, additional directories do not load memory files | `1` |

764| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` | Set to `1` to enable [agent teams](/en/agent-teams). Agent teams are experimental and disabled by default | |

808| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) | |765| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) | |

809| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication | |766| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication | |

810| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) | |767| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) | |

811| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication | |768| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication | |

769| `CLAUDE_CODE_EFFORT_LEVEL` | Set the effort level for supported models. Values: `low`, `medium`, `high` (default). Lower effort is faster and cheaper, higher effort provides deeper reasoning. Currently supported with Opus 4.6 only. See [Adjust effort level](/en/model-config#adjust-effort-level) | |

812| `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 | |770| `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 | |

771| `CLAUDE_CODE_DISABLE_AUTO_MEMORY` | Set to `1` to disable [auto memory](/en/memory#auto-memory). Set to `0` to force auto memory on during the gradual rollout. When disabled, Claude does not create or load auto memory files | |

813| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut | |772| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut | |

773| `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` | Set to `1` to disable the "How is Claude doing?" session quality surveys. Also disabled when using third-party providers or when telemetry is disabled. See [Session quality surveys](/en/data-usage#session-quality-surveys) | |

814| `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` | Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode | |774| `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` | Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode | |

815| `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` | Set to `true` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution | |775| `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` | Set to `true` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution | |

816| `CLAUDE_CODE_TASK_LIST_ID` | Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list. See [Task list](/en/interactive-mode#task-list) | |776| `CLAUDE_CODE_TASK_LIST_ID` | Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list. See [Task list](/en/interactive-mode#task-list) | |

777| `CLAUDE_CODE_TEAM_NAME` | Name of the agent team this teammate belongs to. Set automatically on [agent team](/en/agent-teams) members | |

817| `CLAUDE_CODE_TMPDIR` | Override the temp directory used for internal temp files. Claude Code appends `/claude/` to this path. Default: `/tmp` on Unix/macOS, `os.tmpdir()` on Windows | |778| `CLAUDE_CODE_TMPDIR` | Override the temp directory used for internal temp files. Claude Code appends `/claude/` to this path. Default: `/tmp` on Unix/macOS, `os.tmpdir()` on Windows | |

818| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` | |779| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` | |

819| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context | |780| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context | |

781| `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION` | Set to `false` to disable prompt suggestions (the "Prompt suggestions" toggle in `/config`). These are the grayed-out predictions that appear in your prompt input after Claude responds. See [Prompt suggestions](/en/interactive-mode#prompt-suggestions) | |

820| `CLAUDE_CODE_ENABLE_TASKS` | Set to `false` to temporarily revert to the previous TODO list instead of the task tracking system. Default: `true`. See [Task list](/en/interactive-mode#task-list) | |782| `CLAUDE_CODE_ENABLE_TASKS` | Set to `false` to temporarily revert to the previous TODO list instead of the task tracking system. Default: `true`. See [Task list](/en/interactive-mode#task-list) | |

821| `CLAUDE_CODE_ENABLE_TELEMETRY` | Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. See [Monitoring](/en/monitoring-usage) | |783| `CLAUDE_CODE_ENABLE_TELEMETRY` | Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. See [Monitoring](/en/monitoring-usage) | |

822| `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS` | Override the default token limit for file reads. Useful when you need to read larger files in full | |784| `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS` | Override the default token limit for file reads. Useful when you need to read larger files in full | |


824| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions | |786| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions | |

825| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests. Default: 32,000. Maximum: 64,000. Increasing this value reduces the effective context window available before [auto-compaction](/en/costs#reduce-token-usage) triggers. | |787| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests. Default: 32,000. Maximum: 64,000. Increasing this value reduces the effective context window available before [auto-compaction](/en/costs#reduce-token-usage) triggers. | |

826| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) | |788| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) | |

789| `CLAUDE_CODE_PLAN_MODE_REQUIRED` | Auto-set to `true` on [agent team](/en/agent-teams) teammates that require plan approval. Read-only: set by Claude Code when spawning teammates. See [require plan approval](/en/agent-teams#require-plan-approval-for-teammates) | |

827| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) | |790| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) | |

828| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` | |791| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` | |

829| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) | |792| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) | |


851| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections | |814| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections | |

852| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization from the UI, skips onboarding, and hides internal commands. Useful for streaming or recording sessions | |815| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization from the UI, skips onboarding, and hides internal commands. Useful for streaming or recording sessions | |

853| `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) | |816| `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) | |

854| `MAX_THINKING_TOKENS` | Override the [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) token budget. Thinking is enabled at max budget (31,999 tokens) by default. Use this to limit the budget (for example, `MAX_THINKING_TOKENS=10000`) or disable thinking entirely (`MAX_THINKING_TOKENS=0`). Extended thinking improves performance on complex reasoning and coding tasks but impacts [prompt caching efficiency](https://docs.claude.com/en/docs/build-with-claude/prompt-caching#caching-with-thinking-blocks). | |817| `MAX_THINKING_TOKENS` | Override the [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) token budget. Thinking is enabled at max budget (31,999 tokens) by default. Use this to limit the budget (for example, `MAX_THINKING_TOKENS=10000`) or disable thinking entirely (`MAX_THINKING_TOKENS=0`). For Opus 4.6, thinking depth is controlled by [effort level](/en/model-config#adjust-effort-level) instead, and this variable is ignored unless set to `0` to disable thinking. | |

818| `MCP_CLIENT_SECRET` | OAuth client secret for MCP servers that require [pre-configured credentials](/en/mcp#use-pre-configured-oauth-credentials). Avoids the interactive prompt when adding a server with `--client-secret` | |

819| `MCP_OAUTH_CALLBACK_PORT` | Fixed port for the OAuth redirect callback, as an alternative to `--callback-port` when adding an MCP server with [pre-configured credentials](/en/mcp#use-pre-configured-oauth-credentials) | |

855| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup | |820| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup | |

856| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution | |821| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution | |

857| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy | |822| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy | |

858| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for skill metadata shown to the [Skill tool](/en/skills#control-who-invokes-a-skill) (default: 15000). Legacy name kept for backwards compatibility. | |823| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Override the character budget for skill metadata shown to the [Skill tool](/en/skills#control-who-invokes-a-skill). The budget scales dynamically at 2% of the context window, with a fallback of 16,000 characters. Legacy name kept for backwards compatibility | |

859| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code | |824| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code | |

860| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI | |825| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI | |

861| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI | |826| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI | |


891| **Write** | Creates or overwrites files | Yes |856| **Write** | Creates or overwrites files | Yes |

892| **LSP** | Code intelligence via language servers. Reports type errors and warnings automatically after file edits. Also supports navigation operations: jump to definitions, find references, get type info, list symbols, find implementations, trace call hierarchies. Requires a [code intelligence plugin](/en/discover-plugins#code-intelligence) and its language server binary | No |857| **LSP** | Code intelligence via language servers. Reports type errors and warnings automatically after file edits. Also supports navigation operations: jump to definitions, find references, get type info, list symbols, find implementations, trace call hierarchies. Requires a [code intelligence plugin](/en/discover-plugins#code-intelligence) and its language server binary | No |

893 858 

894Permission 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).859Permission rules can be configured using `/allowed-tools` or in [permission settings](/en/settings#available-settings). Also see [Tool-specific permission rules](/en/permissions#tool-specific-permission-rules).

895 860 

896### Bash tool behavior861### Bash tool behavior

897 862 


966 931 

967## See also932## See also

968 933 

969* [Identity and Access Management](/en/iam#configuring-permissions) - Permission system overview and how allow/ask/deny rules interact934* [Permissions](/en/permissions): permission system, rule syntax, tool-specific patterns, and managed policies

970* [Tool-specific permission rules](/en/iam#tool-specific-permission-rules) - Detailed patterns for Bash, Read, Edit, WebFetch, MCP, and Task tools, including security limitations935* [Authentication](/en/authentication): set up user access to Claude Code

971* [Managed settings](/en/iam#managed-settings) - Managed policy configuration for organizations936* [Troubleshooting](/en/troubleshooting): solutions for common configuration issues

972* [Troubleshooting](/en/troubleshooting) - Solutions for common configuration issues

setup.md +20 −5

Details

8 8 

9## System requirements9## System requirements

10 10 

11* **Operating Systems**: macOS 13.0+, Ubuntu 20.04+/Debian 10+, or Windows 10 1809+ / Windows Server 2019+ (with WSL 1, WSL 2, or Git for Windows)11* **Operating System**:

12 * macOS 13.0+

13 * Windows 10 1809+ or Windows Server 2019+ ([see setup notes](#platform-specific-setup))

14 * Ubuntu 20.04+

15 * Debian 10+

16 * Alpine Linux 3.19+ ([additional dependencies required](#platform-specific-setup))

12* **Hardware**: 4 GB+ RAM17* **Hardware**: 4 GB+ RAM

13* **Network**: Internet connection required (see [network configuration](/en/network-config#network-access-requirements))18* **Network**: Internet connection required (see [network configuration](/en/network-config#network-access-requirements))

14* **Shell**: Works best in Bash or Zsh19* **Shell**: Works best in Bash or Zsh


82 Run `claude doctor` after installation to check your installation type and version.87 Run `claude doctor` after installation to check your installation type and version.

83</Tip>88</Tip>

84 89 

85<Note>90### Platform-specific setup

86 **Alpine Linux and other musl/uClibc-based distributions**: The native installer requires `libgcc`, `libstdc++`, and `ripgrep`. For Alpine: `apk add libgcc libstdc++ ripgrep`. Set `USE_BUILTIN_RIPGREP=0`.91 

87</Note>92**Windows**: Run Claude Code natively (requires [Git Bash](https://git-scm.com/downloads/win)) or inside WSL. Both WSL 1 and WSL 2 are supported, but WSL 1 has limited support and does not support features like Bash tool sandboxing.

93 

94**Alpine Linux and other musl/uClibc-based distributions**:

95 

96The native installer on Alpine and other musl/uClibc-based distributions requires `libgcc`, `libstdc++`, and `ripgrep`. Install these using your distribution's package manager, then set `USE_BUILTIN_RIPGREP=0`.

97 

98On Alpine:

99 

100```bash theme={null}

101apk add libgcc libstdc++ ripgrep

102```

88 103 

89### Authentication104### Authentication

90 105 


238}253}

239```254```

240 255 

241For enterprise deployments, you can enforce a consistent release channel across your organization using [managed settings](/en/iam#managed-settings).256For enterprise deployments, you can enforce a consistent release channel across your organization using [managed settings](/en/permissions#managed-settings).

242 257 

243### Disable auto-updates258### Disable auto-updates

244 259 

skills.md +16 −8

Details

77Where you store a skill determines who can use it:77Where you store a skill determines who can use it:

78 78 

79| Location | Path | Applies to |79| Location | Path | Applies to |

80| :--------- | :----------------------------------------------- | :----------------------------- |80| :--------- | :------------------------------------------------------- | :----------------------------- |

81| Enterprise | See [managed settings](/en/iam#managed-settings) | All users in your organization |81| Enterprise | See [managed settings](/en/permissions#managed-settings) | All users in your organization |

82| Personal | `~/.claude/skills/<skill-name>/SKILL.md` | All your projects |82| Personal | `~/.claude/skills/<skill-name>/SKILL.md` | All your projects |

83| Project | `.claude/skills/<skill-name>/SKILL.md` | This project only |83| Project | `.claude/skills/<skill-name>/SKILL.md` | This project only |

84| Plugin | `<plugin>/skills/<skill-name>/SKILL.md` | Where plugin is enabled |84| Plugin | `<plugin>/skills/<skill-name>/SKILL.md` | Where plugin is enabled |


107 Files in `.claude/commands/` still work and support the same [frontmatter](#frontmatter-reference). Skills are recommended since they support additional features like supporting files.107 Files in `.claude/commands/` still work and support the same [frontmatter](#frontmatter-reference). Skills are recommended since they support additional features like supporting files.

108</Note>108</Note>

109 109 

110#### Skills from additional directories

111 

112Skills defined in `.claude/skills/` within directories added via `--add-dir` are loaded automatically and picked up by live change detection, so you can edit them during a session without restarting.

113 

114<Note>

115 CLAUDE.md files from `--add-dir` directories are not loaded by default. To load them, set `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1`. See [Load memory from additional directories](/en/memory#load-memory-from-additional-directories).

116</Note>

117 

110## Configure skills118## Configure skills

111 119 

112Skills are configured through YAML frontmatter at the top of `SKILL.md` and the markdown content that follows.120Skills are configured through YAML frontmatter at the top of `SKILL.md` and the markdown content that follows.


409 417 

410### Restrict Claude's skill access418### Restrict Claude's skill access

411 419 

412By default, Claude can invoke any skill that doesn't have `disable-model-invocation: true` set. Skills that define `allowed-tools` grant Claude access to those tools without per-use approval when the skill is active. Your [permission settings](/en/iam) still govern baseline approval behavior for all other tools. Built-in commands like `/compact` and `/init` are not available through the Skill tool.420By default, Claude can invoke any skill that doesn't have `disable-model-invocation: true` set. Skills that define `allowed-tools` grant Claude access to those tools without per-use approval when the skill is active. Your [permission settings](/en/permissions) still govern baseline approval behavior for all other tools. Built-in commands like `/compact` and `/init` are not available through the Skill tool.

413 421 

414Three ways to control which skills Claude can invoke:422Three ways to control which skills Claude can invoke:

415 423 


420Skill428Skill

421```429```

422 430 

423**Allow or deny specific skills** using [permission rules](/en/iam):431**Allow or deny specific skills** using [permission rules](/en/permissions):

424 432 

425```433```

426# Allow only specific skills434# Allow only specific skills


445 453 

446* **Project skills**: Commit `.claude/skills/` to version control454* **Project skills**: Commit `.claude/skills/` to version control

447* **Plugins**: Create a `skills/` directory in your [plugin](/en/plugins)455* **Plugins**: Create a `skills/` directory in your [plugin](/en/plugins)

448* **Managed**: Deploy organization-wide through [managed settings](/en/iam#managed-settings)456* **Managed**: Deploy organization-wide through [managed settings](/en/permissions#managed-settings)

449 457 

450### Generate visual output458### Generate visual output

451 459 


656 664 

657### Claude doesn't see all my skills665### Claude doesn't see all my skills

658 666 

659Skill descriptions are loaded into context so Claude knows what's available. If you have many skills, they may exceed the character budget (default 15,000 characters). Run `/context` to check for a warning about excluded skills.667Skill descriptions are loaded into context so Claude knows what's available. If you have many skills, they may exceed the character budget. The budget scales dynamically at 2% of the context window, with a fallback of 16,000 characters. Run `/context` to check for a warning about excluded skills.

660 668 

661To increase the limit, set the `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable.669To override the limit, set the `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable.

662 670 

663## Related resources671## Related resources

664 672 


667* **[Hooks](/en/hooks)**: automate workflows around tool events675* **[Hooks](/en/hooks)**: automate workflows around tool events

668* **[Memory](/en/memory)**: manage CLAUDE.md files for persistent context676* **[Memory](/en/memory)**: manage CLAUDE.md files for persistent context

669* **[Interactive mode](/en/interactive-mode#built-in-commands)**: built-in commands and shortcuts677* **[Interactive mode](/en/interactive-mode#built-in-commands)**: built-in commands and shortcuts

670* **[Permissions](/en/iam)**: control tool and skill access678* **[Permissions](/en/permissions)**: control tool and skill access

slack.md +27 −2

Details

64 In Code + Chat mode, if Claude routes a message to Chat but you wanted a coding session, you can click "Retry as Code" to create a Claude Code session instead. Similarly, if it's routed to Code but you wanted a Chat session, you can choose that option in that thread.64 In Code + Chat mode, if Claude routes a message to Chat but you wanted a coding session, you can click "Retry as Code" to create a Claude Code session instead. Similarly, if it's routed to Code but you wanted a Chat session, you can choose that option in that thread.

65 </Note>65 </Note>

66 </Step>66 </Step>

67 

68 <Step title="Add Claude to channels">

69 Claude is not automatically added to any channels after installation. To use Claude in a channel, invite it by typing `/invite @Claude` in that channel. Claude can only respond to @mentions in channels where it has been added.

70 </Step>

67</Steps>71</Steps>

68 72 

69## How it works73## How it works


127| Repository Access | Users can only access repositories they've personally connected |131| Repository Access | Users can only access repositories they've personally connected |

128| Session History | Sessions appear in your Claude Code history on claude.ai/code |132| Session History | Sessions appear in your Claude Code history on claude.ai/code |

129 133 

130### Workspace admin permissions134### Workspace-level access

135 

136Slack workspace administrators control whether the Claude app is available in their workspace:

137 

138| Control | Description |

139| :--------------------------- | :---------------------------------------------------------------------------------------------------------------- |

140| App installation | Workspace admins decide whether to install the Claude app from the Slack App Marketplace |

141| Enterprise Grid distribution | For Enterprise Grid organizations, organization admins can control which workspaces have access to the Claude app |

142| App removal | Removing the app from a workspace immediately revokes access for all users in that workspace |

131 143 

132Slack workspace administrators control whether the Claude app can be installed in the workspace. Individual users then authenticate with their own Claude accounts to use the integration.144### Channel-based access control

145 

146Claude is not automatically added to any channels after installation. Users must explicitly invite Claude to channels where they want to use it:

147 

148* **Invite required**: Type `/invite @Claude` in any channel to add Claude to that channel

149* **Channel membership controls access**: Claude can only respond to @mentions in channels where it has been added

150* **Access gating through channels**: Admins can control who uses Claude Code by managing which channels Claude is invited to and who has access to those channels

151* **Private channel support**: Claude works in both public and private channels, giving teams flexibility in controlling visibility

152 

153This channel-based model allows teams to restrict Claude Code usage to specific channels, providing an additional layer of access control beyond workspace-level permissions.

133 154 

134## What's accessible where155## What's accessible where

135 156 


137 158 

138**On the web**: The complete Claude Code session with full conversation history, all code changes, file operations, and the ability to continue the session or create pull requests.159**On the web**: The complete Claude Code session with full conversation history, all code changes, file operations, and the ability to continue the session or create pull requests.

139 160 

161For Enterprise and Teams accounts, sessions created from Claude in Slack are

162automatically visible to the organization. See [Claude Code on the Web sharing](/en/claude-code-on-the-web#sharing-sessions)

163for more details.

164 

140## Best practices165## Best practices

141 166 

142### Writing effective requests167### Writing effective requests

statusline.md +747 −166

Details

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.3> Use this file to discover all available pages before exploring further.

4 4 

5# Status line configuration5# Customize your status line

6 6 

7> Create a custom status line for Claude Code to display contextual information7> Configure a custom status bar to monitor context window usage, costs, and git status in Claude Code

8 8 

9Make Claude Code your own with a custom status line that displays at the bottom of the Claude Code interface, similar to how terminal prompts (PS1) work in shells like Oh-my-zsh.9The status line is a customizable bar at the bottom of Claude Code that runs any shell script you configure. It receives JSON session data on stdin and displays whatever your script prints, giving you a persistent, at-a-glance view of context usage, costs, git status, or anything else you want to track.

10 10 

11## Create a custom status line11Status lines are useful when you:

12 12 

13You can either:13* Want to monitor context window usage as you work

14* Need to track session costs

15* Work across multiple sessions and need to distinguish them

16* Want git branch and status always visible

14 17 

15* Run `/statusline` to ask Claude Code to help you set up a custom status line. By default, it will try to reproduce your terminal's prompt, but you can provide additional instructions about the behavior you want to Claude Code, such as `/statusline show the model name in orange`18Here's an example of a [multi-line status line](#display-multiple-lines) that displays git info on the first line and a color-coded context bar on the second.

16 19 

17* Directly add a `statusLine` command to your `.claude/settings.json`:20<Frame>

21 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=60f11387658acc9ff75158ae85f2ac87" alt="A multi-line status line showing model name, directory, git branch on the first line, and a context usage progress bar with cost and duration on the second line" data-og-width="776" width="776" data-og-height="212" height="212" data-path="images/statusline-multiline.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=2e448b44c332620e6c9c2be4ded992e5 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=f796af2db9c68ab2ddbc5136840b9551 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d29c13d6164773198a0b2c47b31f6c09 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d7720e5f51310185c0c02152f6c10d8b 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=b4e008cde27990a8d5783e41e5b93246 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=40ab24813303dc2e4c09f2675f3faf6e 2500w" />

22</Frame>

23 

24This page walks through [setting up a basic status line](#set-up-a-status-line), explains [how the data flows](#how-status-lines-work) from Claude Code to your script, lists [all the fields you can display](#available-data), and provides [ready-to-use examples](#examples) for common patterns like git status, cost tracking, and progress bars.

25 

26## Set up a status line

27 

28Use the [`/statusline` command](#use-the-statusline-command) to have Claude Code generate a script for you, or [manually create a script](#manually-configure-a-status-line) and add it to your settings.

29 

30### Use the /statusline command

31 

32The `/statusline` command accepts natural language instructions describing what you want displayed. Claude Code generates a script file in `~/.claude/` and updates your settings automatically:

33 

34```

35/statusline show model name and context percentage with a progress bar

36```

37 

38### Manually configure a status line

39 

40Add a `statusLine` field to your user settings (`~/.claude/settings.json`, where `~` is your home directory) or [project settings](/en/settings#settings-files). Set `type` to `"command"` and point `command` to a script path or an inline shell command. For a full walkthrough of creating a script, see [Build a status line step by step](#build-a-status-line-step-by-step).

18 41 

19```json theme={null}42```json theme={null}

20{43{

21 "statusLine": {44 "statusLine": {

22 "type": "command",45 "type": "command",

23 "command": "~/.claude/statusline.sh",46 "command": "~/.claude/statusline.sh",

24 "padding": 0 // Optional: set to 0 to let status line go to edge47 "padding": 2

48 }

49}

50```

51 

52The `command` field runs in a shell, so you can also use inline commands instead of a script file. This example uses `jq` to parse the JSON input and display the model name and context percentage:

53 

54```json theme={null}

55{

56 "statusLine": {

57 "type": "command",

58 "command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'"

25 }59 }

26}60}

27```61```

28 62 

29## How it Works63The optional `padding` field adds extra horizontal spacing (in characters) to the status line content. Defaults to `0`. This padding is in addition to the interface's built-in spacing, so it controls relative indentation rather than absolute distance from the terminal edge.

30 64 

31* The status line is updated when the conversation messages update65### Disable the status line

32* Updates run at most every 300 ms

33* The first line of stdout from your command becomes the status line text

34* ANSI color codes are supported for styling your status line

35* Claude Code passes contextual information about the current session (model, directories, etc.) as JSON to your script via stdin

36 66 

37## JSON Input Structure67Run `/statusline` and ask it to remove or clear your status line (e.g., `/statusline delete`, `/statusline clear`, `/statusline remove it`). You can also manually delete the `statusLine` field from your settings.json.

38 68 

39Your status line command receives structured data via stdin in JSON format:69## Build a status line step by step

40 70 

41```json theme={null}71This walkthrough shows what's happening under the hood by manually creating a status line that displays the current model, working directory, and context window usage percentage.

42{72 

43 "hook_event_name": "Status",73<Note>Running [`/statusline`](#use-the-statusline-command) with a description of what you want configures all of this for you automatically.</Note>

44 "session_id": "abc123...",74 

45 "transcript_path": "/path/to/transcript.json",75These examples use Bash scripts, which work on macOS and Linux. On Windows, you can run Bash scripts through [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install) or rewrite them in PowerShell.

76 

77<Frame>

78 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=696445e59ca0059213250651ad23db6b" alt="A status line showing model name, directory, and context percentage" data-og-width="726" width="726" data-og-height="164" height="164" data-path="images/statusline-quickstart.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=728c4bd06c8559cb46ddffffad983373 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=f9d28e0f8f48f695167dd1d632a6cf4f 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=57a2803a18cafe8cf1aa05619444f20c 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=52cdd52865842f0cda24489dd5310d3b 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=f8876ea1f72bf40bd0aeec483ee20164 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-quickstart.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=6b1524305c7c71122cde65d0c3822374 2500w" />

79</Frame>

80 

81<Steps>

82 <Step title="Create a script that reads JSON and prints output">

83 Claude Code sends JSON data to your script via stdin. This script uses [`jq`](https://jqlang.github.io/jq/), a command-line JSON parser you may need to install, to extract the model name, directory, and context percentage, then prints a formatted line.

84 

85 Save this to `~/.claude/statusline.sh` (where `~` is your home directory, such as `/Users/username` on macOS or `/home/username` on Linux):

86 

87 ```bash theme={null}

88 #!/bin/bash

89 # Read JSON data that Claude Code sends to stdin

90 input=$(cat)

91 

92 # Extract fields using jq

93 MODEL=$(echo "$input" | jq -r '.model.display_name')

94 DIR=$(echo "$input" | jq -r '.workspace.current_dir')

95 # The "// 0" provides a fallback if the field is null

96 PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)

97 

98 # Output the status line - ${DIR##*/} extracts just the folder name

99 echo "[$MODEL] 📁 ${DIR##*/} | ${PCT}% context"

100 ```

101 </Step>

102 

103 <Step title="Make it executable">

104 Mark the script as executable so your shell can run it:

105 

106 ```bash theme={null}

107 chmod +x ~/.claude/statusline.sh

108 ```

109 </Step>

110 

111 <Step title="Add to settings">

112 Tell Claude Code to run your script as the status line. Add this configuration to `~/.claude/settings.json`, which sets `type` to `"command"` (meaning "run this shell command") and points `command` to your script:

113 

114 ```json theme={null}

115 {

116 "statusLine": {

117 "type": "command",

118 "command": "~/.claude/statusline.sh"

119 }

120 }

121 ```

122 

123 Your status line appears at the bottom of the interface. Settings reload automatically, but changes won't appear until your next interaction with Claude Code.

124 </Step>

125</Steps>

126 

127## How status lines work

128 

129Claude Code runs your script and pipes [JSON session data](#available-data) to it via stdin. Your script reads the JSON, extracts what it needs, and prints text to stdout. Claude Code displays whatever your script prints.

130 

131**When it updates**

132 

133Your script runs after each new assistant message, when the permission mode changes, or when vim mode toggles. Updates are debounced at 300ms, meaning rapid changes batch together and your script runs once things settle. If a new update triggers while your script is still running, the in-flight execution is cancelled. If you edit your script, the changes won't appear until your next interaction with Claude Code triggers an update.

134 

135**What your script can output**

136 

137* **Multiple lines**: each `echo` or `print` statement displays as a separate row. See the [multi-line example](#display-multiple-lines).

138* **Colors**: use [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) like `\033[32m` for green (terminal must support them). See the [git status example](#git-status-with-colors).

139* **Links**: use [OSC 8 escape sequences](https://en.wikipedia.org/wiki/ANSI_escape_code#OSC) to make text clickable (Cmd+click on macOS, Ctrl+click on Windows/Linux). Requires a terminal that supports hyperlinks like iTerm2, Kitty, or WezTerm. See the [clickable links example](#clickable-links).

140 

141<Note>The status line runs locally and does not consume API tokens. It temporarily hides during certain UI interactions, including autocomplete suggestions, the help menu, and permission prompts.</Note>

142 

143## Available data

144 

145Claude Code sends the following JSON fields to your script via stdin:

146 

147| Field | Description |

148| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

149| `model.id`, `model.display_name` | Current model identifier and display name |

150| `cwd`, `workspace.current_dir` | Current working directory. Both fields contain the same value; `workspace.current_dir` is preferred for consistency with `workspace.project_dir`. |

151| `workspace.project_dir` | Directory where Claude Code was launched, which may differ from `cwd` if the working directory changes during a session |

152| `cost.total_cost_usd` | Total session cost in USD |

153| `cost.total_duration_ms` | Total wall-clock time since the session started, in milliseconds |

154| `cost.total_api_duration_ms` | Total time spent waiting for API responses in milliseconds |

155| `cost.total_lines_added`, `cost.total_lines_removed` | Lines of code changed |

156| `context_window.total_input_tokens`, `context_window.total_output_tokens` | Cumulative token counts across the session |

157| `context_window.context_window_size` | Maximum context window size in tokens. 200000 by default, or 1000000 for models with extended context. |

158| `context_window.used_percentage` | Pre-calculated percentage of context window used |

159| `context_window.remaining_percentage` | Pre-calculated percentage of context window remaining |

160| `context_window.current_usage` | Token counts from the last API call, described in [context window fields](#context-window-fields) |

161| `exceeds_200k_tokens` | Whether the total token count (input, cache, and output tokens combined) from the most recent API response exceeds 200k. This is a fixed threshold regardless of actual context window size. |

162| `session_id` | Unique session identifier |

163| `transcript_path` | Path to conversation transcript file |

164| `version` | Claude Code version |

165| `output_style.name` | Name of the current output style |

166| `vim.mode` | Current vim mode (`NORMAL` or `INSERT`) when [vim mode](/en/interactive-mode#vim-editor-mode) is enabled |

167| `agent.name` | Agent name when running with the `--agent` flag or agent settings configured |

168 

169<Accordion title="Full JSON schema">

170 Your status line command receives this JSON structure via stdin:

171 

172 ```json theme={null}

173 {

46 "cwd": "/current/working/directory",174 "cwd": "/current/working/directory",

175 "session_id": "abc123...",

176 "transcript_path": "/path/to/transcript.jsonl",

47 "model": {177 "model": {

48 "id": "claude-opus-4-1",178 "id": "claude-opus-4-6",

49 "display_name": "Opus"179 "display_name": "Opus"

50 },180 },

51 "workspace": {181 "workspace": {


67 "total_input_tokens": 15234,197 "total_input_tokens": 15234,

68 "total_output_tokens": 4521,198 "total_output_tokens": 4521,

69 "context_window_size": 200000,199 "context_window_size": 200000,

70 "used_percentage": 42.5,200 "used_percentage": 8,

71 "remaining_percentage": 57.5,201 "remaining_percentage": 92,

72 "current_usage": {202 "current_usage": {

73 "input_tokens": 8500,203 "input_tokens": 8500,

74 "output_tokens": 1200,204 "output_tokens": 1200,

75 "cache_creation_input_tokens": 5000,205 "cache_creation_input_tokens": 5000,

76 "cache_read_input_tokens": 2000206 "cache_read_input_tokens": 2000

77 }207 }

208 },

209 "exceeds_200k_tokens": false,

210 "vim": {

211 "mode": "NORMAL"

212 },

213 "agent": {

214 "name": "security-reviewer"

78 }215 }

79}216 }

80```217 ```

81 218 

82## Example Scripts219 **Fields that may be absent** (not present in JSON):

83 220 

84### Simple Status Line221 * `vim`: appears only when vim mode is enabled

222 * `agent`: appears only when running with the `--agent` flag or agent settings configured

85 223 

86```bash theme={null}224 **Fields that may be `null`**:

87#!/bin/bash

88# Read JSON input from stdin

89input=$(cat)

90 225 

91# Extract values using jq226 * `context_window.current_usage`: `null` before the first API call in a session

92MODEL_DISPLAY=$(echo "$input" | jq -r '.model.display_name')227 * `context_window.used_percentage`, `context_window.remaining_percentage`: may be `null` early in the session

93CURRENT_DIR=$(echo "$input" | jq -r '.workspace.current_dir')

94 228 

95echo "[$MODEL_DISPLAY] 📁 ${CURRENT_DIR##*/}"229 Handle missing fields with conditional access and null values with fallback defaults in your scripts.

96```230</Accordion>

231 

232### Context window fields

233 

234The `context_window` object provides two ways to track context usage:

235 

236* **Cumulative totals** (`total_input_tokens`, `total_output_tokens`): sum of all tokens across the entire session, useful for tracking total consumption

237* **Current usage** (`current_usage`): token counts from the most recent API call, use this for accurate context percentage since it reflects the actual context state

238 

239The `current_usage` object contains:

240 

241* `input_tokens`: input tokens in current context

242* `output_tokens`: output tokens generated

243* `cache_creation_input_tokens`: tokens written to cache

244* `cache_read_input_tokens`: tokens read from cache

245 

246The `used_percentage` field is calculated from input tokens only: `input_tokens + cache_creation_input_tokens + cache_read_input_tokens`. It does not include `output_tokens`.

247 

248If you calculate context percentage manually from `current_usage`, use the same input-only formula to match `used_percentage`.

249 

250The `current_usage` object is `null` before the first API call in a session.

251 

252## Examples

253 

254These examples show common status line patterns. To use any example:

255 

2561. Save the script to a file like `~/.claude/statusline.sh` (or `.py`/`.js`)

2572. Make it executable: `chmod +x ~/.claude/statusline.sh`

2583. Add the path to your [settings](#manually-configure-a-status-line)

259 

260The Bash examples use [`jq`](https://jqlang.github.io/jq/) to parse JSON. Python and Node.js have built-in JSON parsing.

261 

262### Context window usage

263 

264Display the current model and context window usage with a visual progress bar. Each script reads JSON from stdin, extracts the `used_percentage` field, and builds a 10-character bar where filled blocks (▓) represent usage:

265 

266<Frame>

267 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=15b58ab3602f036939145dde3165c6f7" alt="A status line showing model name and a progress bar with percentage" data-og-width="448" width="448" data-og-height="152" height="152" data-path="images/statusline-context-window-usage.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=a18fecd31f06b16e984b1ab3310acbc0 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=2f4b3caff156efede2ded995dbaf167f 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=8f6b8c7e7d3a999c570e96ad2ea13d5a 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d9334e6a08e6f11a253733c8592774a9 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=e79490da8f62952e4d92837c408e63dc 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-context-window-usage.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=6f7c9ef8e629a794969c54b24163f92d 2500w" />

268</Frame>

269 

270<CodeGroup>

271 ```bash Bash theme={null}

272 #!/bin/bash

273 # Read all of stdin into a variable

274 input=$(cat)

275 

276 # Extract fields with jq, "// 0" provides fallback for null

277 MODEL=$(echo "$input" | jq -r '.model.display_name')

278 PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)

279 

280 # Build progress bar: printf creates spaces, tr replaces with blocks

281 BAR_WIDTH=10

282 FILLED=$((PCT * BAR_WIDTH / 100))

283 EMPTY=$((BAR_WIDTH - FILLED))

284 BAR=""

285 [ "$FILLED" -gt 0 ] && BAR=$(printf "%${FILLED}s" | tr ' ' '▓')

286 [ "$EMPTY" -gt 0 ] && BAR="${BAR}$(printf "%${EMPTY}s" | tr ' ' '░')"

287 

288 echo "[$MODEL] $BAR $PCT%"

289 ```

290 

291 ```python Python theme={null}

292 #!/usr/bin/env python3

293 import json, sys

97 294 

98### Git-Aware Status Line295 # json.load reads and parses stdin in one step

296 data = json.load(sys.stdin)

297 model = data['model']['display_name']

298 # "or 0" handles null values

299 pct = int(data.get('context_window', {}).get('used_percentage', 0) or 0)

99 300 

100```bash theme={null}301 # String multiplication builds the bar

101#!/bin/bash302 filled = pct * 10 // 100

102# Read JSON input from stdin303 bar = '▓' * filled + '░' * (10 - filled)

103input=$(cat)

104 304 

105# Extract values using jq305 print(f"[{model}] {bar} {pct}%")

106MODEL_DISPLAY=$(echo "$input" | jq -r '.model.display_name')306 ```

107CURRENT_DIR=$(echo "$input" | jq -r '.workspace.current_dir')

108 307 

109# Show git branch if in a git repo308 ```javascript Node.js theme={null}

110GIT_BRANCH=""309 #!/usr/bin/env node

111if git rev-parse --git-dir > /dev/null 2>&1; then310 // Node.js reads stdin asynchronously with events

311 let input = '';

312 process.stdin.on('data', chunk => input += chunk);

313 process.stdin.on('end', () => {

314 const data = JSON.parse(input);

315 const model = data.model.display_name;

316 // Optional chaining (?.) safely handles null fields

317 const pct = Math.floor(data.context_window?.used_percentage || 0);

318 

319 // String.repeat() builds the bar

320 const filled = Math.floor(pct * 10 / 100);

321 const bar = '▓'.repeat(filled) + '░'.repeat(10 - filled);

322 

323 console.log(`[${model}] ${bar} ${pct}%`);

324 });

325 ```

326</CodeGroup>

327 

328### Git status with colors

329 

330Show git branch with color-coded indicators for staged and modified files. This script uses [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) for terminal colors: `\033[32m` is green, `\033[33m` is yellow, and `\033[0m` resets to default.

331 

332<Frame>

333 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=e656f34f90d1d9a1d0e220988914345f" alt="A status line showing model, directory, git branch, and colored indicators for staged and modified files" data-og-width="742" width="742" data-og-height="178" height="178" data-path="images/statusline-git-context.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=c1bced5f46afdc9aae549702591f8457 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=debe46a7a888234ec692751243bba492 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=3a069d5c8b0395908e42f0e295fd4854 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=26aff0978865756d5ea299a22e5e9afd 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d5ac1d59881e6f2032af053557dc4590 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-git-context.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=46febbf34b0ee646502d095433132709 2500w" />

334</Frame>

335 

336Each script checks if the current directory is a git repository, counts staged and modified files, and displays color-coded indicators:

337 

338<CodeGroup>

339 ```bash Bash theme={null}

340 #!/bin/bash

341 input=$(cat)

342 

343 MODEL=$(echo "$input" | jq -r '.model.display_name')

344 DIR=$(echo "$input" | jq -r '.workspace.current_dir')

345 

346 GREEN='\033[32m'

347 YELLOW='\033[33m'

348 RESET='\033[0m'

349 

350 if git rev-parse --git-dir > /dev/null 2>&1; then

112 BRANCH=$(git branch --show-current 2>/dev/null)351 BRANCH=$(git branch --show-current 2>/dev/null)

113 if [ -n "$BRANCH" ]; then352 STAGED=$(git diff --cached --numstat 2>/dev/null | wc -l | tr -d ' ')

114 GIT_BRANCH=" | 🌿 $BRANCH"353 MODIFIED=$(git diff --numstat 2>/dev/null | wc -l | tr -d ' ')

115 fi

116fi

117 354 

118echo "[$MODEL_DISPLAY] 📁 ${CURRENT_DIR##*/}$GIT_BRANCH"355 GIT_STATUS=""

119```356 [ "$STAGED" -gt 0 ] && GIT_STATUS="${GREEN}+${STAGED}${RESET}"

357 [ "$MODIFIED" -gt 0 ] && GIT_STATUS="${GIT_STATUS}${YELLOW}~${MODIFIED}${RESET}"

120 358 

121### Python Example359 echo -e "[$MODEL] 📁 ${DIR##*/} | 🌿 $BRANCH $GIT_STATUS"

360 else

361 echo "[$MODEL] 📁 ${DIR##*/}"

362 fi

363 ```

122 364 

123```python theme={null}365 ```python Python theme={null}

124#!/usr/bin/env python3366 #!/usr/bin/env python3

125import json367 import json, sys, subprocess, os

126import sys

127import os

128 368 

129# Read JSON from stdin369 data = json.load(sys.stdin)

130data = json.load(sys.stdin)370 model = data['model']['display_name']

371 directory = os.path.basename(data['workspace']['current_dir'])

131 372 

132# Extract values373 GREEN, YELLOW, RESET = '\033[32m', '\033[33m', '\033[0m'

133model = data['model']['display_name']

134current_dir = os.path.basename(data['workspace']['current_dir'])

135 374 

136# Check for git branch

137git_branch = ""

138if os.path.exists('.git'):

139 try:375 try:

140 with open('.git/HEAD', 'r') as f:376 subprocess.check_output(['git', 'rev-parse', '--git-dir'], stderr=subprocess.DEVNULL)

141 ref = f.read().strip()377 branch = subprocess.check_output(['git', 'branch', '--show-current'], text=True).strip()

142 if ref.startswith('ref: refs/heads/'):378 staged_output = subprocess.check_output(['git', 'diff', '--cached', '--numstat'], text=True).strip()

143 git_branch = f" | 🌿 {ref.replace('ref: refs/heads/', '')}"379 modified_output = subprocess.check_output(['git', 'diff', '--numstat'], text=True).strip()

380 staged = len(staged_output.split('\n')) if staged_output else 0

381 modified = len(modified_output.split('\n')) if modified_output else 0

382 

383 git_status = f"{GREEN}+{staged}{RESET}" if staged else ""

384 git_status += f"{YELLOW}~{modified}{RESET}" if modified else ""

385 

386 print(f"[{model}] 📁 {directory} | 🌿 {branch} {git_status}")

144 except:387 except:

145 pass388 print(f"[{model}] 📁 {directory}")

389 ```

146 390 

147print(f"[{model}] 📁 {current_dir}{git_branch}")391 ```javascript Node.js theme={null}

148```392 #!/usr/bin/env node

393 const { execSync } = require('child_process');

394 const path = require('path');

149 395 

150### Node.js Example396 let input = '';

397 process.stdin.on('data', chunk => input += chunk);

398 process.stdin.on('end', () => {

399 const data = JSON.parse(input);

400 const model = data.model.display_name;

401 const dir = path.basename(data.workspace.current_dir);

402 

403 const GREEN = '\x1b[32m', YELLOW = '\x1b[33m', RESET = '\x1b[0m';

151 404 

152```javascript theme={null}405 try {

153#!/usr/bin/env node406 execSync('git rev-parse --git-dir', { stdio: 'ignore' });

407 const branch = execSync('git branch --show-current', { encoding: 'utf8' }).trim();

408 const staged = execSync('git diff --cached --numstat', { encoding: 'utf8' }).trim().split('\n').filter(Boolean).length;

409 const modified = execSync('git diff --numstat', { encoding: 'utf8' }).trim().split('\n').filter(Boolean).length;

410 

411 let gitStatus = staged ? `${GREEN}+${staged}${RESET}` : '';

412 gitStatus += modified ? `${YELLOW}~${modified}${RESET}` : '';

154 413 

155const fs = require('fs');414 console.log(`[${model}] 📁 ${dir} | 🌿 ${branch} ${gitStatus}`);

156const path = require('path');415 } catch {

416 console.log(`[${model}] 📁 ${dir}`);

417 }

418 });

419 ```

420</CodeGroup>

157 421 

158// Read JSON from stdin422### Cost and duration tracking

159let input = '';423 

160process.stdin.on('data', chunk => input += chunk);424Track your session's API costs and elapsed time. The `cost.total_cost_usd` field accumulates the cost of all API calls in the current session. The `cost.total_duration_ms` field measures total elapsed time since the session started, while `cost.total_api_duration_ms` tracks only the time spent waiting for API responses.

161process.stdin.on('end', () => {425 

426Each script formats cost as currency and converts milliseconds to minutes and seconds:

427 

428<Frame>

429 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=e3444a51fe6f3440c134bd5f1f08ad29" alt="A status line showing model name, session cost, and duration" data-og-width="588" width="588" data-og-height="180" height="180" data-path="images/statusline-cost-tracking.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=b1d35fa8acd792f559b6b1662ed10204 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=a3ed4330c3645fc28b87a6cab55be0b7 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=386ee2ed68a7d520eba20eac54f7fe52 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=479c2515e53f46d5d1da3b87a6dd993a 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=1340c7589a4cb89ec071234aba3571d1 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-cost-tracking.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=69056cf4fe3271770cac4dc1704bcd0a 2500w" />

430</Frame>

431 

432<CodeGroup>

433 ```bash Bash theme={null}

434 #!/bin/bash

435 input=$(cat)

436 

437 MODEL=$(echo "$input" | jq -r '.model.display_name')

438 COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')

439 DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')

440 

441 COST_FMT=$(printf '$%.2f' "$COST")

442 DURATION_SEC=$((DURATION_MS / 1000))

443 MINS=$((DURATION_SEC / 60))

444 SECS=$((DURATION_SEC % 60))

445 

446 echo "[$MODEL] 💰 $COST_FMT | ⏱️ ${MINS}m ${SECS}s"

447 ```

448 

449 ```python Python theme={null}

450 #!/usr/bin/env python3

451 import json, sys

452 

453 data = json.load(sys.stdin)

454 model = data['model']['display_name']

455 cost = data.get('cost', {}).get('total_cost_usd', 0) or 0

456 duration_ms = data.get('cost', {}).get('total_duration_ms', 0) or 0

457 

458 duration_sec = duration_ms // 1000

459 mins, secs = duration_sec // 60, duration_sec % 60

460 

461 print(f"[{model}] 💰 ${cost:.2f} | ⏱️ {mins}m {secs}s")

462 ```

463 

464 ```javascript Node.js theme={null}

465 #!/usr/bin/env node

466 let input = '';

467 process.stdin.on('data', chunk => input += chunk);

468 process.stdin.on('end', () => {

162 const data = JSON.parse(input);469 const data = JSON.parse(input);

470 const model = data.model.display_name;

471 const cost = data.cost?.total_cost_usd || 0;

472 const durationMs = data.cost?.total_duration_ms || 0;

473 

474 const durationSec = Math.floor(durationMs / 1000);

475 const mins = Math.floor(durationSec / 60);

476 const secs = durationSec % 60;

477 

478 console.log(`[${model}] 💰 $${cost.toFixed(2)} | ⏱️ ${mins}m ${secs}s`);

479 });

480 ```

481</CodeGroup>

482 

483### Display multiple lines

484 

485Your script can output multiple lines to create a richer display. Each `echo` statement produces a separate row in the status area.

486 

487<Frame>

488 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=60f11387658acc9ff75158ae85f2ac87" alt="A multi-line status line showing model name, directory, git branch on the first line, and a context usage progress bar with cost and duration on the second line" data-og-width="776" width="776" data-og-height="212" height="212" data-path="images/statusline-multiline.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=2e448b44c332620e6c9c2be4ded992e5 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=f796af2db9c68ab2ddbc5136840b9551 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d29c13d6164773198a0b2c47b31f6c09 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d7720e5f51310185c0c02152f6c10d8b 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=b4e008cde27990a8d5783e41e5b93246 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-multiline.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=40ab24813303dc2e4c09f2675f3faf6e 2500w" />

489</Frame>

490 

491This example combines several techniques: threshold-based colors (green under 70%, yellow 70-89%, red 90%+), a progress bar, and git branch info. Each `print` or `echo` statement creates a separate row:

492 

493<CodeGroup>

494 ```bash Bash theme={null}

495 #!/bin/bash

496 input=$(cat)

497 

498 MODEL=$(echo "$input" | jq -r '.model.display_name')

499 DIR=$(echo "$input" | jq -r '.workspace.current_dir')

500 COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')

501 PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)

502 DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')

503 

504 CYAN='\033[36m'; GREEN='\033[32m'; YELLOW='\033[33m'; RED='\033[31m'; RESET='\033[0m'

505 

506 # Pick bar color based on context usage

507 if [ "$PCT" -ge 90 ]; then BAR_COLOR="$RED"

508 elif [ "$PCT" -ge 70 ]; then BAR_COLOR="$YELLOW"

509 else BAR_COLOR="$GREEN"; fi

510 

511 FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))

512 BAR=$(printf "%${FILLED}s" | tr ' ' '█')$(printf "%${EMPTY}s" | tr ' ' '░')

513 

514 MINS=$((DURATION_MS / 60000)); SECS=$(((DURATION_MS % 60000) / 1000))

515 

516 BRANCH=""

517 git rev-parse --git-dir > /dev/null 2>&1 && BRANCH=" | 🌿 $(git branch --show-current 2>/dev/null)"

163 518 

164 // Extract values519 echo -e "${CYAN}[$MODEL]${RESET} 📁 ${DIR##*/}$BRANCH"

520 COST_FMT=$(printf '$%.2f' "$COST")

521 echo -e "${BAR_COLOR}${BAR}${RESET} ${PCT}% | ${YELLOW}${COST_FMT}${RESET} | ⏱️ ${MINS}m ${SECS}s"

522 ```

523 

524 ```python Python theme={null}

525 #!/usr/bin/env python3

526 import json, sys, subprocess, os

527 

528 data = json.load(sys.stdin)

529 model = data['model']['display_name']

530 directory = os.path.basename(data['workspace']['current_dir'])

531 cost = data.get('cost', {}).get('total_cost_usd', 0) or 0

532 pct = int(data.get('context_window', {}).get('used_percentage', 0) or 0)

533 duration_ms = data.get('cost', {}).get('total_duration_ms', 0) or 0

534 

535 CYAN, GREEN, YELLOW, RED, RESET = '\033[36m', '\033[32m', '\033[33m', '\033[31m', '\033[0m'

536 

537 bar_color = RED if pct >= 90 else YELLOW if pct >= 70 else GREEN

538 filled = pct // 10

539 bar = '█' * filled + '░' * (10 - filled)

540 

541 mins, secs = duration_ms // 60000, (duration_ms % 60000) // 1000

542 

543 try:

544 branch = subprocess.check_output(['git', 'branch', '--show-current'], text=True, stderr=subprocess.DEVNULL).strip()

545 branch = f" | 🌿 {branch}" if branch else ""

546 except:

547 branch = ""

548 

549 print(f"{CYAN}[{model}]{RESET} 📁 {directory}{branch}")

550 print(f"{bar_color}{bar}{RESET} {pct}% | {YELLOW}${cost:.2f}{RESET} | ⏱️ {mins}m {secs}s")

551 ```

552 

553 ```javascript Node.js theme={null}

554 #!/usr/bin/env node

555 const { execSync } = require('child_process');

556 const path = require('path');

557 

558 let input = '';

559 process.stdin.on('data', chunk => input += chunk);

560 process.stdin.on('end', () => {

561 const data = JSON.parse(input);

165 const model = data.model.display_name;562 const model = data.model.display_name;

166 const currentDir = path.basename(data.workspace.current_dir);563 const dir = path.basename(data.workspace.current_dir);

564 const cost = data.cost?.total_cost_usd || 0;

565 const pct = Math.floor(data.context_window?.used_percentage || 0);

566 const durationMs = data.cost?.total_duration_ms || 0;

567 

568 const CYAN = '\x1b[36m', GREEN = '\x1b[32m', YELLOW = '\x1b[33m', RED = '\x1b[31m', RESET = '\x1b[0m';

167 569 

168 // Check for git branch570 const barColor = pct >= 90 ? RED : pct >= 70 ? YELLOW : GREEN;

169 let gitBranch = '';571 const filled = Math.floor(pct / 10);

572 const bar = '█'.repeat(filled) + '░'.repeat(10 - filled);

573 

574 const mins = Math.floor(durationMs / 60000);

575 const secs = Math.floor((durationMs % 60000) / 1000);

576 

577 let branch = '';

170 try {578 try {

171 const headContent = fs.readFileSync('.git/HEAD', 'utf8').trim();579 branch = execSync('git branch --show-current', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();

172 if (headContent.startsWith('ref: refs/heads/')) {580 branch = branch ? ` | 🌿 ${branch}` : '';

173 gitBranch = ` | 🌿 ${headContent.replace('ref: refs/heads/', '')}`;581 } catch {}

174 }582 

175 } catch (e) {583 console.log(`${CYAN}[${model}]${RESET} 📁 ${dir}${branch}`);

176 // Not a git repo or can't read HEAD584 console.log(`${barColor}${bar}${RESET} ${pct}% | ${YELLOW}$${cost.toFixed(2)}${RESET} | ⏱️ ${mins}m ${secs}s`);

585 });

586 ```

587</CodeGroup>

588 

589### Clickable links

590 

591This example creates a clickable link to your GitHub repository. It reads the git remote URL, converts SSH format to HTTPS with `sed`, and wraps the repo name in OSC 8 escape codes. Hold Cmd (macOS) or Ctrl (Windows/Linux) and click to open the link in your browser.

592 

593<Frame>

594 <img src="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=4bcc6e7deb7cf52f41ab85a219b52661" alt="A status line showing a clickable link to a GitHub repository" data-og-width="726" width="726" data-og-height="198" height="198" data-path="images/statusline-links.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?w=280&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=9386f78056f7be99599bcefe9e838180 280w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?w=560&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=d748012a0866c37dddc6babd4b7a88c4 560w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?w=840&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=bade8fbfcde957c1033c376c58b89131 840w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?w=1100&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=9f7e0c729ea093c3b39682619fd3f201 1100w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?w=1650&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=ccec17e90a89d82381888a4a9a8fa40e 1650w, https://mintcdn.com/claude-code/nibzesLaJVh4ydOq/images/statusline-links.png?w=2500&fit=max&auto=format&n=nibzesLaJVh4ydOq&q=85&s=4d2e34a4d2f24e174cae1256c84f9a52 2500w" />

595</Frame>

596 

597Each script gets the git remote URL, converts SSH format to HTTPS, and wraps the repo name in OSC 8 escape codes. The Bash version uses `printf '%b'` which interprets backslash escapes more reliably than `echo -e` across different shells:

598 

599<CodeGroup>

600 ```bash Bash theme={null}

601 #!/bin/bash

602 input=$(cat)

603 

604 MODEL=$(echo "$input" | jq -r '.model.display_name')

605 

606 # Convert git SSH URL to HTTPS

607 REMOTE=$(git remote get-url origin 2>/dev/null | sed 's/git@github.com:/https:\/\/github.com\//' | sed 's/\.git$//')

608 

609 if [ -n "$REMOTE" ]; then

610 REPO_NAME=$(basename "$REMOTE")

611 # OSC 8 format: \e]8;;URL\a then TEXT then \e]8;;\a

612 # printf %b interprets escape sequences reliably across shells

613 printf '%b' "[$MODEL] 🔗 \e]8;;${REMOTE}\a${REPO_NAME}\e]8;;\a\n"

614 else

615 echo "[$MODEL]"

616 fi

617 ```

618 

619 ```python Python theme={null}

620 #!/usr/bin/env python3

621 import json, sys, subprocess, re, os

622 

623 data = json.load(sys.stdin)

624 model = data['model']['display_name']

625 

626 # Get git remote URL

627 try:

628 remote = subprocess.check_output(

629 ['git', 'remote', 'get-url', 'origin'],

630 stderr=subprocess.DEVNULL, text=True

631 ).strip()

632 # Convert SSH to HTTPS format

633 remote = re.sub(r'^git@github\.com:', 'https://github.com/', remote)

634 remote = re.sub(r'\.git$', '', remote)

635 repo_name = os.path.basename(remote)

636 # OSC 8 escape sequences

637 link = f"\033]8;;{remote}\a{repo_name}\033]8;;\a"

638 print(f"[{model}] 🔗 {link}")

639 except:

640 print(f"[{model}]")

641 ```

642 

643 ```javascript Node.js theme={null}

644 #!/usr/bin/env node

645 const { execSync } = require('child_process');

646 const path = require('path');

647 

648 let input = '';

649 process.stdin.on('data', chunk => input += chunk);

650 process.stdin.on('end', () => {

651 const data = JSON.parse(input);

652 const model = data.model.display_name;

653 

654 try {

655 let remote = execSync('git remote get-url origin', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();

656 // Convert SSH to HTTPS format

657 remote = remote.replace(/^git@github\.com:/, 'https://github.com/').replace(/\.git$/, '');

658 const repoName = path.basename(remote);

659 // OSC 8 escape sequences

660 const link = `\x1b]8;;${remote}\x07${repoName}\x1b]8;;\x07`;

661 console.log(`[${model}] 🔗 ${link}`);

662 } catch {

663 console.log(`[${model}]`);

177 }664 }

665 });

666 ```

667</CodeGroup>

178 668 

179 console.log(`[${model}] 📁 ${currentDir}${gitBranch}`);669### Cache expensive operations

180});

181```

182 670 

183### Helper Function Approach671Your status line script runs frequently during active sessions. Commands like `git status` or `git diff` can be slow, especially in large repositories. This example caches git information to a temp file and only refreshes it every 5 seconds.

184 

185For more complex bash scripts, you can create helper functions:

186 

187```bash theme={null}

188#!/bin/bash

189# Read JSON input once

190input=$(cat)

191 

192# Helper functions for common extractions

193get_model_name() { echo "$input" | jq -r '.model.display_name'; }

194get_current_dir() { echo "$input" | jq -r '.workspace.current_dir'; }

195get_project_dir() { echo "$input" | jq -r '.workspace.project_dir'; }

196get_version() { echo "$input" | jq -r '.version'; }

197get_cost() { echo "$input" | jq -r '.cost.total_cost_usd'; }

198get_duration() { echo "$input" | jq -r '.cost.total_duration_ms'; }

199get_lines_added() { echo "$input" | jq -r '.cost.total_lines_added'; }

200get_lines_removed() { echo "$input" | jq -r '.cost.total_lines_removed'; }

201get_input_tokens() { echo "$input" | jq -r '.context_window.total_input_tokens'; }

202get_output_tokens() { echo "$input" | jq -r '.context_window.total_output_tokens'; }

203get_context_window_size() { echo "$input" | jq -r '.context_window.context_window_size'; }

204 

205# Use the helpers

206MODEL=$(get_model_name)

207DIR=$(get_current_dir)

208echo "[$MODEL] 📁 ${DIR##*/}"

209```

210 672 

211### Context Window Usage673Use a stable, fixed filename for the cache file like `/tmp/statusline-git-cache`. Each status line invocation runs as a new process, so process-based identifiers like `$$`, `os.getpid()`, or `process.pid` produce a different value every time and the cache is never reused.

212 674 

213Display the percentage of context window consumed. The `context_window` object contains:675Each script checks if the cache file is missing or older than 5 seconds before running git commands:

214 676 

215* `total_input_tokens` / `total_output_tokens`: Cumulative totals across the entire session677<CodeGroup>

216* `used_percentage`: Pre-calculated percentage of context window used (0-100)678 ```bash Bash theme={null}

217* `remaining_percentage`: Pre-calculated percentage of context window remaining (0-100)679 #!/bin/bash

218* `current_usage`: Current context window usage from the last API call (may be `null` if no messages yet)680 input=$(cat)

219 * `input_tokens`: Input tokens in current context

220 * `output_tokens`: Output tokens generated

221 * `cache_creation_input_tokens`: Tokens written to cache

222 * `cache_read_input_tokens`: Tokens read from cache

223 681 

224You can use the pre-calculated `used_percentage` and `remaining_percentage` fields directly, or calculate from `current_usage` for more control.682 MODEL=$(echo "$input" | jq -r '.model.display_name')

683 DIR=$(echo "$input" | jq -r '.workspace.current_dir')

225 684 

226**Simple approach using pre-calculated percentages:**685 CACHE_FILE="/tmp/statusline-git-cache"

686 CACHE_MAX_AGE=5 # seconds

227 687 

228```bash theme={null}688 cache_is_stale() {

229#!/bin/bash689 [ ! -f "$CACHE_FILE" ] || \

230input=$(cat)690 # stat -f %m is macOS, stat -c %Y is Linux

691 [ $(($(date +%s) - $(stat -f %m "$CACHE_FILE" 2>/dev/null || stat -c %Y "$CACHE_FILE" 2>/dev/null || echo 0))) -gt $CACHE_MAX_AGE ]

692 }

231 693 

232MODEL=$(echo "$input" | jq -r '.model.display_name')694 if cache_is_stale; then

233PERCENT_USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0')695 if git rev-parse --git-dir > /dev/null 2>&1; then

696 BRANCH=$(git branch --show-current 2>/dev/null)

697 STAGED=$(git diff --cached --numstat 2>/dev/null | wc -l | tr -d ' ')

698 MODIFIED=$(git diff --numstat 2>/dev/null | wc -l | tr -d ' ')

699 echo "$BRANCH|$STAGED|$MODIFIED" > "$CACHE_FILE"

700 else

701 echo "||" > "$CACHE_FILE"

702 fi

703 fi

234 704 

235echo "[$MODEL] Context: ${PERCENT_USED}%"705 IFS='|' read -r BRANCH STAGED MODIFIED < "$CACHE_FILE"

236```

237 706 

238**Advanced approach with manual calculation:**707 if [ -n "$BRANCH" ]; then

708 echo "[$MODEL] 📁 ${DIR##*/} | 🌿 $BRANCH +$STAGED ~$MODIFIED"

709 else

710 echo "[$MODEL] 📁 ${DIR##*/}"

711 fi

712 ```

239 713 

240```bash theme={null}714 ```python Python theme={null}

241#!/bin/bash715 #!/usr/bin/env python3

242input=$(cat)716 import json, sys, subprocess, os, time

243 717 

244MODEL=$(echo "$input" | jq -r '.model.display_name')718 data = json.load(sys.stdin)

245CONTEXT_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size')719 model = data['model']['display_name']

246USAGE=$(echo "$input" | jq '.context_window.current_usage')720 directory = os.path.basename(data['workspace']['current_dir'])

247 721 

248if [ "$USAGE" != "null" ]; then722 CACHE_FILE = "/tmp/statusline-git-cache"

249 # Calculate current context from current_usage fields723 CACHE_MAX_AGE = 5 # seconds

250 CURRENT_TOKENS=$(echo "$USAGE" | jq '.input_tokens + .cache_creation_input_tokens + .cache_read_input_tokens')724 

251 PERCENT_USED=$((CURRENT_TOKENS * 100 / CONTEXT_SIZE))725 def cache_is_stale():

252 echo "[$MODEL] Context: ${PERCENT_USED}%"726 if not os.path.exists(CACHE_FILE):

253else727 return True

254 echo "[$MODEL] Context: 0%"728 return time.time() - os.path.getmtime(CACHE_FILE) > CACHE_MAX_AGE

255fi729 

256```730 if cache_is_stale():

731 try:

732 subprocess.check_output(['git', 'rev-parse', '--git-dir'], stderr=subprocess.DEVNULL)

733 branch = subprocess.check_output(['git', 'branch', '--show-current'], text=True).strip()

734 staged = subprocess.check_output(['git', 'diff', '--cached', '--numstat'], text=True).strip()

735 modified = subprocess.check_output(['git', 'diff', '--numstat'], text=True).strip()

736 staged_count = len(staged.split('\n')) if staged else 0

737 modified_count = len(modified.split('\n')) if modified else 0

738 with open(CACHE_FILE, 'w') as f:

739 f.write(f"{branch}|{staged_count}|{modified_count}")

740 except:

741 with open(CACHE_FILE, 'w') as f:

742 f.write("||")

743 

744 with open(CACHE_FILE) as f:

745 branch, staged, modified = f.read().strip().split('|')

746 

747 if branch:

748 print(f"[{model}] 📁 {directory} | 🌿 {branch} +{staged} ~{modified}")

749 else:

750 print(f"[{model}] 📁 {directory}")

751 ```

752 

753 ```javascript Node.js theme={null}

754 #!/usr/bin/env node

755 const { execSync } = require('child_process');

756 const fs = require('fs');

757 const path = require('path');

758 

759 let input = '';

760 process.stdin.on('data', chunk => input += chunk);

761 process.stdin.on('end', () => {

762 const data = JSON.parse(input);

763 const model = data.model.display_name;

764 const dir = path.basename(data.workspace.current_dir);

765 

766 const CACHE_FILE = '/tmp/statusline-git-cache';

767 const CACHE_MAX_AGE = 5; // seconds

768 

769 const cacheIsStale = () => {

770 if (!fs.existsSync(CACHE_FILE)) return true;

771 return (Date.now() / 1000) - fs.statSync(CACHE_FILE).mtimeMs / 1000 > CACHE_MAX_AGE;

772 };

773 

774 if (cacheIsStale()) {

775 try {

776 execSync('git rev-parse --git-dir', { stdio: 'ignore' });

777 const branch = execSync('git branch --show-current', { encoding: 'utf8' }).trim();

778 const staged = execSync('git diff --cached --numstat', { encoding: 'utf8' }).trim().split('\n').filter(Boolean).length;

779 const modified = execSync('git diff --numstat', { encoding: 'utf8' }).trim().split('\n').filter(Boolean).length;

780 fs.writeFileSync(CACHE_FILE, `${branch}|${staged}|${modified}`);

781 } catch {

782 fs.writeFileSync(CACHE_FILE, '||');

783 }

784 }

785 

786 const [branch, staged, modified] = fs.readFileSync(CACHE_FILE, 'utf8').trim().split('|');

787 

788 if (branch) {

789 console.log(`[${model}] 📁 ${dir} | 🌿 ${branch} +${staged} ~${modified}`);

790 } else {

791 console.log(`[${model}] 📁 ${dir}`);

792 }

793 });

794 ```

795</CodeGroup>

257 796 

258## Tips797## Tips

259 798 

260* Keep your status line concise - it should fit on one line799* **Test with mock input**: `echo '{"model":{"display_name":"Opus"},"context_window":{"used_percentage":25}}' | ./statusline.sh`

261* Use emojis (if your terminal supports them) and colors to make information scannable800* **Keep output short**: the status bar has limited width, so long output may get truncated or wrap awkwardly

262* Use `jq` for JSON parsing in Bash (see examples above)801* **Cache slow operations**: your script runs frequently during active sessions, so commands like `git status` can cause lag. See the [caching example](#cache-expensive-operations) for how to handle this.

263* Test your script by running it manually with mock JSON input: `echo '{"model":{"display_name":"Test"},"workspace":{"current_dir":"/test"}}' | ./statusline.sh`802 

264* Consider caching expensive operations (like git status) if needed803Community projects like [ccstatusline](https://github.com/sirmalloc/ccstatusline) and [starship-claude](https://github.com/martinemde/starship-claude) provide pre-built configurations with themes and additional features.

265 804 

266## Troubleshooting805## Troubleshooting

267 806 

268* If your status line doesn't appear, check that your script is executable (`chmod +x`)807**Status line not appearing**

269* Ensure your script outputs to stdout (not stderr)808 

809* Verify your script is executable: `chmod +x ~/.claude/statusline.sh`

810* Check that your script outputs to stdout, not stderr

811* Run your script manually to verify it produces output

812* If `disableAllHooks` is set to `true` in your settings, the status line is also disabled. Remove this setting or set it to `false` to re-enable.

813 

814**Status line shows `--` or empty values**

815 

816* Fields may be `null` before the first API response completes

817* Handle null values in your script with fallbacks such as `// 0` in jq

818* Restart Claude Code if values remain empty after multiple messages

819 

820**Context percentage shows unexpected values**

821 

822* Use `used_percentage` for accurate context state rather than cumulative totals

823* The `total_input_tokens` and `total_output_tokens` are cumulative across the session and may exceed the context window size

824* Context percentage may differ from `/context` output due to when each is calculated

825 

826**OSC 8 links not clickable**

827 

828* Verify your terminal supports OSC 8 hyperlinks (iTerm2, Kitty, WezTerm)

829* Terminal.app does not support clickable links

830* SSH and tmux sessions may strip OSC sequences depending on configuration

831* If escape sequences appear as literal text like `\e]8;;`, use `printf '%b'` instead of `echo -e` for more reliable escape handling

832 

833**Display glitches with escape sequences**

834 

835* Complex escape sequences (ANSI colors, OSC 8 links) can occasionally cause garbled output if they overlap with other UI updates

836* If you see corrupted text, try simplifying your script to plain text output

837* Multi-line status lines with escape codes are more prone to rendering issues than single-line plain text

838 

839**Script errors or hangs**

840 

841* Scripts that exit with non-zero codes or produce no output cause the status line to go blank

842* Slow scripts block the status line from updating until they complete. Keep scripts fast to avoid stale output.

843* If a new update triggers while a slow script is running, the in-flight script is cancelled

844* Test your script independently with mock input before configuring it

845 

846**Notifications share the status line row**

847 

848* System notifications like MCP server errors, auto-updates, and token warnings display on the right side of the same row as your status line

849* Enabling verbose mode adds a token counter to this area

850* On narrow terminals, these notifications may truncate your status line output

sub-agents.md +82 −7

Details

8 8 

9Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.9Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.

10 10 

11<Note>

12 If you need multiple agents working in parallel and communicating with each other, see [agent teams](/en/agent-teams) instead. Subagents work within a single session; agent teams coordinate across separate sessions.

13</Note>

14 

11Subagents help you:15Subagents help you:

12 16 

13* **Preserve context** by keeping exploration and implementation out of your main conversation17* **Preserve context** by keeping exploration and implementation out of your main conversation


170}'174}'

171```175```

172 176 

173The `--agents` flag accepts JSON with the same fields as [frontmatter](#supported-frontmatter-fields). Use `prompt` for the system prompt (equivalent to the markdown body in file-based subagents). See the [CLI reference](/en/cli-reference#agents-flag-format) for the full JSON format.177The `--agents` flag accepts JSON with the same [frontmatter](#supported-frontmatter-fields) fields as file-based subagents: `description`, `prompt`, `tools`, `disallowedTools`, `model`, `permissionMode`, `mcpServers`, `hooks`, `maxTurns`, `skills`, and `memory`. Use `prompt` for the system prompt, equivalent to the markdown body in file-based subagents. See the [CLI reference](/en/cli-reference#agents-flag-format) for the full JSON format.

174 178 

175**Plugin subagents** come from [plugins](/en/plugins) you've installed. They appear in `/agents` alongside your custom subagents. See the [plugin components reference](/en/plugins-reference#agents) for details on creating plugin subagents.179**Plugin subagents** come from [plugins](/en/plugins) you've installed. They appear in `/agents` alongside your custom subagents. See the [plugin components reference](/en/plugins-reference#agents) for details on creating plugin subagents.

176 180 


201The following fields can be used in the YAML frontmatter. Only `name` and `description` are required.205The following fields can be used in the YAML frontmatter. Only `name` and `description` are required.

202 206 

203| Field | Required | Description |207| Field | Required | Description |

204| :---------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |208| :---------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

205| `name` | Yes | Unique identifier using lowercase letters and hyphens |209| `name` | Yes | Unique identifier using lowercase letters and hyphens |

206| `description` | Yes | When Claude should delegate to this subagent |210| `description` | Yes | When Claude should delegate to this subagent |

207| `tools` | No | [Tools](#available-tools) the subagent can use. Inherits all tools if omitted |211| `tools` | No | [Tools](#available-tools) the subagent can use. Inherits all tools if omitted |

208| `disallowedTools` | No | Tools to deny, removed from inherited or specified list |212| `disallowedTools` | No | Tools to deny, removed from inherited or specified list |

209| `model` | No | [Model](#choose-a-model) to use: `sonnet`, `opus`, `haiku`, or `inherit`. Defaults to `inherit` |213| `model` | No | [Model](#choose-a-model) to use: `sonnet`, `opus`, `haiku`, or `inherit`. Defaults to `inherit` |

210| `permissionMode` | No | [Permission mode](#permission-modes): `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, or `plan` |214| `permissionMode` | No | [Permission mode](#permission-modes): `default`, `acceptEdits`, `delegate`, `dontAsk`, `bypassPermissions`, or `plan` |

215| `maxTurns` | No | Maximum number of agentic turns before the subagent stops |

211| `skills` | No | [Skills](/en/skills) to load into the subagent's context at startup. The full skill content is injected, not just made available for invocation. Subagents don't inherit skills from the parent conversation |216| `skills` | No | [Skills](/en/skills) to load into the subagent's context at startup. The full skill content is injected, not just made available for invocation. Subagents don't inherit skills from the parent conversation |

217| `mcpServers` | No | [MCP servers](/en/mcp) available to this subagent. Each entry is either a server name referencing an already-configured server (e.g., `"slack"`) or an inline definition with the server name as key and a full [MCP server config](/en/mcp#configure-mcp-servers) as value |

212| `hooks` | No | [Lifecycle hooks](#define-hooks-for-subagents) scoped to this subagent |218| `hooks` | No | [Lifecycle hooks](#define-hooks-for-subagents) scoped to this subagent |

219| `memory` | No | [Persistent memory scope](#enable-persistent-memory): `user`, `project`, or `local`. Enables cross-session learning |

213 220 

214### Choose a model221### Choose a model

215 222 


238---245---

239```246```

240 247 

248#### Restrict which subagents can be spawned

249 

250When an agent runs as the main thread with `claude --agent`, it can spawn subagents using the Task tool. To restrict which subagent types it can spawn, use `Task(agent_type)` syntax in the `tools` field:

251 

252```yaml theme={null}

253---

254name: coordinator

255description: Coordinates work across specialized agents

256tools: Task(worker, researcher), Read, Bash

257---

258```

259 

260This is an allowlist: only the `worker` and `researcher` subagents can be spawned. If the agent tries to spawn any other type, the request fails and the agent sees only the allowed types in its prompt. To block specific agents while allowing all others, use [`permissions.deny`](#disable-specific-subagents) instead.

261 

262To allow spawning any subagent without restrictions, use `Task` without parentheses:

263 

264```yaml theme={null}

265tools: Task, Read, Bash

266```

267 

268If `Task` is omitted from the `tools` list entirely, the agent cannot spawn any subagents. This restriction only applies to agents running as the main thread with `claude --agent`. Subagents cannot spawn other subagents, so `Task(agent_type)` has no effect in subagent definitions.

269 

241#### Permission modes270#### Permission modes

242 271 

243The `permissionMode` field controls how the subagent handles permission prompts. Subagents inherit the permission context from the main conversation but can override the mode.272The `permissionMode` field controls how the subagent handles permission prompts. Subagents inherit the permission context from the main conversation but can override the mode.

244 273 

245| Mode | Behavior |274| Mode | Behavior |

246| :------------------ | :----------------------------------------------------------------- |275| :------------------ | :------------------------------------------------------------------------------------------------------------------- |

247| `default` | Standard permission checking with prompts |276| `default` | Standard permission checking with prompts |

248| `acceptEdits` | Auto-accept file edits |277| `acceptEdits` | Auto-accept file edits |

249| `dontAsk` | Auto-deny permission prompts (explicitly allowed tools still work) |278| `dontAsk` | Auto-deny permission prompts (explicitly allowed tools still work) |

279| `delegate` | Coordination-only mode for [agent team](/en/agent-teams#use-delegate-mode) leads. Restricts to team management tools |

250| `bypassPermissions` | Skip all permission checks |280| `bypassPermissions` | Skip all permission checks |

251| `plan` | Plan mode (read-only exploration) |281| `plan` | Plan mode (read-only exploration) |

252 282 


278 This is the inverse of [running a skill in a subagent](/en/skills#run-skills-in-a-subagent). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system.308 This is the inverse of [running a skill in a subagent](/en/skills#run-skills-in-a-subagent). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system.

279</Note>309</Note>

280 310 

311#### Enable persistent memory

312 

313The `memory` field gives the subagent a persistent directory that survives across conversations. The subagent uses this directory to build up knowledge over time, such as codebase patterns, debugging insights, and architectural decisions.

314 

315```yaml theme={null}

316---

317name: code-reviewer

318description: Reviews code for quality and best practices

319memory: user

320---

321 

322You are a code reviewer. As you review code, update your agent memory with

323patterns, conventions, and recurring issues you discover.

324```

325 

326Choose a scope based on how broadly the memory should apply:

327 

328| Scope | Location | Use when |

329| :-------- | :-------------------------------------------- | :------------------------------------------------------------------------------------------ |

330| `user` | `~/.claude/agent-memory/<name-of-agent>/` | the subagent should remember learnings across all projects |

331| `project` | `.claude/agent-memory/<name-of-agent>/` | the subagent's knowledge is project-specific and shareable via version control |

332| `local` | `.claude/agent-memory-local/<name-of-agent>/` | the subagent's knowledge is project-specific but should not be checked into version control |

333 

334When memory is enabled:

335 

336* The subagent's system prompt includes instructions for reading and writing to the memory directory.

337* The subagent's system prompt also includes the first 200 lines of `MEMORY.md` in the memory directory, with instructions to curate `MEMORY.md` if it exceeds 200 lines.

338* Read, Write, and Edit tools are automatically enabled so the subagent can manage its memory files.

339 

340##### Persistent memory tips

341 

342* `user` is the recommended default scope. Use `project` or `local` when the subagent's knowledge is only relevant to a specific codebase.

343* Ask the subagent to consult its memory before starting work: "Review this PR, and check your memory for patterns you've seen before."

344* Ask the subagent to update its memory after completing a task: "Now that you're done, save what you learned to your memory." Over time, this builds a knowledge base that makes the subagent more effective.

345* Include memory instructions directly in the subagent's markdown file so it proactively maintains its own knowledge base:

346 

347 ```markdown theme={null}

348 Update your agent memory as you discover codepaths, patterns, library

349 locations, and key architectural decisions. This builds up institutional

350 knowledge across conversations. Write concise notes about what you found

351 and where.

352 ```

353 

281#### Conditional rules with hooks354#### Conditional rules with hooks

282 355 

283For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.356For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.


336claude --disallowedTools "Task(Explore)"409claude --disallowedTools "Task(Explore)"

337```410```

338 411 

339See [IAM documentation](/en/iam#tool-specific-permission-rules) for more details on permission rules.412See [Permissions documentation](/en/permissions#tool-specific-permission-rules) for more details on permission rules.

340 413 

341### Define hooks for subagents414### Define hooks for subagents

342 415 


386| Event | Matcher input | When it fires |459| Event | Matcher input | When it fires |

387| :-------------- | :-------------- | :------------------------------- |460| :-------------- | :-------------- | :------------------------------- |

388| `SubagentStart` | Agent type name | When a subagent begins execution |461| `SubagentStart` | Agent type name | When a subagent begins execution |

389| `SubagentStop` | (none) | When any subagent completes |462| `SubagentStop` | Agent type name | When a subagent completes |

390 463 

391`SubagentStart` supports matchers to target specific agent types by name. `SubagentStop` fires for all subagent completions regardless of matcher values. This example runs a setup script only when the `db-agent` subagent starts, and a cleanup script when any subagent stops:464Both events support matchers to target specific agent types by name. This example runs a setup script only when the `db-agent` subagent starts, and a cleanup script when any subagent stops:

392 465 

393```json theme={null}466```json theme={null}

394{467{


467 When subagents complete, their results return to your main conversation. Running many subagents that each return detailed results can consume significant context.540 When subagents complete, their results return to your main conversation. Running many subagents that each return detailed results can consume significant context.

468</Warning>541</Warning>

469 542 

543For tasks that need sustained parallelism or exceed your context window, [agent teams](/en/agent-teams) give each worker its own independent context.

544 

470#### Chain subagents545#### Chain subagents

471 546 

472For multi-step workflows, ask Claude to use subagents in sequence. Each subagent completes its task and returns results to Claude, which then passes relevant context to the next subagent.547For multi-step workflows, ask Claude to use subagents in sequence. Each subagent completes its task and returns results to Claude, which then passes relevant context to the next subagent.

Details

109 109 

110Select a deployment option to view setup instructions:110Select a deployment option to view setup instructions:

111 111 

112* [Claude for Teams or Enterprise](/en/iam#claude-for-teams-or-enterprise-recommended)112* [Claude for Teams or Enterprise](/en/authentication#claude-for-teams-or-enterprise)

113* [Anthropic Console](/en/iam#claude-console-authentication)113* [Anthropic Console](/en/authentication#claude-console-authentication)

114* [Amazon Bedrock](/en/amazon-bedrock)114* [Amazon Bedrock](/en/amazon-bedrock)

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

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

Details

167### Repeated permission prompts167### Repeated permission prompts

168 168 

169If you find yourself repeatedly approving the same commands, you can allow specific tools169If you find yourself repeatedly approving the same commands, you can allow specific tools

170to run without approval using the `/permissions` command. See [Permissions docs](/en/iam#configuring-permissions).170to run without approval using the `/permissions` command. See [Permissions docs](/en/permissions#manage-permissions).

171 171 

172### Authentication issues172### Authentication issues

173 173 

vs-code.md +26 −5

Details

49 * **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"49 * **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"

50 * **Status Bar**: Click **✱ Claude Code** in the bottom-right corner of the window. This works even when no file is open.50 * **Status Bar**: Click **✱ Claude Code** in the bottom-right corner of the window. This works even when no file is open.

51 51 

52 When you first open the panel, a **Learn Claude Code** checklist appears. Work through each item by clicking **Show me**, or dismiss it with the X. To reopen it later, uncheck **Hide Onboarding** in VS Code settings under Extensions → Claude Code.

53 

52 You can drag the Claude panel to reposition it anywhere in VS Code. See [Customize your workflow](#customize-your-workflow) for details.54 You can drag the Claude panel to reposition it anywhere in VS Code. See [Customize your workflow](#customize-your-workflow) for details.

53 </Step>55 </Step>

54 56 


72For more ideas on what you can do with Claude Code, see [Common workflows](/en/common-workflows).74For more ideas on what you can do with Claude Code, see [Common workflows](/en/common-workflows).

73 75 

74<Tip>76<Tip>

75 The extension includes two built-in tutorials:77 Run "Claude Code: Open Walkthrough" from the Command Palette for a guided tour of the basics.

76 

77 * **VS Code walkthrough**: Run "Claude Code: Open Walkthrough" from the Command Palette for a guided tour of the basics.

78 * **Interactive checklist**: Click the graduation cap icon in the Claude panel header to work through features like writing code, using Plan mode, and setting up rules.

79</Tip>78</Tip>

80 79 

81## Use the prompt box80## Use the prompt box


86* **Command menu**: Click `/` or type `/` to open the command menu. Options include attaching files, switching models, toggling extended thinking, and viewing plan usage (`/usage`). The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal.85* **Command menu**: Click `/` or type `/` to open the command menu. Options include attaching files, switching models, toggling extended thinking, and viewing plan usage (`/usage`). The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal.

87* **Context indicator**: The prompt box shows how much of Claude's context window you're using. Claude automatically compacts when needed, or you can run `/compact` manually.86* **Context indicator**: The prompt box shows how much of Claude's context window you're using. Claude automatically compacts when needed, or you can run `/compact` manually.

88* **Extended thinking**: Lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). See [Extended thinking](/en/common-workflows#use-extended-thinking-thinking-mode) for details.87* **Extended thinking**: Lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). See [Extended thinking](/en/common-workflows#use-extended-thinking-thinking-mode) for details.

89* **Multi-line input**: Press `Shift+Enter` to add a new line without sending.88* **Multi-line input**: Press `Shift+Enter` to add a new line without sending. This also works in the "Other" free-text input of question dialogs.

90 89 

91### Reference files and folders90### Reference files and folders

92 91 


97> What's in @src/components/ (include a trailing slash for folders)96> What's in @src/components/ (include a trailing slash for folders)

98```97```

99 98 

99For large PDFs, you can ask Claude to read specific pages instead of the whole file: a single page, a range like pages 1-10, or an open-ended range like page 3 onward.

100 

100When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., `@app.ts#5-10`). Click the selection indicator to toggle whether Claude can see your highlighted text - the eye-slash icon means the selection is hidden from Claude.101When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., `@app.ts#5-10`). Click the selection indicator to toggle whether Claude can see your highlighted text - the eye-slash icon means the selection is hidden from Claude.

101 102 

102You can also hold `Shift` while dragging files into the prompt box to add them as attachments. Click the X on any attachment to remove it from context.103You can also hold `Shift` while dragging files into the prompt box to add them as attachments. Click the X on any attachment to remove it from context.


192 193 

193For more about the plugin system, see [Plugins](/en/plugins) and [Plugin marketplaces](/en/plugin-marketplaces).194For more about the plugin system, see [Plugins](/en/plugins) and [Plugin marketplaces](/en/plugin-marketplaces).

194 195 

196## Automate browser tasks with Chrome

197 

198Connect Claude to your Chrome browser to test web apps, debug with console logs, and automate browser workflows without leaving VS Code. This requires the [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) version 1.0.36 or higher.

199 

200Type `@browser` in the prompt box followed by what you want Claude to do:

201 

202```text theme={null}

203@browser go to localhost:3000 and check the console for errors

204```

205 

206You can also open the attachment menu to select specific browser tools like opening a new tab or reading page content.

207 

208Claude opens new tabs for browser tasks and shares your browser's login state, so it can access any site you're already signed into.

209 

210For setup instructions, the full list of capabilities, and troubleshooting, see [Use Claude Code with Chrome](/en/chrome).

211 

195## VS Code commands and shortcuts212## VS Code commands and shortcuts

196 213 

197Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type "Claude Code" to see all available VS Code commands for the Claude Code extension.214Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type "Claude Code" to see all available VS Code commands for the Claude Code extension.


221* **Extension settings** in VS Code: Control the extension's behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to Extensions → Claude Code. You can also type `/` and select **General Config** to open settings.238* **Extension settings** in VS Code: Control the extension's behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to Extensions → Claude Code. You can also type `/` and select **General Config** to open settings.

222* **Claude Code settings** in `~/.claude/settings.json`: Shared between the extension and CLI. Use for allowed commands, environment variables, hooks, and MCP servers. See [Settings](/en/settings) for details.239* **Claude Code settings** in `~/.claude/settings.json`: Shared between the extension and CLI. Use for allowed commands, environment variables, hooks, and MCP servers. See [Settings](/en/settings) for details.

223 240 

241<Tip>

242 Add `"$schema": "https://json.schemastore.org/claude-code-settings.json"` to your `settings.json` to get autocomplete and inline validation for all available settings directly in VS Code.

243</Tip>

244 

224### Extension settings245### Extension settings

225 246 

226| Setting | Default | Description |247| Setting | Default | Description |