docs: compact CLAUDE.md/AGENTS.md to load-bearing rules
What
Compacts CLAUDE.md (the file AGENTS.md symlinks to) from 533 → 313 lines by moving reference material into self-contained in-repo docs and deduplicating repeated prose. No load-bearing rule is dropped.
The symlink AGENTS.md -> CLAUDE.md is unchanged.
Why
CLAUDE.md/AGENTS.md is pasted into every agent's context window on every task. It should carry constraints an agent would otherwise get wrong, not reference essays that apply to a minority of tasks. Today ~180 of the 533 lines are the Swift package/architecture guidance, which only matters when a task extracts a Packages/ module and is already enforced by the review bots (Codex, CodeRabbit, Greptile). For the other ~95% of tasks (bug fixes, UI tweaks, CLI work) it is dead weight crowding out the rules that do apply.
What moved (content preserved verbatim in docs/, summarized in-file)
- The Swift sections (Package architecture, Refactor architecture / Coordinator-Service-Repository / dependency inversion, File organization, Documentation/DocC, Package design discipline, Testability, Modern Swift concurrency, Test framework) →
docs/swift-architecture.md(~164 lines, verbatim).CLAUDE.mdkeeps a load-bearing summary + pointer. This also fixes a real gap: the old in-file pointer to hq'sdocs/cmux-refactor-audit/blueprint/is unfollowable for an external contributor; the new doc is the canonical in-repo copy. - The sidebar extension-point how-to →
docs/sidebar-extension-point.md.
What was compressed in place (every command/fact kept)
- Xcode toolchain: 3 paragraphs → 1, same pin /
objectVersion = 60/ CI-enforcement facts. - Local dev: the
reload.shbehavior was explained four separate times; merged into one. Kept every script (reload/reloadp/reloads/reload2), the compile-onlyxcodebuildinvocation, thecmux-debug-clihelper, and thefile://link block verbatim (deliberately not redirected to hq's Tag Opener, which externalmanaflow-ai/cmuxcontributors do not have). - Debug event log: kept the implementation +
#if DEBUGcontract; replaced the exhaustive event-name catalog with agrep cmuxDebugLogpointer (the catalog is regenerable from code, not a rule).
Conservation
Every original ## section is either kept in-file or moved to a pointed-to in-repo doc:
| Original section | New location |
|---|---|
| Initial setup, Cloud VM secrets, Backend TypeScript, Regression test policy, Shared behavior, Debug menu, Pitfalls, Test quality policy, Socket threading/focus, Testing policy, Ghostty, Release | kept in CLAUDE.md |
| Xcode toolchain, Local dev, Debug event log | kept, compressed in place |
| Package/Refactor architecture, File organization, Documentation, Package design discipline, Testability, Modern Swift concurrency, Test framework | docs/swift-architecture.md (summary + pointer in-file) |
| Sidebar extension point | docs/sidebar-extension-point.md (pointer in-file) |
Two commits so the move is reviewable: commit 1 adds the docs (verbatim relocation), commit 2 trims CLAUDE.md.
Meta-only change; no runtime/app behavior touched.
🤖 Generated with Claude Code
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.
[!NOTE]
Low Risk
Documentation-only reorganization; no application code, build scripts, or runtime behavior changes.
Overview
Shrinks CLAUDE.md (and the AGENTS.md symlink) so agent context stays lean: long Swift/package guidance and sidebar extension mechanics move into docs/swift-architecture.md and docs/sidebar-extension-point.md, while CLAUDE.md keeps a short load-bearing summary plus links.
In-file sections are tightened without dropping commands or constraints—Xcode toolchain, local dev (reload.sh, tagged builds, file:// app links, cmux-debug-cli), and debug event log (catalog replaced with a grep cmuxDebugLog pointer). The former multi-section Swift architecture, concurrency, testability, and test-framework essays are consolidated behind docs/swift-architecture.md so external contributors get an in-repo canonical copy instead of an unfollowable hq blueprint link.
Reviewed by Cursor Bugbot for commit a375e5d817cf6e91512f601966337219c1170f0f. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Compacted CLAUDE.md/AGENTS.md by moving long-form Swift architecture and sidebar extension docs into repo docs while keeping all load‑bearing rules; file size drops 533 → 313 lines. No runtime changes.
- Refactors
- Moved Swift architecture, file-organization, DocC, testability, concurrency, and test framework content to
docs/swift-architecture.md(CLAUDE.md now has a short summary + pointer). - Moved the sidebar ExtensionKit how-to to
docs/sidebar-extension-point.md. - Compressed in place: Xcode toolchain pinning, local dev (
reload.shand helpers), and debug event log (kept implementation + grep pointer). SymlinkAGENTS.md -> CLAUDE.mdremains unchanged.
- Moved Swift architecture, file-organization, DocC, testability, concurrency, and test framework content to
Summary by CodeRabbit
- Documentation
- Updated internal development architecture guidance and build configuration documentation for reference.
Note: This release contains documentation-only updates with no visible changes to end-user functionality or features.