[BUG] Context compacting occurs at 25% capacity despite 95% threshold in CLAUDE.md

Resolved 💬 3 comments Opened Feb 13, 2026 by Olorin-ai-git Closed Feb 17, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code CLI is ignoring the context management rules in ~/.claude/CLAUDE.md.

Expected Behavior:
Compacting should occur at 95% of token budget (190,000 / 200,000 tokens) per CLAUDE.md:
Whenever you reach 95% of context capacity, do NOT compact the conversation.

Actual Behavior:
Compacting occurs at ~25% capacity (51,833 / 200,000 tokens)

Environment:

  • Claude Code CLI version: [run claude --version]
  • Model: claude-sonnet-4-5-20250929
  • OS: macOS Darwin 25.2.0
  • Token budget: 200,000

Config Files:

  • ~/.claude/CLAUDE.md (line 43)
  • ~/.claude/settings.json (no compacting settings)

Impact: Severe - loses conversation context prematurely, disrupts workflow

What Should Happen?

Claude Code CLI is ignoring the context management rules in ~/.claude/CLAUDE.md.

Expected Behavior:
Compacting should occur at 95% of token budget (190,000 / 200,000 tokens) per CLAUDE.md:
Whenever you reach 95% of context capacity, do NOT compact the conversation.

Actual Behavior:
Compacting occurs at ~25% capacity (51,833 / 200,000 tokens)

Environment:

  • Claude Code CLI version: [run claude --version]
  • Model: claude-sonnet-4-5-20250929
  • OS: macOS Darwin 25.2.0
  • Token budget: 200,000

Config Files:

  • ~/.claude/CLAUDE.md (line 43)
  • ~/.claude/settings.json (no compacting settings)

Impact: Severe - loses conversation context prematurely, disrupts workflow

Error Messages/Logs

Steps to Reproduce

Claude Code CLI is ignoring the context management rules in ~/.claude/CLAUDE.md.

Expected Behavior:
Compacting should occur at 95% of token budget (190,000 / 200,000 tokens) per CLAUDE.md:
Whenever you reach 95% of context capacity, do NOT compact the conversation.

Actual Behavior:
Compacting occurs at ~25% capacity (51,833 / 200,000 tokens)

Environment:

  • Claude Code CLI version: [run claude --version]
  • Model: claude-sonnet-4-5-20250929
  • OS: macOS Darwin 25.2.0
  • Token budget: 200,000

Config Files:

  • ~/.claude/CLAUDE.md (line 43)
  • ~/.claude/settings.json (no compacting settings)

Impact: Severe - loses conversation context prematurely, disrupts workflow

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.41 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗