Codewhale documentation

Find the guidance you need.

Start with the guide and install pages, or go straight to vocabulary, modes, permissions, tools, providers, Fleet, hooks, MCP, and the Runtime API. Each page links to its source document in the repository.

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.json and 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.