{"schemaVersion":"1.0","publication":{"slug":"pivot-claude-code","name":"Claude Code Review","description":"Workflows, releases, and field notes for Anthropic's coding agent.","audience":"Developers and teams adopting Claude Code.","geography":null},"edition":{"id":"875242b3-1590-4d2e-a853-58aac02f109e","date":"2026-09-16","status":"locked","createdAt":"2026-09-16T02:52:47.025Z","storyCount":5,"newsletterSubject":"Claude reshaped Anthropic's CI system, Claude Code 2.1.267 adds effort caps, Claude Code 2.1.268 adds gateway controls"},"updatedAt":"2026-09-16T03:00:33.778Z","stories":[{"id":"5dedbe3e-2941-4736-ad6a-2f02f498f8eb","title":"Anthropic details how Claude-assisted development reshaped its CI system","dek":"A September 14 engineering report says CI jobs rose 25-fold as code output, test volume, and review speed increased, then traces the earlier fixes and redesign.","bodyMd":"In an engineering report published September 14, Anthropic describes how the amount of code its engineers ship, the size of its test suite, and faster pull-request review pushed more work into continuous integration. Over six months, the company recorded a 25-fold increase in CI jobs while its tests grew tenfold and engineering headcount changed only modestly. Claude is part of that workflow: Anthropic says it authors 80% of its code and helps review pull requests. The new bottleneck appeared after code was written, where every change still needed the right tests and reliable results. Anthropic’s first fixes did not last. A larger machine bought 70 days, splitting work across package-level workers bought 29 days, and restarting the service eventually bought less than one day.\n\nThe strained system had two parts. A listener collected results from CI runs, while a selector used test history and package relevance to decide which tests belonged on each pull request. Both depended on one process holding the running history. When the listener fell 20 minutes behind, Anthropic says tens of thousands of updates could be missing from the selector. That stale view could schedule tests already failing across the codebase, block merges on newly flaky dependencies, or miss a newly added test until the listener caught up. Anthropic used a long-running internal Claude Tag session to watch the backlog and resume the same investigation whenever lag passed 50,000 jobs. Claude also generated the earlier package-sharding implementation, but the rising job volume quickly consumed the extra capacity.\n\nThe report says the durable fix moved state out of the listener process. Listener workers can now take any result, append it to a journal in an in-memory data store, and move on. A separate consumer rolls those events into per-test history every few seconds, and the selector reads that history when choosing tests. The distributed design costs more to run, but Anthropic says one engineer completed it in three weeks and that the queued-result backlog stayed flat after cutover and tuning. Claude handled much of the tuning, including journal sizing and worker counts. The practical lesson is about the workflow around Claude Code: faster coding and review can shift the constraint into CI, so teams need to measure the entire path from incoming jobs to recorded results and design critical services so workers do not keep unique state.","status":"published","storyType":"news","category":null,"clusterKey":"q1470-anthropic-ci-test-impact-2026-09-14","slug":"anthropic-details-how-claude-assisted-development-reshaped-its-ci-system-5dedbe","url":"https://claudecodereview.ai/a/anthropic-details-how-claude-assisted-development-reshaped-its-ci-system-5dedbe/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/5dedbe3e-2941-4736-ad6a-2f02f498f8eb","role":"lead","position":0,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/anthropic-details-how-claude-assisted-development-reshaped-its-ci-system-5dedbe/9bc3b3deae63b1a0-a842e00ec15d3ee7/web_hero.webp","imageAlt":"A diagram shows twenty-five worker units funnelling data into a single channel and journal, replacing a previous system where one central vessel was overwhelmed by a large stack of jobs.","createdAt":"2026-09-16T02:52:04.257Z","updatedAt":"2026-09-16T03:00:25.029Z","sources":[{"role":"primary","title":"Anthropic details how Claude-assisted development reshaped its CI system","url":"https://claude.com/blog/agentic-coding-is-straining-ci-heres-how-we-scaled-test-impact-analysis-at-anthropic","sourceName":"claude.com","author":"claude.com","publishedAt":"2026-09-14T12:00:00Z"}]},{"id":"bf2f4c81-6d77-4f02-ace0-c1dc137870ac","title":"Claude Code 2.1.267 adds effort caps and per-request instruction updates","dek":"The release adds model-effort ceilings and refreshes standing instructions on each request, alongside fixes for restricted cloud tasks, resumed sessions, and managed tools.","bodyMd":"Claude Code 2.1.267 added a `maxEffortLevel` setting. Administrators can place the setting at the top level or configure it per model under `modelSettings`. The ceiling applies across providers, including Amazon Bedrock, Google Vertex AI, and Foundry. Users can still choose an effort level below the configured maximum.\n\nThe release also added `--system-prompt-snapshot off`. With that option, Claude Code renders the system prompt fresh on every request instead of reusing the prompt recorded with the conversation. Anthropic describes the option as a way to iterate on prompt text.\n\nSeveral fixes concern managed and automated work. Cowork scheduled tasks in the cloud no longer fail at startup when an organization requires sandboxing through managed settings. Workflow `agent()` calls with large output schemas now go to the safety classifier in auto mode instead of being refused before that check. On macOS and Linux, the release fixes a case in which a backslash in a marketplace entry path could bypass a containment check for fetched marketplaces.\n\nVersion 2.1.267 also repairs resumed sessions. When a session larger than 5 MB is reloaded, parallel tool calls and their hook output are no longer dropped. Resuming after `/compact` or another slash command run through `-p --resume` no longer inserts an extra “Continue from where you left off.” turn. The release also preserves the recorded system prompt and tool definitions for subagents and sessions started with `--system-prompt` or `--append-system-prompt`, improving prompt-cache stability.\n\nRemote use received narrower interface and connection fixes. `/context` and other local command output no longer appear blank on mobile clients. Shift+Enter and Option+Backspace work again after reconnecting to a tmux or SSH session inside an agent view. A `claude remote-control` host whose server credential expires now re-registers instead of exiting and dropping every attached session.\n\nManaged tools and credentials received additional corrections. If managed HTTP-hook URLs, HTTP-hook environment variables, or channel plugins cannot be read, Claude Code now admits none of them rather than all of them. Expired AWS or Google Cloud credentials under a host application now produce the re-authentication error without first making ten retries that show a generic request-failed message.\n\nThe release includes fixes for MCP and plugin tools as they connect, disconnect, or reload during a conversation. It prevents several cases that rewrote tool definitions, broke prompt-cache reuse, or dropped earlier extended thinking. It also fixes GitHub command-line and API calls on Claude Code on the web for organizations without the Claude GitHub App: those calls now use the connected GitHub account and report when no account is connected.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-2-1-267-effort-caps-fresh-prompts","slug":"claude-code-2-1-267-adds-effort-caps-and-per-request-instruction-updates-bf2f4c","url":"https://claudecodereview.ai/a/claude-code-2-1-267-adds-effort-caps-and-per-request-instruction-updates-bf2f4c/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/bf2f4c81-6d77-4f02-ace0-c1dc137870ac","role":"item","position":1,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-2-1-267-adds-effort-caps-and-per-request-instruction-updates-bf2f4c/ea743667d47292b9-9f204162ced4e55d/web_hero.webp","imageAlt":"A single bar capping a three-tiered structure, with a document being pulled from a stack below it.","createdAt":"2026-09-16T02:31:10.360Z","updatedAt":"2026-09-16T03:00:33.778Z","sources":[{"role":"primary","title":"Claude Code v2.1.267 Adds Effort Level Caps, Fresh System Prompts, and Faster Resumes","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.267","sourceName":"ashwin-ant","author":"ashwin-ant","publishedAt":"2026-09-09T19:58:14Z"}]},{"id":"5ce22bb7-fb09-4dc1-b37f-e7d52c5431a4","title":"Claude Code 2.1.268 adds gateway controls and JSON plugin management","dek":"The release adds managed gateway pricing and network warnings, per-session cleanup for runners on the team’s own servers, and machine-readable plugin commands.","bodyMd":"Claude Code 2.1.268 added controls for teams that route the coding agent through a Claude apps gateway. Administrators can put pricing in `gateway.yaml`, and signed-in Claude Code clients then receive those rates through managed settings. The release says the values feed both `/cost` and telemetry, so the numbers shown inside a client can match the gateway’s spend meter.\n\nThe gateway also gained two network-safety signals. Claude Code warns at startup when `access_control.allow_cidrs` is empty, and it produces a one-time warning when the first request arrives from a public address. A new managed setting, `gatewayInternalNetworks`, lets an administrator allow `/login` to a gateway from the organization’s own public IPv4 block. These settings concern gateway access configuration; they do not replace the organization’s network policy.\n\nSelf-hosted runner operators can now start `claude self-hosted-runner` with `--remove-session-state`. The option is off by default. When enabled, Claude Code removes each session’s directories beneath `<base-dir>/_sessions/` after that session ends. The release describes cleanup of per-session state, rather than deletion of the repository or other directories outside that path.\n\nPlugin administration became easier to automate. The `install`, `uninstall`, `update`, `enable`, and `disable` plugin commands now accept `--json`. Rows returned by `claude plugin list --json` also include `errorDetails` and `noteDetails`. Scripts can consume those structured results without parsing the terminal’s display text.\n\nVersion 2.1.268 includes fixes for managed and third-party environments. It repairs HTTP 400 failures that affected third-party Anthropic-compatible endpoints after version 2.1.265. It also fixes stale model-access denials after a restart and a running session silently switching to the organization’s default model when another process refreshes a cached access entry.\n\nFor administrators, the release groups three operational jobs into one update: align gateway cost reporting, surface risky gateway network configuration, and make runner and plugin maintenance easier to automate. Each behavior is controlled by the documented setting or command; the update does not turn on session cleanup by default.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-2-1-268-gateway-controls","slug":"claude-code-2-1-268-adds-gateway-controls-and-json-plugin-management-5ce22b","url":"https://claudecodereview.ai/a/claude-code-2-1-268-adds-gateway-controls-and-json-plugin-management-5ce22b/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/5ce22bb7-fb09-4dc1-b37f-e7d52c5431a4","role":"item","position":2,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-2-1-268-adds-gateway-controls-and-json-plugin-management-5ce22b/bbdbc83f65c23d21-70699b3f85534f07/web_hero.webp","imageAlt":"A funnel connecting to a gauge, a barrier with two warning symbols, and a stack of five rectangular blocks being lifted away.","createdAt":"2026-09-16T02:12:00.070Z","updatedAt":"2026-09-16T02:31:10.948Z","sources":[{"role":"primary","title":"Claude Code v2.1.268 Brings Gateway Pricing, New CLI Flags, and MCP Fixes","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.268","sourceName":"ashwin-ant","author":"ashwin-ant","publishedAt":"2026-09-10T20:30:54Z"}]},{"id":"da744993-71e4-4686-95fb-e3b58734fdb3","title":"Claude Code 2.1.273 lets remote-control sessions fork locally","dek":"Users can fork a Remote Control session from the Claude app and keep the new branch running as a background session on their own computer.","bodyMd":"Claude Code 2.1.273 added a way to fork a session that began through `claude --remote-control` or `/remote-control` from the Claude app. The fork runs as a background session on the user’s computer. That gives a remote-control user a second branch of the session without moving the new work to a separate cloud host. Anthropic’s release notes describe where the fork runs but do not claim that it copies every external service state or makes concurrent branches conflict-free.\n\nThe release also added five optional request headers for teams routing Claude Code through an LLM gateway: `x-claude-code-request-class`, `x-claude-code-agent-type`, `x-claude-code-prev-tool-durations`, `x-claude-code-compaction`, and `x-claude-code-context-compacted`. Operators opt in with `CLAUDE_CODE_GATEWAY_HINT_HEADERS=1`. These headers expose request context that a gateway can use operationally; the notes do not say that enabling them changes model output.\n\nModel Context Protocol (MCP), the standard for connecting agents to outside tools, also gets clearer failure alerts. When an MCP server disconnects during a session and automatic reconnection eventually gives up, Claude Code now posts a notification that points the user to `/mcp`. The feature concerns the exhausted retry state. It does not promise that every disconnected server will reconnect, and it does not replace whatever authentication or service repair the MCP server itself requires.\n\nA group of permission fixes closes cases where command structure obscured risk. Bash commands the checker could not fully analyze no longer skip the prompt under `permissions.blockReadsOutsideWorkingDirectories`, and a subshell can no longer hide a dangerous `rm` while bypass mode is active. Memory directories selected by repository settings are also excluded from prompt loading, recall, indexing, and extraction when outside-working-directory reads are blocked. Managed MCP and connector restrictions delivered through MDM or `managed-settings.json` now remain effective when server-managed settings are present.\n\nThe update corrected several state and recovery problems. Skills synced from claude.ai move to recoverable trash after an organization disables Skills. Scheduled tasks copied into another folder no longer run in the wrong session. Backgrounded subagents keep their remaining streamed messages and final report in SDK and stream-JSON output. Artifact publishing can safely retry after a connection drops once the upload has reached claude.ai, avoiding a duplicate version.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-2-1-273-remote-control-local-forks","slug":"claude-code-2-1-273-lets-remote-control-sessions-fork-locally-da7449","url":"https://claudecodereview.ai/a/claude-code-2-1-273-lets-remote-control-sessions-fork-locally-da7449/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/da744993-71e4-4686-95fb-e3b58734fdb3","role":"item","position":3,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-2-1-273-lets-remote-control-sessions-fork-locally-da7449/b3725415012a0247-bc6ea506cfefd0ae/web_hero.webp","imageAlt":"A diagram of a single line branching into two, with one branch ending in a detached loop to represent an independent local session.","createdAt":"2026-09-16T02:07:51.033Z","updatedAt":"2026-09-16T02:31:18.249Z","sources":[{"role":"primary","title":"Claude Code v2.1.273 Adds Session Forking, MCP Alerts, and Gateway Headers","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.273","sourceName":"ashwin-ant","author":"ashwin-ant","publishedAt":"2026-09-15T20:23:03Z"}]},{"id":"a7af1910-7243-4885-89cd-e8e30446ff07","title":"Claude Code 2.1.271 brings fast mode to remote sessions","dek":"The release applies an organization-approved fast-mode setting to cloud sessions and sessions on the team’s own servers, adds per-command network allowances, and improves runner drain reporting.","bodyMd":"Claude Code 2.1.271 extended fast mode to Remote sessions running in Anthropic’s cloud or on self-hosted runners. According to the official release notes, the host’s fast-mode setting or `/fast` typed in the session applies when the user’s organization permits it. Fast mode is Anthropic’s product name; the notes do not supply a measured speed gain for this release, so the change should be understood as availability in another execution context rather than a new performance benchmark.\n\nAnthropic also changed how sandboxed commands can reach the network in auto mode. Bash, PowerShell, and Monitor commands can request an `allowed_domains` list for that individual command. The requested hosts are reviewed with the command and opened only for it, while other hosts remain refused. This is a narrower mechanism than opening broad network access for an entire session and gives a reviewer the command and its requested destinations together.\n\nSelf-hosted runner operators gained `claude self-hosted-runner --drain-marker-file <path>`. If the marker exists when a runner receives SIGTERM during a drain, the runner reports the exit as a host drain. Anthropic explicitly describes the signal as telemetry only. It does not change the scheduling or shutdown behavior by itself, and the release makes no uptime claim based on the marker.\n\nThe fullscreen `/config` panel gained mouse support: the wheel scrolls the list, clicking a value changes it, and the row under the pointer is highlighted. Custom and plugin subagents can also use `omitClaudeMd` in agent frontmatter or `--agents` JSON to run without user, project, and local CLAUDE.md files. Managed policy files still load, so the option does not bypass organization policy.\n\nSeveral fixes address fast-mode fallback and permissions. A fast request that hits overload or a usage-credit limit now falls back to standard speed in the covered retry path rather than failing the turn or retrying at fast speed. Bash permission checking was corrected for wildcard-expanded files, unrecognized option layouts, shell declaration flags, and command chains that previously could skip a prompt under `permissions.blockReadsOutsideWorkingDirectories`. The release also fixed enterprise MCP exclusivity when `managed-mcp.json` cannot be read: Claude Code now retains exclusive control and warns instead of silently loading other servers.\n\nTogether, the changes make remote execution, command-specific network review, and managed policy behavior more explicit. They do not establish generalized productivity or infrastructure gains beyond the behaviors listed in Anthropic’s September 14 notes.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-v2-1-271-fast-mode-remote","slug":"claude-code-brings-fast-mode-to-remote-sessions-and-mouse-scrolling-to-s-a7af19","url":"https://claudecodereview.ai/a/claude-code-brings-fast-mode-to-remote-sessions-and-mouse-scrolling-to-s-a7af19/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/a7af1910-7243-4885-89cd-e8e30446ff07","role":"item","position":4,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-brings-fast-mode-to-remote-sessions-and-mouse-scrolling-to-s-a7af19/7372f6c498ea1231-215fbc369288ef9f/web_hero.webp","imageAlt":"A diagram shows three separate elements—a cloud, three command blocks, and a flag—all funneling down into one single rectangular output.","createdAt":"2026-09-16T00:45:37.931Z","updatedAt":"2026-09-16T02:31:25.084Z","sources":[{"role":"primary","title":"Claude Code v2.1.271 Adds Fast Mode for Remote Sessions and Mouse Config","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.271","sourceName":"ashwin-ant","author":"ashwin-ant","publishedAt":"2026-09-14T22:12:54Z"}]}],"tips":[{"id":"a1514f8d-452e-45f5-a72a-2b9592d638e2","title":"Which Claude Code project files to commit, and what goes in CLAUDE.md versus .claude","dek":"Anthropic's docs contrast CLAUDE.md, the instructions file Claude reads every session, with skills, which load only when called or relevant; the hidden .claude folder holds the rest of the project's Claude Code configuration.","bodyMd":"Claude Code's docs say what each project file does and when it loads, and that decides where an instruction belongs. The clearest contrast is between `CLAUDE.md`, the instructions file Claude reads at the start of every session, and skills, which load only when you call them or when they are relevant. Here is the layout, drawn from Anthropic's pages on memory, the `.claude` directory, skills, subagents, MCP and settings (read October 25, 2026).\n\n**CLAUDE.md: what every session needs.** Put build and test commands, naming conventions, project layout and \"always do X\" rules in `CLAUDE.md` at the repo root or in `.claude/CLAUDE.md`. Keep it under 200 lines: longer files use more context and Claude follows them less reliably. Write checkable instructions (\"Run `npm test` before committing\", not \"Test your changes\"). Run `/init` to draft one from your codebase and `/context` to confirm it loaded. Anthropic's trigger for adding a line: Claude made the same mistake twice, a code review caught something it should have known, or you retyped the same correction.\n\nCLAUDE.md is context, not enforcement. If something must happen every time, such as blocking edits to `.env`, use a hook in settings.\n\n**Everything else under `.claude`**\n\n`.claude` is the hidden project folder that holds Claude Code's configuration, skills, agents and rules.\n\n- `.claude/rules/*.md`: topic-specific instructions. A rule with `paths` frontmatter (for example `\"src/api/**/*.ts\"`) loads only when Claude reads or edits a matching file. A rule without `paths` loads at launch, with the same priority as `.claude/CLAUDE.md`. `@path` imports in CLAUDE.md still load with it, so they don't save context. Path-scoped rules do.\n- `.claude/skills/<name>/SKILL.md`: workflows and long checklists that load when called or relevant. The folder name becomes a command such as `/deploy`.\n- `.claude/agents/<name>.md`: subagents with their own system prompt, tools and optional model. They run in a separate context window and return a summary, which suits tasks that read dozens of files.\n- `.claude/settings.json`: team permissions, hooks, plugins and environment variables.\n- `.mcp.json` at the repo root: project MCP servers, added with `claude mcp add --scope project`. Each person is asked to approve them before use. Use `${API_KEY}` or `${VAR:-default}` placeholders so keys expand from each person's environment.\n\n**What to commit.** `CLAUDE.md` (or `.claude/CLAUDE.md`), `.claude/rules/`, `.claude/skills/`, `.claude/agents/`, `.claude/settings.json`, and `.mcp.json` with placeholders.\n\n**What to keep out of git.** `CLAUDE.local.md` (add it to `.gitignore`) and `.claude/settings.local.json`, which holds personal overrides and wins over the team file. Claude Code creates the latter when you pick \"Yes, and don't ask again\" on a permission prompt and adds it to your global git excludes. If you create it by hand, ignore it yourself. Files in `~/.claude` and auto memory under `~/.claude/projects/` never enter the repo.\n\n**If the repo also serves other agents.** By default Claude Code reads `AGENTS.md` only when no `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md` exists in the working directory or above. Adding a `CLAUDE.local.md` therefore makes Claude stop reading `AGENTS.md` for you. To keep one shared file, put `@AGENTS.md` on the first line of `CLAUDE.md` and add Claude-only notes below. Alternatively, set **Project instructions** in `/config` to `claude-md-and-agents-md` to read both. Reading `AGENTS.md` directly needs Claude Code v2.1.277 or later, so use the import on older installs.\n\nAnything under `.agents/` is not read as instructions, and the skills docs list only `.claude/skills` locations. Cursor documents reading `.claude/skills`, which makes it the one skills path both tools document.","category":"Workflow","slug":"which-claude-code-project-files-to-commit-and-what-goes-in-claude-md-ver-a1514f","url":"https://claudecodereview.ai/a/which-claude-code-project-files-to-commit-and-what-goes-in-claude-md-ver-a1514f/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/a1514f8d-452e-45f5-a72a-2b9592d638e2","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/which-claude-code-project-files-to-commit-and-what-goes-in-claude-md-ver-a1514f/88eda2ba5e65f4bd-18af441a6d0bd9f4/web_hero.webp","imageAlt":"A tall rectangular prism stands taller than a group of small, varied blocks, representing the distinction between core instructions and modular project configuration.","createdAt":"2026-10-30T03:33:49.533Z"},{"id":"012d35b5-2133-4478-8cb3-f1e7957e1fbe","title":"Keep long sessions from filling up on tool output with the Context Mode plugin","dek":"Context Mode routes raw MCP output into a sandbox and tracks session events in SQLite, which its README says keeps far less raw output from heavy browser, GitHub and log tools in your context.","bodyMd":"Context Mode is an MCP server plus a set of hooks that keeps raw tool output out of the chat. According to its README, a Playwright snapshot costs 56 KB, twenty GitHub issues cost 59 KB and one access log is 45 KB. After about 30 minutes of work, roughly 40% of a Claude Code context can be gone, and after compaction the agent can lose track of which files it was editing. Context Mode keeps the raw output in a sandbox so only a small result reaches the conversation. It also records session events in SQLite so work survives compaction.\n\n## Set it up\n\nYou need Claude Code v1.0.33 or newer (`claude --version`). If `/plugin` is not recognized, update with `brew upgrade claude-code` or `npm update -g @anthropic-ai/claude-code`.\n\n1. **Install.** Inside Claude Code run `/plugin marketplace add mksglu/context-mode`, then `/plugin install context-mode@context-mode`. Restart Claude Code or run `/reload-plugins`.\n2. **Verify.** Run `/context-mode:ctx-doctor`. Every check should show `[x]`. It validates runtimes, hooks, FTS5 and plugin registration. Fix anything red first, because the routing hooks are what make the savings automatic.\n3. **Let the model write code instead of reading files.** Routing is automatic: a SessionStart hook injects instructions at runtime, so nothing is written into your project. The README's example replaces 47 `Read()` calls (700 KB) with one `ctx_execute()` script that prints only line counts (3.6 KB). The README quotes 315 KB shrinking to 5.4 KB for sandboxed output. Those are the project's own numbers, so measure yours.\n4. **Measure.** `/context-mode:ctx-stats` shows a per-tool breakdown, tokens consumed and the savings ratio. For a live meter, add this to `~/.claude/settings.json` and restart:\n\n```json\n{\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"context-mode statusline\"\n  }\n}\n```\n\n5. **Index docs you keep re-reading.** `/context-mode:ctx-index` loads a local file or directory into a persistent FTS5 knowledge base. `/context-mode:ctx-search` then returns only the relevant passages through BM25 search. `/context-mode:ctx-purge` permanently deletes everything indexed.\n\n## Try it without the plugin\n\n`claude mcp add context-mode -- npx -y context-mode` adds only the MCP server. You get all 11 tools but no automatic routing or slash commands, so the model is not nudged away from raw Bash, Read and WebFetch and savings are smaller. It works as a low-commitment test.\n\n## When it is worth it\n\nThe plugin targets long sessions that lean on browser, GitHub or log-heavy MCP tools and keep hitting compaction. For short sessions, the write-up says the overhead is not worth it.\n\nOne caution from the README: if you do not start with `--continue`, previous session data is deleted immediately, so a fresh session is a clean slate. After a compaction, Context Mode indexes the recorded events (file edits, git operations, tasks, errors, decisions) and retrieves only what is relevant rather than replaying the history.","category":"Workflow","slug":"keep-long-sessions-from-filling-up-on-tool-output-with-the-context-mode-012d35","url":"https://claudecodereview.ai/a/keep-long-sessions-from-filling-up-on-tool-output-with-the-context-mode-012d35/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/012d35b5-2133-4478-8cb3-f1e7957e1fbe","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/keep-long-sessions-from-filling-up-on-tool-output-with-the-context-mode-012d35/64ab7afaa95425f6-2859cb9dfee6cb92/web_hero.webp","imageAlt":"A funneling graphic showing forty-seven rectangular blocks passing through a narrow aperture into one single, small cube.","createdAt":"2026-10-30T03:31:19.263Z"},{"id":"a3b34cbb-9e00-4643-bdea-82b6d27706e5","title":"Shrink test logs and JSON output before they hit your token bill","dek":"Headroom, an open-source local proxy (a program on your machine that sits between Claude Code and the model), compresses logs and tool output, including JSON and token-heavy text, before it is sent, and one command wraps your sessions.","bodyMd":"Test runs, build logs, large JSON (the structured data format many tools print) and long diffs go back to the model on every step, and you pay for those tokens each time. Tokens are the units of text the model bills by. Headroom is an open-source tool that sits between Claude Code and the model and compresses that material first. Its README gives one example: a log that costs 10,144 tokens shrinks to 1,260 while the same fatal error is still found.\n\nCompression runs on your machine. Headroom routes each piece of content to a fitting compressor (one for JSON, one that understands code structure, a text model for prose) and caches the originals locally. The model gets a `headroom_retrieve` tool to pull back the full text when it needs it. Headroom flags content that would break your provider's prompt cache but does not rewrite your prompts.\n\n## Setup\n\n1. Install the CLI with `uv tool install --python 3.13 \"headroom-ai[all]\"` or `pip install \"headroom-ai[all]\"`. The npm package (`npm install headroom-ai`) is the TypeScript SDK only and has no CLI.\n2. Run `headroom wrap claude`. It starts a local proxy (a program on your machine that sits between Claude Code and the model), installs the Serena MCP server for semantic code navigation (registered for the wrapped project only) and launches Claude Code routed through Headroom. Launch Claude Code this way each session. To back out, run `headroom unwrap claude`.\n3. Check it works: `headroom doctor` confirms routing, `headroom perf` shows compression stats, and `headroom dashboard` shows live savings while the proxy is running. Run `doctor` first.\n4. If you would rather not wrap anything, run `headroom proxy --port 8787` and point your tools at it. Anything that can set an API base URL can use it, including your own scripts.\n5. Optionally, run `headroom learn`. It mines failed sessions and writes corrections to `CLAUDE.local.md` (gitignored) by default, or to `CLAUDE.md` or `AGENTS.md` if you choose. Review what it proposes before committing it to a shared file.\n\n## When it pays off\n\nLong sessions on a large repo, usage limits you keep hitting, or per-token billing are the cases where a quick trial makes sense. Sessions heavy on test runs, build logs and large JSON compress well. A session of short prompts will not move much.\n\n## Caveats\n\nThe 10,144 to 1,260 figure is the README's own example, not a benchmark of your repo, so measure with `headroom perf` on real sessions. Headroom also adds a local proxy to your setup, one more moving part when something breaks. The same `wrap` command works for Codex, Cursor, Aider, Cline, Goose and OpenHands.","category":"Workflow","slug":"shrink-test-logs-and-json-output-before-they-hit-your-token-bill-a3b34c","url":"https://claudecodereview.ai/a/shrink-test-logs-and-json-output-before-they-hit-your-token-bill-a3b34c/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/a3b34cbb-9e00-4643-bdea-82b6d27706e5","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/shrink-test-logs-and-json-output-before-they-hit-your-token-bill-a3b34c/5aa2e890dcb437f0-544c3236601d11e5/web_hero.webp","imageAlt":"A wide funnel feeds three types of data blocks into a single narrow tube, where a clay-orange filter section represents compressed data output.","createdAt":"2026-10-29T21:58:29.261Z"},{"id":"bbbd9b99-2dd4-4c09-9d14-30e77a90254a","title":"Catch file changes a PostToolUse hook misses with a Stop hook that asks git","dek":"In a scripted test, a PostToolUse hook matching Edit|MultiEdit|Write saw 3 of 7 file changes, while a Stop hook running git status saw all 7.","bodyMd":"In a scripted test, a PostToolUse hook matched on `Edit|MultiEdit|Write` saw only the changes made through Claude's file tools. On Claude Code 2.1.312, it caught 3 of 7 changes. The four it missed were made through Bash: `sed -i`, a `>` redirect, `rm` and `git mv`. A Stop hook that runs `git status` listed all seven, including the delete and the rename.\n\nA quick gloss on the terms: a hook is a script Claude Code runs automatically at set points. A PostToolUse hook runs after each tool call, and a Stop hook runs when Claude finishes. Git is the version-control tool that tracks uncommitted changes in a repo, and `git status` lists them.\n\nThe test used a scripted fake model (a local server standing in for the Messages API) that issued a fixed list of tool calls against the real Claude Code binary, so no API key was needed. A real model picks its own routes, and seven routes are a sample, not a census.\n\n**Add the git-backed Stop hook**\n\n1. Create `.claude/stop-check.sh`:\n\n```\ngit status --porcelain -uall > .git/hk-status\ngrep -q '\"stop_hook_active\":true' && exit 0\n[ -s .git/hk-status ] || exit 0\ncat .git/hk-status >&2\nexit 2\n```\n\n2. Register it in `.claude/settings.json` as a `Stop` hook with the command `cd \"$CLAUDE_PROJECT_DIR\" && sh .claude/stop-check.sh`.\n\nThe `cd` matters because hooks run in Claude's current directory, which moves when Claude runs `cd`. Exit code 2 tells Claude Code not to stop yet and passes stderr to the model, so Claude sees the list of changed files before it finishes. The `stop_hook_active` check lets the second stop through, so the hook can't loop. In the test, this cost one extra model call and delivered all seven status lines.\n\n**Why adding Bash to the matcher doesn't fix it**\n\nMatching `Edit|Write|Bash` makes the hook fire on the four Bash changes. But those payloads hold the command string, with no `file_path` and no patch. To learn which files `rm` or `git mv` touched, the hook would have to parse shell.\n\n**New files arrive with an empty patch**\n\nA file created with Write reports `type=create` and `structuredPatch=[]`; the text sits in `tool_response.content`. A hook that reviews `structuredPatch` sees nothing for new files, so read `content` when `type` is `create`.\n\n**Worth using when** a review loop depends on knowing what Claude changed. Keep PostToolUse for instant per-edit checks, since Stop only runs when Claude finishes.\n\n**Limits**\n- Git skips gitignored files, files outside the repo, and anything Claude commits itself.\n- The hook also lists your own uncommitted work.\n- `MultiEdit` did not appear in the request Claude Code 2.1.312 sent the model, so it widens nothing.\n- `NotebookEdit` appears as a deferred tool and the usual matcher doesn't name it; its payload wasn't tested.\n- PostToolUse behavior in subagents wasn't tested.","category":"Workflow","slug":"catch-file-changes-a-posttooluse-hook-misses-with-a-stop-hook-that-asks-bbbd9b","url":"https://claudecodereview.ai/a/catch-file-changes-a-posttooluse-hook-misses-with-a-stop-hook-that-asks-bbbd9b/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/bbbd9b99-2dd4-4c09-9d14-30e77a90254a","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/catch-file-changes-a-posttooluse-hook-misses-with-a-stop-hook-that-asks-bbbd9b/77803526806d849e-d986ba588b19e4b0/web_hero.webp","imageAlt":"A diagram shows seven file blocks being caught by a container versus a sieve that only catches three.","createdAt":"2026-10-29T21:56:56.756Z"},{"id":"8d01e30d-2c9d-4811-9baa-5d6f7de00bfd","title":"See every waiting session, subagent and Codex run that Agent View leaves off its list","dek":"Agent View only lists background sessions, so a JSON command, a Notification hook or ccdeck, a free, open-source dashboard that runs on your machine and shows Claude Code and Codex sessions, has to cover the rest.","bodyMd":"Agent View, opened with `claude agents`, is one screen for background sessions. Anthropic's documentation says interactive sessions open in other terminals don't appear until you background them, and that subagents and teammates a session spawns aren't listed as separate rows. Codex isn't listed either. The feature is in research preview, and a row shows only the session's name, current activity and age: no spend or quota.\n\nTwo terms used below: a subagent is a helper session that a main Claude Code session spawns. Codex is a separate coding-agent CLI that has its own `codex agents` dashboard and writes rollout files under `~/.codex/sessions`.\n\nThree ways to see the rest:\n\n1. **Poll `claude agents --json`.** In Claude Code 2.1.312 the command prints active sessions, interactive and background, as a JSON array. Each entry has a `kind` and, while its process is alive, a `status` of `busy`, `waiting` or `idle`. A waiting session adds `waitingFor`, such as `permission prompt` or `input needed`. Filter it with jq: `claude agents --json | jq '.[] | select(.status == \"waiting\")'`. It lists sessions, not subagents, and it is a snapshot, so poll it to keep it current.\n\n2. **Add a `Notification` hook** to `~/.claude/settings.json`. It applies to every session that reads that file, whichever terminal started it. Match `permission_prompt|idle_prompt` and have the hook command append one line per wait to a log, for example with `jq -c` writing to `~/.claude/waiting.log`. Notification hooks can't block or modify notifications, so this only observes.\n\n3. **Run a dashboard.** ccdeck, a free, open-source dashboard, starts with `npx ccdeck`. Its first run adds a hook to `~/.claude/settings.json`, so sessions from any terminal report to it. Each subagent gets its own card joined to its session, and Codex CLI sessions appear on the same canvas, read from the rollout files under `~/.codex/sessions`. The topbar names Claude Code sessions stopped on a prompt or question, with how long each has waited. It also shows estimated spend per session. `ccdeck sessions` prints the waiting list in a terminal.\n\nFor subagents without a dashboard, hooks from settings files also run inside subagents. Tool events such as `PreToolUse` carry `agent_id` and `agent_type` when a subagent made the call, and `SubagentStart` and `SubagentStop` mark each one's life.\n\n**When to use which.** Dispatch and reply in Agent View. Poll the JSON if all you need is who is waiting in any terminal. Add a hook or dashboard when you want subagents, Codex or spend alongside.\n\n**Limits.** ccdeck can't reply, start or attach to sessions, because its hook is a one-way forwarder. It keeps nothing while no deck is running. Its waiting list covers Claude Code only, and the tool name beside a wait is its inference. Codex logs record no approval request, so a running Codex session shows \"approvals not visible\". Because the hook only observes, it doesn't change what Agent View does, and background sessions read user settings, so they report too.","category":"Workflow","slug":"see-every-waiting-session-subagent-and-codex-run-that-agent-view-leaves-8d01e3","url":"https://claudecodereview.ai/a/see-every-waiting-session-subagent-and-codex-run-that-agent-view-leaves-8d01e3/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/8d01e30d-2c9d-4811-9baa-5d6f7de00bfd","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/see-every-waiting-session-subagent-and-codex-run-that-agent-view-leaves-8d01e3/00195507b7b60ff9-5f4c5c671f925426/web_hero.webp","imageAlt":"A diagram shows rectangular session strips, square subagent tiles, and circular coding-agent discs being connected by a single line into a unified cluster.","createdAt":"2026-10-29T21:52:06.001Z"}]}