Repository navigation
fix(hooks): session-log の分割警告の上限を 600 行へ引き上げる #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,19 @@ | |
| | 変数 | デフォルト | 参照元 | | ||
| |------|---------|-------| | ||
| | `PLANS_MAX_LINES` | 200 | `scripts/auto-cleanup-hook.sh` | | ||
| | `SESSION_LOG_MAX_LINES` | 500 | 同上 | | ||
| | `SESSION_LOG_MAX_LINES` | 600 | 同上 | | ||
|
coderabbitai[bot] marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The threshold table now says 600, but the session-log section in this same reference still says splitting is recommended above 500 lines (line 80). Since the maintenance skill explicitly loads this file for its thresholds and procedure, users handling a 501–600-line log receive contradictory guidance and can encounter the exact no-op cleanup scenario this change intends to eliminate. Update that prose, along with the Codex and OpenCode mirrors, to 600. Useful? React with 👍 / 👎. |
||
| | `CLAUDE_MD_MAX_LINES` | 100 | 同上 | | ||
| | `ARCHIVE_AFTER_DAYS` | 7 | Plans.md 完了タスクの年齢閾値 | | ||
| | `LOGS_RETAIN_DAYS` | 30 | `.claude/logs/` の保持日数 | | ||
|
|
||
| ユーザーが自由記述で別の閾値を指定したらそちらを優先。 | ||
|
|
||
| > **`SESSION_LOG_MAX_LINES` と保持期間の関係** (2026-08-08 に 500 → 600 へ引き上げ): | ||
| > 分割で実際に動かせるのは「直近 30 日より古いエントリ」だけなので、 | ||
| > 全エントリが 30 日以内に収まっている間は、行数が上限を超えても**移動対象はゼロ**になる。 | ||
| > 上限は読みやすさの目安であって守りの強さではないため、この不一致は上限側を上げて解消する。 | ||
| > 保持期間 30 日は、直近の作業履歴を本体に残すための下限として維持する。 | ||
|
|
||
| --- | ||
|
|
||
| ## plans — Plans.md アーカイブ | ||
|
|
@@ -71,7 +77,13 @@ grep -c '\[x\].*pm:確認済\|cursor:確認済' "$PLANS" || true | |
|
|
||
| ## session-log — session-log.md 月別分割 | ||
|
|
||
| 対象は `.claude/memory/session-log.md`。500行超で分割推奨。 | ||
| 対象は `.claude/memory/session-log.md`。600行超で分割推奨(`SESSION_LOG_MAX_LINES`)。 | ||
|
|
||
| > **既知の限界**: この警告は行数だけを見ており、退避条件(直近 30 日より古いこと)を満たすエントリが | ||
| > 実際に存在するかは判定していない。したがって 600 行を超えていても、全エントリが 30 日以内なら | ||
| > 移動対象は 0 件になりうる。上限の引き上げはこの不一致が起きる位置をずらすだけで、種類としては | ||
| > 残る。恒久的に解消するには、警告の発火条件自体を「退避可能なエントリが 1 件以上ある」に | ||
| > 変更する必要がある(未実施)。上限超過の警告が出たら、まず退避対象の有無を確認すること。 | ||
|
|
||
| ### 手順 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raising this constant only hides the reported mismatch for the current 520-line file; a session log with 601 or more lines whose entries are all less than 30 days old still triggers
checkSessionLog, while/maintenanceis required to retain every entry. The same persistent, unactionable warning therefore returns under a sufficiently active 30-day period. Base the warning on the presence of at least one archivable entry, rather than moving the line-only cutoff.Useful? React with 👍 / 👎.