今日已更新 84 条资讯 | 累计 29818 条内容
关于我们

标签:#shellscript

找到 1 篇相关文章

AI 资讯

How Claude Code Detects Its Own Weekly Rot and Repairs Itself

Your Claude Code setup doesn't break in one dramatic moment — it degrades a few bytes at a time, and by the time you notice, you've been paying a context tax for weeks. In a previous post I covered running an unattended daily health check with launchd. This one is the follow-up: a three-layer loop that detects that quiet degradation weekly and hands the repair job to claude -p itself. The problem: environments rot quietly if you leave them alone Some things in a Claude Code environment grow just from doing your normal work. ~/.claude/rules/ and MEMORY.md keep getting appended to, until context injection quietly crosses 40KB Experimental agent definition .md files never get archived, leaving dozens to nearly a hundred files under ~/.claude/agents/ permanently loaded Stop hooks fire over and over, creating a hook spam condition Frustration-signaling words pile up in conversation logs and nobody notices A performance audit on 2026-07-11 revealed that "agents I thought I'd archived were still being injected — 99 of them," and that turned out to be the main cause of the degraded experience. That led to the question "so do I have to go check this every week myself?" — and the answer was to automate it , which is what cc-self-audit.sh does. Five degradation metrics and their thresholds The script measures five metrics and flags "red" when any of them crosses its threshold. # 閾値(env変数で上書き可) TH_INJECT_BYTES = " ${ SELF_AUDIT_TH_INJECT :- 40000 } " # rules+CLAUDE.md+MEMORY.md 合計バイト TH_AGENTS = " ${ SELF_AUDIT_TH_AGENTS :- 60 } " # ~/.claude/agents 配下 .md 総数(再帰) TH_STOPSPAM = " ${ SELF_AUDIT_TH_STOPSPAM :- 15 } " # 監査hook発火/週 TH_FRUSTRATION = " ${ SELF_AUDIT_TH_FRUST :- 8 } " # 不満ワード/週 TH_TOOLERR = " ${ SELF_AUDIT_TH_TOOLERR :- 400 } " # tool失敗/週 The first three are static metrics (state at this exact moment); the last two are dynamic metrics (trends since the previous run). That distinction maps directly onto how each one is measured, as described below. Overall design: a thr

2026-07-26 原文 →