Skip to content

feat: support CCB_CLAUDE_MD_MODE=route to reduce CLAUDE.md context bloat#120

Merged
bfly123 merged 1 commit intobfly123:mainfrom
LeoLin990405:feat/external-ccb-config
Mar 10, 2026
Merged

feat: support CCB_CLAUDE_MD_MODE=route to reduce CLAUDE.md context bloat#120
bfly123 merged 1 commit intobfly123:mainfrom
LeoLin990405:feat/external-ccb-config

Conversation

@LeoLin990405
Copy link
Contributor

Summary

Closes #113

Adds CCB_CLAUDE_MD_MODE environment variable (Proposal A from the issue) to support externalizing CCB config from CLAUDE.md.

Great problem analysis by @bookandlover in the original issue — this PR implements the approach discussed there.

What it does

Two modes controlled by CCB_CLAUDE_MD_MODE:

  • inline (default) — current behavior, full config in CLAUDE.md (~57 lines). Fully backward compatible, nothing changes for existing users.
  • route — minimal 3-line pointer in CLAUDE.md, full config written to ~/.claude/rules/ccb-config.md

Usage

# Default (no change needed)
./install.sh install

# Minimal mode
CCB_CLAUDE_MD_MODE=route ./install.sh install

Switching between modes is safe — re-running install with a different mode updates the <!-- CCB_CONFIG_START --> block in-place.

Changes

File Change
install.sh install_claude_md_config() — select template based on CCB_CLAUDE_MD_MODE env var
install.sh usage() — document new env var
install.sh install_all() — output message shows active mode
install.sh uninstall_claude_md_config() — clean up external config file
config/claude-md-ccb-route.md New minimal route template (6 lines)

Test plan

  • ./install.sh install — default inline behavior unchanged
  • CCB_CLAUDE_MD_MODE=route ./install.sh install — verify minimal CLAUDE.md + full ~/.claude/rules/ccb-config.md
  • Re-run with different mode — verify in-place update
  • ./install.sh uninstall — verify both CLAUDE.md block and external file cleaned up

概要

关闭 #113

新增 CCB_CLAUDE_MD_MODE 环境变量,支持将 CCB 配置从 CLAUDE.md 外部化。

  • inline(默认):行为不变,完全向后兼容
  • route:CLAUDE.md 只保留 3 行指针,完整配置写入 ~/.claude/rules/ccb-config.md

感谢 @bookandlover 在 issue 中的详细分析和方案设计。

Add CCB_CLAUDE_MD_MODE env var with two modes:
- "inline" (default): full config injected into CLAUDE.md (~57 lines), backward compatible
- "route": minimal 3-line pointer in CLAUDE.md, full config written to ~/.claude/rules/ccb-config.md

This reduces context pollution for solo development sessions where CCB
multi-agent collaboration rules are not needed.

Closes bfly123#113
@bfly123 bfly123 merged commit 7390c45 into bfly123:main Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Support external CCB config to reduce CLAUDE.md context bloat

2 participants