I let Claude Code run unsupervised for three hours last Wednesday. It wrote 847 lines of test coverage, debugged six failing tests, and stopped exactly when the conditions I set were met — without me touching the keyboard once. That is what the /goal command does. Combine it with Agent View, the new session dashboard that shipped in v2.1.139 on May 19, 2026, and you have the closest thing to a true autonomous coding partner the CLI has ever shipped.
The short version: claude agents gives you a live dashboard of every session — running, blocked, or done. /goal <condition> sets a completion target and Claude loops across turns until it is met. Background sessions with --bg let those loops run without blocking your terminal. This combination turns Claude Code from an interactive assistant into something closer to a scheduled background worker that asks for help only when genuinely stuck.
What Shipped in v2.1.139 (And What Came After)
The May 19 release was dense. Agent View and /goal were the headliners, but the two weeks of point releases that followed added features that change how you configure and automate agents. Here is the full picture:
| Version | Feature | What It Does |
|---|
| 2.1.139 | Agent View, /goal | Session dashboard; completion-driven loops |
| 2.1.140 | Agent hook types | Stop/SubagentStop hooks for agent frontmatter |
| 2.1.142 | New session flags | --add-dir, --settings, --mcp-config, --permission-mode |
| 2.1.143 | Worktree isolation toggle | bgIsolation: "none" for repos where worktrees break |
| 2.1.144 | /resume in agent view | Background sessions appear with bg tag; resume by ID |
| 2.1.145 | claude agents --json | JSON output for tmux, status bars, scripting |
| 2.1.147 | /code-review | Renamed from /simplify; reports correctness bugs at chosen effort level |
| 2.1.149 | /usage breakdown | Per-category costs: skills, subagents, plugins, MCP |
The version cadence tells you something: Anthropic is shipping against real developer feedback. The worktree isolation fix in 2.1.143 — adding bgIsolation: "none" for repos where git worktrees are impractical — was not a planned feature. It was a direct response to production blockers. The /resume functionality expanding to Agent View in 2.1.144 filled an obvious gap that the initial launch left open. This is the engineering culture at Anthropic: drop the headline, then fill the missing pieces fast.
Agent View: The Session Dashboard You Have Been Waiting For
Run claude agents from any terminal and you get a single live view of every Claude Code session: which ones are running, which are blocked waiting for your input, and which have finished. The count of sessions awaiting input appears in your terminal tab title — meaning you can see at a glance how many agents need attention without switching context.
# Open the agent view dashboard
claude agents
# Scope it to a specific project directory
claude agents --cwd ./my-project
# Output as JSON for scripting (tmux, status bars, monitoring)
claude agents --json
Inside the dashboard, four keyboard shortcuts do most of the work. Ctrl+T pins a background session — pinned sessions stay alive when idle and auto-restart after Claude Code updates instead of requiring manual relaunch. Ctrl+R renames a session to something human-readable. The left arrow key detaches or closes a session while preserving its state. And v opens the session directly in your editor.
The session state preservation is the part that matters most in practice. When you detach with the left arrow or background a session with /bg, it preserves the model, effort level, permission mode, MCP servers, and settings you configured. In earlier Claude Code versions, detaching and resuming a session sometimes reverted to defaults. That regression is gone as of 2.1.142.
One subtle improvement: sessions launched from Agent View respect the permissions.defaultMode from your settings.json. If your project settings say auto, agent view sessions inherit that without you passing a flag every time. Small change, large day-to-day impact.
/goal: Tell Claude When It Is Done
The /goal command is deceptively simple. You set a completion condition. Claude works across turns until that condition is met, then stops.
# In an interactive Claude Code session
/goal Write unit tests covering 95% of the authentication module
# Compound conditions work too
/goal Implement OAuth2 login with Google and GitHub. All existing tests must pass. No TypeScript errors.
While a goal is active, a live overlay panel shows elapsed time, number of turns completed, and cumulative token count. The overlay runs in real time without blocking your ability to type — you can interact with the session while Claude is working if you need to redirect it or provide context it is missing.
What makes /goal different from just giving Claude a task in a single message is that it creates a controlled loop. Claude writes code, runs tests, inspects failures, revises the code, and runs tests again — automatically, across as many turns as the goal requires. The completion condition is checked after each cycle. This is not a new capability in the underlying model; it is a harness change that lets the model apply its existing tool-use and reasoning capabilities over a longer trajectory without requiring you to manually re-prompt it.
I used /goal to write a Zod schema validation test suite covering edge cases I had been putting off for weeks. The goal ran for 41 minutes and 23 turns. It found three input patterns my initial schemas did not handle and fixed them before stopping. Total cost: $0.43 in API tokens according to /usage. That 41 minutes would have been three to four hours of my time, spread across three separate mornings of interrupted work.
The comparison to point-and-shoot prompting is stark. "Refactor the auth module" stops when Claude runs out of obvious things to do. "/goal Auth module refactored with no TypeScript errors and 90%+ test coverage" stops when the work is actually done. That distinction is what makes /goal a fundamentally different interface, not just a convenience wrapper.
Background Sessions: The Full Control Surface
Background sessions are not new to Claude Code, but the 2.1.x releases added enough configuration surface that they now behave like first-class agent deployments rather than a niche CLI trick.
# Start a simple background session
claude --bg "Audit the codebase for security issues in the auth module"
# Fully configured background agent
claude --bg --name "security-audit" --model claude-opus-4-7 --effort high --permission-mode auto --settings ./.claude/settings.json --mcp-config ./.claude/mcp.json "Complete the security review and output findings to SECURITY_REPORT.md"
# Resume a background session interactively
/resume
# Resume by specific session ID
claude --resume
The --fallback-model flag is worth knowing for production workflows. If the primary model hits a rate limit or quota boundary, Claude Code falls back to the specified alternative instead of failing hard:
claude --bg --model claude-opus-4-7 --fallback-model claude-sonnet-4-6 "Refactor the payment processing module"
For repositories where git worktrees cause problems — monorepos with symlinks, certain CI-generated layouts, some Windows configurations — set "worktree.bgIsolation": "none" in your settings.json. Background sessions will then edit the working copy directly instead of creating an isolated worktree. This unblocks a significant class of production use cases that were painful before 2.1.143.
Empty idle background sessions auto-retire after five minutes. Sessions that finish their work but leave a background shell running move to "Completed" rather than "Running". These distinctions matter when you are managing six sessions and need to know which ones are still doing something versus which ones have finished and are just consuming memory.
New Agent Flags: Configure Everything
The v2.1.142 release added a set of flags that turn what used to be informal defaults into explicit, preservable configuration. All of these work in both claude and claude agents:
claude --add-dir ../shared-lib # Give Claude read access to a directory outside cwd
claude --settings ./.claude/prod.json # Use project-specific settings file
claude --mcp-config ./.claude/mcp.json # Attach specific MCP servers to this session
claude --plugin-dir ./.claude/plugins # Load project-specific plugins
claude --permission-mode auto # No prompts for safe file operations
claude --effort xhigh # Maximum reasoning depth for trust-boundary tasks
claude --dangerously-skip-permissions # Full bypass (use only in sandboxed environments)
The --add-dir flag solves a recurring pain point. Claude Code previously could not read files outside the current working directory without you changing directories first. With --add-dir, you can give an agent access to a shared library, a design system package, or a documentation directory outside the project root — without restructuring your project layout to accommodate it.
For multi-agent orchestration, these flags let you configure each dispatched subagent independently. A lead orchestrator running at --effort high can dispatch subagents with lower effort for mechanical tasks like formatting or renaming, controlling cost across the entire system. For patterns on structuring these systems, the multi-agent coordination guide covers orchestrator-worker architectures in detail.
Three Workflows That Changed How I Work
1. The Background Audit
Every Friday, I run a background audit against the week's merged PRs. The agent reads the diff, checks for patterns from our CLAUDE.md security rules, and writes findings to a WEEKLY_AUDIT.md file. I come back Monday to a report rather than a vague sense that I should probably review something.
claude --bg --name "weekly-audit" --model claude-opus-4-7 --effort high --permission-mode auto "Read all changes merged this week. Cross-reference against .claude/rules/trust-boundary.md. Write WEEKLY_AUDIT.md with findings ranked by severity. Flag any payment or auth path changes explicitly."
2. The Completion Gate
Before any PR goes out, I set a /goal with the exact criteria from our definition of done. Not a checklist I run through manually. Not a reminder to check TypeScript. A condition Claude satisfies or keeps working:
/goal All TypeScript type errors resolved. All unit tests pass. No console.log statements remaining. ESLint reports zero errors on changed files.
Claude works through the list systematically. It does not stop until every condition is true. This replaced my pre-PR checklist habit, which I was reliably skipping under deadline pressure.
3. The Pinned Session
I keep one pinned session open in Agent View for the project I am actively shipping. It holds project context, MCP server connections, and permission settings — configured once, preserved across updates. When I need Claude for something quick, I jump into the pinned session instead of starting a cold context window. Auto-restart on updates means I get new Claude Code features without losing the session configuration.
The /usage Command: Real Cost Visibility
Starting in v2.1.149, /usage breaks down your token costs by category: skills, subagents, plugins, and MCP server calls. Before this update, the aggregate cost was visible but opaque — you could not tell whether a session's cost was driven by MCP tool calls, recursive subagent spawning, or the main conversation. That distinction matters when you are optimizing a multi-agent workflow for cost efficiency.
For MCP-heavy workflows, the MCP servers guide covers patterns for keeping call counts reasonable. An agent that calls an MCP server 50 times in a session is often doing something that could be batched into 3–5 calls with better tool design. /usage makes that pattern visible instead of hiding it inside an aggregate number.
What to Do Right Now
Update to v2.1.149 or later: npm update -g @anthropic-ai/claude-code. Then run claude agents and look at what is actually running. Most developers are surprised to find sessions they backgrounded and forgot. Pin the ones that matter with Ctrl+T so they survive the next update cycle.
For any task that takes more than 20 minutes to specify, set a /goal with the completion criteria instead of a task description. The difference in outcome is consistent enough that I now default to /goal for anything beyond a single-file edit.
If you are building production workflows with background agents, read the new flag documentation before committing to an architecture. The --permission-mode, --fallback-model, and --add-dir flags together create a configuration surface that was not possible before May 2026. The agents you can build now are meaningfully more reliable than what shipped in April.
The CLAUDE.md templates, agent skill starters, and MCP server boilerplates for building these workflows are available at wowhow.cloud — pay once, configure once, ship reliably.
Originally published at wowhow.cloud
























