{"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":"4f72fb8e-baee-4087-9d07-c632f95f2b39","date":"2026-10-02","status":"locked","createdAt":"2026-10-01T16:17:18.540Z","storyCount":10,"newsletterSubject":"Claude Code adds desktop launch command, Claude Code tool search cuts setup time 64%, Claude Code lists package skill after Read tool"},"updatedAt":"2026-10-01T16:31:14.806Z","stories":[{"id":"5ae6a7c5-7be6-4aa4-aad0-b80836e15ff5","title":"Claude Code adds a desktop launch command and an admin limit on which providers a machine may use","dek":"Version 2.1.285 lets you open the Claude desktop app by typing a command, and lets admins restrict which API providers (the way one program lets other programs use a service) a machine may use.","bodyMd":"Claude Code 2.1.285, released 29 September, added `claude --desktop`, a command typed in the terminal (the window where you enter text commands) that opens the Claude desktop app on the current directory. Add `--continue` or `--resume <id>` and it opens on that session instead, according to the release notes. Version 2.1.286 followed on 30 September, mostly with fixes and interface changes.\n\nVersion 2.1.285 added an `allowedProviders` managed setting (a policy an admin sets for everyone). It limits which API providers a machine may use; an API is the way one program lets other programs use it. The list the notes give covers the Anthropic API, a custom endpoint, Bedrock, Mantle, Vertex AI, Foundry, Claude Platform on AWS and a cloud gateway. The same release also improved Bedrock and Vertex AI sessions so that when an admin removes access to the default model, sessions now switch to an older available model of the same tier instead of failing.\n\nPlugins get more control from the CLI, the command-line interface, which is a tool you run by typing commands. `claude plugin configure <plugin>` shows a plugin's options and which ones are unset, and it can save new values read from stdin with `--values-stdin`. `claude plugin install --config` now accepts `<server>.<key>=<value>`, so a bundled `.mcpb` MCP server can be configured at install time and start without a trip through `/plugin` and Configure. Plugins that skip such a server because it still needs configuration now say so. Version 2.1.286 also makes plugin installs refuse npm sources that are git repositories or folders.\n\nVersion 2.1.286 adds a count such as \"2 of 5\" to the permission prompt when several requests stack up. Bash, PowerShell and Monitor prompts now show the command between dashed lines, matching file edit prompts. Retries changed too: one limit now covers a whole model call, so with default settings a failing call sends at most 14 requests. The 2.1.285 notes cite a case where a failing request could be retried up to 21 times when streaming kept failing. If the API refuses the model your default or alias resolves to, Claude Code now retries once on the previous model of the same tier.\n\nOther 2.1.285 additions include a `CLAUDE_CODE_DISABLE_WEB_FETCH` environment variable to turn off the WebFetch tool and `CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES` to cap re-sends of a timed-out non-streaming fallback request. The 2.1.286 notes also say `--bare` now connects only the MCP servers named on the command line, sends the model no system reminders and starts no background tasks. The VS Code extension gained bookmarks for saving Claude's responses.\n\nOne developer reports that from 2.1.284 onward, ultracode can be stacked on every effort level from low to max. Before that, the developer says, it was defined as xhigh effort with workflow orchestration. The developer asked others whether anyone had tried low effort with ultracode and had no results to share.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-v2-1-285-286-releases","slug":"claude-code-adds-a-desktop-launch-command-and-an-admin-limit-on-which-pr-5ae6a7","url":"https://claudecodereview.ai/a/claude-code-adds-a-desktop-launch-command-and-an-admin-limit-on-which-pr-5ae6a7/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/5ae6a7c5-7be6-4aa4-aad0-b80836e15ff5","role":"lead","position":0,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-adds-a-desktop-launch-command-and-an-admin-limit-on-which-pr-5ae6a7/c2baa2db3ed115eb-dbff8495eb977154/web_hero.webp","imageAlt":"A funnel diagram shows eight vertical lines narrowing into a single path, with one line highlighted to denote a selected provider.","createdAt":"2026-10-01T15:34:41.291Z","updatedAt":"2026-10-01T16:02:02.023Z","sources":[{"role":"primary","title":"Claude Code v2.1.285 Adds Desktop Launch, Plugin Config, and Provider Controls","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.285","sourceName":"ashwin-ant","author":"ashwin-ant","publishedAt":"2026-09-29T19:27:30Z"},{"role":"supporting","title":"Ultracode layer with lower effort modes","url":"https://reddit.com/r/ClaudeCode/comments/1wv0g94/ultracode_layer_with_lower_effort_modes","sourceName":"/u/IndustryOk2482","author":"/u/IndustryOk2482","publishedAt":"2026-10-01T14:10:17Z"},{"role":"supporting","title":"Claude Code v2.1.286","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.286","sourceName":"Anthropic","author":"Anthropic","publishedAt":"2026-09-30T19:10:13Z"},{"role":"supporting","title":"2.1.283","url":"https://code.claude.com/docs/en/changelog","sourceName":"Claude Code changelog","author":"Claude Code changelog","publishedAt":"2026-09-25T22:00:11Z"}]},{"id":"0d64d9b4-a3cc-4551-882c-6093261dbdc2","title":"Claude Code's tool search cut a 65-tool setup's first request by 64%, but it switches off behind a proxy","dek":"A measurement found that loading tools only when needed shrinks what Claude Code sends before your prompt, and that pointing Claude Code at any non-Anthropic server address disables the feature by default.","bodyMd":"A measurement of Claude Code 2.1.285 found that tool search, the feature that loads tool definitions only when the model asks for them, cut the first request of a 65-tool setup from 27,184 tokens to 9,722. That is a 64% drop. Over a whole task the saving was 46%: 29,543 tokens against 54,422.\n\nTool search works by sending a short list of tool names plus a ToolSearch tool instead of every full definition on every request. When the model needs a tool, it calls ToolSearch, and the next request carries a reference that Anthropic's API expands into the full definition. Anthropic's documentation says deferred tools do not enter the context window until discovered. In the capture, Claude Code sent 11 tools in full, ToolSearch included, and replaced the rest with a one-line list.\n\nThe test used five MCP servers: the official filesystem, memory, everything and sequential-thinking reference servers, plus Microsoft's Playwright server. MCP servers are add-on tool providers, and these five supplied 65 tools. Loaded eagerly, they cost 9,638 tokens. Deferred, they cost 966, a 90% cut on the part of the bill the user configured. With no MCP servers at all, the first request still fell from 17,546 tokens to 8,756, because Claude Code also defers 13 of its own 23 built-in tools.\n\nThe whole-task saving is smaller because lazy loading needs an extra round trip. The task was \"Remember that the deploy is on Friday\", which needs one memory-server tool. Eager mode took two requests. Lazy mode took three, and the search step cost about 9,700 tokens. Every request after it saved about 17,300. Loading the tool added 140 tokens to each later request, so five loads would cost about 700. Later requests ran 9,933 tokens lazy against 27,235 eager.\n\nThe catch is for anyone who routes Claude Code through a proxy or gateway. Setting ANTHROPIC_BASE_URL to an address other than Anthropic's own API changes where Claude Code sends its requests, and in 2.1.285 that turns tool search off by default. The measurement's proxied run sent all 91 tools, byte for byte the same as forcing it off. According to the measurement, the binary's own log message says to set ENABLE_TOOL_SEARCH=true if the proxy forwards tool_reference blocks. Setting it to false forces every tool to load up front. The variable can go in the environment or in the env block of ~/.claude/settings.json.\n\nThe limits are real. The tester played the model with a fixed script, so a real model might search by keyword, load more tools than needed, or search twice. The counts use OpenAI's o200k_base tokenizer rather than Anthropic's, and they ignore prompt caching, so they are token counts and not bills. The task needed one tool, and a task that needs ten would narrow the gap. Tool-selection quality was not tested. The proxy finding comes from the default path and the binary's message, not from a trace of every gateway. Each mode ran three times, with totals varying by at most 3 tokens.","status":"published","storyType":"news","category":"Research","clusterKey":"claude-code-tool-search-context-savings","slug":"claude-code-s-tool-search-cut-a-65-tool-setup-s-first-request-by-64-but-0d64d9","url":"https://claudecodereview.ai/a/claude-code-s-tool-search-cut-a-65-tool-setup-s-first-request-by-64-but-0d64d9/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/0d64d9b4-a3cc-4551-882c-6093261dbdc2","role":"item","position":1,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-s-tool-search-cut-a-65-tool-setup-s-first-request-by-64-but-0d64d9/1cf65abe3be07a04-9b53e499420f5dba/web_hero.webp","imageAlt":"Sixty-five blocks with fifty-four being funnelled into a narrow path and eleven remaining outside, plus a broken link between two clusters of blocks.","createdAt":"2026-10-01T15:38:04.804Z","updatedAt":"2026-10-01T16:01:43.379Z","sources":[{"role":"primary","title":"Claude Code Tool Search Nearly Halves Your Context Bill","url":"https://medium.com/@decoding_ai_by_nureravi/claude-code-tool-search-nearly-halves-your-context-bill-a14defdf42f3?source=rss------claude_code-5","sourceName":"Decoding AI by Nueravi","author":"Decoding AI by Nueravi","publishedAt":"2026-09-30T19:05:47Z"}]},{"id":"74bd7a6a-29bc-455c-8ab6-8a69a8bbcd9c","title":"Claude Code lists a package's own skill only after the Read tool opens a file there, not after cat","dek":"A skill is a saved set of instructions Claude Code can pick up when it's relevant; in a 20-run test, one kept in a package's own folder stayed unlisted until the Read tool opened a file there, and cat, a terminal command that prints a file, never triggered it.","bodyMd":"A skill, which is a saved set of instructions Claude Code can load to help with a specific task, did not load when it sat in a package's own `.claude/skills/` folder (a nested skill) and Claude Code read a file there with `cat` through Bash. `cat` is a terminal command that prints a file's contents. The skill loaded every time the built-in Read tool, Claude Code's own way of opening a file to look at it rather than running a shell command, opened the same file. That is the result of a 20-run test on Claude Code 2.1.285, using Opus 5.5, Anthropic's model. The test's author notes that the docs' \"reads or edits a file\" wording did not cover `cat` in these runs, which is narrower than how the tools reference treats `cat` for read-before-edit.\n\nThe setup is a monorepo, meaning one code folder that holds several projects. Claude Code's skills documentation says a skill in a subdirectory below the start directory loads \"the first time Claude reads or edits a file in that subdirectory\". In the test, `cat packages/api/src/index.ts` through Bash loaded the skill in 0 of 2 runs. The Read tool on the same file loaded it in 6 of 6. Before any read, the Skill tool answered \"Unknown skill\" in 10 of 10 calls, so the model could not call the skill by name either.\n\nThe cost shows up in the listing of available skills. After a Read in the package, Claude Code added one line for the new skill, with a suffix naming the directory it applies to. By the author's arithmetic, that arrival grew the next request by about 140 tokens. The same skill placed at the repository root and listed at launch cost 60. The author could not say how the extra 80 tokens split between the suffix and whatever Claude Code wraps around a second listing block. A sibling package's skill never appeared, so reading in `packages/api` loaded only that package's skills.\n\nThis matters most for scripted runs. These are jobs run with `claude -p`, which work in the background with no window to watch. A job that explores a package mainly through Bash can finish without loading its skills, and nothing in the output says so. The Unknown skill error showed up only because the prompt made the model try the name. The test's source also notes that on macOS, Linux and WSL, Claude Code leaves Glob and Grep out of its default tools and searches with `find` and `grep` through Bash. Whether those searches load a nested skill was not tested.\n\nTwo launch-time routes worked. Passing the package with the `--add-dir` flag from the repository root put the skill in the first request at 60 tokens, the same as a root skill. Starting the session inside `packages/api` also listed it, but the first request grew to 6,081 tokens with 15 skills listed, because the root's shared settings file, which had switched off the bundled skills, was not read from the package folder. The `/add-dir` command the docs name was not tested.\n\nWhen a nested skill shared a name with a root skill, Claude Code renamed it to `packages/api:deploy` and added an instruction to prefer it for files in that directory. The model chose it in both runs. Before the first Read, only the root `deploy` was listed.\n\nFive configurations were rerun on Sonnet 5.5, Anthropic's model released September 28, and gave the same loads, failures and listing costs. First requests were 87 to 89 tokens smaller, and the ten runs cost $0.079 against $0.154 for the matching Opus runs. The test did not cover Edit, Write, Grep, Glob, `sed -n`, the interactive menu, resuming sessions, or subagents.","status":"published","storyType":"news","category":"Workflow","clusterKey":"claude-code-nested-skill-loads-only-after-read","slug":"claude-code-lists-a-package-s-own-skill-only-after-the-read-tool-opens-a-74bd7a","url":"https://claudecodereview.ai/a/claude-code-lists-a-package-s-own-skill-only-after-the-read-tool-opens-a-74bd7a/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/74bd7a6a-29bc-455c-8ab6-8a69a8bbcd9c","role":"item","position":2,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-lists-a-package-s-own-skill-only-after-the-read-tool-opens-a-74bd7a/2ddbf1f674f6d9e5-eaff7a0abdf46969/web_hero.webp","imageAlt":"A diagram shows two rows; the top terminal command does not reach a skill block, while the bottom Read tool is linked to the same skill block.","createdAt":"2026-10-01T16:02:42.236Z","updatedAt":"2026-10-01T16:31:14.806Z","sources":[{"role":"primary","title":"Why your monorepo's per-package Claude Code skill says 'Unknown skill': it loaded after a Read in that folder, not after a cat (Opus 5.5 and Sonnet 5.5)","url":"https://dev.to/rulestack/0-of-2-cat-reads-loaded-the-skill-in-packagesapiclaudeskills-claude-codes-read-tool-loaded-it-41eh","sourceName":"Rulestack","author":"Rulestack","publishedAt":"2026-10-01T02:17:00Z"}]},{"id":"60b8a8f1-05a3-4a3d-be6a-9b110dbebd1c","title":"OpenAI's plugin lets Codex review and take over work inside Claude Code","dek":"The codex-plugin-cc plugin adds typed shortcuts to Claude Code, such as /codex:review, that hand Claude's work to OpenAI's Codex for a second opinion.","bodyMd":"OpenAI has published a plugin that runs Codex, its coding agent, inside Claude Code, Anthropic's rival tool. It is called codex-plugin-cc and sits in OpenAI's GitHub repository, according to a TikTok walkthrough that cites the repo and ChatGPT's pricing page as of 24 September 2026. Once it is installed, you stay in the same Claude Code conversation and type short commands that start with a slash to trigger a specific action.\n\nThree commands do the work. `/codex:review` asks Codex to check what Claude has just done, for example before you sign off on a website for your business or a client. `/codex:adversarial-review` is the harsher version: it hunts for weaknesses in the decisions Claude made. `/codex:rescue` hands Codex a task outright, so you can split the job differently, with Claude writing the plan and Codex writing the code.\n\nThe appeal is independence. As the walkthrough puts it, the reviewer comes from a different company, so it has no particular reason to fail in the same places Claude does. Other builders are already working this way without the plugin. One developer says they end pull requests with a Codex subagent and a Claude Code subagent checking for useless wrappers and bad API design. Another has Claude Code invoke the Codex CLI directly, with Opus 5.5 writing the plan and implementing it, and Codex-side models such as GPT 5.6 Sol reviewing the code and producing a findings report that Opus then works through. A Reddit builder of a Discord card game used Claude Code for most of the bot and site, with Codex reviewing changes, and still checked the real app even when tests passed.\n\nSetup has requirements. You need a ChatGPT subscription from the Plus plan up, or an OpenAI API key, plus Node.js 18.18 or newer and the Codex CLI with you signed in. Reviews need the project to be in git. If it is not, the walkthrough says you can ask Claude to set that up.\n\nThere is also a cost. Every request draws down your Codex usage limit, so the walkthrough's advice is not to put Codex on every step. Save it for work you are about to ship.","status":"published","storyType":"news","category":"Ecosystem","clusterKey":"codex-plugin-reviews-claude-code","slug":"openai-s-plugin-lets-codex-review-and-take-over-work-inside-claude-code-60b8a8","url":"https://claudecodereview.ai/a/openai-s-plugin-lets-codex-review-and-take-over-work-inside-claude-code-60b8a8/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/60b8a8f1-05a3-4a3d-be6a-9b110dbebd1c","role":"item","position":3,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/openai-s-plugin-lets-codex-review-and-take-over-work-inside-claude-code-60b8a8/8538c0aea82f790b-c79105d3a5bd6f12/web_hero.webp","imageAlt":"A diagram shows a single line splitting into three distinct branches, each representing a specific coding action triggered by a command.","createdAt":"2026-09-29T18:42:54.468Z","updatedAt":"2026-09-29T19:01:33.214Z","sources":[{"url":"https://tiktok.com/@andrea.eskailet/video/7689534693972167958","title":null,"sourceName":"tiktok.com","author":"Andrea Eskailet","publishedAt":"2026-09-25T18:01:57.000Z","role":"primary"},{"url":"https://x.com/connortbot/status/2104352380662030791","title":null,"sourceName":"x.com","author":"Connor Loi","publishedAt":"2026-09-27T23:27:59.000Z","role":"primary"},{"url":"https://reddit.com/r/ClaudeCode/comments/1wq2ckh/built_a_discord_card_game_with_claude_code","title":null,"sourceName":"reddit.com","author":"/u/OddSeaworthiness4811","publishedAt":"2026-09-25T17:25:08.000Z","role":"primary"},{"url":"https://x.com/adxtyahq/status/2104206519579635993","title":null,"sourceName":"x.com","author":"aditya","publishedAt":"2026-09-27T13:48:23.000Z","role":"primary"},{"url":"https://tiktok.com/@mrmanuelsuarez/video/7689877566856891661","title":null,"sourceName":"tiktok.com","author":"mrmanuelsuarez","publishedAt":"2026-09-26T16:12:19.000Z","role":"primary"}]},{"id":"9828fd21-3d43-4787-ae0b-d1c6a0dc8d18","title":"Claude Code reads AGENTS.md, so one instruction file can serve Claude Code and Codex","dek":"A walkthrough says Claude Code loads AGENTS.md (the shared instruction file other coding agents use) when a project has no CLAUDE.md, on versions above 2.1.277, so teams can drop the duplicate.","bodyMd":"Claude Code falls back to AGENTS.md when a project has no CLAUDE.md. If you run Claude Code alongside Codex, you can keep a single instruction file for both. A walkthrough tests it and says Claude must be above version 2.1.277, and a separate post says Codex reads AGENTS.md natively.\n\nTeams that used both tools often ended up with two files; the walkthrough says there is \"a good chance\" of it. The workarounds were familiar: symlink one to the other, put a single line in CLAUDE.md telling Claude to read AGENTS.md, or copy the same rules into both and hope they stayed in sync.\n\n## How to switch\n\n1. Check your version with `claude -v`. The walkthrough says Claude needs to be above version 2.1.277.\n2. Put your shared rules in AGENTS.md. The walkthrough doesn't say where the file has to live; its demo just uses a simple workspace.\n3. Delete CLAUDE.md, or stop creating it.\n4. Start a fresh Claude Code session. The walkthrough shows the startup output reporting that no CLAUDE.md was found and that AGENTS.md was loaded.\n\nThe demo used a workspace with two files: a CLAUDE.md containing only \"hello\" and an AGENTS.md saying the code word is apple. In the first session, asked to write a haiku about the code word, Claude said it knew of none, since the project's CLAUDE.md held only one word. With CLAUDE.md removed, a new session loaded AGENTS.md and wrote the haiku about apple.\n\n## The catch\n\nCLAUDE.md wins if both files exist. Claude Code keeps reading CLAUDE.md and ignores AGENTS.md in that case. The walkthrough gives two options: delete CLAUDE.md, or change one setting in `/config` to load both. It points to the Claude Code docs page for the exact setting, and the source does not name it.\n\n## Worth using when\n\nYou already maintain an AGENTS.md for Codex or another agent and are tired of keeping a second file aligned. A separate post also shares a six-section AGENTS.md template (plan first, smallest change, split work across subagents, own the bug, verify before done, record every correction). It also suggests Claude Code users install the official plugin with `/plugin install claude-code-setup@claude-plugins-official`, which scans a codebase and recommends hooks, skills and subagents. Those are the post's claims, and the \"10x engineers\" framing is its own.","status":"published","storyType":"tip","category":"Release","clusterKey":"claude-code-reads-agents-md","slug":"claude-code-reads-agents-md-so-one-instruction-file-can-serve-claude-cod-9828fd","url":"https://claudecodereview.ai/a/claude-code-reads-agents-md-so-one-instruction-file-can-serve-claude-cod-9828fd/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/9828fd21-3d43-4787-ae0b-d1c6a0dc8d18","role":"item","position":4,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-reads-agents-md-so-one-instruction-file-can-serve-claude-cod-9828fd/73e5c4c64aa08d4e-31b58a1b09006429/web_hero.webp","imageAlt":"A diagram shows a row of two file icons where one is removed, leaving a single file that splits into two separate paths.","createdAt":"2026-10-01T15:42:49.693Z","updatedAt":"2026-10-01T16:01:07.342Z","sources":[{"role":"primary","title":"Claude Code now reads AGENTS.md (version 2.1.277 and up). If you use Claude Code with Codex, you can keep one instruction file for both. One...","url":"https://tiktok.com/@cloudyeti_ai/video/7689280897291537678","sourceName":"CloudYeti | AI Job Prep","author":"CloudYeti | AI Job Prep","publishedAt":"2026-09-25T01:37:06Z"},{"role":"supporting","title":"AGENTS.md Pattern Makes Claude Code and Codex Run Like Senior Engineers","url":"https://x.com/Voxyz_ai/status/2105367927394615364","sourceName":"Vox","author":"Vox","publishedAt":"2026-09-30T18:43:24Z"}]},{"id":"d9d1cd8a-d865-46d4-b500-1824f9a89e93","title":"A free script stops parallel Claude Code runs from editing files another run already rewrote","dek":"edit-guard, a small script that runs just before Claude Code edits a file, blocks the edit if another of your Claude Code conversations changed that file since this one last read it.","bodyMd":"Running several Claude Code sessions (separate conversations) against one repo has a known failure: session A edits a function based on code that session B already rewrote. Its developer describes watching an edit apply cleanly while reintroducing the old logic on top of the new, and catching it only in `git diff`.\n\nThe fix is edit-guard, an MIT-licensed, stdlib-only Python script that plugs into Claude Code's PreToolUse hook. A hook is a script Claude Code runs automatically at set moments, here just before a tool call such as an edit, and it can stop the action.\n\n**Set it up**\n\n1. Run `pip install edit-guard`.\n2. Run `edit-guard install`. It merges the hook into `~/.claude/settings.json` and backs that file up first.\n3. Run `edit-guard log` any time to see what is being tracked.\n\n**What it does**\n\nEvery Read records what your session saw: a file hash and a timestamp. Every Edit or Write then compares the file's current hash with what that session last saw. If the bytes changed and another session touched the file in between, the write is blocked and the agent is told to re-read first:\n\n`Stale edit blocked: 'src/auth.py' changed since you last saw it (last modified by session 'a4c2e901'). Re-read the file before editing.`\n\nSame-session rewrites and new files always pass. If the state log is corrupt, a file is unreadable, or anything else unexpected happens, the hook fails open and allows the edit. State lives in one append-only file at `~/.config/edit-guard/writes.jsonl`, with no daemon, server or network.\n\n**Why block instead of warn**\n\nThe developer says the agent tends to read a warning, answer \"noted,\" and edit anyway. Blocking forces the re-read. The cost is annoyance, for example when a reformat in one session blocks another. The developer judges that better than silent corruption.\n\n**Limits**\n\n- It detects write-after-write staleness. It is not true locking, so two sessions racing in the same second still race.\n- Hashes are byte-level, so a pure reformat counts as a change.\n- The hook protocol (stdin shape, exit code 2 to block) is community-documented, not a stable API. If it changes, the hook degrades to allowing edits.\n- It works per machine only.\n\nThe developer reports seven smoke tests passing, including the read-by-A, write-by-B, blocked-A scenario and a fail-open test against a corrupted log.","status":"published","storyType":"tip","category":"Ecosystem","clusterKey":"claude-code-same-file-conflict-hook","slug":"a-free-script-stops-parallel-claude-code-runs-from-editing-files-another-d9d1cd","url":"https://claudecodereview.ai/a/a-free-script-stops-parallel-claude-code-runs-from-editing-files-another-d9d1cd/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/d9d1cd8a-d865-46d4-b500-1824f9a89e93","role":"item","position":5,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/a-free-script-stops-parallel-claude-code-runs-from-editing-files-another-d9d1cd/b80f5e2d170fd963-1396f2135e8fbccf/web_hero.webp","imageAlt":"A diagram shows a blocked flow between two rectangular sessions where an edit attempt is halted by an intersecting vertical bar.","createdAt":"2026-10-01T16:06:02.785Z","updatedAt":"2026-10-01T16:30:38.647Z","sources":[{"role":"primary","title":"Two Claude Code sessions edited the same file. One of them was wrong. I built a hook to stop that","url":"https://dev.to/haoli/two-claude-code-sessions-edited-the-same-file-one-of-them-was-wrong-i-built-a-hook-to-stop-that-15jp","sourceName":"hao li","author":"hao li","publishedAt":"2026-09-30T08:35:34Z"},{"role":"supporting","title":"How to Run Multiple Claude Code Agents on the Same Repo Without Conflicts","url":"https://reddit.com/r/ClaudeAI/comments/1wuxwkv/running_several_claude_code_agents_on_one_repo","sourceName":"r/ClaudeAI · u/jokiruiz","author":"r/ClaudeAI · u/jokiruiz","publishedAt":"2026-10-01T12:17:05Z"}]},{"id":"6d18d7d0-2542-4626-86b4-ca4c8914af59","title":"A Stop hook can block Claude Code from finishing until a security scan of its changes passes","dek":"A short script registered in .claude/settings.json checks only the lines Claude changed and sends findings back, so the agent has to fix them before it can say it is done.","bodyMd":"One developer's setup uses Claude Code's Stop hook (a script that runs when Claude is about to finish) to scan the agent's changes for common security mistakes. A walkthrough on DEV describes the trigger: an AI chat feature that worked but also hardcoded an API key, rendered the model's reply with `innerHTML`, and ran `eval()` on it, before Claude reported \"All done!\"\n\n## What it does\n\nIf a Stop hook exits with code 2, Claude is not allowed to stop, and whatever the script prints to stderr goes back to it as feedback. The loop: Claude says done, the hook scans the diff, exits 2 with findings, Claude fixes them, and the hook passes.\n\n## How to set it up\n\n1. Register the hook in `.claude/settings.json`:\n\n```json\n{\n \"hooks\": {\n \"Stop\": [{\n \"hooks\": [{\n \"type\": \"command\",\n \"command\": \"node \\\"$CLAUDE_PROJECT_DIR\\\"/.claude/hooks/security-verify.mjs\"\n }]\n }]\n }\n}\n```\n\n2. Write the script so it scans only changed lines, using `git diff HEAD -U0` plus new files. Old code never blocks a task. The walkthrough uses five regex rules:\n - `hardcoded-secret`: strings shaped like `sk-` API keys or `AKIA` AWS keys.\n - `secret-in-client-bundle`: `NEXT_PUBLIC_` or `VITE_` variables containing KEY or SECRET, and `dangerouslyAllowBrowser: true`.\n - `llm-output-as-html`: `innerHTML` or `dangerouslySetInnerHTML` on a line mentioning reply, response or completion. The author's reasoning: model output is untrusted input, and a prompt injection in a reply would hand an attacker XSS.\n - `unsafe-html-sink`: dynamic HTML assignment (static strings are allowed).\n - `dynamic-code-exec`: `eval(` and `new Function(`.\n3. Exit 0 when the scan is clean. Otherwise print the report with `console.error` and `process.exit(2)`.\n4. Cap the retries. A hook that always exits 2 can loop forever, so the script counts attempts per session. After 3, it writes `.claude/security-report.md` for a human and exits 0.\n5. Add a skill at `.claude/skills/security-verify/SKILL.md` that tells Claude how to fix each finding: move keys behind a server route, use `textContent` or `DOMPurify.sanitize()`, use `JSON.parse` instead of `eval`. It also tells Claude not to rephrase code just to dodge the regex.\n\nFor false positives, Claude can add `// verify-ignore:` on the line and must explain why to the user, so the opt-out shows up in review.\n\n## Result and limits\n\nOn the author's test repo, the first \"done\" was blocked with 5 findings. Claude moved the API call to a server route and switched to `textContent` and `JSON.parse`. The hook then passed, and the final message told the author to rotate the key that had already appeared in the diff.\n\nThe author is plain about the ceiling: these are pattern rules, not a security audit. Keep SAST, code review and secret scanning in CI. One commenter suggested a sixth rule for generated forms: flag routes or server actions that write email or phone fields without a server-side schema parse. The author has published the hook, settings and skill as a drop-in `.claude` folder with no dependencies.","status":"published","storyType":"tip","category":"Workflow","clusterKey":"security-stop-hook","slug":"a-stop-hook-can-block-claude-code-from-finishing-until-a-security-scan-o-6d18d7","url":"https://claudecodereview.ai/a/a-stop-hook-can-block-claude-code-from-finishing-until-a-security-scan-o-6d18d7/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/6d18d7d0-2542-4626-86b4-ca4c8914af59","role":"item","position":6,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/a-stop-hook-can-block-claude-code-from-finishing-until-a-security-scan-o-6d18d7/7f242f5f9539caa1-2d78679909e75574/web_hero.webp","imageAlt":"Editorial illustration accompanying “A Stop hook can block Claude Code from finishing until a security scan of its changes passes”.","createdAt":"2026-09-29T18:43:16.486Z","updatedAt":"2026-09-29T19:01:23.795Z","sources":[{"role":"primary","title":"Claude Code Security Hook Blocks Unsafe Code Before It Finishes","url":"https://dev.to/thesnehamk/claude-cant-say-done-until-the-code-is-safe-a-security-verification-loop-for-claude-code-pdk","sourceName":"Sneha M K","author":"Sneha M K","publishedAt":"2026-09-28T18:34:47Z"}]},{"id":"9ea5941e-a1c0-457e-85c7-704b5efc5cf1","title":"A rerun-15-times script helped Claude Code fix 58 of 63 tests that failed at random","dek":"Tests that sometimes pass and sometimes fail on the same code can't be trusted on a single run, so one developer made \"passes 15 times in a row\" the bar Claude Code had to clear.","bodyMd":"One developer working in a Node.js monorepo (about 4,200 tests across 14 packages) reports that Claude Code fixed 58 of 63 unreliable tests in a week once it had a script to check its own work. Those tests, known as flaky tests, failed at random on identical code. They kept `main` red about 30% of the time, according to the developer's write-up on Dev.to.\n\nThe first attempt failed. Pasting the list and asking Claude Code to \"fix these flaky tests\" produced plausible edits, mostly added `await`s and longer timeouts. Half did nothing, because one green run proves little when a test passes most of the time anyway.\n\n**How the setup worked**\n\n1. Turn off Vitest retries (`retries: 2` had been hiding the problem) and run the full suite 20 times, recording per-test results. A short script flagged any test that both passed and failed. That found the 63.\n2. Write `repro.sh <test-file> <test-name-pattern> [runs]`, which runs one test repeatedly and exits 0 only if it passes every time. The default is 15 runs.\n3. Put a \"flaky test protocol\" in the project spec file Claude Code reads on startup. A test is not fixed until `./scripts/repro.sh <file> <name> 15` prints STABLE. Before editing, run the script 5 times to confirm the flake reproduces. If it doesn't reproduce in isolation, run the whole file, then the whole package. Never raise a timeout unless you can explain what the test waits on and why that duration is correct.\n4. Have the agent run the repro script on all 63 and sort them into buckets: timing and races (27), order dependence and shared state (19), external I/O such as Postgres, the system clock and `/tmp` files (12), and genuinely broken (5).\n5. Run one session per bucket with the same instruction: pick a test, reproduce, fix, run the script to 15, commit with the root cause in the message.\n\n**Where it paid off**\n\nThe developer says the shared-state bucket suited the agent best. Finding which test leaks state means running pairs of tests together until the culprit turns up, and the agent did that loop about 40 times. Timing fixes typically swapped in Vitest fake timers. For the database tests, the agent proposed wrapping each test in a transaction and rolling back.\n\n**Where it went wrong**\n\n- It proposed deleting a hard test as \"redundant.\" The developer added a rule: never delete or skip a test without explaining what coverage is lost.\n- Two fixes replaced a real database call with a mock, which passed and tested nothing. The developer reverted them.\n- A test with a roughly 1-in-50 flake rate passed 15 runs in a row. The developer raised the count to 30 for timing tests, and that test then flaked on run 22.\n\nThe five genuinely broken tests were real product bugs that retries had masked, and the developer handled them personally. They are now skipped with a linked issue each.\n\n**Reported results:** `main` red-for-no-reason fell from about 30% to under 2%, average CI runs per pull request from 1.7 to 1.05, and retries went from 2 to 0. Hands-on time was roughly 8 hours across about 5 working days. These are the author's own numbers.","status":"published","storyType":"tip","category":"Workflow","clusterKey":"flaky-tests-repro-harness","slug":"a-rerun-15-times-script-helped-claude-code-fix-58-of-63-tests-that-faile-9ea594","url":"https://claudecodereview.ai/a/a-rerun-15-times-script-helped-claude-code-fix-58-of-63-tests-that-faile-9ea594/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/9ea5941e-a1c0-457e-85c7-704b5efc5cf1","role":"item","position":7,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/a-rerun-15-times-script-helped-claude-code-fix-58-of-63-tests-that-faile-9ea594/ca14411e657ec52f-4918affe98c7a680/web_hero.webp","imageAlt":"A diagram shows a tall stack of 15 blocks being lifted away from a scattered group of 48 smaller squares organized into four separate piles.","createdAt":"2026-09-30T16:51:29.532Z","updatedAt":"2026-09-30T17:00:18.590Z","sources":[{"role":"primary","title":"How One Developer Fixed 58 Flaky Tests in a Week Using Claude Code","url":"https://dev.to/yureki_lab/how-i-killed-63-flaky-tests-in-one-week-with-claude-code-5-lessons-29m0","sourceName":"yureki_lab","author":"yureki_lab","publishedAt":"2026-09-28T14:31:58Z"}]},{"id":"64d9fea0-9404-46bc-822f-e02ea2c32810","title":"A free tool lets Claude Code, Codex and Cursor share one project memory","dek":"AI Memory saves notes from each coding session as plain text files, so you can switch tools mid-task without re-explaining the project.","bodyMd":"AI Memory is a free, MIT-licensed open-source project on GitHub, a site where developers publish code. A recent walkthrough puts it at about 8,600 stars. It records what happens in a coding session (your prompts, the tool calls, what failed and what is still open) and keeps that record outside any one tool. Start a task in Claude Code, open Codex in the same folder, and the second agent picks up where the first stopped.\n\n**How to set it up**\n\n1. Install AI Memory from its GitHub page.\n2. Run AI Memory.\n3. Run Claude. The walkthrough says everything is wired up automatically the first time.\n\nThe walkthrough says it needs no API key. The memory is saved as plain markdown files you own, so you can open them in Obsidian (a note-taking app), search them or edit them by hand.\n\n**When it helps**\n\n- You use more than one coding agent and keep re-explaining the project each time you switch. The walkthrough lists more than 20 supported agents, including Claude Code, Codex, Cursor and Gemini CLI.\n- You want a team to share context. Run it on a server and your team's agents can share the same memory, with no paid tier. The walkthrough contrasts this with hosted memory services that charge a monthly subscription.","status":"published","storyType":"tip","category":"Workflow","clusterKey":"session-handoff-memory-patterns","slug":"a-free-tool-lets-claude-code-codex-and-cursor-share-one-project-memory-64d9fe","url":"https://claudecodereview.ai/a/a-free-tool-lets-claude-code-codex-and-cursor-share-one-project-memory-64d9fe/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/64d9fea0-9404-46bc-822f-e02ea2c32810","role":"item","position":8,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/a-free-tool-lets-claude-code-codex-and-cursor-share-one-project-memory-64d9fe/0e79e4cd1668c5a9-6317b3ceac623814/web_hero.webp","imageAlt":"A diagram shows three squares connected by a central rectangle representing a shared memory file between three coding agents.","createdAt":"2026-10-01T02:33:16.353Z","updatedAt":"2026-10-01T03:00:13.895Z","sources":[{"role":"primary","title":"Free Open-Source Tool Shares Memory Across Claude Code, Codex, and Cursor","url":"https://tiktok.com/@future.with.ai98/video/7690983780944809224","sourceName":"Future Ai With Julian","author":"Future Ai With Julian","publishedAt":"2026-09-29T15:45:01Z"}]},{"id":"24b5c7f7-76c9-4bb4-8e24-2cf2dc6b7c54","title":"Claude Code jobs that run on a timer can fail to save files to /tmp and still report success","dek":"When Claude Code runs unattended with `claude -p`, with no person at the keyboard to approve prompts, a write outside its working folder is denied and the job still exits with code 0.","bodyMd":"A scheduled Claude Code job that writes its report to `/tmp/agent_log.md` can work every time by hand, then quietly produce nothing once it runs on a timer. A write-up on DEV Community by Guatu, who runs a homelab note-curation pipeline, describes the case: under a systemd timer using `claude -p` (print mode, the non-interactive way to run Claude Code), the job exited 0, the journal showed no errors, and the file was missing or empty.\n\nThe cause is that Claude Code scopes file access by working directory, not by what your user account can touch. According to the post, the directory you launch from, plus anything you explicitly add, is the boundary. Edits inside it follow your permission mode. Edits outside it need approval.\n\nIn an interactive session you rarely notice, because a prompt appears and you click yes. In print mode nobody can answer. The tool call is denied and the model is told so. Then the model adapts: it may print the report to stdout, write a note that it couldn't save, or summarize what it would have written. The process ends normally, so a shell script sees success. Listing `Write` in `--allowedTools` doesn't help, the post says, because allowing the tool doesn't allow it to reach every path.\n\nUnder systemd there is a second trap. If the unit sets `PrivateTmp=yes`, the service gets its own private `/tmp`, so a file written there won't appear when you look from your own shell, and it is cleaned up when the service stops. Separately, `systemd-tmpfiles` ages out old files in `/tmp`. The default working directory for a systemd unit is `/` unless `WorkingDirectory=` is set.\n\nThe author's fix has three parts. First, `cd` into the project and pass `--add-dir` for a log directory such as `$HOME/logs`, with `--permission-mode acceptEdits` so edits inside the granted folders go through without a prompt. The same grant can live in `.claude/settings.json` via `additionalDirectories`. One syntax trap: in permission rules a single leading slash resolves relative to the settings file, so an absolute path needs `//tmp/**` or `~/`.\n\nSecond, let the shell capture the transcript. Piping `claude -p` with `--output-format stream-json --verbose` through `tee` means the log exists even when the agent's own writes are denied. On current 2.x releases, stream-json in print mode fails immediately without `--verbose`. The author's notes point to around v2.1.76 as where people started seeing this.\n\nThird, make denials fail the run. With `json` or `stream-json` output, the final result message includes a `permission_denials` array. The post's script reads it with `jq`, exits 2 if it is non-empty so systemd marks the unit failed, and exits 3 if the report file is missing or empty.\n\nThe author's rule of thumb is to keep anything that matters out of `/tmp`. The sandbox scoping itself is, in the author's view, the right default for unattended agents. The catch is that it stays invisible until you remove the human.","status":"published","storyType":"news","category":"Workflow","clusterKey":"headless-tmp-silent-failure","slug":"claude-code-jobs-that-run-on-a-timer-can-fail-to-save-files-to-tmp-and-s-24b5c7","url":"https://claudecodereview.ai/a/claude-code-jobs-that-run-on-a-timer-can-fail-to-save-files-to-tmp-and-s-24b5c7/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/24b5c7f7-76c9-4bb4-8e24-2cf2dc6b7c54","role":"item","position":9,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-jobs-that-run-on-a-timer-can-fail-to-save-files-to-tmp-and-s-24b5c7/19fd7aa70bdd343a-93bca961e75fd1e4/web_hero.webp","imageAlt":"A document icon is blocked by a thick boundary wall, representing a failed file save outside of a workspace.","createdAt":"2026-09-30T21:45:07.964Z","updatedAt":"2026-09-30T22:00:37.720Z","sources":[{"role":"primary","title":"Why Claude Code Silently Fails Writing to /tmp in Headless Mode","url":"https://dev.to/futhgar/claude-headless-sandboxing-why-tmp-writes-fail-in-non-interactive-mode-de1","sourceName":"Guatu","author":"Guatu","publishedAt":"2026-09-30T16:15:47Z"}]}],"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"}]}