minssam.
Published on

Claude Code 2.1.311 & 2.1.312: VS Code Syntax Colors, OIDC User ID Claims, and Compaction Fix

Claude Code released v2.1.311 and v2.1.312 on consecutive days, October 26 and 27. Where v2.1.310 focused on expanding the Monitor tool across platforms, these two releases target developer ergonomics and enterprise identity configuration.

v2.1.311: Syntax Coloring for Code Blocks in VS Code

Reading code blocks in Claude's replies used to feel like reading monochrome printouts โ€” every token the same color, regardless of language. With v2.1.311, the VS Code extension now applies syntax coloring to code blocks in Claude's responses, covering light, dark, and high-contrast dark themes.

When the code Claude suggests looks visually consistent with the code you're writing, the cognitive gap shrinks. It's similar to proofreading when both the original and the revision are in the same typeface โ€” comparing them is just easier.

The same release also adds self-hosted runner controls, giving teams that run Claude Code on internal infrastructure finer-grained management of runner configuration.

v2.1.312: Choose Which OIDC Claim Identifies Users

When operating the Claude Apps gateway in enterprise environments, the choice of user identifier matters. Previously only the id_token's sub claim was available โ€” but organizations using Microsoft Entra ID often prefer oid, because sub can vary across tenants.

v2.1.312 adds oidc.user_id_claim to the gateway configuration, letting admins select oid or any other claim instead of sub. For organizations with Entra ID-based SSO, this brings meaningful consistency to identity management across Claude Code sessions.

Compaction Bug Fixed: No More "200K Token" Session Halts

Perhaps the most practically impactful fix in v2.1.312: standard-context sessions that exceeded 200K tokens used to crash with "Usage credits required for 1M context". Now, instead of halting, Claude Code automatically compacts the conversation and continues the task.

Anyone who has worked with large codebases โ€” opening multiple files, passing long context windows โ€” will recognize this as a relief. Long uninterrupted sessions become reliably resumable.

v2.1.311 also improved compaction: when the model's reply contains no summary, Claude Code now asks for a summary once more before replacing the conversation, so less context is lost in the transition.

CLAUDE.md Overwrite Bug Fixed

v2.1.312 also patches a bug where Claude would overwrite a large CLAUDE.md file after reading only the beginning of it. Now the file is read fully before any edits are made. Teams that maintain large CLAUDE.md files with detailed team rules or project context will find this a welcome safety fix.

24 Concurrent Hooks Cap

Also in v2.1.312: prompt and agent hooks are now capped at 24 running concurrently per session, subagents included. This prevents runaway hook accumulation in complex pipelines.

Summary

VersionKey Changes
2.1.311VS Code code-block syntax coloring, self-hosted runner controls, compaction summary re-request
2.1.312OIDC user ID claim setting, auto-compaction on 200K token overflow, CLAUDE.md safe overwrite, 24 concurrent hooks cap

Claude Code ships at a pace that rewards checking the changelog regularly. A single small fix โ€” like ending silent session crashes โ€” can meaningfully change how a day of coding feels.


Sources:

Claude Code 2.1.311 & 2.1.312: VS Code Syntax Colors, OIDC User ID Claims, and Compaction Fix | MINSSAM.COM