Build This Now
Build This Now
O que é o Código Claude?Instalar o Claude CodeInstalador Nativo do Claude CodeO Teu Primeiro Projeto com Claude Code
Claude Code v2.1.122 Release NotesMelhores Práticas do Claude CodeBoas Práticas para o Claude Opus 4.7Claude Code num VPSIntegração GitRevisão de Código com ClaudeWorktrees no Claude CodeControle Remoto do Claude CodeChannels do Claude CodeTarefas Agendadas no Claude CodePermissões do Claude CodeModo Auto do Claude CodeFeedback LoopsFluxos de Trabalho com TodosTarefas no Claude CodeTemplates de ProjetoPreços e Consumo de Tokens no Claude CodeClaude Code Ultra Review
speedy_devvkoen_salo
Blog/Handbook/Workflow/Claude Code v2.1.122 Release Notes

Claude Code v2.1.122 Release Notes

alwaysLoad in MCP config, PostToolUse hooks for all tools, PR URL session lookup, plugin pruning, and multi-GB memory leak fixes.

Pare de configurar. Comece a construir.

Templates SaaS com orquestração de IA.

Published Apr 29, 20268 min readHandbook hubWorkflow index

Claude Code v2.1.121 and v2.1.122 both landed on April 28, 2026 — eight features and eighteen fixes spanning the CLI, Desktop app, and agent hook system.

Problem: PostToolUse hooks could only intercept MCP tool output. Bash results, file reads, web fetches — the model saw all of those raw, with no way for a hook to touch them. MCP servers loaded lazily by default, so tools from a freshly-connected server sat behind a ToolSearch call instead of appearing immediately. And finding the session that opened a specific PR meant scrolling the /resume list by hand.

Quick Win: Add alwaysLoad to any MCP server in your config and every tool from that server is available at session start, no ToolSearch step required:

{
  "mcpServers": {
    "myserver": {
      "command": "npx my-mcp-server",
      "alwaysLoad": true
    }
  }
}

This is the fastest visible change from these releases. Tools appear instantly. For servers you open in every session, that removes one quiet source of friction. Read Hooks Guide for the full hook system, and MCP Tool Hooks for how PostToolUse behaves across tool types.

What v2.1.121 and v2.1.122 Changed

Two patch releases shipped the same evening. v2.1.121 at 00:31 UTC carried most of the new capabilities: alwaysLoad, the PostToolUse expansion, plugin pruning, /skills search, and the memory leak patches. v2.1.122 at 22:05 UTC followed with Bedrock service tier selection, the PR URL /resume improvement, and a second batch of bug fixes.

The features that matter most for agent orchestration and production deployments are in v2.1.121.

PostToolUse Hooks Now Cover All Tools

Before this release, PostToolUse hooks could replace tool output for MCP tools only. You could write a hook that intercepted a custom MCP call and rewrote the result before the model saw it. That same trick did not work on Bash, Read, Write, WebFetch, or any built-in tool type.

Now, output replacement works across every tool type. The mechanism is hookSpecificOutput.updatedToolOutput returned from your hook script. Your hook receives the tool name, the original result, and the session context. Return updatedToolOutput in the JSON response and Claude sees that instead of the raw tool output:

{
  "hookSpecificOutput": {
    "updatedToolOutput": "your replacement output here"
  }
}

The hook fires after every matching tool completes. It does not block execution. If your hook returns nothing, or returns without updatedToolOutput, the original result passes through unchanged. Your existing MCP PostToolUse hooks work exactly as before.

What "All Tools" Includes

Tool categoryPostToolUse before v2.1.121PostToolUse after v2.1.121
MCP toolsOutput replacement supportedOutput replacement supported
BashInspect onlyOutput replacement supported
Read / Write / EditInspect onlyOutput replacement supported
WebFetch / WebSearchInspect onlyOutput replacement supported
Agent (subagent results)Inspect onlyOutput replacement supported

This matters most for agent workflows where you want a processing layer between tools and the model. A PostToolUse hook on Bash can strip noise from command output or annotate log lines before the model parses them. A hook on WebFetch can trim a fetched page down to the relevant sections before it hits the context window. A hook on Read can normalize file content into a format your agent expects.

Before, those patterns required wrapping built-in tools behind MCP proxies to get hook access. That workaround is no longer necessary.

alwaysLoad: MCP Tools Without Deferral

Claude Code defers tool loading for MCP servers by default. Tools register lazily and surface through ToolSearch when Claude identifies a need for them. For servers with large tool counts, this keeps the initial context lean. For servers you reach for in every session, the deferral is just overhead — an extra round trip before the first tool call goes through.

The alwaysLoad flag disables deferral for a specific server. All tools from that server load at session start. Set it in your Claude Code settings wherever MCP servers are configured:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx @modelcontextprotocol/server-filesystem",
      "args": ["/Users/you/projects"],
      "alwaysLoad": true
    },
    "large-integration": {
      "command": "npx my-big-server",
      "alwaysLoad": false
    }
  }
}

The flag is per-server. Mix freely: set it on your core tools server, leave it off on a rarely-used integration server with 50+ tools. Servers with under 15-20 tools are good candidates for alwaysLoad. Larger servers are better left on lazy loading unless you know you need immediate access to all of them.

Note: alwaysLoad also addresses a related fix in v2.1.122. ToolSearch was previously missing MCP tools that connected after session start in nonblocking mode. Both issues now have direct solutions: alwaysLoad for servers you want guaranteed upfront, and the ToolSearch fix for servers that connect late.

/resume Now Accepts PR URLs

Finding the session that opened a specific pull request meant scanning the /resume list by timestamp or relying on whatever session name you happened to use. That friction is gone.

Paste any PR URL directly into the /resume search box. Claude Code locates the session that created that PR and surfaces it. Four platforms work: GitHub, GitHub Enterprise, GitLab, and Bitbucket.

The lookup works on the PR URL structure embedded in session history, not on metadata you had to configure. Open /resume, paste the URL, and the session appears. No manual scanning.

This pairs naturally with scheduled tasks or autonomous agent runs that opened PRs without you watching. If something in a PR needs review, you now have a direct path back to the session that built it.

Plugin Pruning

Claude Code auto-installs plugin dependencies when you install a plugin. Those dependencies don't clean up automatically when you remove the plugin that required them. After several installs and removals, ~/.claude/plugins/ accumulates orphaned packages.

Two new commands handle the cleanup:

# Remove all orphaned auto-installed plugin dependencies
claude plugin prune

# Uninstall a plugin and cascade-remove its dependencies
claude plugin uninstall my-plugin --prune

claude plugin prune scans for packages that were auto-installed as dependencies and have no remaining dependents, then removes them. --prune appended to plugin uninstall does the same cleanup in one step at uninstall time.

If you have installed and removed several plugins over the lifetime of your setup, run claude plugin prune once. You'll likely reclaim meaningful disk space.

/skills Gets a Search Box

The /skills panel now has a type-to-filter input. Start typing and the list filters to matching skill names in real time.

This addresses a problem that compounds with skill count. A setup with 40 or 50 skills installed makes scrolling to find a specific one slow, especially on first use in a session. Typing two or three characters narrows the list immediately.

The filter matches on skill names. It doesn't search descriptions or trigger phrases, just the name visible in the panel list.

Memory Leak Fixes

Three separate leaks were patched in v2.1.121. All three could produce multi-gigabyte RSS growth in long-running sessions.

LeakSymptomFix
Image processingUnbounded RSS growth when processing many images across a sessionMemory released after each image is processed
/usage with large transcript histories~2GB memory hit on machines with many old sessionsTranscript data streamed, not held in memory
Long-running tool progress eventsTools failing to clear progress state caused memory to accumulateProgress events cleared correctly when tools complete

Production users running Claude Code in always-on setups, scheduled tasks, or CI environments are most likely to have hit these. If your Claude Code process was growing to 4-8GB RSS over hours, these are the fixes that matter. Update to v2.1.121 or later and restart the Claude Code process once to reclaim any RSS that built up before the patch.

Other Fixes Worth Knowing

FixWhat it does
ANTHROPIC_BEDROCK_SERVICE_TIERNew env var selects Bedrock service tier: default, flex, or priority
Malformed hooks in settings.jsonA bad hooks entry no longer disables the entire hooks configuration
/branch forks from rewound sessionsFixed "tool_use ids without tool_result blocks" errors on branched sessions
Images sent to newer modelsResize limit corrected to 2000px max (was 2576px)
Remote control idle redrawsFixed double redraws per second that could flood tmux control pipes and pause the terminal
!exit / !quit in bash modeThese now run as shell commands instead of terminating the CLI
Vertex AI structured outputFixed invalid_request_error: output_config: Extra inputs are not permitted
ToolSearch in nonblocking modeMCP tools that connect after session start now appear in ToolSearch results

The malformed hooks fix deserves attention if you manage settings.json by hand or generate it programmatically. Previously, a single bad entry in the hooks array disabled all hooks silently. Now Claude Code skips the bad entry and runs the rest. If you've ever wondered why a hook stopped firing after a config edit, this was likely the cause.

Frequently Asked Questions

Does PostToolUse output replacement work for all hook configurations? Yes. Any PostToolUse hook entry in settings.json can return hookSpecificOutput.updatedToolOutput to replace what Claude receives from that tool. Return nothing and the original output passes through. The hook target tool type no longer matters.

Does alwaysLoad affect startup time? It can, for servers with many tools. All tools load at session start instead of on demand, so a server with 50 tools adds that registration overhead upfront. For servers with under 15-20 tools, the difference is negligible in practice.

What does claude plugin prune actually delete? It removes packages under ~/.claude/plugins/ that were auto-installed as dependencies and have no remaining plugins depending on them. It does not touch plugins you installed directly. Running it is safe — it only targets orphaned auto-installed packages.

Does the PR URL lookup in /resume require special setup? No setup needed. Paste a PR URL from GitHub, GitHub Enterprise, GitLab, or Bitbucket into the /resume search box. The match uses the PR URL stored in session history from when the session opened that PR.

Do the memory leak fixes require any config change? No config change. Update to v2.1.121 or later. If you have a long-running Claude Code process that accumulated RSS before the update, restart it once to reclaim the memory.

Were v2.1.121 and v2.1.122 released together intentionally? They shipped the same day but as separate versions. v2.1.121 carried the feature work. v2.1.122 followed the same day with Bedrock additions and the remaining bug fixes. The two releases form a natural pair and are covered together here.

What This Means for Agent Workflows

PostToolUse output replacement on all tools changes what's possible in agent orchestration. Hooks are no longer limited to the MCP surface — every tool call is a potential processing point. Annotate Bash output before the model reads it. Strip irrelevant sections from web fetches. Normalize file content into the format your agent expects. The hook layer becomes a true pipeline between tools and model.

Pair that with alwaysLoad on your core MCP servers and agent sessions start with full tool access — no ToolSearch detour on the first call. The combination trims latency from the opening moves of any agentic run.

The memory leak fixes make long sessions safer to operate. Multi-hour scheduled tasks that process images or accumulate large transcripts were candidates for RSS bloat before these patches. That risk is addressed.

Update to v2.1.122. Audit your PostToolUse hooks for any tool type you've been wanting to intercept. Add alwaysLoad to the MCP servers you open in every session.

Sources

  • Claude Code v2.1.122 release notes — GitHub
  • Claude Code changelog — code.claude.com

Continue in Workflow

  • Melhores Práticas do Claude Code
    Cinco hábitos separam os engenheiros que entregam com Claude Code: PRDs, regras modulares em CLAUDE.md, slash commands personalizados, resets com /clear e uma mentalidade de evolução do sistema.
  • Modo Auto do Claude Code
    Um segundo modelo Sonnet revê cada chamada de ferramenta do Claude Code antes de ser executada. O que o modo auto bloqueia, o que permite e as regras de permissão que cria nas tuas definições.
  • Channels do Claude Code
    Liga o Claude Code ao Telegram, Discord ou iMessage com plugins MCP. Walkthroughs de configuração e os fluxos de trabalho assíncronos e mobile-first que tornam a ligação válida.
  • Boas Práticas para o Claude Opus 4.7
    Como tirar partido do Claude Opus 4.7 no Claude Code: primeiras mensagens, níveis de esforço, pensamento adaptativo, uso de ferramentas, subagentes, reinícios de sessão e controlo de tokens.
  • Revisão de Código com Claude
    Agentes Claude em paralelo caçam bugs em cada PR, cruzam resultados e publicam um único comentário com sinal alto. O que encontra, quanto custa, como ativar.
  • Feedback Loops
    Passe para o Claude Code um prompt que escreve código, roda o seu teste ou comando de dev, lê a saída, corrige o que quebra e faz loop até a suite ficar verde.

More from Handbook

  • Fundamentos do agente
    Cinco maneiras de criar agentes especializados no Código Claude: Sub-agentes de tarefas, .claude/agents YAML, comandos de barra personalizados, personas CLAUDE.md e prompts de perspetiva.
  • Engenharia de Harness para Agentes
    O harness é cada camada ao redor do seu agente de IA, exceto o modelo em si. Aprenda os cinco pontos de controle, o paradoxo das restrições, e por que o design do harness determina o desempenho do agente mais do que o modelo.
  • Padrões de Agentes
    Orchestrator, fan-out, cadeia de validação, routing especializado, refinamento progressivo e watchdog. Seis formas de orquestração para ligar sub-agentes no Claude Code.
  • Boas Práticas para Equipas de Agentes
    Padrões testados em produção para Equipas de Agentes Claude Code. Prompts de criação ricos em contexto, tarefas bem dimensionadas, posse de ficheiros, modo delegado, e correções das versões v2.1.33-v2.1.45.

Pare de configurar. Comece a construir.

Templates SaaS com orquestração de IA.

Auto Memory no Claude Code

Auto memory permite que o Claude Code mantenha notas contínuas do projeto. Onde os arquivos ficam, o que é escrito, como /memory alterna, e quando escolhê-lo em vez de CLAUDE.md.

Melhores Práticas do Claude Code

Cinco hábitos separam os engenheiros que entregam com Claude Code: PRDs, regras modulares em CLAUDE.md, slash commands personalizados, resets com /clear e uma mentalidade de evolução do sistema.

On this page

What v2.1.121 and v2.1.122 Changed
PostToolUse Hooks Now Cover All Tools
What "All Tools" Includes
alwaysLoad: MCP Tools Without Deferral
/resume Now Accepts PR URLs
Plugin Pruning
/skills Gets a Search Box
Memory Leak Fixes
Other Fixes Worth Knowing
Frequently Asked Questions
What This Means for Agent Workflows
Sources

Pare de configurar. Comece a construir.

Templates SaaS com orquestração de IA.