/context command fails with 400 error: max_tokens: Extra inputs are not permitted

Resolved 💬 4 comments Opened Dec 16, 2025 by valkyriweb Closed Jan 17, 2026

Description

The /context command fails immediately with a 400 API error. A red error message flashes briefly on screen, then the command hangs indefinitely showing "loading".

Error

From debug logs (~/.claude/debug/*.txt):

Error: Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"max_tokens: Extra inputs are not permitted"},"request_id":"req_011CWACoSJW7TehVUcyhhuv1"}

This error occurs repeatedly when running /context:

  • 2025-12-16T10:11:23.524Z [ERROR] Error: Error: 400 {..."message":"max_tokens: Extra inputs are not permitted"...}
  • 2025-12-16T10:13:03.533Z [ERROR] Error: Error: 400 {..."message":"max_tokens: Extra inputs are not permitted"...}
  • 2025-12-16T10:20:03.031Z [ERROR] Error: Error: 400 {..."message":"max_tokens: Extra inputs are not permitted"...}
  • 2025-12-16T10:20:28.826Z [ERROR] Error: Error: 400 {..."message":"max_tokens: Extra inputs are not permitted"...}
  • 2025-12-16T10:25:22.381Z [ERROR] Error: Error: 400 {..."message":"max_tokens: Extra inputs are not permitted"...}

Steps to Reproduce

  1. Run claude --debug to start Claude Code with debug logging
  2. Type /context and press Enter
  3. Observe: red error text flashes briefly, then UI shows "loading" indefinitely

Expected Behavior

The /context command should display context window information without errors.

Environment

  • Claude Code version: 2.0.70
  • OS: macOS Darwin 25.0.0 (Sequoia)
  • Installation: Native installer

Additional Context

The error suggests the /context command is sending a malformed API request with an invalid max_tokens parameter that the API is rejecting.

View original on GitHub ↗

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