智能助手网
标签聚合 技巧

/tag/技巧

linux.do · 2026-04-18 22:06:31+08:00 · tech

1:结构化agents/claude 初始提示词. 只应该放置你是谁你在什么环境,本机有什么内容,现在的项目介绍一句话. 2:mcp标准化简略化. 可以配置disable 把不需要的mcp 工具给关闭. 3:skill搭配mcp工具特化如grok/context7/adb/chrome/supabase等 4:重点model基本化 配置示范 codex config.toml (点击了解更多详细信息) claude CLAUDE.md (点击了解更多详细信息) 项目说明使用 github.com GitHub - TokenRollAI/llmdoc: TokenRoll LLMDoc for Coding Agent TokenRoll LLMDoc for Coding Agent 记忆管理使用 github.com GitHub - gaoziman/claude-context-manager: claude-context-manager for claude code claude-context-manager for claude code model setting 使用 high 代替xhigh. todoplan 任务纲要使用 chatgpt 网页的pro对话完成 pro 反代公益站点 一次对话完成一件事情. 避免长上下文. 第一是我打出来的高缓存+高token 对话切费率低. 如果你们看懂了 就知道我说的是什么. llm最爱 代码行数低于1000/1个文件 组织结构化的文件目录. 清晰的顶层目录 每个大目录都应该有claude/agents文档. 从0~1~95%号池自建 自建号池状态页1Etoken=67刀 留下小爱心 冲击lv 3 1 个帖子 - 1 位参与者 阅读完整话题

linux.do · 2026-04-16 14:00:43+08:00 · tech

有的时候问问题,带有上传的图片,或者某个连接里有图片, 可能会造成浪费这次对话的 上下文数。 因为有时候上传的是自己拍的照,可能有6mb 大小(手机拍照)。 把图片 压缩 小体积,或者用 截图工具 再截图一次,让体积变小之后再上传给ai ,节省上下文。 (有些专业的压缩图片的软件,可以把图片压缩到几十kb) 我以前上传了几张照片,很快ai 就说超过上下文数了。让我重新去开一个问。 2 个帖子 - 2 位参与者 阅读完整话题

linux.do · 2026-04-14 09:10:00+08:00 · tech

最近一段时间有空的时候在研究如何降低openclaw的token消耗 因为基本上如果一天不干什么不和它对话的话,也要吞掉我十几二十刀的gpt5.4额度 于是看了一下平常的请求,发现heartbeat这个操作真耗token啊,动不动一个请求就90k token 这费用还是我给openclaw打了缓存补丁之后,要是没打补丁更是上天 我的heartbeat相关配置之前是这样的,当时就是直接照抄了站内的教程(我记得是两篇巨长的文章) "heartbeat": { "every": "30m", "target": "last", "directPolicy": "allow" }, 然后我发现请求体里面一直在同一个session重复 “Read HEARTBEAT.md …”, 都重复一百多次了! { "model": "gpt-5.4", "input": [ { "role": "developer", "content": "You are a personal assistant running inside OpenClaw.\n## Tooling\nTool availabili...[42548 chars]" }, { "role": "user", "content": [ { "type": "input_text", "text": (省略。。。) } ] }, { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "I'll check HEARTBEAT.md for any periodic tasks.", "annotations": [] } ], "status": "completed", "id": "msg_1" }, (省略一堆function call。。。) { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Memory maintenance was already done today (2026-04-03). The backup notification ...[63 chars]", "annotations": [] } ], "status": "completed", "id": "msg_5" }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[311 chars]" } ] }, "...[159 more items]" ], "tools": [ (省略。。。) ], "reasoning": { "effort": "high", "summary": "auto" }, (省略。。。) "instructions": (省略。。。) } 然后我就把这个问题丢给codex了,让我添加这两个配置: "heartbeat": { "every": "30m", "isolatedSession": true, "lightContext": true, "target": "none", "directPolicy": "allow" }, isolatedSession 写成true的意思是,heartbeat 会在“没有 prior conversation history 的 isolated session”里运行,能明显减少token消耗 如果再启用 lightContext ,那么比如 AGENTS.md 、 USER.md 、 TOOLS.md 、 MEMORY.md 之类的bootstrap文件就不会在heartbeat的时候注入(只有 HEARTBEAT.md 会被注入上下文)。所以如果你的 HEARTBEAT.md 写的很明确,告诉openclaw要读哪个文件要干什么,那就完全可以开启,进一步节省token. 如果 HEARTBEAT.md 写的很模糊,需要openclaw综合你的 AGENTS.md , MEMORY.md 之类的进行综合判断,那可能还是别加了。 "target"改为none,就防止heartbeat的消息和用户消息放的太近 修改后,我的heartbeat请求基本上只有10k左右token了 每次的请求体也明显干净多了 { "model": "gpt-5.4", "input": [ { "role": "developer", "content": "You are a personal assistant running inside OpenClaw.\n## Tooling\nTool availabili...[36009 chars]" }, { "role": "user", "content": [ { "type": "input_text", "text": "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not i...[313 chars]" } ] } ], "tools": [ (省略。。。) ], "reasoning": { "effort": "high", "summary": "auto" }, "instructions": (省略。。。) 这样heartbeat就不会带一堆重复的heartbeat请求了 1 个帖子 - 1 位参与者 阅读完整话题