Issue 2026-07-11
v0.8.67
CodeWhale
any model, open models first
Section 02 · Docs

Documentation 文档

How CodeWhale works: ego, conflict law, evidence, modes, tools, sandbox, MCP, config, hooks. The full architecture walkthrough is in docs/ARCHITECTURE.md

Constitution and /constitution 宪法与 /constitution

CodeWhale gives the agent an accountable address, then a legal system for context conflicts. /constitution is the primary personal constitution surface: guided setup stores structured user-global data in $CODEWHALE_HOME/constitution.jsonand renders it as model-facing prose. Repos can still add local law via .codewhale/constitution.json; runtime policy separately encodes modes, approval, sandbox, cost, and tool boundaries.

User-global 用户全局

Use /constitution for standing personal law across projects. It is structured data rendered to prose, not a raw prompt editor.

Repo-local 仓库本地

.codewhale/constitution.json is optional project policy for protected invariants, branch rules, verification, and escalation.

Runtime 运行时

Constitution text may express preferences, but approval, sandbox, shell, network, trust, and MCP permissions remain enforced config.

Standard project instructions still live in AGENTS.md; memory and handoffs rank below constitutions and project instructions; the full base-prompt Markdown override is an expert escape hatch, not the normal setup path. See configuration docs.

Source document: docs/ARCHITECTURE.md · Update docs-map.ts when changing.