更新日期:2026 年 3 月 7 日
Hajimi Work 通用配置参考
面向“AI 桌面助手配置教程”搜索意图,集中展示审批、日志、并发等配置大表,便于快速查阅。
通用配置字段表
| 配置项 | 可选值 | 默认 | 说明 |
|---|---|---|---|
| general.approval_mode | auto_read / auto_all / manual | auto_read | 审批策略:只读自动通过 / 全自动通过 / 全手动审批 |
| general.approval_timeout_secs | 5-300(秒) | 60 | 审批弹窗等待时间;超时后按拒绝处理 |
| general.default_allowed_commands | 字符串数组(支持 * 和 ?) | [] | run_command 的默认放行规则(前缀或通配符匹配) |
| general.auto_allow_all_commands | true / false | false | 开启后 run_command 不再弹审批(风险较高) |
| general.log_level | error / warn / info / debug / trace | info | 日志输出详细程度 |
| general.max_steps | 数字 | 300 | 代理模式下最大执行步数 |
| general.log_retention_days | 数字 | 7 | 日志文件保留时间 |
| general.max_context_tokens | 数字(0 = 系统默认) | 0 | 上下文窗口大小限制(按模型与供应商生效) |
| general.max_output_tokens | 数字 | 8000 | 单次最大输出 Token 数 |
| agent.custom_prompt_file | 文件路径 | — | 自定义系统提示词文件 |
| agent.max_concurrent_subagents | 数字 | — | 同时运行的子代理数量上限(留空使用默认) |
| agent.compaction_model | 模型 ID | — | 上下文压缩时优先使用的模型(可选) |
配置保存在
~/.hajimi/config.toml,Hajimi Work 与 Hajimi Code(CLI)共享此文件。建议策略
- • 日常建议使用
auto_read:只读工具自动执行,写入和命令类操作仍需确认。 - • 如果你有固定安全命令(如
pnpm test),可加入default_allowed_commands减少重复审批。 - • 日志级别默认
info即可;排查问题时临时改为debug。 - • 长流程任务可按需提升
max_steps,避免任务在中途被截断。