{"id":1324,"date":"2026-09-29T22:10:49","date_gmt":"2026-09-29T13:10:49","guid":{"rendered":"https:\/\/cg-method.com\/ai\/?p=1324"},"modified":"2026-09-29T22:10:49","modified_gmt":"2026-09-29T13:10:49","slug":"claude-code-context-compact","status":"publish","type":"post","link":"https:\/\/cg-method.com\/ai\/claude-code-context-compact\/","title":{"rendered":"Claude Code\u2502\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u6b8b\u308a\u3092\u898b\u308b\u30fb\u6e1b\u3089\u3059\uff5c\/context\u3068\/compact\u306e\u4f7f\u3044\u5206\u3051"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Claude Code \u306f\u3001\u4f1a\u8a71\u306e\u6587\u8108\uff08\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\uff09\u304c\u4e0a\u9650\u306b\u8fd1\u3065\u304f\u3068\u3001\u81ea\u52d5\u3067\u8981\u7d04\uff08\u5727\u7e2e\uff09\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9014\u4e2d\u3067\u8a71\u304c\u98db\u3076\u306e\u3092\u9632\u3050\u306b\u306f\u3001\/context \u3067\u6b8b\u308a\u3092\u898b\u3066\u3001\u533a\u5207\u308a\u306e\u3088\u3044\u3068\u3053\u308d\u3067\u81ea\u5206\u3067 \/compact \u3059\u308b\u306e\u304c\u78ba\u5b9f\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>\/context\uff1a\u4eca\u3069\u308c\u3060\u3051\u4f7f\u3063\u3066\u3044\u308b\u304b\u3092\u3001\u9805\u76ee\u3054\u3068\u306b\u8868\u793a\u3059\u308b<\/li>\n\n\n<li>\/compact \u6b8b\u3057\u305f\u3044\u3053\u3068\uff1a\u4f1a\u8a71\u3092\u8981\u7d04\u3057\u3066\u7a7a\u304d\u3092\u4f5c\u308b<\/li>\n\n\n<li>\/clear\uff1a\u4f1a\u8a71\u3092\u7a7a\u306b\u3057\u3066\u65b0\u3057\u304f\u59cb\u3081\u308b\uff08\u524d\u306e\u4f1a\u8a71\u306f \/resume \u3067\u623b\u308c\u308b\uff09<\/li>\n\n\n<li>\u81ea\u52d5\u5727\u7e2e\u306e\u767a\u52d5\u70b9\u306f \/autocompact \u3067\u6c7a\u3081\u3089\u308c\u308b\uff0810\u4e07\u301c100\u4e07\u30c8\u30fc\u30af\u30f3\uff09<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u306f\u3001Claude Code \u306e\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\uff08code.claude.com\/docs\u30012026\u5e749\u670829\u65e5\u306b\u78ba\u8a8d\uff09\u306b\u3082\u3068\u3065\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u624b\u5143\u306e\u78ba\u8a8d\u306f\u30012026\u5e749\u670829\u65e5\u306b Windows 11 \u306e Claude Code 2.1.284 \u3067\u3001\u7df4\u7fd2\u7528\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\uff08C:\\demo\\cc-b\uff09\u3092\u4f7f\u3063\u3066\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\/context\u306e\u8868\u793a<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\"><code>MSYS_NO_PATHCONV=1 claude -p \"\/context\"<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7df4\u7fd2\u7528\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u3067\u5b9f\u884c\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u51fa\u307e\u3057\u305f\uff08MCP \u306e\u30c4\u30fc\u30eb\u306e\u5185\u8a33\u306f\u7701\u3044\u3066\u3044\u307e\u3059\uff09\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>## Context Usage\n\n**Model:** claude-opus-5\n**Tokens:** 29k \/ 1m (3%)\n\n| Category | Tokens | Percentage |\n|----------|--------|------------|\n| System prompt | 3.2k | 0.3% |\n| System tools | 20.3k | 2.0% |\n| MCP tools (deferred) | 5.6k | 0.6% |\n| System tools (deferred) | 19.7k | 2.0% |\n| Custom agents | 45 | 0.0% |\n| Skills | 5.3k | 0.5% |\n| Messages | 8 | 0.0% |\n| Free space | 938k | 93.8% |\n| Autocompact buffer | 33k | 3.3% |<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f1a\u8a71\u3092\u59cb\u3081\u308b\u524d\u304b\u3089\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u6307\u793a\u3084\u30c4\u30fc\u30eb\u306e\u8aac\u660e\u3067\u7d0429,000\u30c8\u30fc\u30af\u30f3\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u81ea\u4f5c\u306e\u30b5\u30d6\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\uff08Custom agents\uff09\u3084\u30b9\u30ad\u30eb\uff08Skills\uff09\u3082\u3001\u8aac\u660e\u306e\u5206\u3060\u3051\u6587\u8108\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Git Bash \u3067\u306f \/context \u304c\u30d1\u30b9\u306b\u66f8\u304d\u63db\u3048\u3089\u308c\u308b\u306e\u3067\u3001MSYS_NO_PATHCONV=1 \u3092\u4ed8\u3051\u3066\u3044\u307e\u3059\uff08PowerShell \u306a\u3089\u4e0d\u8981\uff09\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\/compact\u3067\u7a7a\u304d\u3092\u4f5c\u308b<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-text\"><code>\/compact \u8a8d\u8a3c\u307e\u308f\u308a\u306e\u4fee\u6b63\u306e\u7d4c\u7def\u3092\u6b8b\u3057\u3066<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\/compact \u306e\u3042\u3068\u306b\u66f8\u3044\u305f\u6307\u793a\u3067\u3001\u8981\u7d04\u3067\u4f55\u3092\u6b8b\u3059\u304b\u3092\u6c7a\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CLAUDE.md \u306b\u300cCompact Instructions\u300d\u306e\u7bc0\u3092\u66f8\u3044\u3066\u304a\u304f\u3068\u3001\u6bce\u56de\u306e\u5727\u7e2e\u3067\u6b8b\u3059\u3053\u3068\u3092\u6307\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5727\u7e2e\u3067\u6d88\u3048\u308b\u3082\u306e\u30fb\u6b8b\u308b\u3082\u306e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>\u4f9d\u983c\u306e\u5185\u5bb9\u3068\u5927\u4e8b\u306a\u30b3\u30fc\u30c9\u306f\u6b8b\u308b\u304c\u3001\u4f1a\u8a71\u306e\u6700\u521d\u306e\u307b\u3046\u306e\u7d30\u304b\u3044\u6307\u793a\u306f\u5931\u308f\u308c\u308b\u3053\u3068\u304c\u3042\u308b<\/li>\n\n\n<li>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e CLAUDE.md \u3068\u81ea\u52d5\u30e1\u30e2\u30ea\u306f\u3001\u5727\u7e2e\u306e\u3042\u3068\u30c7\u30a3\u30b9\u30af\u304b\u3089\u8aad\u307f\u76f4\u3055\u308c\u308b<\/li>\n\n\n<li>\u6700\u8fd1\u89e6\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u6700\u59275\u3064\u8aad\u307f\u76f4\u3055\u308c\u308b<\/li>\n\n\n<li>\u4f7f\u3063\u305f\u30b9\u30ad\u30eb\u306e\u672c\u6587\u306f\u30011\u30645,000\u30c8\u30fc\u30af\u30f3\u30fb\u5408\u8a0825,000\u30c8\u30fc\u30af\u30f3\u307e\u3067\u623b\u3055\u308c\u308b<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u3044\u3064\u3082\u5b88\u3089\u305b\u305f\u3044\u6c7a\u307e\u308a\u306f\u3001\u4f1a\u8a71\u3067\u306f\u306a\u304f CLAUDE.md \u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u52d5\u5727\u7e2e\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table class=\"has-fixed-layout\"><thead><tr><th style=\"min-width:8em !important\">\u65b9\u6cd5<\/th><th>\u50cd\u304d<\/th><\/tr><\/thead><tbody><tr><td>\/autocompact 500k<\/td><td>\u767a\u52d5\u70b9\u3092\u6c7a\u3081\u3066\u4fdd\u5b58\u3059\u308b\uff08autoCompactWindow\u30012.1.221 \u4ee5\u964d\uff09<\/td><\/tr><tr><td>claude &#8211;autocompact 500k<\/td><td>\u305d\u306e\u8d77\u52d5\u3060\u3051<\/td><\/tr><tr><td>CLAUDE_CODE_AUTO_COMPACT_WINDOW<\/td><td>\u3044\u3061\u3070\u3093\u512a\u5148\uff08\u6574\u6570\u3060\u3051\uff09<\/td><\/tr><tr><td>CLAUDE_AUTOCOMPACT_PCT_OVERRIDE<\/td><td>\u767a\u52d5\u70b9\u30921\u301c100%\u3067\u65e9\u3081\u308b\uff08\u9045\u304f\u306f\u3067\u304d\u306a\u3044\uff09<\/td><\/tr><tr><td>DISABLE_AUTO_COMPACT=1<\/td><td>\u81ea\u52d5\u5727\u7e2e\u3092\u6b62\u3081\u308b\uff08\u624b\u3067\u306e \/compact \u306f\u4f7f\u3048\u308b\uff09<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Claude Code \u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u3082\u3068\u306b\u4f5c\u6210<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6307\u5b9a\u3067\u304d\u308b\u7bc4\u56f2\u306f10\u4e07\u301c100\u4e07\u30c8\u30fc\u30af\u30f3\u3067\u3001\u4e0a\u306e\u8868\u793a\u306b\u3042\u3063\u305f\u300cAutocompact buffer\u300d\u304c\u305d\u306e\u4f59\u767d\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\/clear\u3068\u306e\u9055\u3044<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\/clear \u306f\u4f1a\u8a71\u3092\u7a7a\u306b\u3057\u3066\u65b0\u3057\u304f\u59cb\u3081\u307e\u3059\uff08\u5225\u540d \/reset\u30fb\/new\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u3058\u8a71\u3092\u7d9a\u3051\u305f\u307e\u307e\u7a7a\u304d\u3092\u4f5c\u308a\u305f\u3044\u3068\u304d\u306f\u3001\/clear \u3067\u306f\u306a\u304f \/compact \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6587\u8108\u3092\u98df\u308f\u306a\u3044\u30b3\u30c4<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>CLAUDE.md \u306f1\u30d5\u30a1\u30a4\u30eb200\u884c\u672a\u6e80\u3092\u76ee\u5b89\u306b\u3059\u308b\u3002\u9577\u3044\u8aac\u660e\u306f .claude\/rules\/ \u3084 @ \u3067\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5206\u3051\u308b<\/li>\n\n\n<li>CLAUDE.md \u306e &lt;!&#8211; &#8211;&gt; \u306e\u30b3\u30e1\u30f3\u30c8\u306f\u3001\u6587\u8108\u306b\u5165\u308b\u524d\u306b\u53d6\u308a\u9664\u304b\u308c\u308b<\/li>\n\n\n<li>\u4f7f\u308f\u306a\u3044\u30d7\u30e9\u30b0\u30a4\u30f3\u3084 MCP \u30b5\u30fc\u30d0\u30fc\u306f\u5916\u3059<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9650\u306b\u5f53\u305f\u3063\u3066\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u3068\u304d\u306f\u3001<a href=\"https:\/\/cg-method.com\/ai\/claude-code-context-limit\/\">Context limit \u306e\u30a8\u30e9\u30fc\u306e\u5bfe\u51e6\u6cd5<\/a>\u3067\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>\/context \u3067\u6b8b\u308a\u3068\u5185\u8a33\u3092\u898b\u308b<\/li>\n\n\n<li>\u533a\u5207\u308a\u3067 \/compact \u6b8b\u3057\u305f\u3044\u3053\u3068<\/li>\n\n\n<li>\u8a71\u3092\u5909\u3048\u308b\u306a\u3089 \/clear<\/li>\n\n\n<li>\u3044\u3064\u3082\u5b88\u3089\u305b\u308b\u6c7a\u307e\u308a\u306f CLAUDE.md \u306b<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c2\u8003\uff1aClaude Code\u300cCommands\u300d\u300cContext window\u300d\u300cHow Claude Code works\u300d\u300cMemory\u300d\uff082026\u5e749\u670829\u65e5\u306b\u78ba\u8a8d\uff09\u3068\u3001Claude Code 2.1.284 \u3067\u306e\u5b9f\u884c\u7d50\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Claude Code \u306f\u3001\u4f1a\u8a71\u306e\u6587\u8108\uff08\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\uff09\u304c\u4e0a\u9650\u306b\u8fd1\u3065\u304f\u3068\u3001\u81ea\u52d5\u3067\u8981\u7d04\uff08\u5727\u7e2e\uff09\u3057\u307e\u3059\u3002 \u9014\u4e2d\u3067\u8a71\u304c\u98db\u3076\u306e\u3092\u9632\u3050\u306b\u306f\u3001\/context \u3067\u6b8b\u308a\u3092\u898b\u3066\u3001\u533a\u5207\u308a\u306e\u3088\u3044\u3068\u3053\u308d\u3067\u81ea\u5206\u3067 \/compact \u3059\u308b\u306e\u304c\u78ba\u5b9f\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1325,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","book_review_data":"","footnotes":"","ssp_meta_title":"Claude Code\u306e\/context\u3068\/compact","ssp_meta_description":"Claude Code\u3067\u4f1a\u8a71\u306e\u6587\u8108\uff08\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\uff09\u306e\u6b8b\u308a\u3092\u78ba\u304b\u3081\u308b\/context\u3068\u3001\u8981\u7d04\u3057\u3066\u7a7a\u304d\u3092\u4f5c\u308b\/compact\u306e\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002\u5b9f\u969b\u306e\u8868\u793a\u3001\u81ea\u52d5\u5727\u7e2e\u306e\u8a2d\u5b9a\u3001\/clear\u3068\u306e\u9055\u3044\u3001CLAUDE.md\u3092\u77ed\u304f\u4fdd\u3064\u30b3\u30c4\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002"},"categories":[21],"tags":[],"class_list":["post-1324","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-claude"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/posts\/1324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/comments?post=1324"}],"version-history":[{"count":1,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/posts\/1324\/revisions"}],"predecessor-version":[{"id":1326,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/posts\/1324\/revisions\/1326"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/media\/1325"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/media?parent=1324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/categories?post=1324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/ai\/wp-json\/wp\/v2\/tags?post=1324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}