[Feature Request] Add configurable context lines for code display

Resolved 💬 3 comments Opened Jan 15, 2026 by akzoe Closed Jan 19, 2026

Feature Description

Currently, when Claude Code displays code snippets (e.g., in diffs, search results, or file previews), it shows only 3 lines of surrounding context by default. This is often insufficient to understand the code's context without pressing Ctrl+O to expand.

Proposed Solution

Add a configurable setting to control the number of context lines displayed. For example:

// In settings.json or via CLI config
{
  "codeContextLines": 10
}

Or via environment variable:

CLAUDE_CODE_CONTEXT_LINES=10

Use Case

  • When reviewing code changes, 3 lines of context is often not enough to understand the surrounding logic
  • Users frequently need to press Ctrl+O to see more context, which interrupts the workflow
  • Different users have different preferences based on their screen size and coding style

Suggested Default

Keep the current default of 3 lines for backward compatibility, but allow users to configure it to their preference (e.g., 5, 10, or more lines).

Additional Context

This would improve the user experience by reducing the need to manually expand code views and allowing users to customize the display to their workflow.

View original on GitHub ↗

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