-
Notifications
You must be signed in to change notification settings - Fork 31
37 lines (33 loc) · 1.27 KB
/
claude-md-check.yml
File metadata and controls
37 lines (33 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: CLAUDE.md Size Check
on:
pull_request:
paths:
- 'CLAUDE.md'
jobs:
check-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check CLAUDE.md size
run: |
SIZE=$(wc -c < CLAUDE.md)
echo "CLAUDE.md size: $SIZE characters"
echo ""
if [ $SIZE -gt 40000 ]; then
echo "::error file=CLAUDE.md::CLAUDE.md exceeds 40,000 character limit ($SIZE chars)."
echo ""
echo "To fix this issue:"
echo " 1. Move detailed content to docs/ folder"
echo " 2. Add a link like: See [docs/topic.md](docs/topic.md) for details"
echo " 3. Keep CLAUDE.md focused on essential context only"
echo ""
echo "Target size: <25,000 characters for optimal AI agent performance"
exit 1
elif [ $SIZE -gt 38000 ]; then
echo "::warning file=CLAUDE.md::CLAUDE.md approaching limit: $SIZE/40,000 characters."
echo ""
echo "Consider moving detailed content to docs/ folder to stay under the limit."
echo "Target size: <25,000 characters for optimal AI agent performance"
else
echo "CLAUDE.md size OK: $SIZE/40,000 characters"
fi