{"id":90,"date":"2026-03-21T22:47:17","date_gmt":"2026-03-21T14:47:17","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-context\/"},"modified":"2026-03-21T23:08:57","modified_gmt":"2026-03-21T15:08:57","slug":"concepts-context","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-context\/","title":{"rendered":"\u4e0a\u4e0b\u6587"},"content":{"rendered":"<h1>\u4e0a\u4e0b\u6587<\/h1>\n<p>&#8220;\u4e0a\u4e0b\u6587&#8221;\u662f <strong>OpenClaw \u5728\u4e00\u6b21\u8fd0\u884c\u4e2d\u53d1\u9001\u7ed9\u6a21\u578b\u7684\u6240\u6709\u5185\u5bb9<\/strong>\u3002\u5b83\u53d7\u6a21\u578b\u7684<strong>\u4e0a\u4e0b\u6587\u7a97\u53e3<\/strong>\uff08token \u9650\u5236\uff09\u7ea6\u675f\u3002<\/p>\n<p>\u65b0\u624b\u5fc3\u667a\u6a21\u578b\uff1a<\/p>\n<ul>\n<li><strong>\u7cfb\u7edf\u63d0\u793a\u8bcd<\/strong>\uff08OpenClaw \u6784\u5efa\uff09\uff1a\u89c4\u5219\u3001\u5de5\u5177\u3001Skills \u5217\u8868\u3001\u65f6\u95f4\/\u8fd0\u884c\u65f6\uff0c\u4ee5\u53ca\u6ce8\u5165\u7684\u5de5\u4f5c\u533a\u6587\u4ef6\u3002<\/li>\n<li><strong>\u5bf9\u8bdd\u5386\u53f2<\/strong>\uff1a\u4f60\u7684\u6d88\u606f + \u52a9\u624b\u5728\u6b64\u4f1a\u8bdd\u4e2d\u7684\u6d88\u606f\u3002<\/li>\n<li><strong>\u5de5\u5177\u8c03\u7528\/\u7ed3\u679c + \u9644\u4ef6<\/strong>\uff1a\u547d\u4ee4\u8f93\u51fa\u3001\u6587\u4ef6\u8bfb\u53d6\u3001\u56fe\u7247\/\u97f3\u9891\u7b49\u3002<\/li>\n<\/ul>\n<p>\u4e0a\u4e0b\u6587\u4e0e&#8221;\u8bb0\u5fc6&#8221;<em>\u4e0d\u662f\u540c\u4e00\u56de\u4e8b<\/em>\uff1a\u8bb0\u5fc6\u53ef\u4ee5\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\u5e76\u7a0d\u540e\u91cd\u65b0\u52a0\u8f7d\uff1b\u4e0a\u4e0b\u6587\u662f\u6a21\u578b\u5f53\u524d\u7a97\u53e3\u5185\u7684\u5185\u5bb9\u3002<\/p>\n<h2>\u5feb\u901f\u5f00\u59cb\uff08\u68c0\u67e5\u4e0a\u4e0b\u6587\uff09<\/h2>\n<ul>\n<li><code>\/status<\/code> \u2192 \u5feb\u901f\u67e5\u770b&#8221;\u6211\u7684\u7a97\u53e3\u6709\u591a\u6ee1\uff1f&#8221; + \u4f1a\u8bdd\u8bbe\u7f6e\u3002<\/li>\n<li><code>\/context list<\/code> \u2192 \u6ce8\u5165\u4e86\u4ec0\u4e48 + \u5927\u81f4\u5927\u5c0f\uff08\u6bcf\u4e2a\u6587\u4ef6 + \u603b\u8ba1\uff09\u3002<\/li>\n<li><code>\/context detail<\/code> \u2192 \u66f4\u6df1\u5165\u7684\u5206\u89e3\uff1a\u6bcf\u4e2a\u6587\u4ef6\u3001\u6bcf\u4e2a\u5de5\u5177 schema \u5927\u5c0f\u3001\u6bcf\u4e2a Skills \u6761\u76ee\u5927\u5c0f\u548c\u7cfb\u7edf\u63d0\u793a\u8bcd\u5927\u5c0f\u3002<\/li>\n<li><code>\/usage tokens<\/code> \u2192 \u5728\u6b63\u5e38\u56de\u590d\u540e\u9644\u52a0\u6bcf\u6b21\u56de\u590d\u7684\u4f7f\u7528\u91cf\u9875\u811a\u3002<\/li>\n<li><code>\/compact<\/code> \u2192 \u5c06\u8f83\u65e7\u7684\u5386\u53f2\u603b\u7ed3\u4e3a\u7d27\u51d1\u6761\u76ee\u4ee5\u91ca\u653e\u7a97\u53e3\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<p>\u53e6\u8bf7\u53c2\u9605\uff1a<a href=\"\/tools\/slash-commands\">\u659c\u6760\u547d\u4ee4<\/a>\u3001<a href=\"\/reference\/token-use\">Token \u4f7f\u7528\u4e0e\u6210\u672c<\/a>\u3001<a href=\"\/concepts\/compaction\">\u538b\u7f29<\/a>\u3002<\/p>\n<h2>\u793a\u4f8b\u8f93\u51fa<\/h2>\n<p>\u6570\u503c\u56e0\u6a21\u578b\u3001\u63d0\u4f9b\u5546\u3001\u5de5\u5177\u7b56\u7565\u548c\u5de5\u4f5c\u533a\u5185\u5bb9\u800c\u5f02\u3002<\/p>\n<h3><code>\/context list<\/code><\/h3>\n<pre><code>\ud83e\udde0 Context breakdown\nWorkspace: &lt;workspaceDir&gt;\nBootstrap max\/file: 20,000 chars\nSandbox: mode=non-main sandboxed=false\nSystem prompt (run): 38,412 chars (~9,603 tok) (Project Context 23,901 chars (~5,976 tok))\n\nInjected workspace files:\n- AGENTS.md: OK | raw 1,742 chars (~436 tok) | injected 1,742 chars (~436 tok)\n- SOUL.md: OK | raw 912 chars (~228 tok) | injected 912 chars (~228 tok)\n- TOOLS.md: TRUNCATED | raw 54,210 chars (~13,553 tok) | injected 20,962 chars (~5,241 tok)\n- IDENTITY.md: OK | raw 211 chars (~53 tok) | injected 211 chars (~53 tok)\n- USER.md: OK | raw 388 chars (~97 tok) | injected 388 chars (~97 tok)\n- HEARTBEAT.md: MISSING | raw 0 | injected 0\n- BOOTSTRAP.md: OK | raw 0 chars (~0 tok) | injected 0 chars (~0 tok)\n\nSkills list (system prompt text): 2,184 chars (~546 tok) (12 skills)\nTools: read, edit, write, exec, process, browser, message, sessions_send, \u2026\nTool list (system prompt text): 1,032 chars (~258 tok)\nTool schemas (JSON): 31,988 chars (~7,997 tok) (counts toward context; not shown as text)\nTools: (same as above)\n\nSession tokens (cached): 14,250 total \/ ctx=32,000\n<\/code><\/pre>\n<h3><code>\/context detail<\/code><\/h3>\n<pre><code>\ud83e\udde0 Context breakdown (detailed)\n\u2026\nTop skills (prompt entry size):\n- frontend-design: 412 chars (~103 tok)\n- oracle: 401 chars (~101 tok)\n\u2026 (+10 more skills)\n\nTop tools (schema size):\n- browser: 9,812 chars (~2,453 tok)\n- exec: 6,240 chars (~1,560 tok)\n\u2026 (+N more tools)\n<\/code><\/pre>\n<h2>\u4ec0\u4e48\u8ba1\u5165\u4e0a\u4e0b\u6587\u7a97\u53e3<\/h2>\n<p>\u6a21\u578b\u63a5\u6536\u7684\u6240\u6709\u5185\u5bb9\u90fd\u8ba1\u5165\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u7cfb\u7edf\u63d0\u793a\u8bcd\uff08\u6240\u6709\u90e8\u5206\uff09\u3002<\/li>\n<li>\u5bf9\u8bdd\u5386\u53f2\u3002<\/li>\n<li>\u5de5\u5177\u8c03\u7528 + \u5de5\u5177\u7ed3\u679c\u3002<\/li>\n<li>\u9644\u4ef6\/\u8f6c\u5f55\uff08\u56fe\u7247\/\u97f3\u9891\/\u6587\u4ef6\uff09\u3002<\/li>\n<li>\u538b\u7f29\u6458\u8981\u548c\u4fee\u526a\u4ea7\u7269\u3002<\/li>\n<li>\u63d0\u4f9b\u5546&#8221;\u5305\u88c5\u5668&#8221;\u6216\u9690\u85cf\u5934\u90e8\uff08\u4e0d\u53ef\u89c1\uff0c\u4ecd\u7136\u8ba1\u6570\uff09\u3002<\/li>\n<\/ul>\n<h2>OpenClaw \u5982\u4f55\u6784\u5efa\u7cfb\u7edf\u63d0\u793a\u8bcd<\/h2>\n<p>\u7cfb\u7edf\u63d0\u793a\u8bcd\u7531 <strong>OpenClaw \u62e5\u6709<\/strong>\uff0c\u6bcf\u6b21\u8fd0\u884c\u65f6\u91cd\u5efa\u3002\u5b83\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5de5\u5177\u5217\u8868 + \u7b80\u77ed\u63cf\u8ff0\u3002<\/li>\n<li>Skills \u5217\u8868\uff08\u4ec5\u5143\u6570\u636e\uff1b\u89c1\u4e0b\u6587\uff09\u3002<\/li>\n<li>\u5de5\u4f5c\u533a\u4f4d\u7f6e\u3002<\/li>\n<li>\u65f6\u95f4\uff08UTC + \u5982\u679c\u914d\u7f6e\u4e86\u5219\u8f6c\u6362\u4e3a\u7528\u6237\u65f6\u95f4\uff09\u3002<\/li>\n<li>\u8fd0\u884c\u65f6\u5143\u6570\u636e\uff08\u4e3b\u673a\/\u64cd\u4f5c\u7cfb\u7edf\/\u6a21\u578b\/\u601d\u8003\uff09\u3002<\/li>\n<li>\u5728<strong>\u9879\u76ee\u4e0a\u4e0b\u6587<\/strong>\u4e0b\u6ce8\u5165\u7684\u5de5\u4f5c\u533a\u5f15\u5bfc\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u5b8c\u6574\u5206\u89e3\uff1a<a href=\"\/concepts\/system-prompt\">\u7cfb\u7edf\u63d0\u793a\u8bcd<\/a>\u3002<\/p>\n<h2>\u6ce8\u5165\u7684\u5de5\u4f5c\u533a\u6587\u4ef6\uff08\u9879\u76ee\u4e0a\u4e0b\u6587\uff09<\/h2>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cOpenClaw \u6ce8\u5165\u4e00\u7ec4\u56fa\u5b9a\u7684\u5de5\u4f5c\u533a\u6587\u4ef6\uff08\u5982\u679c\u5b58\u5728\uff09\uff1a<\/p>\n<ul>\n<li><code>AGENTS.md<\/code><\/li>\n<li><code>SOUL.md<\/code><\/li>\n<li><code>TOOLS.md<\/code><\/li>\n<li><code>IDENTITY.md<\/code><\/li>\n<li><code>USER.md<\/code><\/li>\n<li><code>HEARTBEAT.md<\/code><\/li>\n<li><code>BOOTSTRAP.md<\/code>\uff08\u4ec5\u9996\u6b21\u8fd0\u884c\uff09<\/li>\n<\/ul>\n<p>\u5927\u6587\u4ef6\u6309\u6587\u4ef6\u4f7f\u7528 <code>agents.defaults.bootstrapMaxChars<\/code>\uff08\u9ed8\u8ba4 <code>20000<\/code> \u5b57\u7b26\uff09\u622a\u65ad\u3002<code>\/context<\/code> \u663e\u793a<strong>\u539f\u59cb vs \u6ce8\u5165<\/strong>\u5927\u5c0f\u4ee5\u53ca\u662f\u5426\u53d1\u751f\u4e86\u622a\u65ad\u3002<\/p>\n<h2>Skills\uff1a\u6ce8\u5165\u7684\u5185\u5bb9 vs \u6309\u9700\u52a0\u8f7d\u7684\u5185\u5bb9<\/h2>\n<p>\u7cfb\u7edf\u63d0\u793a\u8bcd\u5305\u542b\u4e00\u4e2a\u7d27\u51d1\u7684 <strong>Skills \u5217\u8868<\/strong>\uff08\u540d\u79f0 + \u63cf\u8ff0 + \u4f4d\u7f6e\uff09\u3002\u6b64\u5217\u8868\u6709\u5b9e\u9645\u5f00\u9500\u3002<\/p>\n<p>Skill \u6307\u4ee4\u9ed8\u8ba4<em>\u4e0d<\/em>\u5305\u542b\u3002\u6a21\u578b\u5e94\u8be5<strong>\u4ec5\u5728\u9700\u8981\u65f6<\/strong><code>read<\/code> Skill \u7684 <code>SKILL.md<\/code>\u3002<\/p>\n<h2>\u5de5\u5177\uff1a\u6709\u4e24\u79cd\u6210\u672c<\/h2>\n<p>\u5de5\u5177\u4ee5\u4e24\u79cd\u65b9\u5f0f\u5f71\u54cd\u4e0a\u4e0b\u6587\uff1a<\/p>\n<ol>\n<li>\u7cfb\u7edf\u63d0\u793a\u8bcd\u4e2d\u7684<strong>\u5de5\u5177\u5217\u8868\u6587\u672c<\/strong>\uff08\u4f60\u770b\u5230\u7684&#8221;Tooling&#8221;\uff09\u3002<\/li>\n<li><strong>\u5de5\u5177 schema<\/strong>\uff08JSON\uff09\u3002\u8fd9\u4e9b\u53d1\u9001\u7ed9\u6a21\u578b\u4ee5\u4fbf\u5b83\u53ef\u4ee5\u8c03\u7528\u5de5\u5177\u3002\u5b83\u4eec\u8ba1\u5165\u4e0a\u4e0b\u6587\uff0c\u5373\u4f7f\u4f60\u770b\u4e0d\u5230\u5b83\u4eec\u4f5c\u4e3a\u7eaf\u6587\u672c\u3002<\/li>\n<\/ol>\n<p><code>\/context detail<\/code> \u5206\u89e3\u6700\u5927\u7684\u5de5\u5177 schema\uff0c\u4ee5\u4fbf\u4f60\u53ef\u4ee5\u770b\u5230\u4ec0\u4e48\u5360\u4e3b\u5bfc\u3002<\/p>\n<h2>\u547d\u4ee4\u3001\u6307\u4ee4\u548c&#8221;\u5185\u8054\u5feb\u6377\u65b9\u5f0f&#8221;<\/h2>\n<p>\u659c\u6760\u547d\u4ee4\u7531 Gateway \u7f51\u5173\u5904\u7406\u3002\u6709\u51e0\u79cd\u4e0d\u540c\u7684\u884c\u4e3a\uff1a<\/p>\n<ul>\n<li><strong>\u72ec\u7acb\u547d\u4ee4<\/strong>\uff1a\u4ec5\u4e3a <code>\/...<\/code> \u7684\u6d88\u606f\u4f5c\u4e3a\u547d\u4ee4\u8fd0\u884c\u3002<\/li>\n<li><strong>\u6307\u4ee4<\/strong>\uff1a<code>\/think<\/code>\u3001<code>\/verbose<\/code>\u3001<code>\/reasoning<\/code>\u3001<code>\/elevated<\/code>\u3001<code>\/model<\/code>\u3001<code>\/queue<\/code> \u5728\u6a21\u578b\u770b\u5230\u6d88\u606f\u4e4b\u524d\u88ab\u5265\u79bb\u3002<\/li>\n<li>\u4ec5\u6307\u4ee4\u6d88\u606f\u4f1a\u6301\u4e45\u5316\u4f1a\u8bdd\u8bbe\u7f6e\u3002<\/li>\n<li>\u6b63\u5e38\u6d88\u606f\u4e2d\u7684\u5185\u8054\u6307\u4ee4\u4f5c\u4e3a\u6bcf\u6761\u6d88\u606f\u7684\u63d0\u793a\u3002<\/li>\n<li><strong>\u5185\u8054\u5feb\u6377\u65b9\u5f0f<\/strong>\uff08\u4ec5\u5141\u8bb8\u5217\u8868\u4e2d\u7684\u53d1\u9001\u8005\uff09\uff1a\u6b63\u5e38\u6d88\u606f\u4e2d\u7684\u67d0\u4e9b <code>\/...<\/code> token \u53ef\u4ee5\u7acb\u5373\u8fd0\u884c\uff08\u4f8b\u5982\uff1a&#8221;hey \/status&#8221;\uff09\uff0c\u5e76\u5728\u6a21\u578b\u770b\u5230\u5269\u4f59\u6587\u672c\u4e4b\u524d\u88ab\u5265\u79bb\u3002<\/li>\n<\/ul>\n<p>\u8be6\u60c5\uff1a<a href=\"\/tools\/slash-commands\">\u659c\u6760\u547d\u4ee4<\/a>\u3002<\/p>\n<h2>\u4f1a\u8bdd\u3001\u538b\u7f29\u548c\u4fee\u526a\uff08\u4ec0\u4e48\u4f1a\u6301\u4e45\u5316\uff09<\/h2>\n<p>\u4ec0\u4e48\u5728\u6d88\u606f\u4e4b\u95f4\u6301\u4e45\u5316\u53d6\u51b3\u4e8e\u673a\u5236\uff1a<\/p>\n<ul>\n<li><strong>\u6b63\u5e38\u5386\u53f2<\/strong>\u5728\u4f1a\u8bdd\u8bb0\u5f55\u4e2d\u6301\u4e45\u5316\uff0c\u76f4\u5230\u88ab\u7b56\u7565\u538b\u7f29\/\u4fee\u526a\u3002<\/li>\n<li><strong>\u538b\u7f29<\/strong>\u5c06\u6458\u8981\u6301\u4e45\u5316\u5230\u8bb0\u5f55\u4e2d\uff0c\u5e76\u4fdd\u6301\u6700\u8fd1\u7684\u6d88\u606f\u4e0d\u53d8\u3002<\/li>\n<li><strong>\u4fee\u526a<\/strong>\u4ece\u8fd0\u884c\u7684<em>\u5185\u5b58\u4e2d<\/em>\u63d0\u793a\u8bcd\u4e2d\u5220\u9664\u65e7\u7684\u5de5\u5177\u7ed3\u679c\uff0c\u4f46\u4e0d\u91cd\u5199\u8bb0\u5f55\u3002<\/li>\n<\/ul>\n<p>\u6587\u6863\uff1a<a href=\"\/concepts\/session\">\u4f1a\u8bdd<\/a>\u3001<a href=\"\/concepts\/compaction\">\u538b\u7f29<\/a>\u3001<a href=\"\/concepts\/session-pruning\">\u4f1a\u8bdd\u4fee\u526a<\/a>\u3002<\/p>\n<h2><code>\/context<\/code> \u5b9e\u9645\u62a5\u544a\u4ec0\u4e48<\/h2>\n<p><code>\/context<\/code> \u5728\u53ef\u7528\u65f6\u4f18\u5148\u4f7f\u7528\u6700\u65b0\u7684<strong>\u8fd0\u884c\u6784\u5efa\u7684<\/strong>\u7cfb\u7edf\u63d0\u793a\u8bcd\u62a5\u544a\uff1a<\/p>\n<ul>\n<li><code>System prompt (run)<\/code> = \u4ece\u6700\u540e\u4e00\u6b21\u5d4c\u5165\u5f0f\uff08\u5177\u6709\u5de5\u5177\u80fd\u529b\u7684\uff09\u8fd0\u884c\u4e2d\u6355\u83b7\uff0c\u5e76\u6301\u4e45\u5316\u5728\u4f1a\u8bdd\u5b58\u50a8\u4e2d\u3002<\/li>\n<li><code>System prompt (estimate)<\/code> = \u5f53\u6ca1\u6709\u8fd0\u884c\u62a5\u544a\u5b58\u5728\u65f6\uff08\u6216\u901a\u8fc7\u4e0d\u751f\u6210\u62a5\u544a\u7684 CLI \u540e\u7aef\u8fd0\u884c\u65f6\uff09\u5373\u65f6\u8ba1\u7b97\u3002<\/li>\n<\/ul>\n<p>\u65e0\u8bba\u54ea\u79cd\u65b9\u5f0f\uff0c\u5b83\u90fd\u62a5\u544a\u5927\u5c0f\u548c\u4e3b\u8981\u8d21\u732e\u8005\uff1b\u5b83<strong>\u4e0d\u4f1a<\/strong>\u8f6c\u50a8\u5b8c\u6574\u7684\u7cfb\u7edf\u63d0\u793a\u8bcd\u6216\u5de5\u5177 schema\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e0b\u6587 &#8220;\u4e0a\u4e0b\u6587&#8221;\u662f OpenClaw \u5728\u4e00\u6b21\u8fd0\u884c\u4e2d\u53d1\u9001\u7ed9\u6a21\u578b\u7684\u6240\u6709\u5185\u5bb9\u3002\u5b83\u53d7\u6a21\u578b\u7684\u4e0a [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":385,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/90\/revisions\/385"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}