← Back to all entries
2026-04-23 💡 Tips 'n' Tricks

Claude Code v2.1.118: Vim Mode, MCP Hooks & Unified /usage

Claude Code v2.1.118: Vim Mode, MCP Hooks & Unified /usage — visual for 2026-04-23

💡 Claude Code v2.1.118 Ships: Vim Mode, /usage, Named Themes, WSL Fix & More

Claude Code v2.1.118 dropped at 00:42 on April 23, landing the largest batch of UX improvements in a single release since the Claude Code 2.0 rollout in February. The headline features — vim visual mode, a unified /usage command, named custom themes, and MCP tool invocation inside hooks — each address long-standing friction points that developers have been requesting in the GitHub issues tracker for weeks. Here is what changed and what it means in practice.

Vim visual mode (v / V)

Claude Code's terminal prompt editor now supports vim visual mode via v (character selection) and V (line selection), with the full standard selection operator set: d delete, y yank, c change, >/< indent. This completes the vim modal editing surface that shipped incrementally over the past three releases — you can now navigate, select, and manipulate prompt text entirely without the mouse in vim normal mode.

Practical note for vim users

Visual mode works best combined with the existing w/b word-motion operators. A pattern like vw (select word forward), then c (change), lets you rewrite individual tokens in a long prompt without reaching for the arrow keys. V followed by y copies the entire current line to the clipboard — useful when you want to re-send a previous prompt with modifications.

/usage: one command instead of two

The /cost and /stats commands are gone. They have been merged into a single /usage command that displays both token consumption and cost in a unified view. The merged output shows the current session's input/output/cache token counts, the running cost in USD, and a per-model breakdown if you have used multiple models in the same session (e.g. switching between Opus and Sonnet for different tasks). This is a minor but welcome reduction in command-surface cognitive load.

Named custom themes via /theme

The /theme command now supports named themes. You can persist a colour scheme by name (e.g. /theme save monokai) and switch between saved themes with /theme monokai. Theme definitions are stored in ~/.claude/themes/ as JSON files, making them portable across machines via dotfile sync. The built-in themes (light, dark, high-contrast) continue to work as before.

DISABLE_UPDATES env var

Setting DISABLE_UPDATES=1 in your environment suppresses the automatic update prompt that appears at Claude Code startup when a newer version is available. This is primarily useful in CI/CD contexts where you want a pinned Claude Code version and do not want the update check to add latency or produce unexpected output in logs. Note that the env var disables the prompt, not the update check itself — Claude Code still checks, it just silently skips the nag when DISABLE_UPDATES=1.

WSL: inherit Windows-managed settings

Claude Code running inside WSL (Windows Subsystem for Linux) can now inherit managed settings from the Windows-side settings.json. Previously, WSL and Windows instances maintained separate configurations — organisations managing Claude Code via fleet tooling had to maintain two config files. With this change, WSL instances automatically inherit the Windows-managed settings block, though WSL-specific overrides remain possible. This matters for teams that manage Claude Code settings centrally through MDM or deployment scripts on Windows fleets with WSL development environments.

/color: sync accent colour to claude.ai/code

The /color command lets you set Claude Code's accent colour and have it synchronised to your claude.ai/code session. If you have multiple Claude interfaces open (terminal + browser), the accent colour now stays consistent across both. Minor quality-of-life feature, but a signal that Anthropic is actively working on the cross-surface identity coherence of the Claude Code product.

Bug fixes worth knowing about

Claude Code v2.1.118 vim mode /usage named themes DISABLE_UPDATES WSL /color release notes

💡 MCP Tool Hooks in Claude Code: Trigger Any MCP Tool Before or After a Session Event

The most technically significant change in v2.1.118 is the ability to invoke MCP tools directly from Claude Code hooks — using "type": "mcp_tool" in the hook definition. Previously, hooks could only run shell commands ("type": "command"). The new mcp_tool hook type lets you call any tool registered with your Claude Code MCP server at hook-trigger points: PreToolUse, PostToolUse, Stop, Notification, and SubagentStop. This opens a class of automation that was previously impossible: using Claude's own toolset as part of the hooks system.

Hook structure with type: "mcp_tool"

# ~/.claude/settings.json (or project .claude/settings.json)
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "mcp_tool",
            "tool": "filesystem/audit_log",
            "input": {
              "event": "file_write",
              "path": "{{tool_input.file_path}}",
              "session_id": "{{session_id}}"
            }
          }
        ]
      }
    ]
  }
}

In the example above, every time Claude Code uses the Write tool, the filesystem/audit_log MCP tool fires automatically with metadata about the write. The {{tool_input.*}} and {{session_id}} template variables are interpolated at hook execution time, giving the MCP tool access to the triggering event's context.

Template variables available in mcp_tool hooks

Four patterns this enables

MCP server must be running before hooks fire

Unlike type: "command" hooks (which spawn a subprocess), type: "mcp_tool" hooks require the target MCP server to already be connected when the hook fires. If the server is not running, the hook silently fails (no error surfaced to Claude). Include an MCP server health check in your session startup workflow if you depend on MCP tool hooks for anything critical like audit logging or policy enforcement.

# Minimal PreToolUse policy-enforcement hook
# Blocks Bash commands not in an allowed set

# In your MCP server (e.g. a FastMCP server):
@mcp.tool()
def check_bash_policy(command: str, session_id: str) -> dict:
    BLOCKED_PATTERNS = ["rm -rf", "DROP TABLE", "curl.*| sh"]
    import re
    for pattern in BLOCKED_PATTERNS:
        if re.search(pattern, command, re.IGNORECASE):
            return {"decision": "block", "reason": f"Command matches blocked pattern: {pattern}"}
    return {"decision": "allow"}

# In settings.json hooks:
# {
#   "type": "mcp_tool",
#   "tool": "policy/check_bash_policy",
#   "input": {
#     "command": "{{tool_input.command}}",
#     "session_id": "{{session_id}}"
#   }
# }

The type: "mcp_tool" hook type is available in all project-level and user-level settings.json files. Enterprise teams using Claude Code's managed settings (including the new WSL Windows inheritance) can push MCP tool hook configurations centrally.

Claude Code MCP hooks mcp_tool audit logging policy enforcement PreToolUse PostToolUse automation
Source trust ratings ⭐⭐⭐ Official Anthropic  ·  ⭐⭐ Established press  ·  Community / research