chore: add .claudeignore and split CLAUDE.md for token optimization#1112
chore: add .claudeignore and split CLAUDE.md for token optimization#1112
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🧰 Additional context used🧠 Learnings (24)📓 Common learnings📚 Learning: 2026-04-06T16:35:12.934ZApplied to files:
📚 Learning: 2026-03-31T14:31:11.894ZApplied to files:
📚 Learning: 2026-04-01T18:57:46.655ZApplied to files:
📚 Learning: 2026-03-17T22:08:13.456ZApplied to files:
📚 Learning: 2026-03-19T11:19:40.044ZApplied to files:
📚 Learning: 2026-03-21T14:12:17.848ZApplied to files:
📚 Learning: 2026-03-15T21:32:02.880ZApplied to files:
📚 Learning: 2026-03-19T07:12:14.508ZApplied to files:
📚 Learning: 2026-03-15T21:32:02.880ZApplied to files:
📚 Learning: 2026-03-15T18:17:43.675ZApplied to files:
📚 Learning: 2026-03-15T21:32:02.880ZApplied to files:
📚 Learning: 2026-03-21T14:12:17.848ZApplied to files:
📚 Learning: 2026-04-02T12:21:16.739ZApplied to files:
📚 Learning: 2026-03-21T12:54:22.557ZApplied to files:
📚 Learning: 2026-03-31T14:28:28.895ZApplied to files:
📚 Learning: 2026-03-14T15:43:05.601ZApplied to files:
📚 Learning: 2026-03-19T07:13:44.964ZApplied to files:
📚 Learning: 2026-03-19T07:12:14.508ZApplied to files:
📚 Learning: 2026-03-15T18:38:44.202ZApplied to files:
📚 Learning: 2026-04-02T16:11:16.315ZApplied to files:
📚 Learning: 2026-03-15T21:32:02.880ZApplied to files:
📚 Learning: 2026-04-02T12:21:16.739ZApplied to files:
📚 Learning: 2026-04-02T08:47:46.313ZApplied to files:
🪛 LanguageTooldocs/reference/claude-reference.md[uncategorized] ~72-~72: The official name of this software platform is spelled with a capital “H”. (GITHUB) [uncategorized] ~72-~72: The official name of this software platform is spelled with a capital “H”. (GITHUB) [uncategorized] ~73-~73: The official name of this software platform is spelled with a capital “H”. (GITHUB) [uncategorized] ~82-~82: The official name of this software platform is spelled with a capital “H”. (GITHUB) [uncategorized] ~85-~85: The official name of this software platform is spelled with a capital “H”. (GITHUB) 🔇 Additional comments (8)
WalkthroughThis pull request introduces documentation restructuring and configuration changes. A new Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the root CLAUDE.md by moving several detailed sections into a new reference file to reduce token costs and introduces a .claudeignore file. Feedback suggests expanding the .claudeignore file to include additional directories like .venv/ and tool caches to further optimize context usage.
| node_modules/ | ||
| _site/ | ||
| __pycache__/ | ||
| *.pyc |
There was a problem hiding this comment.
To further optimize token usage and prevent the agent from indexing large, irrelevant tool caches and environment folders, consider expanding the .claudeignore file. Adding .venv/ (the default for uv), as well as caches for ruff, mypy, and pytest, will ensure these high-churn directories don't consume unnecessary context or processing time.
node_modules/
_site/
__pycache__/
*.pyc
.venv/
.mypy_cache/
.pytest_cache/
.ruff_cache/
.hypothesis/
dist/
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR optimizes Claude-related token usage by moving infrequently used guidance out of the root CLAUDE.md and adding ignore rules to reduce unnecessary file reads.
Changes:
- Added
.claudeignoreto exclude common large/generated directories from Claude Code file reads. - Split root
CLAUDE.mdby moving infrequently needed sections intodocs/reference/claude-reference.md. - Updated root
CLAUDE.mdto link to the new on-demand reference doc.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
docs/reference/claude-reference.md |
New on-demand reference document containing less frequently needed CLAUDE guidance. |
CLAUDE.md |
Removes large reference sections and replaces them with a pointer to the new reference doc. |
.claudeignore |
Adds ignore rules for common heavyweight/generated paths to reduce token/file-read overhead. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Docs**: `docs/` (Markdown, built with Zensical, config: `mkdocs.yml`). Also embedded in the web Docker image at `/docs/` via a docs-builder stage | ||
| - **Design spec**: `docs/design/` (12 pages), **Architecture**: `docs/architecture/`, **Roadmap**: `docs/roadmap/` | ||
| - **Security**: `docs/security.md`, **Licensing**: `docs/licensing.md`, **Reference**: `docs/reference/` | ||
| - **REST API reference**: `docs/openapi/index.md` (landing page) + `docs/openapi/reference.html` (Scalar viewer) + `docs/openapi/openapi.json` (schema). The viewer and schema are generated by `scripts/export_openapi.py` and written as static siblings of the landing page so zensical copies them through on build. |
There was a problem hiding this comment.
In this sentence the tool name is lowercased ("zensical") while the surrounding text refers to the project as "Zensical". For consistency/clarity, consider capitalizing it here (or rephrasing to explicitly refer to the uv run zensical build command).
| - **REST API reference**: `docs/openapi/index.md` (landing page) + `docs/openapi/reference.html` (Scalar viewer) + `docs/openapi/openapi.json` (schema). The viewer and schema are generated by `scripts/export_openapi.py` and written as static siblings of the landing page so zensical copies them through on build. | |
| - **REST API reference**: `docs/openapi/index.md` (landing page) + `docs/openapi/reference.html` (Scalar viewer) + `docs/openapi/openapi.json` (schema). The viewer and schema are generated by `scripts/export_openapi.py` and written as static siblings of the landing page so Zensical copies them through on build. |
🤖 I have created a release *beep* *boop* --- ## [0.6.4](v0.6.3...v0.6.4) (2026-04-07) ### Features * analytics and metrics runtime pipeline ([#226](#226), [#225](#225), [#227](#227), [#224](#224)) ([#1127](#1127)) ([ec57641](ec57641)) * engine intelligence -- quality signals, health monitoring, trajectory scoring, coordination metrics ([#1099](#1099)) ([aac2029](aac2029)), closes [#697](#697) [#707](#707) [#705](#705) [#703](#703) * enterprise-grade auth -- HttpOnly cookie sessions, CSRF, lockout, session limits ([#1102](#1102)) ([d3022c7](d3022c7)), closes [#1068](#1068) * implement core tool categories and granular sub-constraints ([#1101](#1101)) ([0611b53](0611b53)), closes [#1034](#1034) [#220](#220) * memory evolution -- GraphRAG/consistency research + SelfEditingMemoryStrategy ([#1036](#1036), [#208](#208)) ([#1129](#1129)) ([a9acda3](a9acda3)) * security hardening -- sandbox, risk override, SSRF self-heal, DAST fix ([#1100](#1100)) ([31e7273](31e7273)), closes [#1098](#1098) [#696](#696) [#222](#222) [#671](#671) ### Bug Fixes * harden agent identity versioning post-review ([#1128](#1128)) ([8eb2859](8eb2859)), closes [#1076](#1076) ### Documentation * engine architecture research ([#688](#688) [#690](#690) [#848](#848) [#687](#687)) ([#1114](#1114)) ([59b31f9](59b31f9)) ### Maintenance * add .claudeignore and split CLAUDE.md for token optimization ([#1112](#1112)) ([b0fbd18](b0fbd18)) * bump github.com/sigstore/protobuf-specs from 0.5.0 to 0.5.1 in /cli in the all group ([#1106](#1106)) ([73089c9](73089c9)) * bump jsdom from 29.0.1 to 29.0.2 in /site in the all group ([#1107](#1107)) ([8e99dce](8e99dce)) * bump jsdom from 29.0.1 to 29.0.2 in /web in the all group ([#1108](#1108)) ([ce8c749](ce8c749)) * bump python from `fb83750` to `6869258` in /docker/backend in the all group ([#1104](#1104)) ([4911726](4911726)) * bump python from `fb83750` to `6869258` in /docker/web in the all group ([#1103](#1103)) ([87bdf09](87bdf09)) * bump the all group across 1 directory with 4 updates ([#1111](#1111)) ([f702464](f702464)) * bump the all group in /docker/sandbox with 2 updates ([#1105](#1105)) ([05a91ca](05a91ca)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Token optimization changes based on r/ClaudeAI megathread findings.
.claudeignore: New file excludingnode_modules/,_site/,__pycache__/,*.pycfrom Claude Code file readsCLAUDE.mdsplit (247 -> 154 lines, ~37% reduction): Moved Documentation, Docker, Package Structure, Releasing, CI, and Dependencies sections todocs/reference/claude-reference.md(loaded on demand)Test Plan
Review Coverage