From d06c422adbfd3124739e4cf363da960336730ac7 Mon Sep 17 00:00:00 2001 From: "claude-yolo[bot]" Date: Sat, 6 Sep 2025 06:25:28 +0000 Subject: [PATCH] docs: Claude Code v1.0.108 - Major SDK hooks system and API improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔥 MAJOR UPDATE: Version 1.0.106 → 1.0.108 ## Key Features Added - **SDK Hooks System**: Complete lifecycle customization with PreToolUse, PostToolUse, etc - **Enhanced canUseTool**: Now supports input modification (updatedInput) - **Better SDK Documentation**: 518 lines of improved examples and type definitions - **Reorganized SDK Overview**: Clearer feature descriptions and use cases ## Changes - Added comprehensive hooks documentation with practical examples - Enhanced TypeScript SDK with better type safety and examples - Improved permission control patterns - Removed LS tool from available tools list - Updated security documentation for write permissions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- content/.metadata.json | 128 ++--- content/anthropic-blog/claude-code.md | 147 +++-- .../engineering/claude-code-best-practices.md | 2 +- content/claude-code-docs/sdk/sdk-overview.md | 58 +- .../claude-code-docs/sdk/sdk-typescript.md | 518 ++++++++++++++---- content/claude-code-docs/security.md | 2 +- content/claude-code-docs/settings.md | 1 - content/claude-code-manifest.json | 18 +- 8 files changed, 566 insertions(+), 308 deletions(-) diff --git a/content/.metadata.json b/content/.metadata.json index e746fb758..fd55dab23 100644 --- a/content/.metadata.json +++ b/content/.metadata.json @@ -1,11 +1,11 @@ { "metadata": { "version": "1.0", - "fetch_date": "2025-09-05T01:14:16Z", + "fetch_date": "2025-09-06T06:24:34Z", "format": "md" }, "versions": { - "latest_npm": "1.0.106", + "latest_npm": "1.0.108", "npm_package": "@anthropic-ai/claude-code" }, "sources": { @@ -40,7 +40,7 @@ "sha256": "25183f0f38898a54326ab0cbedf8dc36116309df228676b3f3d9401353796c49", "size": 7669, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -50,7 +50,7 @@ "sha256": "21d5d85a64d11712f4b8010211696ecd3ccda4a6a327a94000a95f73b054804e", "size": 2459, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -60,7 +60,7 @@ "sha256": "f7f1bdc8351ee6f6511ce35cabcde69cd50baacbe43bd3ac2c4bd91c4adab0e4", "size": 7145, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -70,7 +70,7 @@ "sha256": "4004b1fe2440bbebb2d8c041f944d4a79a7bb8c61bd3bd355596340a1cf3f723", "size": 25142, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -80,7 +80,7 @@ "sha256": "7d2bce10e29f366e42763b269aead3f45ed1a5fd42d705c5fdb297f8aebc579f", "size": 2535, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -90,7 +90,7 @@ "sha256": "1225bb4cbc94d0cd8ce469f67cde3b7fdb66d291072930f26a236d7aa8d7b044", "size": 6510, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -100,7 +100,7 @@ "sha256": "dd1c5e4f5b6bad954fe63f8a7979cac59b31adb959072f4aa4cf11e53c6c0924", "size": 8029, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -110,7 +110,7 @@ "sha256": "9f0b062248ffc15d89f1653f16958144e4a8a30531f00585818b221a6aa843ae", "size": 4414, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -120,7 +120,7 @@ "sha256": "de4f4b56f46236c29eb47e0f6c2b2ef2f31c52b2f436cf9dc3e353e605f80c45", "size": 26649, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -130,7 +130,7 @@ "sha256": "a9ed91f61818cb0c96bbb725da50d736df7ee2c7504efc7523c406a80a68f387", "size": 6048, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -140,7 +140,7 @@ "sha256": "218596daf32354ca64f49e8ab30dd480254cf99e7749946207baacea819c84fe", "size": 23040, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -150,7 +150,7 @@ "sha256": "a8347a1951dfe7a55e644c95b5dced0ab1bdb5ef387f4e3443dac610a8cac836", "size": 9549, "mime": "text/x-script.python", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -160,7 +160,7 @@ "sha256": "43d29a41e580ef96176752e019d1371a189602b91212e83e7551930219a6acff", "size": 10342, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -170,7 +170,7 @@ "sha256": "8eeb41ded01f5411202a7bf0d28856cecbad5d17039ee09930b8961b9b86d47d", "size": 6007, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -180,7 +180,7 @@ "sha256": "64615ef94295923ce71d9979d3e3aa93c388cf2875040e287808b1d04e836513", "size": 4793, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -190,7 +190,7 @@ "sha256": "0204d2f835282a350861c31c5c3bf2f2d9905861132b528ddf475c2bd95f3386", "size": 1545, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -200,7 +200,7 @@ "sha256": "635632a8fd0aba81cd6159772e55d81b9a52881f029826716bee2e68c8f82eee", "size": 4189, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -210,7 +210,7 @@ "sha256": "84a885fe250ec6a0254051bbff7564d9d9ac2a578bb4e34db1de161f5df210f4", "size": 37163, "mime": "application/javascript", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -220,7 +220,7 @@ "sha256": "fb91c5ca36a50ad644648bb0a4af00dab4fa5489a1317d5ca8a33c593fd18b1c", "size": 6355, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -230,7 +230,7 @@ "sha256": "c00bb65754f4dcd9596ff92f916a61a041a8b9e462c150bd77d6260332520048", "size": 4879, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -240,7 +240,7 @@ "sha256": "c7677ad78b92746de1ff6e6d1f087973853dcc4157ca26e3bb587451f63ad5dc", "size": 21932, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -250,7 +250,7 @@ "sha256": "12d774955a3e3596fbe7d72d52ac27182573396b93ff08d5a25c5f038d9f9867", "size": 3648, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -260,7 +260,7 @@ "sha256": "292193171a314151e088a6a296e6c3bd306f8354088d59f080de437c6d4fb10a", "size": 4332, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -270,7 +270,7 @@ "sha256": "bd2798770a64b026d80a25088f0fb8c034955c991204110e355ad080784e2358", "size": 8223, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -280,17 +280,17 @@ "sha256": "075878969c9bc428ba1e5217b0b0cea3c740421c4814dcdc0c9c8cecc44de4e1", "size": 8827, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", "url": "https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-overview", "kind": "raw", "path": "claude-code-docs/sdk/sdk-overview.md", - "sha256": "b0ed967b280d3b05362a9c50f206c925db6d75c8ef73449dba71c02b41d49f6e", - "size": 4316, + "sha256": "6ad619a51b8d5f17bb81c7f8d471d9b2245d5e8c35c6b6194b4b0c9643676fd4", + "size": 4004, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -300,37 +300,37 @@ "sha256": "c7a81ed658275171bd157211bd29efef96103cac51934ff4c1ce56b0855706bf", "size": 26100, "mime": "text/x-script.python", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", "url": "https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-typescript", "kind": "raw", "path": "claude-code-docs/sdk/sdk-typescript.md", - "sha256": "39b55637cf499d67df484cee1fc1ef1ef22e559902d6961c46d7e17b0319100d", - "size": 22617, + "sha256": "c4395ba894af04bbcb1ece95a6b72e0dcc7b0fafa6feb4df1c0781eae7082bdb", + "size": 31290, "mime": "application/javascript", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", "url": "https://docs.anthropic.com/en/docs/claude-code/security", "kind": "raw", "path": "claude-code-docs/security.md", - "sha256": "58b552f95840f16b7506d56f6d9df54cd5e8d52d9c957a751c602e35d3b9302d", - "size": 6727, + "sha256": "859dee1f761e603a2aaa8e848da6f495b15b7c4452113221a04a6c419377184f", + "size": 6755, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", "url": "https://docs.anthropic.com/en/docs/claude-code/settings", "kind": "raw", "path": "claude-code-docs/settings.md", - "sha256": "a311e00d197c76fb0dfd2c360f2c00cd53e7e688195fdb411cffd2c99dc8f70c", - "size": 26146, + "sha256": "432da98a1db2a3fdec01f290c4b67d981aa486fcce9f469a4f362eef6a2f6861", + "size": 26048, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -340,7 +340,7 @@ "sha256": "98c6b8570665d0d413c0942bc7f8f7baac99f970f68a3bc712d7b738e3814b7d", "size": 6252, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -350,7 +350,7 @@ "sha256": "a92657563011b0d9cf1b59de5c493e3d3cb5f4f1f5aa31ae3a3acf3bd97d7750", "size": 12889, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -360,7 +360,7 @@ "sha256": "7e9ba7d4046c8f50477b4b86fdfb40909738492094f7adabff9e7db814597baa", "size": 5698, "mime": "application/javascript", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -370,7 +370,7 @@ "sha256": "4897316c00d2bbb93701c5569580d521d11b430a0a7b37b96c7fea6946b58f5b", "size": 11804, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -380,7 +380,7 @@ "sha256": "f43b3d3ff68b017ff8c039aa896bc6dd5df213141f6341f4ed012ff05de08efb", "size": 2943, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -390,7 +390,7 @@ "sha256": "e56232ebb48800dcbdcc296bed2babc195ffa20a9ba43f78dbb55cd85587e29b", "size": 7876, "mime": "text/html", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -400,7 +400,7 @@ "sha256": "81f3ba7936c8e03bb30beb5efdf880098572bd59564ecba669136983548bd473", "size": 12072, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "docs", @@ -410,7 +410,7 @@ "sha256": "6fdd703940478612a68b5ab56fe52f8cca56dd73a5028a334b57a642631a0d45", "size": 344, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "anthropic", @@ -420,17 +420,17 @@ "sha256": "a28bc7a22d122ed899f6febb2dde49aacc7ea71e48ad5f460e025d51cda1c74a", "size": 33760, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "anthropic", "url": "https://www.anthropic.com/engineering/claude-code-best-practices", "kind": "raw", "path": "anthropic-blog/engineering/claude-code-best-practices.md", - "sha256": "7ae4e6f9cc0c6640f2c8176fe0cd433a82a43dc7ad73757c05030baf4d538e65", + "sha256": "193a84fb5a5387b62b090450aebd7aab5673e9248226f0ffcaebdc1bb3de5c84", "size": 30483, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "anthropic", @@ -440,7 +440,7 @@ "sha256": "d1300dee01c3a034d4d02a71a9b6723bf09b99cbdf1f1f7e20b2d9e0993ccdeb", "size": 4647, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "anthropic", @@ -450,7 +450,7 @@ "sha256": "b26c237e1b0b627059386ed626e793cfeff6265b4b0e4a30ec6d11e013ace89f", "size": 4964, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "anthropic", @@ -460,7 +460,7 @@ "sha256": "322f9ab2140d07c71f26b7977583bd59c3090ee39c1466647fc644cc0c3d44cb", "size": 2476, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "anthropic", @@ -470,7 +470,7 @@ "sha256": "eef0e20fd1e53d8dfcfc676892989b89252cac85af15e53870c3f0788b8fca87", "size": 8227, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "github", @@ -480,17 +480,17 @@ "sha256": "74700c0e9be0a5924121b30d73b8a08d3678f58f457db3f054d79417a3ebd623", "size": 22193, "mime": "text/plain", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" }, { "source": "npm", "url": "https://registry.npmjs.org/@anthropic-ai/claude-code/latest", "kind": "raw", "path": "claude-code-manifest.json", - "sha256": "ac7a4ecef667505f7ed88dc1fd674adee04567e7fa4a0bdaba797cca4cb9759f", + "sha256": "4a297b9ce7a9fe5587177cb24be86b137ae2807df190f25b6802d4045b512d51", "size": 2990, "mime": "application/json", - "fetched_at": "2025-09-05T01:14:16Z" + "fetched_at": "2025-09-06T06:24:34Z" } ], "by_url": { @@ -699,7 +699,7 @@ "source": "docs", "kind": "raw", "path": "claude-code-docs/sdk/sdk-overview.md", - "sha256": "b0ed967b280d3b05362a9c50f206c925db6d75c8ef73449dba71c02b41d49f6e" + "sha256": "6ad619a51b8d5f17bb81c7f8d471d9b2245d5e8c35c6b6194b4b0c9643676fd4" } ], "https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-python": [ @@ -715,7 +715,7 @@ "source": "docs", "kind": "raw", "path": "claude-code-docs/sdk/sdk-typescript.md", - "sha256": "39b55637cf499d67df484cee1fc1ef1ef22e559902d6961c46d7e17b0319100d" + "sha256": "c4395ba894af04bbcb1ece95a6b72e0dcc7b0fafa6feb4df1c0781eae7082bdb" } ], "https://docs.anthropic.com/en/docs/claude-code/security": [ @@ -723,7 +723,7 @@ "source": "docs", "kind": "raw", "path": "claude-code-docs/security.md", - "sha256": "58b552f95840f16b7506d56f6d9df54cd5e8d52d9c957a751c602e35d3b9302d" + "sha256": "859dee1f761e603a2aaa8e848da6f495b15b7c4452113221a04a6c419377184f" } ], "https://docs.anthropic.com/en/docs/claude-code/settings": [ @@ -731,7 +731,7 @@ "source": "docs", "kind": "raw", "path": "claude-code-docs/settings.md", - "sha256": "a311e00d197c76fb0dfd2c360f2c00cd53e7e688195fdb411cffd2c99dc8f70c" + "sha256": "432da98a1db2a3fdec01f290c4b67d981aa486fcce9f469a4f362eef6a2f6861" } ], "https://docs.anthropic.com/en/docs/claude-code/setup": [ @@ -811,7 +811,7 @@ "source": "npm", "kind": "raw", "path": "claude-code-manifest.json", - "sha256": "ac7a4ecef667505f7ed88dc1fd674adee04567e7fa4a0bdaba797cca4cb9759f" + "sha256": "4a297b9ce7a9fe5587177cb24be86b137ae2807df190f25b6802d4045b512d51" } ], "https://www.anthropic.com/claude-code": [ @@ -827,7 +827,7 @@ "source": "anthropic", "kind": "raw", "path": "anthropic-blog/engineering/claude-code-best-practices.md", - "sha256": "7ae4e6f9cc0c6640f2c8176fe0cd433a82a43dc7ad73757c05030baf4d538e65" + "sha256": "193a84fb5a5387b62b090450aebd7aab5673e9248226f0ffcaebdc1bb3de5c84" } ], "https://www.anthropic.com/news/automate-security-reviews-with-claude-code": [ diff --git a/content/anthropic-blog/claude-code.md b/content/anthropic-blog/claude-code.md index 045fbf44a..42ed99944 100644 --- a/content/anthropic-blog/claude-code.md +++ b/content/anthropic-blog/claude-code.md @@ -25,10 +25,10 @@ Plans * [Enterprise plan](https://www.anthropic.com/enterprise) * [Explore pricing](https://www.anthropic.com/pricing) - * [Download apps](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/download) - * [Claude log in](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53) + * [Download apps](https://claude.ai/download) + * [Claude log in](https://claude.ai/) -[![Image 27](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d15af22ddab26ed8a3c_claude.svg) News Claude’s Character](https://www.anthropic.com/news/claude-character) +[![Image 29](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d15af22ddab26ed8a3c_claude.svg) News Claude’s Character](https://www.anthropic.com/news/claude-character) * API @@ -40,7 +40,7 @@ Build with Claude * [Console log in](https://console.anthropic.com/) -[![Image 28](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d3852e295a440e882d8_api.svg) News Learn how to build with Claude](https://docs.anthropic.com/en/docs/welcome) +[![Image 30](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d3852e295a440e882d8_api.svg) News Learn how to build with Claude](https://docs.anthropic.com/en/docs/welcome) * Solutions @@ -54,7 +54,7 @@ Collaborate with Claude * [Financial services](https://www.anthropic.com/solutions/financial-services) * [Government](https://www.anthropic.com/solutions/government) -[![Image 29](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d1df9b6c1e8ef0058d9_solutions.svg) Case studies Hear from our customers](https://www.anthropic.com/customers) +[![Image 31](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d1df9b6c1e8ef0058d9_solutions.svg) Case studies Hear from our customers](https://www.anthropic.com/customers) * Research @@ -69,7 +69,7 @@ Claude model family * [Claude Sonnet 4](https://www.anthropic.com/claude/sonnet) * [Claude Haiku 3.5](https://www.anthropic.com/claude/haiku) -[![Image 30](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d14ff4db668287c739b_research.svg) Research Claude’s extended thinking](https://www.anthropic.com/news/visible-extended-thinking) +[![Image 32](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d14ff4db668287c739b_research.svg) Research Claude’s extended thinking](https://www.anthropic.com/news/visible-extended-thinking) * Commitments @@ -82,7 +82,7 @@ Trust center * [Security and compliance](http://trust.anthropic.com/) -[![Image 31](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d210c6dfebadac6be54_commitments.svg) Announcement ISO 42001 certification](https://www.anthropic.com/news/anthropic-achieves-iso-42001-certification-for-responsible-ai) +[![Image 33](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d210c6dfebadac6be54_commitments.svg) Announcement ISO 42001 certification](https://www.anthropic.com/news/anthropic-achieves-iso-42001-certification-for-responsible-ai) * Learn @@ -98,12 +98,12 @@ Company * [Careers](https://www.anthropic.com/careers) * [Events](https://www.anthropic.com/events) -[![Image 32](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d185c76e0eb33f1c42e_learn.svg) Engineering Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) +[![Image 34](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d185c76e0eb33f1c42e_learn.svg) Engineering Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) * [News](https://www.anthropic.com/news) * EN [This is some text inside of a div block.](https://www.anthropic.com/claude-code#) -* [Try Claude](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/login)Try Claude Try Claude [Download App](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/download)Download App Download App +* [Try Claude](https://claude.ai/login)Try Claude Try Claude [Download App](https://claude.ai/download)Download App Download App [](https://www.anthropic.com/) @@ -121,10 +121,10 @@ Plans * [Enterprise plan](https://www.anthropic.com/enterprise) * [Explore pricing](https://www.anthropic.com/pricing) - * [Download apps](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/download) - * [Claude log in](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53) + * [Download apps](https://claude.ai/download) + * [Claude log in](https://claude.ai/) -[![Image 33](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d15af22ddab26ed8a3c_claude.svg) News Claude’s Character](https://www.anthropic.com/news/claude-character) +[![Image 35](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d15af22ddab26ed8a3c_claude.svg) News Claude’s Character](https://www.anthropic.com/news/claude-character) * API @@ -136,7 +136,7 @@ Build with Claude * [Console log in](https://console.anthropic.com/) -[![Image 34](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d3852e295a440e882d8_api.svg) News Learn how to build with Claude](https://docs.anthropic.com/en/docs/welcome) +[![Image 36](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d3852e295a440e882d8_api.svg) News Learn how to build with Claude](https://docs.anthropic.com/en/docs/welcome) * Solutions @@ -150,7 +150,7 @@ Collaborate with Claude * [Financial services](https://www.anthropic.com/solutions/financial-services) * [Government](https://www.anthropic.com/solutions/government) -[![Image 35](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d1df9b6c1e8ef0058d9_solutions.svg) Case studies Hear from our customers](https://www.anthropic.com/customers) +[![Image 37](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d1df9b6c1e8ef0058d9_solutions.svg) Case studies Hear from our customers](https://www.anthropic.com/customers) * Research @@ -165,7 +165,7 @@ Claude model family * [Claude Sonnet 4](https://www.anthropic.com/claude/sonnet) * [Claude Haiku 3.5](https://www.anthropic.com/claude/haiku) -[![Image 36](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d14ff4db668287c739b_research.svg) Research Claude’s extended thinking](https://www.anthropic.com/news/visible-extended-thinking) +[![Image 38](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d14ff4db668287c739b_research.svg) Research Claude’s extended thinking](https://www.anthropic.com/news/visible-extended-thinking) * Commitments @@ -178,7 +178,7 @@ Trust center * [Security and compliance](http://trust.anthropic.com/) -[![Image 37](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d210c6dfebadac6be54_commitments.svg) Announcement ISO 42001 certification](https://www.anthropic.com/news/anthropic-achieves-iso-42001-certification-for-responsible-ai) +[![Image 39](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d210c6dfebadac6be54_commitments.svg) Announcement ISO 42001 certification](https://www.anthropic.com/news/anthropic-achieves-iso-42001-certification-for-responsible-ai) * Learn @@ -194,15 +194,12 @@ Company * [Careers](https://www.anthropic.com/careers) * [Events](https://www.anthropic.com/events) -[![Image 38](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d185c76e0eb33f1c42e_learn.svg) Engineering Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) +[![Image 40](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/688a1d185c76e0eb33f1c42e_learn.svg) Engineering Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) * [News](https://www.anthropic.com/news) * EN [This is some text inside of a div block.](https://www.anthropic.com/claude-code#) -* [Try Claude](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/login)Try Claude Try Claude [Download App](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/download)Download App Download App - -Your code’s new collaborator -============================ +* [Try Claude](https://claude.ai/login)Try Claude Try Claude [Download App](https://claude.ai/download)Download App Download App Your code’s new collaborator ============================ @@ -217,35 +214,31 @@ Install [Node.js 18+](https://nodejs.org/en/download), then run: [npm install-g @anthropic-ai/claude-code](https://www.anthropic.com/claude-code#) -[Try Claude Code on Max](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/upgrade/max?returnTo=/claude-code-install)Try Claude Code on Max +[Try Claude Code on Max](https://claude.ai/upgrade/max?returnTo=/claude-code-install)Try Claude Code on Max Try Claude Code on Max -[Try Claude Code on Max](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/upgrade/max?returnTo=/claude-code-install)Try Claude Code on Max +[Try Claude Code on Max](https://claude.ai/upgrade/max?returnTo=/claude-code-install)Try Claude Code on Max Try Claude Code on Max [See our pricing options](https://www.anthropic.com/claude-code#get-started) -· - -Cerebrating… - Trusted by engineers at ----------------------- -![Image 39: Ramp](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53942514e927c6a88975_ramp.svg)![Image 40: Intercom](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5394cc87c9d0d031dfb2_intercom.svg)![Image 41: Stubhub](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53946c2bcfd12f3843b6_stubhub.svg)![Image 42: Figma](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5395a1d3ff0e4f634e24_figma.svg)![Image 43: Brex](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/689228daecd2afd4b7c5966b_brex.svg)![Image 44: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg)![Image 45: Asana](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466eba54e8a0fa2980ac9_79ef5e13982c7d92be6aff1aa2e8de9e_Asana%20logo.svg)![Image 46: Rakuten](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/682e676d58e904da88e9deee_rakuten.svg)![Image 47: Notion](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ecc4774ab76624b5ad_notion.svg)![Image 48: Plaid](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4eff401a7014f51e70847_plaid.svg)![Image 49: Workato](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a48f687cbabe1cf2845203_workato.svg)![Image 50: Pager Duty](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4f180f2e30ab75fc4b531_pagerduty.svg)![Image 51: Zapier](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b73382717df1d9ad8823b1_zapier-logo_black.svg)![Image 52: Quora](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/680a4690fb6208a83050599d_quora.svg)![Image 53: Bun](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b7345d94d96251f4aefc41_bun.svg)![Image 54: Anthropic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ffe8028fa26e55690ebb2a_anthropic.svg) +![Image 41: Ramp](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53942514e927c6a88975_ramp.svg)![Image 42: Intercom](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5394cc87c9d0d031dfb2_intercom.svg)![Image 43: Stubhub](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53946c2bcfd12f3843b6_stubhub.svg)![Image 44: Figma](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5395a1d3ff0e4f634e24_figma.svg)![Image 45: Brex](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/689228daecd2afd4b7c5966b_brex.svg)![Image 46: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg)![Image 47: Asana](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466eba54e8a0fa2980ac9_79ef5e13982c7d92be6aff1aa2e8de9e_Asana%20logo.svg)![Image 48: Rakuten](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/682e676d58e904da88e9deee_rakuten.svg)![Image 49: Notion](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ecc4774ab76624b5ad_notion.svg)![Image 50: Plaid](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4eff401a7014f51e70847_plaid.svg)![Image 51: Workato](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a48f687cbabe1cf2845203_workato.svg)![Image 52: Pager Duty](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4f180f2e30ab75fc4b531_pagerduty.svg)![Image 53: Zapier](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b73382717df1d9ad8823b1_zapier-logo_black.svg)![Image 54: Quora](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/680a4690fb6208a83050599d_quora.svg)![Image 55: Bun](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b7345d94d96251f4aefc41_bun.svg)![Image 56: Anthropic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ffe8028fa26e55690ebb2a_anthropic.svg) -![Image 55: Ramp](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53942514e927c6a88975_ramp.svg)![Image 56: Intercom](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5394cc87c9d0d031dfb2_intercom.svg)![Image 57: Stubhub](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53946c2bcfd12f3843b6_stubhub.svg)![Image 58: Figma](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5395a1d3ff0e4f634e24_figma.svg)![Image 59: Brex](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/689228daecd2afd4b7c5966b_brex.svg)![Image 60: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg)![Image 61: Asana](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466eba54e8a0fa2980ac9_79ef5e13982c7d92be6aff1aa2e8de9e_Asana%20logo.svg)![Image 62: Rakuten](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/682e676d58e904da88e9deee_rakuten.svg)![Image 63: Notion](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ecc4774ab76624b5ad_notion.svg)![Image 64: Plaid](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4eff401a7014f51e70847_plaid.svg)![Image 65: Workato](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a48f687cbabe1cf2845203_workato.svg)![Image 66: Pager Duty](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4f180f2e30ab75fc4b531_pagerduty.svg)![Image 67: Zapier](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b73382717df1d9ad8823b1_zapier-logo_black.svg)![Image 68: Quora](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/680a4690fb6208a83050599d_quora.svg)![Image 69: Bun](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b7345d94d96251f4aefc41_bun.svg)![Image 70: Anthropic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ffe8028fa26e55690ebb2a_anthropic.svg) +![Image 57: Ramp](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53942514e927c6a88975_ramp.svg)![Image 58: Intercom](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5394cc87c9d0d031dfb2_intercom.svg)![Image 59: Stubhub](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53946c2bcfd12f3843b6_stubhub.svg)![Image 60: Figma](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5395a1d3ff0e4f634e24_figma.svg)![Image 61: Brex](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/689228daecd2afd4b7c5966b_brex.svg)![Image 62: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg)![Image 63: Asana](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466eba54e8a0fa2980ac9_79ef5e13982c7d92be6aff1aa2e8de9e_Asana%20logo.svg)![Image 64: Rakuten](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/682e676d58e904da88e9deee_rakuten.svg)![Image 65: Notion](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ecc4774ab76624b5ad_notion.svg)![Image 66: Plaid](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4eff401a7014f51e70847_plaid.svg)![Image 67: Workato](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a48f687cbabe1cf2845203_workato.svg)![Image 68: Pager Duty](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4f180f2e30ab75fc4b531_pagerduty.svg)![Image 69: Zapier](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b73382717df1d9ad8823b1_zapier-logo_black.svg)![Image 70: Quora](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/680a4690fb6208a83050599d_quora.svg)![Image 71: Bun](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b7345d94d96251f4aefc41_bun.svg)![Image 72: Anthropic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ffe8028fa26e55690ebb2a_anthropic.svg) -![Image 71: Ramp](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53942514e927c6a88975_ramp.svg)![Image 72: Intercom](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5394cc87c9d0d031dfb2_intercom.svg)![Image 73: Stubhub](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53946c2bcfd12f3843b6_stubhub.svg)![Image 74: Figma](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5395a1d3ff0e4f634e24_figma.svg)![Image 75: Brex](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/689228daecd2afd4b7c5966b_brex.svg)![Image 76: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg)![Image 77: Asana](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466eba54e8a0fa2980ac9_79ef5e13982c7d92be6aff1aa2e8de9e_Asana%20logo.svg)![Image 78: Rakuten](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/682e676d58e904da88e9deee_rakuten.svg)![Image 79: Notion](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ecc4774ab76624b5ad_notion.svg)![Image 80: Plaid](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4eff401a7014f51e70847_plaid.svg)![Image 81: Workato](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a48f687cbabe1cf2845203_workato.svg)![Image 82: Pager Duty](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4f180f2e30ab75fc4b531_pagerduty.svg)![Image 83: Zapier](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b73382717df1d9ad8823b1_zapier-logo_black.svg)![Image 84: Quora](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/680a4690fb6208a83050599d_quora.svg)![Image 85: Bun](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b7345d94d96251f4aefc41_bun.svg)![Image 86: Anthropic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ffe8028fa26e55690ebb2a_anthropic.svg) +![Image 73: Ramp](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53942514e927c6a88975_ramp.svg)![Image 74: Intercom](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5394cc87c9d0d031dfb2_intercom.svg)![Image 75: Stubhub](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd53946c2bcfd12f3843b6_stubhub.svg)![Image 76: Figma](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67fd5395a1d3ff0e4f634e24_figma.svg)![Image 77: Brex](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/689228daecd2afd4b7c5966b_brex.svg)![Image 78: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg)![Image 79: Asana](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466eba54e8a0fa2980ac9_79ef5e13982c7d92be6aff1aa2e8de9e_Asana%20logo.svg)![Image 80: Rakuten](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/682e676d58e904da88e9deee_rakuten.svg)![Image 81: Notion](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ecc4774ab76624b5ad_notion.svg)![Image 82: Plaid](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4eff401a7014f51e70847_plaid.svg)![Image 83: Workato](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a48f687cbabe1cf2845203_workato.svg)![Image 84: Pager Duty](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68a4f180f2e30ab75fc4b531_pagerduty.svg)![Image 85: Zapier](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b73382717df1d9ad8823b1_zapier-logo_black.svg)![Image 86: Quora](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/680a4690fb6208a83050599d_quora.svg)![Image 87: Bun](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68b7345d94d96251f4aefc41_bun.svg)![Image 88: Anthropic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ffe8028fa26e55690ebb2a_anthropic.svg) Command-line AI, from concept to commit --------------------------------------- Watch as Claude Code tackles an unfamiliar Next.js project, builds new functionality, creates tests, and fixes what’s broken—all from the command line. Join Boris and Cat as they show you what coding feels like when you’re not doing it alone. -![Image 87: Video thumbnail: Introducing Claude Code](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67f86fb392281ccbac9ead79_maxresdefault.jpg) +![Image 89: Video thumbnail: Introducing Claude Code](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67f86fb392281ccbac9ead79_maxresdefault.jpg) Deep coding at terminal velocity -------------------------------- @@ -254,20 +247,12 @@ Claude Code embeds Claude Opus 4.1—the same model our researchers and engineer ### Interact with Claude Code -[Example 1](https://www.anthropic.com/claude-code#w-tabs-0-data-w-pane-0)[Example 2](https://www.anthropic.com/claude-code#w-tabs-0-data-w-pane-1) +[Example 1](https://www.anthropic.com/claude-code)[Example 2](https://www.anthropic.com/claude-code) [Terminal](https://www.anthropic.com/claude-code#)[Result](https://www.anthropic.com/claude-code#) -· - -Transmuting… - [Terminal](https://www.anthropic.com/claude-code#)[Result](https://www.anthropic.com/claude-code#) -· - -Synthesizing… - ### Powerful intelligence * Uses agentic search to understand your entire codebase without manual context selection @@ -286,62 +271,54 @@ Synthesizing… * Adapts to your coding standards and patterns * Configurable; build on the SDK or run on GitHub Actions -![Image 88](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/687404b9a4ecd9797b33a52a_Works%20with%20your%20IDEs.avif) +![Image 90](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/687404b9a4ecd9797b33a52a_Works%20with%20your%20IDEs.avif) ### Works with your IDEs Claude works directly in VS Code and JetBrains, seeing your entire codebase instead of just isolated snippets. It understands your project structure and existing patterns, making suggestions that actually fit and presenting them directly in your code files. No copying and pasting—just building. -![Image 89: VS Code](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/686424f60220626a6c2b56ab_vs-code.svg)![Image 90: jetBrains](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/686424f6f671b5e18fd03f0f_jetbrains.svg) +![Image 91: VS Code](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/686424f60220626a6c2b56ab_vs-code.svg)![Image 92: jetBrains](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/686424f6f671b5e18fd03f0f_jetbrains.svg) ### ... and your favorite command line tools Your terminal is where real work happens. Claude Code connects with the tools that power development—deployment, databases, monitoring, version control. Rather than adding another interface to juggle, it enhances your existing stack. Less context-switching. -![Image 91: Sentry](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c70d5d447db98279a404_sentry.svg) +![Image 93: Sentry](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c70d5d447db98279a404_sentry.svg) -![Image 92: Datadog](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6806ba3d0a522c20cee99d80_datadog.svg) +![Image 94: Datadog](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6806ba3d0a522c20cee99d80_datadog.svg) -![Image 93: AWS](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466edc77645f4d19f051f_aws.svg) +![Image 95: AWS](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466edc77645f4d19f051f_aws.svg) -![Image 94: Github](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68068b75a6e0e851d2777dac_c2015d2dfa5c2c58d52308460cb2e395_github.svg) +![Image 96: Github](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68068b75a6e0e851d2777dac_c2015d2dfa5c2c58d52308460cb2e395_github.svg) -![Image 95: Terraform](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68079342136c3363721f7e0c_terraform.svg) +![Image 97: Terraform](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68079342136c3363721f7e0c_terraform.svg) -![Image 96: Circle CI](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7178e86bb681268f83f_circleci.svg) +![Image 98: Circle CI](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7178e86bb681268f83f_circleci.svg) -![Image 97: Heroku](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68068c3dde31fea35d4fb6a2_heroku.svg) +![Image 99: Heroku](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68068c3dde31fea35d4fb6a2_heroku.svg) -![Image 98: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg) +![Image 100: Stripe](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7c49d9f83e31f32a5a3_stripe.svg) -![Image 99: New Relic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7828d47b543c12af704_new-relic.svg) +![Image 101: New Relic](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7828d47b543c12af704_new-relic.svg) -![Image 100: Kubernetes](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6807cad844dfad4bc382dde6_kubernetes.svg) +![Image 102: Kubernetes](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6807cad844dfad4bc382dde6_kubernetes.svg) -![Image 101: Vercel](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c706ccc4c67a9c9084ed_vercel.svg) +![Image 103: Vercel](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c706ccc4c67a9c9084ed_vercel.svg) -![Image 102: Elasticsearch](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68079341f3a5b247cbfdf145_elasticsearch.svg) +![Image 104: Elasticsearch](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68079341f3a5b247cbfdf145_elasticsearch.svg) -![Image 103: MongoDB](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7bf58514b6a497c0d04_mongodb.svg) +![Image 105: MongoDB](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6803c7bf58514b6a497c0d04_mongodb.svg) -![Image 104: Gitlab](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67efeb6ff18d6b00eeb70e5c_gitlab.svg) +![Image 106: Gitlab](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67efeb6ff18d6b00eeb70e5c_gitlab.svg) -![Image 105: Atlassian](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68068bb9966a8e711e939c40_atlassian.svg) +![Image 107: Atlassian](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68068bb9966a8e711e939c40_atlassian.svg) What could you do with Claude Code? ----------------------------------- ### See examples -[Code onboarding](https://www.anthropic.com/claude-code#w-tabs-1-data-w-pane-0)[Triage issues](https://www.anthropic.com/claude-code#w-tabs-1-data-w-pane-1)[Refactor code](https://www.anthropic.com/claude-code#w-tabs-1-data-w-pane-2) - -· - -Puttering… - -· - -Coalescing… +[Code onboarding](https://www.anthropic.com/claude-code)[Triage issues](https://www.anthropic.com/claude-code)[Refactor code](https://www.anthropic.com/claude-code) Install [Node.js 18+](https://nodejs.org/en/download), then run: @@ -369,7 +346,7 @@ Ethan @ethancatzel -![Image 106: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) +![Image 108: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) “ @@ -379,7 +356,7 @@ Anton Biryukov Staff Software Engineer at Ramp -![Image 107: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) +![Image 109: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) “ @@ -389,7 +366,7 @@ Fergal Reid VP of AI at Intercom -![Image 108: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) +![Image 110: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) “ @@ -399,7 +376,7 @@ Bradley Silicani COO, Anrok -![Image 109: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) +![Image 111: Slack](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67d466ebe07e57c6905a70af_slack.svg) What developers say about Claude Code ------------------------------------- @@ -423,21 +400,21 @@ VP of AI at Intercom Get started with Claude Code ---------------------------- -[Individual](https://www.anthropic.com/claude-code#w-tabs-2-data-w-pane-0)[Team &Enterprise](https://www.anthropic.com/claude-code#w-tabs-2-data-w-pane-1) +[Individual](https://www.anthropic.com/claude-code)[Team &Enterprise](https://www.anthropic.com/claude-code) -* ### Pro $17 Per month with annual subscription discount; $200 billed up front. $20 if billed monthly. Claude Code is included in your Pro plan. Perfect for short coding sprints in smaller codebases with Claude Sonnet 4. [Sign up](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/upgrade/pro?returnTo=/claude-code-install)Sign up Sign up -* ### Max 5x $100 Per person billed monthly Claude Code is included in your Max plan. Great value for everyday use in larger codebases with access to both Claude Sonnet 4 & Claude Opus 4.1. [Sign up](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/upgrade/max?plan=max_5x&returnTo=/claude-code-install)Sign up Sign up -* ### Max 20x $200 Per person billed monthly Even more Claude Code included in your Max plan. Great value for power users with the most access to Claude Opus 4.1. [Sign up](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/upgrade/max?plan=max_20x&returnTo=/claude-code-install)Sign up Sign up +* ### Pro $17 Per month with annual subscription discount; $200 billed up front. $20 if billed monthly. Claude Code is included in your Pro plan. Perfect for short coding sprints in smaller codebases with Claude Sonnet 4. [Sign up](https://claude.ai/upgrade/pro?returnTo=/claude-code-install)Sign up Sign up +* ### Max 5x $100 Per person billed monthly Claude Code is included in your Max plan. Great value for everyday use in larger codebases with access to both Claude Sonnet 4 & Claude Opus 4.1. [Sign up](https://claude.ai/upgrade/max?plan=max_5x&returnTo=/claude-code-install)Sign up Sign up +* ### Max 20x $200 Per person billed monthly Even more Claude Code included in your Max plan. Great value for power users with the most access to Claude Opus 4.1. [Sign up](https://claude.ai/upgrade/max?plan=max_20x&returnTo=/claude-code-install)Sign up Sign up *Additional [usage limits](https://support.anthropic.com/en/articles/9797557-usage-limit-best-practices) apply. Prices shown do not include applicable tax. * ### Anthropic API Pay as you go with standard Anthropic API pricing. Deploy to unlimited developers with no per-seat fee or platform charges. [Start building](https://console.anthropic.com/login?returnTo=%2F%3F)Start building Start building -* ### Team $150 Per person / month. Minimum 5 members. Claude Code is included with Team plan premium seats. Includes self-serve seat management and additional usage at standard API rates, plus access to both Claude Sonnet 4 and Claude Opus 4.1. [Get the Team plan](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/login)Get the Team plan Get the Team plan +* ### Team $150 Per person / month. Minimum 5 members. Claude Code is included with Team plan premium seats. Includes self-serve seat management and additional usage at standard API rates, plus access to both Claude Sonnet 4 and Claude Opus 4.1. [Get the Team plan](https://claude.ai/login)Get the Team plan Get the Team plan * ### Enterprise Enterprise plan premium seats include everything in the Team plan, plus advanced security, data, and user management. [Contact sales](https://anthropic.com/contact-sales)Contact sales Contact sales Prices shown do not include applicable tax. [Usage limits](https://support.anthropic.com/en/articles/9797557-usage-limit-best-practices) may apply. -![Image 110](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ed67fc18fe086b196a7cab_Hands-Build.svg) +![Image 112](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ed67fc18fe086b196a7cab_Hands-Build.svg) Education plan -------------- @@ -455,7 +432,7 @@ Learn more Get the technical rundown ------------------------- -![Image 111](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68026809a6058737d33fa527_f81f07f771658cd88aa48f8832e27510_Code-Document.svg) +![Image 113](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/68026809a6058737d33fa527_f81f07f771658cd88aa48f8832e27510_Code-Document.svg) Developer docs @@ -464,7 +441,7 @@ Claude Code documentation [Learn more](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview)Learn more -![Image 112](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ed7b7964de6dd5ae87c762_Nodes-BookOpen.svg) +![Image 114](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ed7b7964de6dd5ae87c762_Nodes-BookOpen.svg) Developer docs @@ -473,7 +450,7 @@ Claude Code tutorials [Learn more](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials)Learn more -![Image 113](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ed7b792381adee206836ac_Nodes-Presentation.svg) +![Image 115](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/67ed7b792381adee206836ac_Nodes-Presentation.svg) Case study @@ -510,7 +487,7 @@ When used with an Anthropic Console account, Claude Code consumes API tokens at Organizations can use Claude Code by issuing users ‘Developer’ roles under their Anthropic Console account. [Contact our sales team](https://www.anthropic.com/contact-sales) for more information. -![Image 114](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6892041a22121dadb0e34d89_Object-Envelope.svg) +![Image 116](https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/6892041a22121dadb0e34d89_Object-Envelope.svg) Get the developer newsletter ---------------------------- @@ -525,8 +502,8 @@ Hmm, we couldn’t process that. Please try again. Please provide your email address if you’d like to receive our monthly developer newsletter. You can unsubscribe at any time. -Create what’s exciting. Maintain what’s essential.Create what’s exciting.Maintain what’s essential. ---------------------------------------------------------------------------------------------------- +Create what’s exciting. Maintain what’s essential. +-------------------------------------------------- Install [Node.js 18+](https://nodejs.org/en/download), then run: @@ -548,9 +525,9 @@ Footer * [Max plan](https://www.anthropic.com/max) * [Team plan](https://www.anthropic.com/team) * [Enterprise plan](https://www.anthropic.com/enterprise) -* [Download Claude apps](https://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/download) +* [Download Claude apps](https://claude.ai/download) * [Claude.ai pricing plans](https://www.anthropic.com/pricing) -* [Claude.ai login](http://claude.ai/redirect/website.v1.a8325fb0-6ad1-426e-8402-0c8e85387a53/login) +* [Claude.ai login](http://claude.ai/login) ### API Platform @@ -629,7 +606,7 @@ Enables ads personalization and tracking. Off- [x] Save preferences * [Terms of service - commercial](https://www.anthropic.com/legal/commercial-terms) * [Usage policy](https://www.anthropic.com/legal/aup) -© 2025 Anthropic PBC +© 2024 Anthropic PBC * [](https://www.youtube.com/@anthropic-ai) * [](https://www.linkedin.com/company/anthropicresearch) diff --git a/content/anthropic-blog/engineering/claude-code-best-practices.md b/content/anthropic-blog/engineering/claude-code-best-practices.md index 8e003cdac..f586eb75a 100644 --- a/content/anthropic-blog/engineering/claude-code-best-practices.md +++ b/content/anthropic-blog/engineering/claude-code-best-practices.md @@ -9,7 +9,7 @@ Claude Code is intentionally low-level and unopinionated, providing close to raw This post outlines general patterns that have proven effective, both for Anthropic's internal teams and for external engineers using Claude Code across various codebases, languages, and environments. Nothing in this list is set in stone nor universally applicable; consider these suggestions as starting points. We encourage you to experiment and find what works best for you! -_Looking for more detailed information? Our comprehensive documentation at [claude.ai/code](https://claude.ai/redirect/website.v1.33c33977-ff7a-4ee3-a942-4474e8555f53/code)_ _covers all the features mentioned in this post and provides additional examples, implementation details, and advanced techniques._ +_Looking for more detailed information? Our comprehensive documentation at [claude.ai/code](https://claude.ai/redirect/website.v1.f63ff586-18e6-4793-91d8-2209484351f7/code)_ _covers all the features mentioned in this post and provides additional examples, implementation details, and advanced techniques._ 1. Customize your setup ----------------------- diff --git a/content/claude-code-docs/sdk/sdk-overview.md b/content/claude-code-docs/sdk/sdk-overview.md index 05f109c76..d8905cbf9 100644 --- a/content/claude-code-docs/sdk/sdk-overview.md +++ b/content/claude-code-docs/sdk/sdk-overview.md @@ -2,6 +2,14 @@ > Build custom AI agents with the Claude Code SDK +## SDK Options + +The Claude Code SDK is available in multiple forms to suit different use cases: + +* **[Headless Mode](/en/docs/claude-code/sdk/sdk-headless)** - For CLI scripts and automation +* **[TypeScript SDK](/en/docs/claude-code/sdk/sdk-typescript)** - For Node.js and web applications +* **[Python SDK](/en/docs/claude-code/sdk/sdk-python)** - For Python applications and data science + ## Why use the Claude Code SDK? Built on top of the agent harness that powers Claude Code, the Claude Code SDK provides all the building blocks you need to build production-ready agents: @@ -29,14 +37,6 @@ Here are some example agent types you can create: * Customer support agents that resolve technical issues * Content creation assistants for marketing teams -## SDK Options - -The Claude Code SDK is available in multiple forms to suit different use cases: - -* **[Headless Mode](/en/docs/claude-code/sdk/sdk-headless)** - For CLI scripts and automation -* **[TypeScript SDK](/en/docs/claude-code/sdk/sdk-typescript)** - For Node.js and web applications -* **[Python SDK](/en/docs/claude-code/sdk/sdk-python)** - For Python applications and data science - ## Core Concepts ### Authentication @@ -50,6 +50,17 @@ The SDK also supports authentication via third-party API providers: For detailed configuration instructions for third-party providers, see the [Amazon Bedrock](/en/docs/claude-code/amazon-bedrock) and [Google Vertex AI](/en/docs/claude-code/google-vertex-ai) documentation. +### Full Claude Code Feature Support + +The SDK provides access to all the default features available in Claude Code, leveraging the same file system-based configuration: + +* **Subagents**: Launch specialized agents stored as Markdown files in `./.claude/agents/` +* **Hooks**: Execute custom commands configured in `./.claude/settings.json` that respond to tool events +* **Slash Commands**: Use custom commands defined as Markdown files in `./.claude/commands/` +* **Memory (CLAUDE.md)**: Maintain project context through `CLAUDE.md` files that provide persistent instructions and context + +These features work identically to their Claude Code counterparts by reading from the same file system locations. + ### System Prompts System prompts define your agent's role, expertise, and behavior. This is where you specify what kind of agent you're building. @@ -66,37 +77,6 @@ Control which tools your agent can use with fine-grained permissions: Extend your agents with custom tools and integrations through MCP servers. This allows you to connect to databases, APIs, and other external services. -## Common Use Cases - -### Automated Testing and CI/CD - -Create agents that run tests, analyze results, and fix issues automatically in your CI/CD pipeline. - -### Code Review and Security Audits - -Build agents that review pull requests for security vulnerabilities, code quality, and compliance. - -### Incident Response - -Deploy SRE agents that diagnose production issues, analyze logs, and suggest fixes. - -### Documentation Generation - -Create agents that generate and maintain documentation based on your codebase. - -### Data Analysis - -Build agents that analyze data, generate reports, and create visualizations. - -## Best Practices - -* **Use JSON output format** for programmatic parsing of responses -* **Handle errors gracefully** - check exit codes and implement retry logic -* **Use session management** for maintaining context in multi-turn conversations -* **Implement timeouts** for long-running operations -* **Respect rate limits** when making multiple requests -* **Test thoroughly** before deploying to production - ## Related Resources * [CLI Reference](/en/docs/claude-code/cli-reference) - Complete CLI documentation diff --git a/content/claude-code-docs/sdk/sdk-typescript.md b/content/claude-code-docs/sdk/sdk-typescript.md index 5fc5af37f..2de890d7e 100644 --- a/content/claude-code-docs/sdk/sdk-typescript.md +++ b/content/claude-code-docs/sdk/sdk-typescript.md @@ -27,14 +27,14 @@ import { query } from "@anthropic-ai/claude-code"; for await (const message of query({ prompt: "Analyze system performance", - abortController: new AbortController(), options: { maxTurns: 5, - systemPrompt: "You are a performance engineer", - allowedTools: ["Bash", "Read", "WebSearch"] + appendSystemPrompt: "You are a performance engineer", + allowedTools: ["Bash", "Read", "WebSearch"], + abortController: new AbortController(), } })) { - if (message.type === "result") { + if (message.type === "result" && message.subtype === "success") { console.log(message.result); } } @@ -42,31 +42,31 @@ for await (const message of query({ ## Configuration options -| Argument | Type | Description | Default | -| :--------------------------- | :-------------------------------- | :----------------------------------------------- | :----------------------------------------------------------------------------------- | -| `abortController` | `AbortController` | Abort controller for cancelling operations | `new AbortController()` | -| `additionalDirectories` | `string[]` | Additional directories to include in the session | `undefined` | -| `allowedTools` | `string[]` | List of tools that Claude is allowed to use | All tools enabled by default | -| `appendSystemPrompt` | `string` | Text to append to the default system prompt | `undefined` | -| `canUseTool` | `CanUseTool` | Custom permission function for tool usage | `undefined` | -| `continue` | `boolean` | Continue the most recent session | `false` | -| `customSystemPrompt` | `string` | Replace the default system prompt entirely | `undefined` | -| `cwd` | `string` | Current working directory | `process.cwd()` | -| `disallowedTools` | `string[]` | List of tools that Claude is not allowed to use | `undefined` | -| `env` | `Dict` | Environment variables to set | `undefined` | -| `executable` | `'bun' \| 'deno' \| 'node'` | Which JavaScript runtime to use | `node` when running with Node.js, `bun` when running with Bun | -| `executableArgs` | `string[]` | Arguments to pass to the executable | `[]` | -| `fallbackModel` | `string` | Model to use if primary model fails | `undefined` | -| `maxThinkingTokens` | `number` | Maximum tokens for Claude's thinking process | `undefined` | -| `maxTurns` | `number` | Maximum number of conversation turns | `undefined` | -| `mcpServers` | `Record` | MCP server configurations | `undefined` | -| `model` | `string` | Claude model to use | Uses default from CLI configuration | -| `pathToClaudeCodeExecutable` | `string` | Path to the Claude Code executable | Executable that ships with `@anthropic-ai/claude-code` | -| `permissionMode` | `PermissionMode` | Permission mode for the session | `"default"` (options: `"default"`, `"acceptEdits"`, `"bypassPermissions"`, `"plan"`) | -| `permissionPromptToolName` | `string` | Name of MCP tool for permission prompts | `undefined` | -| `resume` | `string` | Session ID to resume | `undefined` | -| `stderr` | `(data: string) => void` | Callback for stderr output | `undefined` | -| `strictMcpConfig` | `boolean` | Enforce strict MCP configuration validation | `undefined` | +| Argument | Type | Description | Default | +| :--------------------------- | :---------------------------------------------------------------- | :----------------------------------------------- | :----------------------------------------------------------------------------------- | +| `abortController` | `AbortController` | Abort controller for cancelling operations | `new AbortController()` | +| `additionalDirectories` | `string[]` | Additional directories to include in the session | `undefined` | +| `allowedTools` | `string[]` | List of tools that Claude is allowed to use | All tools enabled by default | +| `appendSystemPrompt` | `string` | Text to append to the default system prompt | `undefined` | +| `canUseTool` | `(toolName: string, input: any) => Promise` | Custom permission function for tool usage | `undefined` | +| `continue` | `boolean` | Continue the most recent session | `false` | +| `customSystemPrompt` | `string` | Replace the default system prompt entirely | `undefined` | +| `cwd` | `string` | Current working directory | `process.cwd()` | +| `disallowedTools` | `string[]` | List of tools that Claude is not allowed to use | `undefined` | +| `env` | `Dict` | Environment variables to set | `undefined` | +| `executable` | `'bun' \| 'deno' \| 'node'` | Which JavaScript runtime to use | `node` when running with Node.js, `bun` when running with Bun | +| `executableArgs` | `string[]` | Arguments to pass to the executable | `[]` | +| `fallbackModel` | `string` | Model to use if primary model fails | `undefined` | +| `hooks` | `Partial>` | Lifecycle hooks for customization | `undefined` | +| `maxThinkingTokens` | `number` | Maximum tokens for Claude's thinking process | `undefined` | +| `maxTurns` | `number` | Maximum number of conversation turns | `undefined` | +| `mcpServers` | `Record` | MCP server configurations | `undefined` | +| `model` | `string` | Claude model to use | Uses default from CLI configuration | +| `pathToClaudeCodeExecutable` | `string` | Path to the Claude Code executable | Executable that ships with `@anthropic-ai/claude-code` | +| `permissionMode` | `PermissionMode` | Permission mode for the session | `"default"` (options: `"default"`, `"acceptEdits"`, `"bypassPermissions"`, `"plan"`) | +| `resume` | `string` | Session ID to resume | `undefined` | +| `stderr` | `(data: string) => void` | Callback for stderr output | `undefined` | +| `strictMcpConfig` | `boolean` | Enforce strict MCP configuration validation | `undefined` | ## Multi-turn conversations @@ -83,8 +83,8 @@ import { query } from "@anthropic-ai/claude-code"; for await (const message of query({ prompt: "Now refactor this for better performance", options: { continue: true } -})) { - if (message.type === "result") console.log(message.result); +})) { + if (message.type === "result" && message.subtype === "success") console.log(message.result); } // Resume specific session @@ -95,7 +95,7 @@ for await (const message of query({ maxTurns: 3 } })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } ``` @@ -136,7 +136,7 @@ for await (const message of query({ allowedTools: ["Read", "Grep", "Bash"] } })) { - if (message.type === "result") { + if (message.type === "result" && message.subtype === "success") { console.log(message.result); } } @@ -177,7 +177,7 @@ async function* messagesWithImage() { for await (const message of query({ prompt: messagesWithImage() })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } ``` @@ -192,11 +192,11 @@ import { query } from "@anthropic-ai/claude-code"; for await (const message of query({ prompt: "API is down, investigate", options: { - systemPrompt: "You are an SRE expert. Diagnose issues systematically and provide actionable solutions.", + customSystemPrompt: "You are an SRE expert. Diagnose issues systematically and provide actionable solutions.", maxTurns: 3 } })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } // Append to default system prompt @@ -207,11 +207,11 @@ for await (const message of query({ maxTurns: 2 } })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } ``` -## Custom tools via MCP +## MCP Server Integration The Model Context Protocol (MCP) lets you give your agents custom tools and capabilities: @@ -224,11 +224,11 @@ for await (const message of query({ options: { mcpConfig: "sre-tools.json", allowedTools: ["mcp__datadog", "mcp__pagerduty", "mcp__kubernetes"], - systemPrompt: "You are an SRE. Use monitoring data to diagnose issues.", + appendSystemPrompt: "You are an SRE. Use monitoring data to diagnose issues.", maxTurns: 4 } })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } ``` @@ -342,18 +342,325 @@ tool( ) ``` -### Permission control +## Hooks + +Hooks allow you to customize and extend Claude Code's behavior by running custom callbacks at various points in the agent's lifecycle. Unlike CLI hooks that execute bash commands, SDK hooks are JavaScript/TypeScript functions that run in-process. + +### Defining hooks + +Hooks are organized by event type, with optional matchers to filter when they run: + +```ts +import { query } from "@anthropic-ai/claude-code"; + +for await (const message of query({ + prompt: "Analyze the codebase", + options: { + hooks: { + PreToolUse: [ + { + matcher: "Write", + hooks: [ + async (input, toolUseId, { signal }) => { + console.log(`About to write file: ${input.tool_input.file_path}`); + + // Validate the operation + if (input.tool_input.file_path.includes('.env')) { + return { + decision: 'block', + stopReason: 'Cannot write to environment files' + }; + } + + // Allow the operation + return { continue: true }; + } + ] + } + ], + PostToolUse: [ + { + matcher: "Write|Edit", + hooks: [ + async (input, toolUseId, { signal }) => { + console.log(`File modified: ${input.tool_response.filePath}`); + // Run your custom formatting or validation + return { continue: true }; + } + ] + } + ] + } + } +})) { + if (message.type === "result") console.log(message.result); +} +``` + +### Available hook events + +* **PreToolUse**: Runs before tool execution. Can block tools or provide feedback. +* **PostToolUse**: Runs after successful tool execution. +* **UserPromptSubmit**: Runs when user submits a prompt. +* **SessionStart**: Runs when a session starts. +* **SessionEnd**: Runs when a session ends. +* **Stop**: Runs when Claude is about to stop responding. +* **SubagentStop**: Runs when a subagent is about to stop. +* **PreCompact**: Runs before conversation compaction. +* **Notification**: Runs when notifications are sent. + +### Hook input types + +Each hook receives typed input based on the event: + +```ts +// PreToolUse input +type PreToolUseHookInput = { + hook_event_name: 'PreToolUse'; + session_id: string; + transcript_path: string; + cwd: string; + permission_mode?: string; + tool_name: string; + tool_input: unknown; +} + +// PostToolUse input +type PostToolUseHookInput = { + hook_event_name: 'PostToolUse'; + session_id: string; + transcript_path: string; + cwd: string; + permission_mode?: string; + tool_name: string; + tool_input: unknown; + tool_response: unknown; +} +``` + +### Hook output + +Hooks return output that controls execution flow: + +```ts +interface HookJSONOutput { + // Continue execution (default: true) + continue?: boolean; + + // Suppress output to user + suppressOutput?: boolean; + + // Stop reason (shown to model) + stopReason?: string; + + // Decision for PreToolUse hooks + decision?: 'approve' | 'block'; + + // System message to show + systemMessage?: string; + + // Hook-specific output + hookSpecificOutput?: { + // For PreToolUse + permissionDecision?: 'allow' | 'deny' | 'ask'; + permissionDecisionReason?: string; + + // For UserPromptSubmit or PostToolUse + additionalContext?: string; + }; +} +``` + +### Practical examples + +#### Logging and monitoring + +```ts +const hooks = { + PreToolUse: [ + { + hooks: [ + async (input) => { + // Log all tool usage + await logToMonitoring({ + event: 'tool_use', + tool: input.tool_name, + input: input.tool_input, + session: input.session_id + }); + + return { continue: true }; + } + ] + } + ] +}; +``` + +#### File operation validation + +```ts +const hooks = { + PreToolUse: [ + { + matcher: "Write|Edit", + hooks: [ + async (input) => { + const filePath = input.tool_input.file_path; + + // Block sensitive files + const sensitivePatterns = ['.env', '.git/', 'secrets/', '*.key']; + + for (const pattern of sensitivePatterns) { + if (filePath.includes(pattern)) { + return { + decision: 'block', + stopReason: `Cannot modify sensitive file matching ${pattern}` + }; + } + } + + return { continue: true }; + } + ] + } + ] +}; +``` + +#### Auto-formatting code + +```ts +import { exec } from 'child_process'; +import { promisify } from 'util'; + +const execAsync = promisify(exec); + +const hooks = { + PostToolUse: [ + { + matcher: "Write|Edit|MultiEdit", + hooks: [ + async (input) => { + const filePath = input.tool_response.filePath; + + // Auto-format based on file type + if (filePath.endsWith('.ts') || filePath.endsWith('.tsx')) { + await execAsync(`prettier --write "${filePath}"`); + } else if (filePath.endsWith('.py')) { + await execAsync(`black "${filePath}"`); + } + + return { continue: true }; + } + ] + } + ] +}; +``` + +#### Prompt enhancement + +```ts +const hooks = { + UserPromptSubmit: [ + { + hooks: [ + async (input) => { + // Add context to prompts + const projectContext = await loadProjectContext(); + + return { + continue: true, + hookSpecificOutput: { + hookEventName: 'UserPromptSubmit', + additionalContext: `Project context: ${projectContext}` + } + }; + } + ] + } + ] +}; +``` + +#### Custom compaction instructions + +```ts +const hooks = { + PreCompact: [ + { + hooks: [ + async (input) => { + const trigger = input.trigger; // 'manual' or 'auto' + + return { + continue: true, + systemMessage: 'Focus on preserving implementation details and error resolutions' + }; + } + ] + } + ] +}; +``` + +### Hook execution behavior + +* **Parallelization**: All matching hooks run in parallel +* **Timeout**: Hooks respect the abort signal from options +* **Error handling**: Hook errors are logged but don't stop execution +* **Matchers**: Support regex patterns (e.g., `"Write|Edit"`) + +### Combining hooks with canUseTool + +While `canUseTool` provides permission control, hooks offer broader lifecycle integration: + +```ts +for await (const message of query({ + prompt: "Build the feature", + options: { + // Fine-grained permission control + canUseTool: async (toolName, input) => { + // Modify inputs or deny based on runtime conditions + return { behavior: "allow", updatedInput: input }; + }, + + // Lifecycle hooks for monitoring and automation + hooks: { + PreToolUse: [ + { + hooks: [ + async (input) => { + // Log, validate, or prepare + return { continue: true }; + } + ] + } + ] + } + } +})) { + // Process messages +} +``` + +## Permission control with canUseTool -Combine SDK MCP servers with the `canUseTool` callback for fine-grained permission control: +The `canUseTool` callback provides fine-grained control over tool execution. It's called before each tool use and can allow, deny, or modify tool inputs: ```ts +type ToolPermissionResult = + | { behavior: "allow"; updatedInput?: any } + | { behavior: "deny"; message?: string }; + for await (const message of query({ prompt: "Analyze user behavior and calculate metrics", options: { mcpServers: { "analytics": analyticsServer }, - canUseTool: async (toolName, input) => { + canUseTool: async (toolName: string, input: any) => { // Control which tools can be used if (toolName.startsWith("mcp__analytics__")) { // Check permissions for analytics tools @@ -364,6 +671,13 @@ for await (const message of query({ : { behavior: "deny", message: "Insufficient permissions" }; } + // Modify inputs for certain tools + if (toolName === "Bash") { + // Add safety checks or modify commands + const safeInput = sanitizeBashCommand(input); + return { behavior: "allow", updatedInput: safeInput }; + } + // Allow other tools by default return { behavior: "allow", updatedInput: input }; } @@ -373,67 +687,55 @@ for await (const message of query({ } ``` -### Benefits of SDK MCP servers +### Use cases for canUseTool -* **Type Safety**: Full TypeScript type inference from Zod schemas -* **Performance**: No IPC or network overhead - tools run in the same process -* **Direct Access**: Tools can directly access your application's state, database, and services -* **Easy Testing**: Simple to unit test since tools are just async functions -* **No Configuration**: No need for separate server processes or configuration files - -## Custom tools using external MCP servers - -You can also implement custom tools using external MCP servers, for example here is how you can create a custom permission handling tool. +* **Permission management**: Check user permissions before allowing tool execution +* **Input validation**: Validate or sanitize tool inputs before execution +* **Rate limiting**: Implement rate limits for expensive operations +* **Audit logging**: Log tool usage for compliance or debugging +* **Dynamic permissions**: Enable/disable tools based on runtime conditions ```ts -const server = new McpServer({ - name: "Test permission prompt MCP Server", - version: "0.0.1", -}); - -server.tool( - "approval_prompt", - 'Simulate a permission check - approve if the input contains "allow", otherwise deny', - { - tool_name: z.string().describe("The name of the tool requesting permission"), - input: z.object({}).passthrough().describe("The input for the tool"), - tool_use_id: z.string().optional().describe("The unique tool use request ID"), - }, - async ({ tool_name, input }) => { - return { - content: [ - { - type: "text", - text: JSON.stringify( - JSON.stringify(input).includes("allow") - ? { - behavior: "allow", - updatedInput: input, - } - : { - behavior: "deny", - message: "Permission denied by test approval_prompt tool", - } - ), - }, - ], - }; +// Example: Web scraping rate limiter +const rateLimits = new Map(); + +const canUseTool = async (toolName: string, input: any) => { + // Rate limit web scraping to prevent IP bans and API quota issues + if (toolName === "WebFetch" || toolName === "WebSearch") { + const now = Date.now(); + const limit = rateLimits.get(toolName) || { count: 0, resetTime: now + 60000 }; + + // Reset counter every minute + if (now > limit.resetTime) { + limit.count = 0; + limit.resetTime = now + 60000; + } + + // Allow max 10 requests per minute + if (limit.count >= 10) { + return { + behavior: "deny", + message: `Rate limit exceeded: max 10 ${toolName} requests per minute. Resets in ${Math.ceil((limit.resetTime - now) / 1000)}s` + }; + } + + limit.count++; + rateLimits.set(toolName, limit); + + // Log scraping activity for monitoring + console.log(`${toolName} request ${limit.count}/10 to: ${input.url || input.query}`); } -); - -// Use in SDK -import { query } from "@anthropic-ai/claude-code"; - -for await (const message of query({ - prompt: "Analyze the codebase", - options: { - permissionPromptTool: "mcp__test-server__approval_prompt", - mcpConfig: "my-config.json", - allowedTools: ["Read", "Grep"] + + // Prevent accidental infinite loops in bash scripts + if (toolName === "Bash" && input.command?.includes("while true")) { + return { + behavior: "deny", + message: "Infinite loops are not allowed" + }; } -})) { - if (message.type === "result") console.log(message.result); -} + + return { behavior: "allow", updatedInput: input }; +}; ``` ## Output formats @@ -445,7 +747,7 @@ for await (const message of query({ for await (const message of query({ prompt: "Explain file src/components/Header.tsx" })) { - if (message.type === "result") { + if (message.type === "result" && message.subtype === "success") { console.log(message.result); // Output: This is a React component showing... } @@ -464,7 +766,7 @@ for await (const message of query({ } // Access result message with metadata -const result = messages.find(m => m.type === "result"); +const result = messages.find(m => m.type === "result" && message.subtype === "success"); console.log({ result: result.result, cost: result.total_cost_usd, @@ -479,13 +781,13 @@ console.log({ for await (const message of query({ prompt: "Explain this code" })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } // From variable const userInput = "Explain this code"; for await (const message of query({ prompt: userInput })) { - if (message.type === "result") console.log(message.result); + if (message.type === "result" && message.subtype === "success") console.log(message.result); } ``` @@ -506,7 +808,7 @@ async function investigateIncident( for await (const message of query({ prompt: `Incident: ${incidentDescription} (Severity: ${severity})`, options: { - systemPrompt: "You are an SRE expert. Diagnose the issue, assess impact, and provide immediate action items.", + appendSystemPrompt: "You are an SRE expert. Diagnose the issue, assess impact, and provide immediate action items.", maxTurns: 6, allowedTools: ["Bash", "Read", "WebSearch", "mcp__datadog"], mcpConfig: "monitoring-tools.json" @@ -515,7 +817,7 @@ async function investigateIncident( messages.push(message); } - return messages.find(m => m.type === "result"); + return messages.find(m => m.type === "result" && message.subtype === "success"); } // Usage @@ -537,7 +839,7 @@ async function auditPR(prNumber: number) { for await (const message of query({ prompt: prDiff, options: { - systemPrompt: "You are a security engineer. Review this PR for vulnerabilities, insecure patterns, and compliance issues.", + appendSystemPrompt: "You are a security engineer. Review this PR for vulnerabilities, insecure patterns, and compliance issues.", maxTurns: 3, allowedTools: ["Read", "Grep", "WebSearch"] } @@ -545,7 +847,7 @@ async function auditPR(prNumber: number) { messages.push(message); } - return messages.find(m => m.type === "result"); + return messages.find(m => m.type === "result" && message.subtype === "success"); } // Usage @@ -583,7 +885,7 @@ async function legalReview() { prompt: step, options: { resume: sessionId, maxTurns: 2 } })) { - if (message.type === "result") { + if (message.type === "result" && message.subtype === "success") { console.log(`Step: ${step}`); console.log(message.result); } diff --git a/content/claude-code-docs/security.md b/content/claude-code-docs/security.md index e754143f8..a25e73a6b 100644 --- a/content/claude-code-docs/security.md +++ b/content/claude-code-docs/security.md @@ -20,7 +20,7 @@ For detailed permission configuration, see [Identity and Access Management](/en/ To mitigate risks in agentic systems: -* **Write access restriction**: Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary +* **Write access restriction**: Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary * **Prompt fatigue mitigation**: Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **Accept Edits mode**: Batch accept multiple edits while maintaining permission prompts for commands with side effects diff --git a/content/claude-code-docs/settings.md b/content/claude-code-docs/settings.md index abc137ea0..646373422 100644 --- a/content/claude-code-docs/settings.md +++ b/content/claude-code-docs/settings.md @@ -232,7 +232,6 @@ Claude Code has access to a set of powerful tools that help it understand and mo | **Edit** | Makes targeted edits to specific files | Yes | | **Glob** | Finds files based on pattern matching | No | | **Grep** | Searches for patterns in file contents | No | -| **LS** | Lists files and directories | No | | **MultiEdit** | Performs multiple edits on a single file atomically | Yes | | **NotebookEdit** | Modifies Jupyter notebook cells | Yes | | **NotebookRead** | Reads and displays Jupyter notebook contents | No | diff --git a/content/claude-code-manifest.json b/content/claude-code-manifest.json index a8025f34f..fc65f70c2 100644 --- a/content/claude-code-manifest.json +++ b/content/claude-code-manifest.json @@ -1,12 +1,12 @@ { "name": "@anthropic-ai/claude-code", - "version": "1.0.106", + "version": "1.0.108", "author": { "name": "Anthropic", "email": "support@anthropic.com" }, "license": "SEE LICENSE IN README.md", - "_id": "@anthropic-ai/claude-code@1.0.106", + "_id": "@anthropic-ai/claude-code@1.0.108", "maintainers": [ { "name": "zak-anthropic", @@ -53,17 +53,17 @@ "claude": "cli.js" }, "dist": { - "shasum": "3543052edfddfffa14d78111c56a9a362ddc26f7", - "tarball": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-1.0.106.tgz", + "shasum": "9b10bd911250612abfb3c8594987abc56c667588", + "tarball": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-1.0.108.tgz", "fileCount": 53, - "integrity": "sha512-Ev/y9KNm1FYyhCZcR2cqf9sMi0W8iFXaxhAngQ9vAKD1Et0EO8KIc1JJyUuR4z3jhkAaBYF2uA/mrjFaOD013A==", + "integrity": "sha512-9CsfjFBsv8N8I69yqdmv0Jcp9Xpp+kQIONZRIKpnEtNUZn3Q61vYyaFTliobJPk9M/tmuXjYCh3VEpLHu9Jotw==", "signatures": [ { - "sig": "MEYCIQC+LORTL41QVp20O0XHXLV9UYMBqS31k6eyHFOLe9V56QIhAMc5H6ngsLUwLVUaQS66hoe32HdF580JfdmknLhxKTkK", + "sig": "MEYCIQCw1Zne8e+ZhZj0zzg9v6Mij1IQIdhAacm7BGDSnUZKbwIhAN+VVmuhzFg0S0Wl6j09aQgS6U2G5dhIZlliAjHEq1Cu", "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U" } ], - "unpackedSize": 78083289 + "unpackedSize": 78155046 }, "main": "sdk.mjs", "type": "module", @@ -71,7 +71,7 @@ "engines": { "node": ">=18.0.0" }, - "gitHead": "94538780244c4a9589c4e38e17108cc6cbba046c", + "gitHead": "d3997e0d91f02bea6a6c5cdced7c79b60c102c25", "scripts": { "prepare": "node -e \"if (!process.env.AUTHORIZED) { console.error('ERROR: Direct publishing is not allowed.\\nPlease use the publish-external.sh script to publish this package.'); process.exit(1); }\"" }, @@ -95,7 +95,7 @@ "@img/sharp-darwin-arm64": "^0.33.5" }, "_npmOperationalInternal": { - "tmp": "tmp/claude-code_1.0.106_1757028141228_0.3624728733002047", + "tmp": "tmp/claude-code_1.0.108_1757111808611_0.8169961399236307", "host": "s3://npm-registry-packages-npm-production" } }