{"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":"382c7b63-45e4-4b84-b783-02cac6ba8c7a","date":"2026-10-15","status":"locked","createdAt":"2026-10-15T08:45:10.427Z","storyCount":6,"newsletterSubject":"Nested sessions run parallel Code tasks, Claude Design now works inside Code, Parallel cloud jobs run laptop closed"},"updatedAt":"2026-10-15T09:30:44.930Z","stories":[{"id":"c5f30e0c-9312-4f97-a388-f93341532efa","title":"Run parallel coding tasks in nested sessions and keep the main thread readable","dek":"Claude Code's redesigned desktop app opens a child session for each task you ask it to run in parallel, then reports each result back to the main session.","bodyMd":"Anthropic redesigned the Claude Code desktop app on October 14, 2026. The ClaudeDevs account announced the changes in a thread on X. The centerpiece is nested sessions: when you ask Claude to run tasks in parallel, it starts a nested session for each one. Each reports its result back into your main session when it finishes, so the main thread stays readable instead of filling with every task's intermediate work.\n\nTo try it, update the desktop app and start a new session. The quickstart lives at code.claude.com/docs/en/desktop-quickstart. Coverage from Pasquale Pillitteri lists the requirements: the Claude desktop app on a Pro, Max, Team or Enterprise plan (macOS and Windows, with a Linux beta). That coverage also notes that Anthropic's post explains only the result that comes back to the main session. It does not say how much of a child session's intermediate work can be reopened, or whether context use changes.\n\nThe new-session screen keeps recent folders one click away, so picking up half-finished work no longer means hunting for a path. You can also save a setup as an environment: a few folders, an SSH host or the cloud. Sessions then start from that saved setup, with the option of a worktree per folder. A worktree is a separate working copy of the same Git repository with its own branch, which lets two sessions edit one project without touching each other's files. Someone who works on a backend and a staging server over SSH can save that combination once instead of rebuilding it each morning.\n\nA sidebar shows which sessions are working and which need you. Inside a session, a live to-do list follows Claude's plan as it goes. A recap card sums up the turn when Claude needs you, and a side rail shows where the session runs, its context and its changes.\n\nClaude also suggests follow-up work as it goes, and you can run a suggestion as its own session with one click. Typing /btw opens a side question in its own tab while the main session keeps going.\n\nThe redesign has drawn pushback on Reddit and GitHub. Reports describe sessions grouped under \"This computer\" or by environment instead of by project folder, a Routines list that no longer sits in the sidebar, and context usage that moved from a hover on the context circle to the new side rail. One reported workaround is to ask Claude, inside a desktop session, to create a sidebar section per project folder and move sessions into them. The same prompt adds a SessionStart hook in ~/.claude/settings.json so new sessions file themselves. That is a community fix and not an Anthropic setting.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-desktop-redesign-nested-sessions","slug":"run-parallel-coding-tasks-in-nested-sessions-and-keep-the-main-thread-re-c5f30e","url":"https://claudecodereview.ai/a/run-parallel-coding-tasks-in-nested-sessions-and-keep-the-main-thread-re-c5f30e/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/c5f30e0c-9312-4f97-a388-f93341532efa","role":"lead","position":0,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/run-parallel-coding-tasks-in-nested-sessions-and-keep-the-main-thread-re-c5f30e/f112b399b772d9bd-27f9889de89b090a/web_hero.webp","imageAlt":"A diagram shows a main vertical line receiving inputs from three smaller branching lines, each representing an individual parallel task session returning results to the central thread.","createdAt":"2026-10-15T08:49:54.197Z","updatedAt":"2026-10-15T09:00:41.903Z","sources":[{"role":"primary","title":"When you ask Claude to run tasks in parallel, it starts a nested session for each one. Each reports its result back into","url":"https://x.com/ClaudeDevs/status/2110445847922245974","sourceName":"@ClaudeDevs","author":"ClaudeDevs","publishedAt":"2026-10-14T19:01:14Z"},{"role":"supporting","title":"Claude Code desktop rolls out nested sessions and saved environments - Pasquale Pillitteri","url":"https://pasqualepillitteri.it/en/news/24032/claude-code-desktop-nested-sessions-environments","sourceName":"\"when:7d \"Claude Code\" Anthropic\" - Google News","author":"\"when:7d \"Claude Code\" Anthropic\" - Google News","publishedAt":"2026-10-15T06:58:04Z"},{"role":"supporting","title":"Radical Overhaul of Claude Code Desktop: One Person Commands an AI Legion to Crank Out Code at Blazing Speed - 36 Kr","url":"https://eu.36kr.com/en/p/4026611597628033","sourceName":"\"when:7d \"Claude Code\" Anthropic\" - Google News","author":"\"when:7d \"Claude Code\" Anthropic\" - Google News","publishedAt":"2026-10-15T06:42:09Z"},{"role":"supporting","title":"Bring back project folders, New ui Claude Code","url":"https://reddit.com/r/ClaudeCode/comments/1x6ch31/bring_back_project_folders_new_ui_claude_code","sourceName":"/u/Careless-Mongoose589","author":"/u/Careless-Mongoose589","publishedAt":"2026-10-15T04:38:52Z"},{"role":"supporting","title":"Claude PC interface changed overnight","url":"https://reddit.com/r/ClaudeCode/comments/1x6a19a/claude_pc_interface_changed_overnight","sourceName":"/u/Desperate_Cherry2299","author":"/u/Desperate_Cherry2299","publishedAt":"2026-10-15T02:27:32Z"},{"role":"supporting","title":"Has Claude Code desktop app just updated out of thin air without disturbing my work? Loads of (great) changes with no actual update process + app version hasn’t changed.","url":"https://reddit.com/r/ClaudeCode/comments/1x69i4z/has_claude_code_desktop_app_just_updated_out_of","sourceName":"/u/Extra_Park1392","author":"/u/Extra_Park1392","publishedAt":"2026-10-15T02:00:42Z"},{"role":"supporting","title":"Does anyone knows how to download previous vesions of Claude Code?","url":"https://reddit.com/r/ClaudeCode/comments/1x65yuh/does_anyone_knows_how_to_download_previous","sourceName":"/u/WillowOwn4716","author":"/u/WillowOwn4716","publishedAt":"2026-10-14T23:09:06Z"},{"role":"supporting","title":"Can Anthropic stop removing useful features from the Claude Code desktop UI?","url":"https://reddit.com/r/ClaudeAI/comments/1x61z0o/can_anthropic_stop_removing_useful_features_from","sourceName":"/u/phatstackzdevops","author":"/u/phatstackzdevops","publishedAt":"2026-10-14T20:20:22Z"},{"role":"supporting","title":"To try it, update the desktop app and start a new session. https://code.claude.com/docs/en/desktop-quickstart","url":"https://x.com/ClaudeDevs/status/2110445852905062457","sourceName":"@ClaudeDevs","author":"ClaudeDevs","publishedAt":"2026-10-14T19:01:16Z"},{"role":"supporting","title":"Claude also proactively suggests follow-up work as it's working, and you can run that as its own session with just one c","url":"https://x.com/ClaudeDevs/status/2110445849516101743","sourceName":"@ClaudeDevs","author":"ClaudeDevs","publishedAt":"2026-10-14T19:01:15Z"},{"role":"supporting","title":"The sidebar makes it easy to see which sessions are working and which ones need you. Inside a session, a live to-do list","url":"https://x.com/ClaudeDevs/status/2110445851466485786","sourceName":"@ClaudeDevs","author":"ClaudeDevs","publishedAt":"2026-10-14T19:01:15Z"},{"role":"supporting","title":"It's now much easier to pick up where you left off. The new session screen keeps your recent folders one click away. You","url":"https://x.com/ClaudeDevs/status/2110445846219382954","sourceName":"@ClaudeDevs","author":"ClaudeDevs","publishedAt":"2026-10-14T19:01:14Z"},{"role":"supporting","title":"Claude Code's new UI update is too ugly.","url":"https://reddit.com/r/ClaudeAI/comments/1x5vkpv/claude_codes_new_ui_update_is_too_ugly","sourceName":"r/ClaudeAI · u/Spare-Flamingo6080","author":"r/ClaudeAI · u/Spare-Flamingo6080","publishedAt":"2026-10-14T16:18:17Z"},{"role":"supporting","title":"Claude Code Redesign Removes Folder Sessions and Adds Session Rail Sidebar","url":"https://reddit.com/r/ClaudeCode/comments/1x5v1cg/did_anyone_elses_claude_code_ui_just_update","sourceName":"u/_daath","author":"u/_daath","publishedAt":"2026-10-14T15:58:57Z"}]},{"id":"5e82edbc-3dda-409a-a6b8-7cabff5c92ba","title":"Claude Design works inside Claude Code: type /design to get started","dek":"Anthropic says to type /design to get started with Claude Design in Claude Code, a workflow that starts from your existing code, lets you react to a few options and click through a prototype, then hands the pick to Claude Code to build.","bodyMd":"Anthropic's Claude account said in a post on 2026-10-13 that Claude Design \"works anywhere you talk to Claude, including Claude Code.\" To get started, type `/design`.\n\nThe post shows Claude Design in use rather than defining it. In its example, a product designer at Anthropic starts from existing code, reacts to a few options, clicks through a prototype, and hands the one they like to Claude Code to build.\n\nThe post frames the change around timing. As models get better at building software, Anthropic argues, more of the work that matters moves earlier: having the idea, trying a few directions, and getting reactions while it's still easy to make changes. That applies to small parts too, and the post's example is the onboarding on a side project.\n\nThat sequence (begin from the code you already have, compare a few options, click through a prototype, then build in Claude Code) is the example workflow the post describes. The command itself is introduced with one line: \"Type /design to get started.\"","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-design-command","slug":"claude-design-works-inside-claude-code-type-design-to-get-started-5e82ed","url":"https://claudecodereview.ai/a/claude-design-works-inside-claude-code-type-design-to-get-started-5e82ed/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/5e82edbc-3dda-409a-a6b8-7cabff5c92ba","role":"item","position":1,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-design-works-inside-claude-code-type-design-to-get-started-5e82ed/58664cec5fb643ac-89c8fed157482921/web_hero.webp","imageAlt":"A diagram showing a single base block branching into three paths that reconvene into one final path.","createdAt":"2026-10-15T02:09:16.256Z","updatedAt":"2026-10-15T02:30:51.281Z","sources":[{"role":"primary","title":"Claude Design Now Works in Claude Code With New /design Command","url":"https://instagram.com/reel/DecdhpFOL0S","sourceName":"@claudeai","author":"@claudeai","publishedAt":"2026-10-13T18:34:20Z"}]},{"id":"7214dd77-3d05-4123-818c-a43e73f3f2f6","title":"Split one big goal into parallel cloud coding jobs that keep running with your laptop closed","dek":"Projects, now in beta for Pro and Max plans, has Claude break a large goal into tasks and run each in its own cloud session on a separate copy of your code.","bodyMd":"In a video published October 9, Anthropic introduced Claude Code Projects, a way to hand Claude a goal too big for one session and let it split the work. A project is one ongoing conversation where Claude coordinates the job. You give it a list of tasks (or ask it to explore your repos and propose some), and it starts a thread for each one.\n\nA thread is its own full Claude Code session, running on its own branch in the cloud. A branch is a separate copy of your project, so your main version stays untouched. Because the work lives in the cloud, it keeps going after you close your laptop, and you can check in from your phone. If a task needs your local files or tools, you can ask Claude to run that thread on your computer instead.\n\nWhen a thread has a concrete change ready, such as a bug fix, it opens a pull request on its own or whenever you ask. It then keeps watching that request: it pushes fixes when CI (the automatic tests and checks that run after a change) fails, and it addresses review comments. The main conversation shows the next step for each pull request, a pull requests tab in the overview lists them all with their status, and you can ask Claude to merge when you are ready.\n\nAnthropic's walkthrough points to work that spans many sessions or several repos: migrating an app off a deprecated package, or updating one endpoint across API, web and mobile repos. Its demo project investigates a run of website performance problems. Claude also writes a shareable summary with before and after metrics, stored in the project's library tab, a shared folder every thread can read. Connected to a monitoring service, Claude can set up a daily routine that checks for regressions and opens a thread to investigate when it finds one.\n\nTo start, open the Claude tab on desktop or the web app, create a new project, and enter a name, a goal and the relevant repos or folders. You then land in the main conversation, where you can click a thread's card to follow it, steer it by talking in the thread, or stop it. The threads tab shows any waiting on you.\n\nCost is the catch. Every thread is a full session and a project can run several at once, so it burns plan limits faster than a single session. Anthropic's Claude Code team suggests leaving the coordinator on low effort, since it mostly routes work, and defaulting threads to a smaller model for well-scoped tasks, switching up for larger ones. Both are set in project settings. You can also tell Claude how many threads to run at once, how often to update you, or to show a plan first, and threads share memory that you can edit in project settings. One community account, Vox, says that in a new project every thread runs on Opus at high effort by default, and that a thread hitting a limit waits for the reset and continues on its own. Either way, check the model and effort settings in project settings before sending a big batch.\n\nProjects is in beta and rolling out gradually to Pro and Max plans. Anthropic's ClaudeDevs account says users who have not been admitted can join a waitlist, and that it is letting in more as capacity allows.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-projects-parallel-cloud-threads","slug":"claude-code-projects-splits-one-big-goal-into-several-coding-jobs-that-r-7214dd","url":"https://claudecodereview.ai/a/claude-code-projects-splits-one-big-goal-into-several-coding-jobs-that-r-7214dd/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/7214dd77-3d05-4123-818c-a43e73f3f2f6","role":"item","position":2,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-projects-splits-one-big-goal-into-several-coding-jobs-that-r-7214dd/bc3239465e725e3f-5bbb04426abeb151/web_hero.webp","imageAlt":"A diagram shows one central line splitting into four parallel branches, each ending in a small square block to represent separate coding sessions.","createdAt":"2026-10-10T00:29:23.322Z","updatedAt":"2026-10-14T14:15:10.779Z","sources":[{"url":"https://x.com/ziwenxu_/status/2108635337761194355","title":null,"sourceName":"x.com","author":"Ziwen","publishedAt":"2026-10-09T19:06:55.000Z","role":"primary"},{"url":"https://x.com/ClaudeDevs/status/2108621479164412232","title":null,"sourceName":"x.com","author":"ClaudeDevs","publishedAt":"2026-10-09T18:11:51.000Z","role":"primary"},{"url":"https://x.com/Voxyz_ai/status/2108635045527515434","title":null,"sourceName":"x.com","author":"Vox","publishedAt":"2026-10-09T19:05:46.000Z","role":"primary"},{"url":"https://www.youtube.com/watch?v=omihvjf0A2k","title":null,"sourceName":"www.youtube.com","author":"Claude","publishedAt":"2026-10-09T19:49:09.000Z","role":"primary"}]},{"id":"aa15f313-411b-4dad-9032-4149ca69aec7","title":"Claude Code compacts a long idle session before its one-hour cache expires","dek":"A terminal conversation of roughly 200,000 tokens (the chunks of text a model reads) is compacted after about 54 minutes idle, so your next message doesn't have to reprocess everything. The cache is a short-term memory where the service keeps your conversation so it doesn't have to re-read it; once an hour passes it expires. Claude Code shrinks a long conversation into a shorter summary, so you can keep working in the same session without it getting too big or slow.","bodyMd":"The Claude Code 2.1.299 release notes list idle compaction in the terminal. If a conversation of 200K or more tokens sits untouched for about 54 minutes, Claude Code compacts it (summarizes it into a shorter history) before the one-hour prompt cache expires. The cache is what lets a follow-up message reuse work already done on the conversation. Once it lapses, the next message has to reprocess the whole thing. The release notes say idle compaction means your next message \"doesn't reprocess it all.\" A Reddit post on October 11 showed the message \"Compacted while idle, before the prompt cache expired\" in the poster's CLI windows; the post says the poster doesn't know which update added it.\n\nThe compaction happens while the session sits idle, ahead of the one-hour mark, rather than on your first message after you return.\n\n**Tuning it.** The 200K-token minimum is adjustable: set `CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS` to a different number. To turn the feature off, put `\"idleCompaction\": false` in `settings.json`. Both controls need v2.1.290 or later, per the release notes.\n\n**Seeing the countdown.** The Prompt Cache Control mod shows a countdown to the compaction moment and says why it isn't active when it isn't. Its listed install command is `npx claude-code-templates@latest --mod observability/prompt-cache-control`.\n\nThe same release notes list a `CLAUDE_CODE_DISABLE_FILE_MENTIONS` environment variable. With it set, Claude gets the paths of `@` file mentions to read with its file tools, not the files' contents.\n\nIn agent view, `/effort` and `/fast` set what new sessions start with, and a bare `/model`, `/effort` or `/fast` there opens a picker. The notes also list `/usage` warnings for max effort, workflows, always-on context and large tool results, and a separate changelog entry (2.1.300) adds `cache_creation_5m_tokens` and `cache_creation_1h_tokens` to the OpenTelemetry `api_request` event, which splits cache writes by lifetime.\n\nIdle compaction applies in the terminal and has a 200K-token minimum, which `CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS` changes.","status":"published","storyType":"news","category":"Release","clusterKey":"claude-code-idle-compaction-2-1-299","slug":"claude-code-compacts-a-long-idle-session-before-its-one-hour-cache-expir-aa15f3","url":"https://claudecodereview.ai/a/claude-code-compacts-a-long-idle-session-before-its-one-hour-cache-expir-aa15f3/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/aa15f313-411b-4dad-9032-4149ca69aec7","role":"item","position":3,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-compacts-a-long-idle-session-before-its-one-hour-cache-expir-aa15f3/6181ffb968f71e8a-c082da33963b4fe7/web_hero.webp","imageAlt":"A long horizontal strip representing a 200,000-token conversation is compressed into a single, smaller block at a designated 54-minute mark.","createdAt":"2026-10-15T08:14:35.960Z","updatedAt":"2026-10-15T08:30:51.252Z","sources":[{"role":"primary","title":"Claude Code v2.1.299 Adds Idle Compaction, Effort Controls, and Safer Agent Defaults","url":"https://github.com/anthropics/claude-code/releases/tag/v2.1.299","sourceName":"ashwin-ant","author":"ashwin-ant","publishedAt":"2026-10-14T02:49:42Z"},{"role":"supporting","title":"Claude Code Mod Adds Visual Countdown for Auto-Compaction Before Cache Expires","url":"https://x.com/dani_avila7/status/2110508893612740732","sourceName":"Daniel San","author":"Daniel San","publishedAt":"2026-10-14T23:11:46Z"},{"role":"supporting","title":"Claude Code Adds Idle Compaction, File Mention Controls, and Agent Shortcuts","url":"https://code.claude.com/docs/en/changelog#2-1-300","sourceName":"Claude Code changelog","author":"Claude Code changelog","publishedAt":"2026-10-14T18:57:14Z"},{"role":"supporting","title":"Claude Code Now Compacts Idle Sessions Before Prompt Cache Expires","url":"https://reddit.com/r/ClaudeCode/comments/1x2vc7g/just_noticed_this_wonderful_gem_in_my_cli_windows","sourceName":"u/dar-mit","author":"u/dar-mit","publishedAt":"2026-10-11T01:18:53Z"}]},{"id":"8229ac33-a1c4-4fb1-835d-6e9ca3f412d4","title":"Stop paying to reprocess context when a subagent waits on tests or builds","dek":"Claude Code's subagents (helper agents it spawns for side tasks) lose their saved copy of the conversation after five idle minutes, and a two-line setting in the subagent's file extends that to an hour.","bodyMd":"Claude Code reuses a saved copy of the conversation (the cache) so it does not reread everything on each step. For subagents, that copy expires after 5 minutes with no activity. If a subagent runs a test suite or waits on a build and sits idle longer than that, its next step has to reprocess the whole context from scratch. That is slower than reading from the cache and counts more against your usage limits.\n\n**Set a longer cache on the subagent that waits**\n\nAdd two lines at the top of the subagent's file, with the second indented under the first:\n\n```\nexperimental:\n cacheTtl: 1h\n```\n\nIf the file already has an `experimental:` block, add `cacheTtl` under it rather than writing a second block. Setting `cacheTtl` on a single subagent needs Claude Code 2.1.248 or later; `claude --version` shows what you have.\n\n**When to use it**\n\nUse it for subagents that sit idle for more than 5 minutes partway through, such as running tests, building or waiting on CI, or ones you will resume later. Leave subagents that run straight through and finish in a few minutes on the default.\n\nThe reason to be selective is price. The official docs, as quoted in the tip, say 1-hour cache writes cost 2x the base input price at API rates, against 1.25x for 5-minute writes. A subagent that never pauses gets nothing from the longer cache and just costs more.\n\n**Other limits**\n\n- A `subagentPromptCacheTtl` entry in your settings overrides every subagent's own setting, and it also changes workflows and compaction. To set subagents one by one, delete it first.\n- The main session has the same 5-minute limit on an API key, a cloud provider, or a subscription that is past its limit and drawing on usage credits. If you often step away mid-session there, set `promptCacheTtl` to `1h`.\n- On a 1M-context model such as Opus 5.5, compaction by default does not start until about 967K tokens, so every message carries the whole conversation until then. Running `/autocompact 400k` once makes it compact at 400K.\n\nThe prompt-caching page in the official docs is at code.claude.com/docs/en/prompt-caching.","status":"published","storyType":"tip","category":"Workflow","clusterKey":"subagent-cache-1-hour-setting","slug":"claude-code-helper-agents-that-wait-on-builds-can-keep-their-saved-conte-8229ac","url":"https://claudecodereview.ai/a/claude-code-helper-agents-that-wait-on-builds-can-keep-their-saved-conte-8229ac/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/8229ac33-a1c4-4fb1-835d-6e9ca3f412d4","role":"item","position":4,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/claude-code-helper-agents-that-wait-on-builds-can-keep-their-saved-conte-8229ac/2f12e45ad63b6af4-63580df485fc8554/web_hero.webp","imageAlt":"A row of twelve rectangular blocks, with one block lifted out and extended to be significantly taller than the others.","createdAt":"2026-10-11T09:39:54.098Z","updatedAt":"2026-10-14T14:26:39.920Z","sources":[{"url":"https://x.com/Voxyz_ai/status/2109056129884123370","title":null,"sourceName":"x.com","author":"Vox","publishedAt":"2026-10-10T22:59:00.000Z","role":"primary"},{"url":"https://x.com/daniel_mac8/status/2108903166884368408","title":null,"sourceName":"x.com","author":"Dan McAteer","publishedAt":"2026-10-10T12:51:11.000Z","role":"primary"},{"url":"https://tiktok.com/@aidive.dev/video/7694367459868003606","title":null,"sourceName":"tiktok.com","author":"aidive","publishedAt":"2026-10-08T18:35:35.000Z","role":"supporting"},{"url":"https://x.com/kevinkern/status/2108559704263721121","title":null,"sourceName":"x.com","author":"Kevin Kern","publishedAt":"2026-10-09T14:06:23.000Z","role":"supporting"},{"url":"https://x.com/diegohaz/status/2108662928501035481","title":null,"sourceName":"x.com","author":"Haz","publishedAt":"2026-10-09T20:56:33.000Z","role":"supporting"}]},{"id":"6be19006-189e-4c15-899b-410b8ce2b78e","title":"Stop an agent from committing a secret to git, even when it skips your safety checks","dek":"A Claude Code PreToolUse hook (a script that runs before each tool call and can block it) stops the agent from adding `--no-verify`, a git option that skips the commit-time secret scan.","bodyMd":"A secret in a git commit is two problems: a key that still works, and a history that keeps a copy of it. A tested runbook, run on Claude Code 2.1.295 with a fake token and a local stand-in remote, covers both. It also shows why a git pre-commit hook (a script git runs just before saving a commit, which can refuse the commit) is not enough once an agent is typing the commands.\n\n**Cleanup, in order**\n\n1. **Rotate the key first.** Revoke or replace it with the provider before touching git. GitHub's guide puts this first and says it may be enough alone. The test could not cover rotation because the token was fake.\n2. **Check history, not the file.** Deleting the line and pushing left the token in history. `git grep` over every commit and gitleaks (a secret scanner) both found it. `git log -S` and `gitleaks git` search history.\n3. **Rewrite history with `git filter-repo --replace-text`.** It takes a file of `old==>new` pairs. In the test, no commit contained the token afterwards. It also removes the `origin` remote on purpose, so the first push fails until you re-add it.\n4. **Force-push, then treat the remote as exposed.** After `git push --force origin main`, no branch held the token, but the old commit was still readable by its hash until reflog expiry and garbage collection ran inside the bare repo. On a hosted remote such as GitHub, GitHub's docs say cached views can only be purged by GitHub Support. That was not tested.\n5. **Deal with every clone.** A teammate's clone kept the token, and the filter-repo manual warns that an old clone running `git pull` then `git push` can bring the old history back.\n\n**Prevention**\n\nKeep the value in an ignored `.env` and read it from the environment. Add a gitleaks pre-commit hook in `.git/hooks/pre-commit`: in the test it refused a commit with the token hardcoded and named the file and line.\n\nThe gap is `--no-verify`, a flag on `git commit` that skips those checks. In one run, Claude Code was allowed `Bash(git add:*)` and `Bash(git commit:*)`, and a scripted model asked for `git add -A && git commit -m wip --no-verify`. The commit went through with the secret.\n\n**The guard that closed it**\n\nPer Claude Code's hooks reference, a PreToolUse hook that exits with code 2 blocks the tool call. The guard script runs before every Write, Edit and Bash call. It refuses `git commit --no-verify` and pipes file content through gitleaks before the file is written. Register it in the project's `.claude/settings.json`, using the script's absolute path.\n\nTested directly, the script exited 2 for a Write containing the token, 0 for a Write using `os.environ`, 2 for `git commit --no-verify` and 0 for `git status`. Inside Claude Code, the file was never created and the `--no-verify` commit was blocked, returning a `PreToolUse:Bash hook error` with `is_error: true`.\n\n**Details worth keeping**\n\n- Run gitleaks with `-v --redact` in the pre-commit hook. Without `-v`, the agent got only `Exit code 1` and a leak count, not which file to fix.\n- A `claude -p` run exited 0 even though the hook blocked the Write. Check the files and `git log` yourself.\n\n**Limits**\n\nThe model was a scripted fake, so the test shows Claude Code's mechanics, not what a real model does next. The `--no-verify` check is a simple text match: `git -c core.hooksPath=/dev/null commit` gets past it. Only Write, Edit and Bash text are scanned, not MultiEdit, NotebookEdit or MCP tools. gitleaks catches known formats and high-entropy strings, so an unusual secret format may slip through. GitHub push protection and the Support purge were not tested. Only git 2.47.3 was used.","status":"published","storyType":"tip","category":"Workflow","clusterKey":"secret-committed-git-runbook-pretooluse","slug":"stop-an-agent-from-committing-a-secret-to-git-even-when-it-skips-your-sa-6be190","url":"https://claudecodereview.ai/a/stop-an-agent-from-committing-a-secret-to-git-even-when-it-skips-your-sa-6be190/","relayUrl":"https://relaygrid.com/publications/pivot-claude-code/stories/6be19006-189e-4c15-899b-410b8ce2b78e","role":"item","position":5,"imageStatus":"ready","imageUrl":"https://media.pivotnews.ai/brands/claude-code-review/articles/stop-an-agent-from-committing-a-secret-to-git-even-when-it-skips-your-sa-6be190/5d775c08ec29a5c4-edebf9da51fde587/web_hero.webp","imageAlt":"A solid barrier blocks a chain of four linked blocks from moving forward, stopping the final block in its path.","createdAt":"2026-10-15T09:07:03.723Z","updatedAt":"2026-10-15T09:30:44.930Z","sources":[{"role":"primary","title":"A Secret Committed to Git: Rotate First, Then filter-repo and a PreToolUse Hook","url":"https://nandanpriyadarshi.medium.com/a-secret-committed-to-git-rotate-first-then-filter-repo-and-a-pretooluse-hook-7e2683481f1e?source=rss------claude_code-5","sourceName":"Nandan Priyadarshi","author":"Nandan Priyadarshi","publishedAt":"2026-10-15T01:15:11Z"}]}],"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"}]}