Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions FEATURE_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
| Session message management | ✅ | Supports session history maintenance and serialization |
| Error recovery / re-login | 🟡 | Basic auth error handling and reconfiguration flow exists |
| Token / Cost tracking | 🚫 | Chat CLI does not yet have a complete statistics view |
| Context building | 🟡 | Basic `context_system` supports workspace / git / `CLAUDE.md` injection; still missing README summary, memory, compact |
| Context building | 🟡 | Basic `context_system` supports workspace / git / `CLAWCODEX.md` injection; still missing README summary, memory, compact |
| Claude Code Agent Loop | ✅ | Implemented in agent_loop.py, supports tool call loops |
| `/resume` session recovery | 🚫 | No standalone recovery flow or UI yet |
| `/compact` conversation compaction | 🚫 | No automatic/manual compaction capability yet |
Expand Down Expand Up @@ -114,7 +114,7 @@
| Tool Execution Engine | ✅ | Tool loading, execution, and result feedback loop implemented |
| Output Styles | ✅ | Output style loading system implemented |
| Session Persistence | ✅ | Session save/load capability exists |
| Context Engine | 🟡 | Basic context building pipeline connected, supports workspace, git, `CLAUDE.md` prompt injection |
| Context Engine | 🟡 | Basic context building pipeline connected, supports workspace, git, `CLAWCODEX.md` prompt injection |
| Permission Engine | 🟡 | Framework exists, not fully integrated into tool execution flow |
| Compaction Engine | 🚫 | No conversation compaction or token management capability |
| Hook Runtime | 🚫 | No settings-driven hook execution mechanism |
Expand Down Expand Up @@ -201,7 +201,7 @@ Goal: Move from "mirrored tool catalog" to "genuinely executable Python Agent".
Goal: Complete Claude Code's engineering capabilities.

- [ ] Workspace context building improvements
- [x] git status / file tree / `CLAUDE.md` injection (basic version)
- [x] git status / file tree / `CLAWCODEX.md` injection (basic version)
- [ ] README / entry file summary injection
- [ ] Memory and historical context management
- [ ] Full permission system integration
Expand Down Expand Up @@ -351,7 +351,7 @@ You can introduce the project like this:
| 会话消息管理 | ✅ | 支持会话历史维护与序列化 |
| 错误恢复 / 重新登录 | 🟡 | 已有基础认证错误处理与重新配置流程 |
| Token / Cost 跟踪 | 🚫 | 当前聊天 CLI 尚未形成完整统计视图 |
| 上下文构建 | 🟡 | 已有 `context_system` 基础版,支持 workspace / git / `CLAUDE.md` 注入,仍缺 README 摘要、memory、compact |
| 上下文构建 | 🟡 | 已有 `context_system` 基础版,支持 workspace / git / `CLAWCODEX.md` 注入,仍缺 README 摘要、memory、compact |
| Claude Code Agent Loop | ✅ | 已实现 agent_loop.py,支持工具调用循环 |
| `/resume` 会话恢复体验 | 🚫 | 暂无独立恢复流程与 UI |
| `/compact` 对话压缩 | 🚫 | 暂无自动/手动压缩能力 |
Expand Down Expand Up @@ -424,7 +424,7 @@ You can introduce the project like this:
| Tool Execution Engine | ✅ | 已实现工具加载、执行、结果回填闭环 |
| Output Styles | ✅ | 已实现输出样式加载系统 |
| Session Persistence | ✅ | 已有会话保存/加载能力 |
| Context Engine | 🟡 | 已接入基础上下文构建链路,支持 workspace、git、`CLAUDE.md` prompt 注入 |
| Context Engine | 🟡 | 已接入基础上下文构建链路,支持 workspace、git、`CLAWCODEX.md` prompt 注入 |
| Permission Engine | 🟡 | 已有框架,未完全集成到工具执行流程 |
| Compaction Engine | 🚫 | 未形成对话压缩与 token 管理能力 |
| Hook Runtime | 🚫 | 未接入设置驱动的 hook 执行机制 |
Expand Down Expand Up @@ -511,7 +511,7 @@ You can introduce the project like this:
目标:补齐 Claude Code 的工程化能力。

- [ ] 工作区上下文构建完善
- [x] git status / 文件树 / `CLAUDE.md` 注入基础版
- [x] git status / 文件树 / `CLAWCODEX.md` 注入基础版
- [ ] README / 入口文件摘要注入
- [ ] memory 与历史上下文管理
- [ ] 权限系统完全集成
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ Use `clawcodex config` to check connection status and
| Skill System | ✅ | SKILL.md-based slash-command skills with args + tool limits |
| Cancellation / Abort | ✅ | ESC closes in-flight Bash, Grep/Glob, and streaming HTTP within ~50ms across every provider; subagents get isolated `AbortController`s; `Bash` `tool_result` distinguishes timeout from ESC-abort |
| Image Handling | ✅ | TS-parity Read pipeline (magic-byte sniff, resize/compress to API limits); `@image.png` @-mentions inline as `ImageBlock`; pre-API base64 size validation in `BaseProvider._prepare_messages`; binary @-mentions (PDF/zip/docx/...) routed to a Read-tool hint instead of mojibake |
| Context Building | 🟡 | Workspace / git / `CLAUDE.md` injection; richer summaries and memory still evolving |
| Context Building | 🟡 | Workspace / git / `CLAWCODEX.md` injection; richer summaries and memory still evolving |
| Permission System | 🟡 | Framework and checks; full integration still in progress |
| MCP | 🟡 | MCP-oriented tools and wiring; full protocol/runtime polish ongoing |

Expand Down Expand Up @@ -782,7 +782,7 @@ clawcodex/
│ ├── tool_system/ # Agent loop, tools, schemas
│ ├── skills/ # SKILL.md loading and skill tool
│ ├── services/ # MCP, compact, IDE bridge, tool execution, …
│ ├── context_system/ # Workspace / git / CLAUDE.md context
│ ├── context_system/ # Workspace / git / CLAWCODEX.md context
│ ├── permissions/ # Permission modes and bash parsing
│ ├── hooks/ # Hook types and execution helpers
│ └── command_system/ # Slash commands and substitution
Expand Down
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ subsumed under the bash tool path.

Three tiers, matching the book chapter:

1. **Project-level** — `CLAUDE.md` files in the repo (loaded by
1. **Project-level** — `CLAWCODEX.md` files in the repo (loaded by
`src/memdir/memory_scan.py`).
2. **User-level** — `~/.clawcodex/projects/<project-slug>/memory/MEMORY.md` (loaded by
`src/memdir/paths.py`).
Expand Down
4 changes: 2 additions & 2 deletions docs/i18n/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ clawcodex --allow-dangerously-skip-permissions # 允许之后通过 /per
| Skill 系统 | ✅ | 基于 SKILL.md 的斜杠技能:参数与工具白名单 |
| 取消 / 中止 | ✅ | ESC 可在约 50ms 内中止进行中的 Bash、Grep/Glob 以及所有 provider 的流式 HTTP;子 agent 拥有隔离的 `AbortController`;`Bash` 的 `tool_result` 区分超时与 ESC 中止 |
| 图像处理 | ✅ | 与 TS 对齐的 Read 管线(魔数嗅探、按 API 限制缩放/压缩);`@image.png` @-提及内联为 `ImageBlock`;`BaseProvider._prepare_messages` 中调用 API 前的 base64 大小校验;二进制 @-提及(PDF/zip/docx/…)转为 Read 工具提示而非乱码 |
| 上下文构建 | 🟡 | workspace / git / `CLAUDE.md` 注入;更丰富的摘要与 memory 仍在演进 |
| 上下文构建 | 🟡 | workspace / git / `CLAWCODEX.md` 注入;更丰富的摘要与 memory 仍在演进 |
| 权限系统 | 🟡 | 框架与检查逻辑已有;全面集成进行中 |
| MCP | 🟡 | MCP 相关工具与接线已有;协议层/运行时仍在完善 |

Expand Down Expand Up @@ -621,7 +621,7 @@ clawcodex/
│ ├── tool_system/ # Agent loop、工具与 schema
│ ├── skills/ # SKILL.md 加载与 Skill 工具
│ ├── services/ # MCP、compact、IDE 桥、工具执行等
│ ├── context_system/ # workspace / git / CLAUDE.md 上下文
│ ├── context_system/ # workspace / git / CLAWCODEX.md 上下文
│ ├── permissions/ # 权限模式与 bash 解析
│ ├── hooks/ # Hook 类型与执行辅助
│ └── command_system/ # 斜杠命令与参数替换
Expand Down
6 changes: 3 additions & 3 deletions src/agent/agent_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AgentDefinition:
background: bool = False
color: str | None = None
memory: str | None = None
omit_claude_md: bool = False
omit_clawcodex_md: bool = False
disallowed_tools: list[str] | None = None
hooks: dict[str, Any] | None = None
skills: list[str] | None = None
Expand Down Expand Up @@ -157,7 +157,7 @@ def _explore_system_prompt(**_kwargs: Any) -> str:
disallowed_tools=["Agent", "ExitPlanMode", "Edit", "Write", "NotebookEdit"],
source="built-in",
base_dir="built-in",
omit_claude_md=True,
omit_clawcodex_md=True,
# ch08 round-4 (critic M1) — Explore is the fast/cheap read-only agent;
# TS exploreAgent.ts:77 runs it on Haiku. get_agent_model resolves this
# against the session provider and inherits on providers that don't
Expand Down Expand Up @@ -228,7 +228,7 @@ def _plan_system_prompt(**_kwargs: Any) -> str:
source="built-in",
base_dir="built-in",
model="inherit",
omit_claude_md=True,
omit_clawcodex_md=True,
get_system_prompt=_plan_system_prompt,
)

Expand Down
10 changes: 6 additions & 4 deletions src/agent/parse_agent_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
background → background
color → color
memory → memory
omit-claude-md → omit_claude_md
omitClaudeMd → omit_claude_md (camelCase alias)
omit-clawcodex-md → omit_clawcodex_md
omitClawcodexMd → omit_clawcodex_md (camelCase alias)
hooks → hooks
skills → skills
isolation → isolation
Expand Down Expand Up @@ -182,7 +182,9 @@ def parse_agent_from_markdown(
background = _parse_bool(_first(frontmatter, "background"))
color = _parse_color(_first(frontmatter, "color"))
memory = _parse_memory(_first(frontmatter, "memory"), file_path=file_path)
omit_claude_md = _parse_bool(_first(frontmatter, "omit-claude-md", "omitClaudeMd"))
omit_clawcodex_md = _parse_bool(
_first(frontmatter, "omit-clawcodex-md", "omitClawcodexMd")
)
hooks = parse_hooks(_first(frontmatter, "hooks"), owner_name=f"agent {agent_type}")
skills = parse_string_list(_first(frontmatter, "skills"))
isolation = _parse_isolation(
Expand Down Expand Up @@ -214,7 +216,7 @@ def _get_system_prompt(**_kwargs: Any) -> str:
background=background,
color=color,
memory=memory,
omit_claude_md=omit_claude_md,
omit_clawcodex_md=omit_clawcodex_md,
disallowed_tools=disallowed_tools,
hooks=hooks,
skills=skills or None,
Expand Down
28 changes: 14 additions & 14 deletions src/bootstrap/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ class _BootstrapState:
invoked_skills: dict[str, InvokedSkillInfo] = field(default_factory=dict)

# --- Cache optimization (TS: lines 122-123, 202-205, 207, 256) ---------
cached_claude_md_content: str | None = None
cached_clawcodex_md_content: str | None = None
system_prompt_section_cache: dict[str, str | None] = field(default_factory=dict)
pending_post_compaction: bool = False
additional_directories_for_claude_md: list[str] = field(default_factory=list)
additional_directories_for_clawcodex_md: list[str] = field(default_factory=list)

# --- Model (TS: lines 68-70) -------------------------------------------
main_loop_model_override: str | None = None
Expand Down Expand Up @@ -772,12 +772,12 @@ def set_cost_state_for_restore(
# ===========================================================================


def get_cached_claude_md_content() -> str | None:
return _STATE.cached_claude_md_content
def get_cached_clawcodex_md_content() -> str | None:
return _STATE.cached_clawcodex_md_content


def set_cached_claude_md_content(content: str | None) -> None:
_STATE.cached_claude_md_content = content
def set_cached_clawcodex_md_content(content: str | None) -> None:
_STATE.cached_clawcodex_md_content = content


def get_system_prompt_section_cache() -> dict[str, str | None]:
Expand Down Expand Up @@ -806,12 +806,12 @@ def consume_post_compaction() -> bool:
return was


def get_additional_directories_for_claude_md() -> list[str]:
return _STATE.additional_directories_for_claude_md
def get_additional_directories_for_clawcodex_md() -> list[str]:
return _STATE.additional_directories_for_clawcodex_md


def set_additional_directories_for_claude_md(directories: list[str]) -> None:
_STATE.additional_directories_for_claude_md = list(directories)
def set_additional_directories_for_clawcodex_md(directories: list[str]) -> None:
_STATE.additional_directories_for_clawcodex_md = list(directories)


# ===========================================================================
Expand Down Expand Up @@ -1266,15 +1266,15 @@ def reset_state_for_tests() -> None:
"is_repl_bridge_active",
"get_repl_bridge_handle",
# Cache optimization
"get_cached_claude_md_content",
"set_cached_claude_md_content",
"get_cached_clawcodex_md_content",
"set_cached_clawcodex_md_content",
"get_system_prompt_section_cache",
"set_system_prompt_section_cache_entry",
"clear_system_prompt_section_state",
"mark_post_compaction",
"consume_post_compaction",
"get_additional_directories_for_claude_md",
"set_additional_directories_for_claude_md",
"get_additional_directories_for_clawcodex_md",
"set_additional_directories_for_clawcodex_md",
# Model
"get_main_loop_model_override",
"set_main_loop_model_override",
Expand Down
Loading
Loading