Skip to content
AI Primer
release

Claude Code 2.1.145 adds claude agents --json and Bash tool execution

Anthropic released Claude Code 2.1.145 with JSON session listing for scripting, Bash execution inside Tool, and richer OTEL span metadata. Update if you rely on automation, and review the fix for the environment-variable approval bypass plus the UI bug fixes.

3 min read
Claude Code 2.1.145 adds claude agents --json and Bash tool execution
Claude Code 2.1.145 adds claude agents --json and Bash tool execution

TL;DR

  • ClaudeCodeLog's release thread says Claude Code 2.1.145 shipped 20 CLI changes, led by claude agents --json, a Bash-executing Tool path, and a fix for an environment-variable approval bypass.
  • According to ClaudeCodeLog's changelog post, the release also adds agent_id and parent_agent_id to claude_code.tool OTEL spans and fixes parenting so background subagents nest under the dispatching Agent span.
  • ClaudeCodeLog's changelog post lists a long tail of UI and workflow fixes, including Windows PowerShell resume handling, task ordering, PR badge refresh, Agent Teams non-ASCII names, and /review on repos with Classic Projects.
  • In ClaudeCodeLog's further changes post, the CLI surface also grows a --strict option plus several new environment variables, while prompt tokens rise by 5,453, or 8.5%.

The GitHub release is already live in the v2.1.145 tag. You can also inspect the CLI surface diff, the metadata diff, and the prompt stats diff.

claude agents --json

The most obviously scriptable addition is claude agents --json. In ClaudeCodeLog's changelog post, it is framed as a way to list live Claude sessions for things like tmux-resurrect, status bars, and session pickers.

That is a small CLI flag with very practical consequences. Claude Code already had visible multi-agent behavior, but JSON output turns live sessions into something shell scripts and terminal tooling can consume directly.

Tool and OTEL spans

The same changelog adds agent_id and parent_agent_id attributes to claude_code.tool spans, then fixes trace parenting so background subagents sit under the Agent tool span that launched them. That should make distributed traces less confusing when a foreground agent fans work out to background helpers.

ClaudeCodeLog's further changes post also points to a new prompt string describing a Tool that runs a given Bash command and returns its output. Paired with the tracing changes, 2.1.145 looks a bit more automation-first than the version bump suggests.

Permission and UI fixes

The security-relevant item is the Bash permission bypass. ClaudeCodeLog's changelog post says bare variable assignments to non-allowlisted environment variables had been auto-approved, and 2.1.145 closes that path.

The rest of the fix list is mostly quality-of-life, but it is broad:

CLI surface and prompt growth

The quieter changes are in the diff metadata. ClaudeCodeLog's further changes post says 2.1.145 adds a --strict option and seven environment variables: ANTHROPIC_ENVIRONMENT_ID, ANTHROPIC_ENVIRONMENT_KEY, CLAUDE_CODE_HOST_AUTH_ENV_VAR, CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS, CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH, DISPLAY, and SCREENSHOT_DIR. It also removes CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE.

The same post says the bundle grew by 122.1 kB, or 0.5%, while prompt files rose by three and prompt tokens rose by 5,453, or 8.5%. Tool-related prompt share climbed from 60.0% to 63.1%, which fits the release's overall shape: more plumbing for agents, more shell integration, and more metadata hanging off the CLI surface.

Share on X