The updates whose main change is a skill, a hook or a script that my sessions run. Newest first.
My skill listing outgrew its budget
Claude Code starts each session with a list of its skills, each with a description, and the list has a budget in characters. Past the budget, the skills used least show by name alone, and a session seldom picks a skill it cannot read about. Mine outgrew the budget twice. The second time I raised it again, and my nightly replay of the day's sessions now names any skill of mine shown without its description.
The problem
Claude Code starts every session with a list of the skills it can use, one line each: the skill's name and a description, which is how the session knows when to use it. The list has a budget in characters, and past it the skills used least lose their descriptions and show by name alone. A skill shown that way is seldom picked, so it seldom earns the uses that would bring its description back. At the default budget, 38 of my 68 skills showed by name alone, and I raised it on 17 November. By 30 November I had 75 skills and up to eight had lost their descriptions again, which I learned only when a session checked the premise of a public skill pack built to catch this.
The solution
I raised the setting skillListingBudgetFraction from 0.018 to 0.022, which gives the list 66,000 characters in a session with a 1M-token context window. The first session after the change listed all 75 of my skills with their descriptions, in 65,973 of those characters, and every session now starts with about 12,000 more characters than before. My nightly replay of the day's transcripts now also reads the full skill listing each session starts with, and the one it gets again after a compaction. Its digest, and the page a scheduled task writes from it every morning, name any skill of mine shown by name alone, with how many listings showed it that way and the newest one. On the last day before the raise it named eight skills in 30 of 38 listings, and in the hours after the raise it named none in 8 listings.
How to add it
Look at the newest full skill listing in your transcripts: Claude Code records one in a session's transcript when the session starts and again after a compaction, and a skill shown by name alone has lost its description.
Python 3, saved as listing.py and run with python listing.py
"""Find the newest full skill listing in the Claude Code sessions
changed in the last day, and print the skills it showed by name
alone, without the description a session reads to know when to
use one."""
import json
import time
from pathlib import Path
claude = Path.home() / ".claude"
since = time.time() - 24 * 3600
newest = None
for path in (claude / "projects").glob("*/*.jsonl"):
if path.stat().st_mtime < since:
continue
with open(path, encoding="utf-8", errors="replace") as f:
for line in f:
if '"skill_listing"' not in line:
continue # most lines are tool output: not parsed
try:
d = json.loads(line)
except ValueError:
continue
a = d.get("attachment")
if not (isinstance(a, dict) and a.get("type") == "skill_listing"
and a.get("isInitial")):
continue # a listing that only adds a skill is partial
when = d.get("timestamp") or ""
if newest is None or when > newest[0]:
newest = (when, a.get("content") or "")
if newest is None:
raise SystemExit("No full skill listing in the last day.")
when, content = newest
shown = [s[2:] for s in content.split("\n") if s.startswith("- ")]
alone = [s for s in shown if ": " not in s]
yours = {p.parent.name for p in (claude / "skills").glob("*/SKILL.md")}
print(f"Newest full listing, {when}: {len(shown)} skills, "
f"{len(content):,} characters, {len(alone)} by name alone")
for name in alone:
print(f" {name}{' (one of your own)' if name in yours else ''}")
Work out your budget in characters: the context window in tokens, times 3 characters a token for current models, times skillListingBudgetFraction, which is 0.01 unless you set it. If your own skills show by name alone, add up the length of their descriptions and raise the fraction to cover them, with room to grow.
In ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json), among the other settings: 0.022 gives 66,000 characters with a 1M-token window
"skillListingBudgetFraction": 0.022
Shorten descriptions only once the list fits: while it overflows it fills the whole budget, so a shorter description saves no tokens and only hands its room to the next skill in line.
Check again whenever you add a skill: a script that reads each day's listings at night and names any skill of yours shown by name alone tells you the first day it happens, as long as it leaves out projects that set a smaller budget in their own settings.
Detailed notes: My skill listing outgrew its budget
What happened
On 30 November I asked a session to read a public skill pack for safety before I installed anything from it: an audit script and a weekly schedule, made to catch skills that Claude Code lists without their descriptions. I did not install it. As shipped it fails on Windows, and its schedule would have given an unattended run broad permissions. Its premise did hold here: in the session doing the reading, which ran on Opus 5.5, seven of my own skills were listed by name alone, and sessions on Fable 5.2 showed an eighth that way.
How the listing is built
That session read how the list is built in Claude Code's own code, version 2.1.267, and a later session read it again in 2.1.330, the version my desktop app runs. Both say the same:
The budget is in characters: the context window in tokens, times 3 characters a token for current models (4 for older ones), times the setting skillListingBudgetFraction, which is 0.01 unless set. A session with a 1M-token window gets 30,000 characters at that default.
When every description fits, every skill gets one. Past the budget, Claude Code's own bundled skills keep theirs, and the rest are ranked by a usage score: how many times the skill has been used, halved for every 7 days since its last use, and never below a tenth of the count. Descriptions go in, in that order, wherever they still fit, and the skills left over show by name alone.
A skill that has never been used ranks below every skill that has, and ties keep the order of the list, my own skills before plugins. A skill shown by name alone is seldom picked, so it seldom earns the uses that would bring its description back.
While the list overflows, it fills the whole budget. Shortening a description then saves no tokens; it only gives the room to the next skill in line.
Twice past the budget
At the 1% default, 38 of my 68 skills showed by name alone. On 17 November I raised the fraction to 0.018, and the next sessions listed all 70 skills I had by then with their descriptions. By 30 November there were 75, and eight showed by name alone in sessions on Fable 5.2 (seven on Opus 5.5).
That day I raised the fraction to 0.022, which gives 66,000 characters at a 1M-token window and puts about 12,000 more characters, a few thousand tokens, at the start of every session. Sessions on Fable 5.2 had needed 4,754 more characters to describe all eight, so 0.022 leaves about 7,200 to spare, room for about 13 more skills at my average description of 552 characters. The first session after the change listed all 75 with their descriptions, in 65,973 of the 66,000 characters. The list still fills its budget, so the spare room goes to plugin skills I have never used, and a new skill of my own will take it from them, since my skills come first in a tie.
One project keeps a smaller budget of its own on purpose, 0.005, set in its own settings for the batch sessions it runs, and its sessions list most skills by name alone.
What changed in the nightly replay
My nightly replay of the day's transcripts now reads each full skill listing of the day: the one a session starts with and the one it gets again after a compaction. A listing that only adds a skill is not counted. Its digest gained a section that names each skill of mine shown by name alone, with how many listings showed it that way and the newest one, and the page the morning task writes from the digest carries it as a section of its own.
A project with a budget of its own is left out of the count and named. Whether a listing had one is read from the nearest settings file: going up from the session's folder, the first .claude folder that holds a settings file decides, and the walk stops below my home folder, whose .claude holds my user settings.
How it was checked
The replay's selftest has 38 cases, 6 of them new. Fourteen pieces of the change were reverted one at a time, and each time the selftest failed on that piece's own check. Over the real day before the raise, the new section named eight of my skills in 30 of 38 listings. In the hours after the raise it named none, across 8 listings.
What to copy
Add up the length of your skills' descriptions and compare it with your budget before you trust that every session can see them. Raise the budget first and trim descriptions after, since trimming saves nothing while the list overflows. A check in code that reads each night's listings tells you the first day a new skill pushes an older one out. The script in the steps prints the skills that the newest full listing of the last day showed by name alone, and marks the ones from your own skills folder.
Before a sign-out, my check now names the sessions set to wake later
The check I run before a sign-out or a restart said go with no job running, and the app still warned that one session had unfinished work. That session had set a cron to start a fix at 08:57 the next morning, and Claude Code keeps such a wake-up only in the session's own process, which a sign-out ends. The check now names each session that holds a wake-up, with its time and what it is for, and still says go, since the wake-up is all that is lost.
The problem
Before I sign out of the app or restart the machine, I run a check that lists what the step would cut and says go or what to wait for. At 23:49 on 27 November it found no job running and said go, but the app still warned that one session had unfinished work. That session had set a cron at 19:45 to start a fix at 08:57 the next morning. Claude Code keeps a cron, and a loop wake-up too, only in the session's own process, so a sign-out or a restart ends it, and the app counts a session that holds one as working.
The solution
The check now reads the transcript each open session has written since its process began and lists every wake-up still ahead, with the session, the time it is due and what it is for. A cron counts until the session takes it back or, for one set to run once, until its time comes, and only the last loop wake-up counts, unless it ended the loop. The wake-up is all such a session loses, so the check names those sessions and still says go. Finding that session also showed that its process had resumed under an id the session left nine seconds later, so the check now places a process by any id its session has had.
How to add it
Before a sign-out, a restart or an app update, look for the sessions that have set a cron or a loop wake-up in Claude Code, since each lives only in its session's process and ends with it.
Git Bash, macOS or Linux: the transcripts written in the last day that set a cron or a loop wake-up, each file named for its session's id
When the app warns of unfinished work and no session looks busy, check for such a wake-up first, since the app counts a session that holds one as working.
If you build a check for this, read each open session's transcript from the time its process began, count a cron until it is taken back or has run its one time, and count only the last loop wake-up.
Have the check name those sessions without holding up the go, and set the wake-up again after the switch if the work still needs it.
Detailed notes: Before a sign-out, my check now names the sessions set to wake later
What happened
Before I sign out of the app or restart the machine, I run a check that lists what the step would cut: the jobs running under each session, the scheduled tasks due soon and anything writing shared data. The entry on that check has the rest. At 23:49 on 27 November it found no job running and said go, but the app still warned that one session had unfinished work.
That session had set a cron at 19:45 to start a fix at 08:57 the next morning. A cron here is Claude Code's own, a prompt queued for the session at a set time, once or on a schedule, and the tool's description says the job lives only in that session, is never written to disk and is gone when the session ends. A loop wake-up, which brings a session back to its task after a delay of a minute to an hour, is held the same way. A sign-out, a restart or an app update ends the session's process, and both go with it. The app counts a session that holds either one as working, as it does a session in the middle of a turn, and the check had looked for neither.
What changed
The check now reads the transcript each open session has written since its process began. A transcript records every call a session makes and the tool's answer, so the check can follow each wake-up from the call that set it. A cron the tool accepted counts until the session takes it back, or, if it was set to run once, until its time comes. Of the loop wake-ups only the last counts, unless it ended the loop or its time has passed. A call written twice in a transcript counts once. Each wake-up is one line, soonest first: the session, the time it is due, when it was set and what it is for.
I asked for the list and nothing more, since I knew the wake-ups would be lost and wanted to see which sessions held one. The wake-up is the only thing such a session loses, so the check names those sessions and still says go.
Finding that session showed one more fault. Its process had started at 17:00 by resuming an id that the session left nine seconds later. The check placed a process only by the ids its session uses now, so a job under that process had been listed with no session, and it now also places a process by an id its session had before. The check's self-test, 53 checks on made-up processes, session records, log lines and transcripts, covers each of these cases.
What to copy
If your Claude Code sessions set crons or loop wake-ups, a sign-out or a restart ends them with the session's process. When the app warns of unfinished work and no session looks busy, look for a session that has set one: the transcripts under ~/.claude/projects record each call. Note the times before you go, and set a wake-up again afterwards if the work still needs it.
What a sign-out, a restart or an app update cuts, what it leaves, and the check that runs before and after. Since 26 October one session per account, the first to start, asks about a scheduled task that differs between accounts, and a one-time task that has run stays off on all of them. Since 31 October the check after a switch also wakes each session that was waiting for the account just signed in. Since 26 November it leaves out a background job its own session had stopped, which it had counted as lost, and since 28 November it finds that stop in the session's transcript as well as in the job's output file. On 28 November the check before a switch also began to name each session set to wake itself later, a change with an entry of its own.
The problem
I wanted to sign out of the app and restart the machine while five sessions were waiting on me. Working out what a restart would cut took a dozen tool calls across the sessions. I did not know which sessions were mid-turn, which had background commands, or which scheduled task was due next. Guessing could have cost a long run. On 31 October a session got no answer from the browser extension, most likely because the extension was signed in to another of my accounts, and nothing would tell the session when the app was back on that account.
The solution
One command now lists the jobs running under each session, the scheduled tasks due soon, and what is writing shared data, and says go or what to wait for. A session adds what only it can see: which sessions are mid-turn or waiting. After a switch, the first session on the new account reads the app's log and reports what was cut. It also wakes each session waiting for that account, by sending it the message the session left on a waiting list. Nothing on disk is lost either way, and waiting prompts can be answered by typing a message.
What a sign-out or a restart cuts, and what it keeps. A drawn figure with made-up labels, not a screenshot.
How to add it
Before a sign-out or a restart, look at the sidebar for sessions that are busy rather than waiting.
Let a landing or a long run finish, and answer waiting prompts afterwards by message.
If you use more than one account, note which connectors and artifacts belong to which.
When a session has to wait for another account, put it on a list with the message that should restart it, and have a startup hook tell the first session on that account to send it.
If the same scheduled tasks live on more than one account, keep one list of them and treat a one-time task that has already run as off on every account.
Detailed notes: What to check before you sign out or restart
What happened
Just after midnight on 24 October I had five sessions waiting on an answer from me and wanted to sign out of the app and restart the machine. Working out whether that was safe took a dozen tool calls across the sessions: which were mid-turn, which were waiting, which had a command running in the background, which scheduled task was due in the next hour. By the end of the night the check was a skill.
What a sign-out or a restart cuts
A turn that is working is cut, and a command the session started in the background dies with it. Both can be run again.
A session waiting on a question or an approval loses nothing. Its prompt may not come back after the sign-in, so I answer by typing the answer as a message.
Nothing on disk is lost. Uncommitted edits stay in their folders.
The app's scheduled tasks fire only while the app is running. After a restart, open the app before the first one is due.
A connector such as Gmail belongs to the account it was set up on. A task that needs one has to run while that account is signed in.
Artifacts belong to the account that published them. Another account needs edit access before it can republish one.
With more than one account, the old account's session processes end at the next sign-in, not at the sign-out.
What changed
One command now lists the jobs running under each session, the sessions whose last turn ended in an error, anything writing to shared data, the scheduled tasks due in the next ninety minutes, and memory and uptime, then says go or what to wait for. The session adds the two things only it can see: which sessions are mid-turn or waiting on me, and how much of the account's usage is left.
The app gives no event before a sign-out, so the check cannot run on its own. After one, it can: the first session that starts on a new account reads the app's own log, finds the sign-out and the sign-in, names the sessions that were cut mid-turn and the background jobs that died with them, and lists the tasks due in the next day that need a connector. It puts that at the top of its first reply and then does what I asked.
What to copy
Before a sign-out, a restart or an app update, read the sidebar for sessions that are busy rather than waiting, let a landing or a long run finish, and answer the waiting prompts afterwards by message. If you keep more than one account, note which connectors and artifacts belong to which.
25 and 26 October: scheduled tasks after a switch
My three accounts share one list of scheduled tasks. It lives in git, and a hook writes it into the app's task store for every account except the one signed in, since the app holds that account's store in memory and writes it whole. When a session starts, the same hook compares the signed-in account's copy with the list and asks me about any difference.
On 25 October a one-time reminder ran at nine in the morning on one account, and the app switched it off there, as it does with any one-time task once it has run. From then on the accounts' copies and the list disagreed about whether it was on, and every session that started or resumed asked me the same question. Three of them did that day.
Since then the question goes to one session per account, the first to start, and is dropped once that account's copy matches the list again. A day later a one-time task that has run began counting as off everywhere: the app never runs it again whatever its switch says, so the hook writes it off into the other accounts' stores and asks nobody. On 5 November the next one-time task ran at its time on one account. By the evening it was off on all three, and no session asked me anything.
31 October: waiting for another account
A session that needed Claude in Chrome got no answer from it. The bridge between the app and the browser was running and accepted a test connection, but the extension never replied. The browser had started two days before, while the app was signed in to one of my accounts, and the app moved to another account later that day. My best guess is that the extension was still signed in to the first account. I decided to wait until the app was back on it, and asked for a trigger that would notice the switch back and pick the session up again.
A session that has ended its turn runs nothing, so it cannot notice a switch on its own. The after-switch check above already runs at every switch, in the first session that starts on the new account, so a waiting list is read there. Before it ends its turn, a session blocked on something only another account holds, such as a connector, the extension's sign-in or an artifact shared there, adds itself to the list with my agreement. Its entry holds the account, the session, the step to take then, and my reason as I gave it. When the app is next signed in to that account, the check lists each session waiting for it, oldest first, with the message to send. The session running the check sends each message word for word, which wakes the waiting session, and marks that entry sent. The message names the account the app is on now, the one it came from and when it was signed in, then gives the step and my reason, so the woken session knows what happened and what to do.
Each session has one entry per account, and a newer entry replaces the older one. A waiting session I pick up myself on that account marks its own entry. If the list cannot be read, the check and the command that adds to it both say so, and neither takes that to mean nobody is waiting.
The first session on the list is still waiting as I write this. When the app is back on that account, its retry will show whether the account was the cause. This entry gets a line when it does.
On 5 November the app went back to that account, five days after the session had started waiting. About a minute later another session on that account ran the after-switch check and sent the waiting session its message. The extension answered on the first try, and within a few minutes the session had finished the step it had stopped for. So the guess held: the extension's side panel was signed in to that account, and the app had been on my other two accounts since 29 October. The extension's own connection was only 46 minutes old at the switch, perhaps from an update, and that may have played a part too. If Claude in Chrome stops answering after you switch accounts, check the account in its side panel: the app has to be on the same one.
26 November: a job its own session had stopped
At 02:13 on 26 November the app moved from one of my accounts to another. The switch ended 28 session processes, and the check after it named 13 background jobs in five sessions as lost, though none of them was. Each had been stopped by the session that started it, between 22 November and 22:56 the night before: dev servers, two landings, a few read-only checks, a frame render and a wait loop. At 01:48 the check before the switch had found no job running.
The check had counted every job that never sent its completion notice as one the switch had ended, and a job its own session stops sends no notice either. When a background job starts, Claude Code names the file its output goes to, and the file of a job its session stopped ends in [killed]. The check now reads that file and leaves the job out when the file ends that way and was last written before the sign-out. A job the switch ends still counts: its file has no [killed], or the [killed] was written as its process ended at the sign-in, after the sign-out.
28 November: a session's wake-up
On the night of 27 November the check before a switch said go while the app still warned that one session had unfinished work: that session had set itself to wake the next morning. The check now names each session that holds a wake-up, and that change has an entry of its own: Before a sign-out, my check now names the sessions set to wake later.
28 November, later: a stop in the session's own transcript
At 00:20 on 28 November the app moved to another of my accounts. The switch ended 16 session processes, and the check after it named one background job as lost. Its session had started it at 03:10 on 26 November and stopped it three minutes later, but the job's output file had sat in a temp folder that a sweep had since cleared, so no file was left to end in [killed].
The stop is in the session's transcript too: Claude Code's TaskStop tool answers with the id of the job it stopped. The check now counts that answer as the job's end, as it counts a completion notice. It takes the answer only where it opens the tool's result, the one form that all 780 such answers in that night's transcripts took, so a stop quoted in another tool's output does not count. The output file is still read, for a stop the transcript does not hold.
My scan gate now reads an install as each version of the tool would
My scan gate reads an install command the way the skills tool does, to know which repository and revision to scan, and it had copied that reading from one version of the tool in October. When a command names no version, npx fetches the newest, and a copy installed on the machine may be older. The newer versions read some commands differently, so the gate could scan one revision while the tool installed another. It now reads a command once for each version it may start, and scans whatever any of them would install. Where one of them would fetch something the gate cannot scan, it asks.
The problem
My setup scans a GitHub repository with NVIDIA's SkillSpector before a command that installs a skill from it may run, and to know which repository and revision to scan, the gate reads the command the way the skills tool does. It had copied that reading in October from one version of the tool, 1.7.0. When a command names no version, npx fetches npm's newest, 1.9.1 on 27 November, while a copy installed in the project or globally runs first and can be older. The newer versions read some commands differently: given owner/repo@v1.2.0, version 1.7 installs a skill named v1.2.0 from the default branch, and 1.8 and later install the tag v1.2.0. From 1.8 the tool also fetches each repository's submodules, which the scan never sees.
The solution
A session downloaded all eleven versions from 1.7.0 to 1.9.1 without running any of them, checked each against the registry's hash and compared the code that reads a command: they read it in four ways. The gate now reads a command once for each version it may start: the version the command names, or all four readings when it names none. A command that names a version nobody has read stops and asks. Where the readings disagree, the gate scans every revision any of them would install, and it asks where one of them would fetch what it cannot scan, such as a repository with submodules. The other coding agent reviewed the change at its highest reasoning effort and found one way past it, an option npm reads after the command, and that case now asks too.
How to add it
Find out which versions of an install tool can run on your machine: npx fetches npm's newest when a command names no version, but a copy installed in the project or globally runs first, and a command can pin an older one.
Git Bash, macOS or Linux, in a project's folder: the newest version on npm, then the project's copy, a global copy and the copies npx has kept
npm view skills version
npm ls skills
npm ls -g skills
find "$(npm config get cache)/_npx" -path '*node_modules/skills/package.json' -exec grep -H '"version"' {} +
Download each of those versions without running it, check it against the registry's hash, and compare how each one reads a source and its options.
Have your gate read a command once for each version it may start and scan every repository and revision any of them would install, and make it ask where one of them would fetch something it cannot scan.
Make a command that names a version you have not read stop and ask, and check npm's newest version from time to time, since a command that names no version starts the newest and the gate reads it only as the versions you have read.
Detailed notes: My scan gate now reads an install as each version of the tool would
What happened
My scan gate stops a command that installs a skill from GitHub until NVIDIA's SkillSpector has scanned the repository, and it works out which repository and which revision from the command itself. It does that by reading the command the way the skills tool reads it, and in October it copied that reading from the tool's version 1.7.0. When a command names no version, npx fetches npm's newest, which was 1.9.1 on 27 November. A copy installed in the project or globally runs first, whatever its version, and a command can pin an older one; the copies npx had fetched on my machine before were 1.7.0 and 1.7.4. Closing the work in My scan gate now sees an installer that fetches for itself, a session read a newer version and found that it reads some commands differently, and a second session took that up the same day.
What changed
The second session downloaded every version from 1.7.0 to 1.9.1, eleven in all, each into its own empty folder, checked each against the registry's integrity hash and ran none of them. It extracted the code that reads a source, and the code that reads the options, from each version and compared them. They read a command in four ways: 1.7.0 to 1.7.4 as October's copy does, 1.7.5 and 1.7.6 with a change in how a github: source's revision and skill name are encoded, 1.8.0 and 1.8.1 with a new reading of sources and options, and 1.9.0 and 1.9.1 as 1.8 with one more option.
What 1.8 and later read differently, each now a check in the gate's own tests:
owner/repo@v1.2.0, or a full commit hash after the @, installs that tag or commit. Up to 1.7.6 it installs a skill named v1.2.0 from the default branch, so the gate had scanned the default branch while the newest tool installs the tag.
A tree link that ends in a slash, such as .../tree/main/, installs that branch, where 1.7 installed the default branch.
github.com and gitlab.com count only as the host at the start of a source, so owner/repo/github.com/x/y installs owner/repo, where 1.7 installed x/y.
The options are read by Node's own parser, so -ga is -g -a, and after -- a source may start with a dash.
install with no source installs whatever the project's lock file names.
After each clone the tool fetches the repository's submodules, which are other repositories the scan never sees.
The gate now reads a command once for each version it may start: the version the command names, or all four readings when it names none or asks for the latest. A command that names a version nobody has read, such as 2.0.0, next or a range, stops and asks. Where the readings disagree, the gate scans every repository and revision any of them would install, and where one of them would fetch something the gate cannot scan, it asks and names those versions in the question. Where a version that fetches submodules may run, the gate asks when the repository has any. To see them on a source that names no revision, it now fetches the default branch itself, where before it handed the link to the scanner. A lock-file install asks, and so does a source that starts with a dash.
Found on the way: a source with Azure's _git path segment takes the part after # as the revision in every version, which October's copy had missed, so the gate had scanned the default branch. The package under the tool's old name, add-skill, is a different program at 1.0.x that ignores the part after #: the gate had scanned that revision while the program installs the default branch. Only add-skill 2.0.0, which hands over to the skills tool, is read now, and 1.0.x asks.
The gate carries a copy of Node's parser, which gave the same answer as Node itself on 40,021 generated argument lists; the comparison also caught both of two mistakes planted in the copy to test it. The gate's tests went from 343 checks to 428, and each of the 45 pieces of the change was taken out one at a time and caught by a test of its own.
The review
A gate that scans the wrong revision lets unscanned code in, so I had Codex, the other coding agent I run, review the change at its highest reasoning effort. It found one way past it, one that an ordinary command could take. npm exec reads its own options anywhere before a --, even after the command, so a package option placed at the end could start the old add-skill while the gate read the command as the skills tool. The gate takes the safe side there: when npm exec or npm x has an option after the command and no -- before it, it asks. npx, pnpm, yarn, bun and deno stop reading their own options at the command, so they are read as before.
What to copy
If a gate of yours reads a command the way some tool reads it, it has copied one version of that tool, and new versions keep coming out. Find out which versions can actually run on your machine: what npx fetches when no version is named, what is installed in the project or globally, and what your commands pin. Read each of those without running it, and have the gate read a command as every one of them would. Where they differ, scan everything any of them would fetch, and ask where one of them would fetch what the gate cannot see. A command that names a version you have not read should ask too.
Still open
A version after 1.9.1 will be read as these four readings until someone reads its code, and nothing yet warns when npm's newest moves past the last version read; npm view skills version shows it. A run of a version older than 1.7.0, installed in a project or globally with no version in the command, cannot be told from the command and is not covered.
My scan gate now sees an installer that fetches for itself
Google Chrome's web guidance skill says to install it with one npx command, and that command went past my scan gate with nothing said: the installer runs the fetch as a program of its own, after the gate has read the command. The gate now reads that install as the fetch it makes, and the skills tool's update and sync, which fetch what a file names, stop and ask. A later fix, for the skills tool's newer versions, has an entry of its own.
The problem
My setup scans a GitHub repository with NVIDIA's SkillSpector before a command that fetches one is allowed to run, and it reads the command as typed. On 18 November I asked for Google Chrome's web guidance skill, whose page says to install it with one npx command. Read before it ran, that command turned out to start the real fetch as a program of its own, so the gate saw nothing to scan. The skills tool's own update command had the same gap, since it fetches whatever its lock file names.
The solution
A session read the installer's published code without running it and found the exact command its install starts. The gate now reads that install as the fetch it makes, however the command is typed, and scans the same repository. Its update command, and the skills tool's update, upgrade and sync, now stop and ask, since the repositories they fetch are named in files the gate does not read; the question points to the route the gate does scan, installing the skill again from its source. Any installer the gate has not read is still out of its sight, and the notes list three ways to close that whole family.
How to add it
Before you run an install command a skill's page gives you, save the package as a file without installing it and search it for the commands it starts.
Git Bash, macOS or Linux, in an empty folder: the package saved and searched, none of it run
Keep a short list in your gate of the installers you have read, each with the command its install starts at the version you read, and count every other way of starting one as unread.
Make a command that installs from a lock file or a dependency list, such as an update or a sync, stop and ask, and update a skill by installing it again from its source, which the gate scans.
Detailed notes: My scan gate now sees an installer that fetches for itself
What happened
On 18 November I asked a session to install Google Chrome's modern-web-guidance skill with the command its page gives, npx modern-web-guidance@latest install. The session read the installer before running it. Its install starts npx -y skills add GoogleChrome/modern-web-guidance --skill modern-web-guidance as a program of its own, so the fetch comes after my scan gate has read the command and let it pass. Given that command, the gate said nothing at all, while the same skills add typed by hand stops for a scan. I took the skill in as a copy I had read instead, and a second session took the gate's gap. The gate is one of the pieces listed in Should I build my own harness? No, I already have one.
What changed
The second session downloaded the package without running it, checked it against the registry's integrity and read the installer's main function. Its install always adds that one repository, and any further words go after it, where they cannot change what is fetched. Its update runs the skills tool's own update and its uninstall a remove; search and retrieve fetch no repository.
The gate reads the installer's install as the fetch it starts, in every form it already reads for the skills tool: after npx, pnpm dlx, bunx, yarn dlx or npm exec, with their options, or as a program installed on the machine. It holds for the version that was read, 1.0.1, and @latest is read as that version until a newer one is read. Another version named outright, or an option before the command, stops and asks.
The skills tool's update, upgrade, sync and experimental_install install from the sources a lock file or a project's packages name, as its current version reads them. They now stop and ask, and the question points to the route the gate scans: install the skill again with skills add and its source. Its check command compares and installs nothing, so it is left alone.
Found on the way: the word after a runner's -p, which names the package it installs, had been read as a program of its own, so one ordinary install asked for no reason, and now does not.
Each piece of the change was taken out one at a time and caught by a test of its own, 15 pieces in all, with 51 new cases. Run on the original command, the gate now scans the repository and stops, because that scan runs past its 100 second limit. Before, it let the command through with nothing said.
What to copy
A gate that reads only the command as typed cannot see what the program does next. Read an installer's code before you trust its install command. Keep a short list of the installers you have read, each with the command it starts, and count anything else as unread. A command that installs from a file, such as an update or a sync, is a fetch the gate cannot read, so make it ask.
Still open
Any other program that starts a fetch itself is still out of the gate's sight: another installer, a project's own script, a tool run from its file. Closing that whole family would change what the gate stops on, so it waits on my choice among three ways. One is a small wrapper for npx, git and the other fetching programs, placed first on the agents' path, that runs the same check on its own arguments. Another stops on any package a runner starts that is not on a read list. The narrowest stops on a runner-started package's install, add or update command.
A week later, on 27 November, @latest named 1.0.2. It picks npx, pnpx or yarn dlx by the package manager in use and starts the same install, so the gate still scans the right repository. Reading the skills tool's current version also showed that it reads two kinds of source differently from the version the gate copies, which is a follow-up of its own.
Three house rules became a hook that stops a command before it runs. Hardened over ten reviews, it asked me 74 times in five days of bypass mode, and I clicked through every one. Now it denies in every mode, and nobody is asked. In November it learned two kinds of words that both shells read the same way, and it now refuses curly quotes, which PowerShell treats as real quote marks. The same day it started checking the side copies of a project too, since they share its branches.
The problem
My rules file tells every session what not to do: never move the main branch by hand, never write the shared data from a side copy, never run the other agent outside its route. A rule in a file is only advice. A session can forget it in the middle of a long job, and nobody notices until something is broken. I needed the rules checked before a command runs, not after.
The solution
A small script now runs before every shell command in both coding agents. It reads the command and stops any that breaks one of the rules. At first it asked me each time, and that turned into 74 prompts in five days, all of which I clicked through. Now it refuses the command outright and tells the session why, so the session takes the proper route instead. In November it learned two more kinds of plain words that both shells read alike, and it now refuses curly quotes, which PowerShell treats as quote marks.
Before: a rule that asks, and 74 reflex clicks. A drawn figure with made-up labels, not a screenshot.After: a rule that denies with the reason, in every mode. A drawn figure with made-up labels, not a screenshot.
How to add it
Write down the two or three rules you most need kept, in words a script can check.
Add a PreToolUse hook in Claude Code that reads each shell command and refuses the ones that break a rule, with the reason.
Python, saved as ~/.claude/hooks/gate.py: a gate in the same shape as mine
"""A PreToolUse hook: refuse a shell command that breaks
one of your rules, and say why."""
import json
import sys
# Each rule: the words that must all appear in the command,
# and the reason the session reads. Put your own here.
RULES = [
(("git push", "main"),
"Main moves only through the landing script."),
(("codex exec",),
"Codex runs only through the review script."),
]
event = json.load(sys.stdin)
command = event.get("tool_input", {}).get("command", "")
for words, reason in RULES:
if all(w in command for w in words):
print(json.dumps({"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "deny",
"permissionDecisionReason": reason,
}}))
break
~/.claude/settings.json, with your own user folder in place of you
Detailed notes: My rules became checks that block a command
16 October: three rules become a check
My house rules live in one file that every session reads. Three of them keep sessions out of each other's way. The main branch is moved only by the landing skill, never by hand in the primary checkout. A session working in a worktree may read the primary checkout's data but never writes it; a writer runs in the primary, after a handoff. And the other agent is never run by hand, so that I pick its effort each time and every call is recorded. On 16 October a security read of a popular agent bundle left me with one idea worth keeping: a rule a session can forget is an instruction, and a rule the harness checks before every command is a lock. So the three rules became a hook, a Python script that Claude Code and Codex both run before any shell command. It reads the command word for word as each shell would hand it on and stops the ones that break a rule. Where it cannot read a command to the end, it stops that too.
In Claude Code a stop was an "ask": the command paused, a prompt came to me with the rule it broke, and I decided. Codex cannot pause, so there a stop was a "deny": the command was refused and the agent was told why. At the time the difference looked harmless.
24 and 25 October: the reader is hardened
Codex reviewed the hook ten times in two days, and each round found a way for a command to carry a rule's words past the reader: a variable where the program should be, a nested shell, a heredoc, a quote the two shells read apart, an alias made on the way. Each hole was closed with a test, and wherever the reader could not be sure it now stopped the command, the right side for a lock to fail on. It also meant the hook stopped more often, and in Claude Code a stop was a prompt to me.
26 October: 74 prompts, eight hours, every one clicked
I run every session with the app's bypass-permissions mode on, and I had told the sessions in writing to go ahead without asking. Prompts kept coming anyway, so I asked a session why. The answer was in the app's own log and in the sessions' transcripts. Bypass mode turns off Claude Code's own permission checks, but hooks run in every mode, and a hook's "ask" is a prompt in every mode, bypass included. Every prompt those sessions had raised was the house gate's. Across five sessions over five days it had asked 74 times. Forty-four were commands it could not read to the end, written with a variable, a process substitution, a heredoc into a temp folder or a PowerShell block, with a store path or a git word past the point where the reading stopped. Thirty were worktree sessions handing a data file of the primary checkout to a Python one-liner, nearly all of them reads, which the hook cannot tell from writes inside Python code. I had answered every one with "allow once", and the sessions had waited about eight hours in all for those clicks, the longest nearly two.
Each "allow once" had overridden the gate and let the command run as written, the reads and the few real writes alike. A rule that asks a person to judge 74 commands gets reflex clicks from anyone, and a reflex click decides nothing.
What changed
The gate answers "deny" in both tools and in every permission mode. A refused command never runs. The session gets the whole reason, down to the word where the reading stopped, and takes the sanctioned route: a plain copy of the store into its own worktree (a plain read was always allowed), the landing skill for the main branch, the review skill for Codex, or the same command written plainly so the gate can read it, and nobody is asked.
A crash inside the gate is a deny as well, so a broken gate fails closed in both tools, and that path has a test now.
The one click lost is the one that archived a session I had starred or pinned. Those I archive from the sidebar myself.
A standing preference, written into the house rules: a prompt that keeps coming is fixed in code, with an exact rule or a refusal that explains itself, never answered by hand. Bypass mode does not reach everything, and by design: explicit ask rules in the settings, the model's own questions and a few safeguards prompt in every mode.
Later on 26 October the preference had its first case. A session working in a worktree had notes to append to a private file of one of my sites, and the only runner for that file lived in the private folder itself, so the gate refused the command and the session asked me to run each append from my own terminal tab, one prompt per note. The fix is a small script in the shared skills folder that resolves the file's path inside its own code, so the command line names no store path and the gate has nothing to stop. It appends and nothing else, with the file's own line endings, and it writes only while the session holds the marker the writer handoff leaves for that store. Before it landed, its tests ran against a throwaway copy, and the gate itself was fed both command shapes from a worktree: the new one passed and the old one was refused.
Also on 26 October, the ask rules in my settings got the same treatment. There were 46 of them, written five days earlier in a security pass, on edits to skills, task prompts and project scripts and on sending mail, sharing a file or deleting a database, and an ask rule prompts in every mode as a hook's ask does. Twenty-eight were removed: the ones on routine files, and the ones on sending and sharing, where my word in chat is already the decision. Eight, the deletes of a database, a key store or a storage bucket, became deny rules, since a session never deletes a store. Ten stay, on the settings and hook files themselves, as a tripwire against a session rewriting its own permissions. Two prompts no rule reaches, and both are the app's own: removing the folder a session stands in or a registered worktree folder, which is why a worktree is now retired with git's own worktree remove, and a command typed into my terminal panel, which asks me by design.
What to copy
If you run with permissions bypassed and still get prompts, read the app's log before you touch the mode again. The prompts may be your own hooks, and bypass does not silence a hook's ask. Then count them. Let the hook decide, and make its refusal carry enough for the agent to recover on its own.
Still open
A read hidden inside interpreter code still costs a session one detour, because the gate reads the command text and not what the code does. A narrow allowance for one exact read shape is possible, measured first. And the prompts had been an accidental brake on my weekly usage, about eight idle hours across five sessions. That brake is gone, and a deliberate stop near the limit would have to be built on purpose.
17 and 18 November: two kinds of words both shells read alike
Since the gate began denying instead of asking, a command it cannot read to the end costs the session one retry, and nothing waits on me. My nightly replay of the day's sessions (Replaying a day of sessions from their transcripts) lists those refusals, and over eight days it counted 80. I asked what the reader could safely learn from them.
The obvious candidate was variables: 30 of the 80 began by setting one, usually to a long path, and used it after. I had tried reading variables in October, and two review rounds found sixteen serious ways past the reader, most of them through the variables, so I had dropped them. Doing it safely now would mean reading each command the way one particular shell does, and here Codex's shell tool, which its hook calls Bash, runs Windows PowerShell. The 80 were 75 different commands, and reading variables would have let 26 of them through instead of 8. I left them out.
That left two kinds of words that Bash and PowerShell hand to a program in exactly the same way, which the reader refused only because it had never learned them: a percent sign inside a word, as in date +%H:%M, and an option glued to one quoted value, as in --format='%h %s'. Each form went through both shells into a one-line program that prints the arguments it receives, and the reader learned only the forms that came out the same. A word that starts with a percent sign is still refused, because PowerShell reads a leading percent sign as a short name for ForEach-Object. So is --%, after which PowerShell passes the rest of the line on untouched.
The same test turned up a hole. PowerShell treats curly quotes (‘ ’ “ ”) as real quote marks, and Bash does not. So a line the reader took as one quoted word could, in PowerShell, close the quote early and run a command hidden inside it, and the gate let such a line through. Now a quoted word that holds a curly quote stops the reading, which costs nothing unless one of the rules' words comes after it.
Codex built the change and a Claude session reviewed it before it landed. Of the 80 refusals, 8 are now read and go through, each decided exactly as the same command written without the new words. A replay of the week's 17,934 shell commands through the old gate and the new one changed nothing else. If the new reading ever fails, it refuses that word as before instead of crashing, because a crashed hook would deny every command in every session.
Variables stay unread on purpose. A session that keeps a path in a variable in front of a git command or a data path is refused, and the refusal tells it to write the path out in full.
18 November, later: a side copy could still move the main branch
The review of that change noted one more gap, and I asked for it to be closed the same day. The gate's first rule only looked at a project's main checkout. But a worktree, the side copy a session works in, shares the main checkout's branches, so a git command run there can move the main branch too. In a scratch repository, with the main branch checked out in the main checkout, git still let a worktree point the main branch at another commit through its plumbing commands, delete it, rename it, reset it, and push over the remote's main branch. A few other forms git refused on its own.
The gate now reads a worktree's own git files to see which project it belongs to and which branch it has checked out. From a worktree of one of my projects, a command that names the main branch in any of those forms is refused, with the reason and the landing skill as the way through. A worktree's merge, rebase or reset of its own branch still goes through, and so does a push of its own branch. Codex reviewed the change and found one more form, a pull that names the main branch as its destination, which git also allowed; that is refused now too. Replayed over the week's commands, the change touched one: a session's fetch of the main branch into itself from a worktree, which git would have refused anyway.
A change to a scoring rubric needed a revision-log entry, and I was the one who remembered it. I now have a map of the first three repositories, a check before a branch joins the main code, and a local dashboard of what is owed. Most of the duties recorded so far are still reminders or events the map does not watch. Three more repositories were mapped on 18 November, so six of the fourteen have a record.
The problem
I wanted one place to see how all my projects fit together. A change to a scoring rubric needed an entry in its revision log, and it got one only because I remembered the log. A change in one repository can also leave a step to do in another. Each site's admin page shows its own project, so I had no dashboard across the whole set.
The solution
In one evening, Claude and Codex built a map from a small record in each of the first three repositories. The record names the parts, the stores they read and write, and the duties a change carries. Before a branch joins the main code, the landing step runs the checks for the duties its changed files touch and names the missing step if one fails. Both agents can ask the same reader what a file carries, and Claude gets a reminder when editing. A local dashboard opens on what is owed and what waits for me, with eight repositories still marked as not mapped.
How to add it
Start with a change whose follow-up is easy to forget, and record the parts and stores involved in each repository.
Write when its duty applies, what must follow, which side is the source of truth, and the check or the word none.
Made-up duty, written as a planning note for your own record
Duty: Rebuild the sample catalogue after an item changes.
When: A file under catalogue-source/ changes.
Must follow: Regenerate catalogue.html.
Source of truth: catalogue-source/; catalogue.html is generated.
Check: none.
Status: reminder.
Make the command that merges a branch run the affected checks, and test it with a change that deliberately omits its follow-up.
Give both agents a way to look up a file's duties, and generate the project pages and overview from the same records.
Put unmet checks and decisions waiting for you first on the dashboard, and label reminders and unwatched events separately.
Detailed notes: A map of my projects and the steps between them
What happened
I wanted an organized map of all my projects, with each project's parts and their connections clear in one place. A change to a scoring rubric had needed an entry in its revision log, and the log was brought up to date only because I remembered it. I wanted a session that changes a file to find the steps that change carries, including a step in another repository, without relying on my memory.
I also wanted one dashboard across the projects. Each site's admin page gives me a view of that site, but none covers the whole set.
Two designs before the build
Claude and Codex each proposed a design before seeing the other's. They arrived at the same shape: a small record per repository, a generated overview, a reader that returns what a task needs, and checks where work is completed, with a local dashboard first and a private hosted copy later.
The design asks each duty to say when it applies, what must follow, which side is the source of truth, and what check proves it. Where there is no check, it says so.
What was built that evening
The first records name each repository's parts and the stores each part reads and writes. They attach duties to the files and events that make them apply. A generated page shows each mapped project, and one page lists all fourteen repositories, including those with no record yet.
Claude and Codex use the same reader. Before changing a file, a session can ask what the file carries and get its parts, duties and references. The landing step, which checks a branch before it joins the main code, runs the checks selected by the branch's changes. A failed check refuses the landing and names the duty and the next step. Claude's edit hook also gives a reminder once for a duty in a session; that reminder never blocks an edit.
The local dashboard uses the records and evidence already on disk. Its first screen shows what is owed and what waits for me. A feed that cannot be read is labelled unavailable, and the rest of the page stays usable. That happened on the first real build: the newest line of a log was a run that had done nothing, so it carried no count, and the feed came up unavailable. The reader now takes the newest line that has a count.
What the first records cover
The first evening mapped three of the fourteen repositories: 108 parts, 331 stores and 196 duties. Of those duties, 41 are checked at landing, 110 are reminders and 45 are tied to events the map does not watch yet.
So most duties have no check running at landing. The record keeps that gap beside each duty, so a listed duty does not look as though it has been proved.
What the checks prove
The other coding agent reviewed each of the first three records against the code. It found duties marked as checked whose test proved less than the duty's title claimed. Each was narrowed to what its test proves, split in two with the unproven half left as a reminder, or given the test that does prove it. The dashboard's own duty is split the same way: a test checks its saved data, and keeping the page in step with that data stays a reminder, because that test does not prove the page reads every field. A check that only finds a command named in a test chain is labelled a text check, since finding the name does not prove the command runs.
A session tried the original failure on a scratch branch: it changed the rubric's version without adding the log entry. Landing was refused in seven seconds, naming the duty and the entry to add. With the entry present, the check passed.
What to copy
Start with one change that has already caused a forgotten follow-up in your own repositories. Write down the duty and test the failure before expanding the map. The made-up catalogue duty in the steps above is a planning note, with no check attached; it is a reminder until a test exists and the landing command runs it.
Still open
Eleven repositories still have no record. The map does not yet watch events such as a publish, a deploy or a key rotation, so their follow-ups still depend on the existing procedures and reminders.
The dashboard is a local file. A private hosted copy is the next step.
18 November: the rules file, and the other agent's seat
The next day I added the map's three steps to the rules file that every session reads at its start: ask what a file carries before changing it, expect the landing step to run the duties the change touches, and edit the record in the same branch when a part is added, moved or retired. The edit reminder reaches one agent while it works. The rules file reaches both before they begin.
The other coding agent also ran the refusal from its own seat, on a change that left a name out of a generated file. The landing was refused in eleven seconds. Its notes on what it was shown led to fixes the same night: one failing check had been reported as two unmet duties, the reader had told it to work in the first agent's kind of checkout, a count read "1 duties", and a search reported 83 matches and listed ten.
18 November, later: three more repositories
Three more repositories got their records the same day: two of my sites and the one where my posts are made. They add 74 parts, 148 stores and 140 duties. Of those duties, 44 are checked at landing, 79 are reminders and 17 are tied to events the map does not watch yet. Six of the fourteen repositories now have a record, and eight do not.
The other coding agent reviewed each record once against the code and reported 28 errors, none of them a blocker. Most were of two kinds: a statement in the record that the code did not bear out, and a duty that was not attached to a file it depends on. One duty said a route refuses before anything is written, and a counter is written first. Another credited a test run with checking a rule, though the run swaps that rule for a copy of its own, so the real one was never tested. Three checks ran tests that open a browser or read files outside the repository. A landing check has to work offline and leave the files as it found them, so those three became reminders that name the command.
On the third record, each check was first going to run only the tests named for its duty. The test runner passes when no test has the name it is given, so a renamed test would have emptied the check, and the check would still have passed. Each check on that record now runs a whole test file. The duties also listed every file their tests load at first, and an edit to the file that holds these entries was handed duties about sign-in and the privacy page along with its own. A duty there now lists the files where its own rule lives, and one duty on every file runs the whole test suite, so a file that stops loading is still caught.
The last review also turned up numbers kept by hand in several places, such as a time limit written in the code and again in two emails and on a page. The copies agree today and no test compares them, so each is a reminder. On the last two records a session also broke every checked duty once on purpose, and each check failed.
My house rules now tell Claude and Codex to use a shared task note whenever they work together. The owner keeps the decisions and the next action in one file, and an update based on an old version is refused. A short message still tells the other agent when to act.
The problem
I read a suggestion that Claude and Codex could work more efficiently through a shared Markdown file. Passing the same background between chats can leave decisions buried in old messages. Each agent also works in its own checkout, so two files with the same name can hold different versions of the task. I wanted both agents to pick up the shared note when work resumed, without needing me to remember a command.
The solution
The shared house rules tell both agents to use shared-handoff automatically for joint tasks, reviews and handoffs. The task owner keeps one note outside the code checkouts, with the current inputs, decisions, test evidence and next action. The helper locks each update and refuses it if the file has changed since the owner read it. Other agents return their results for the owner to check and add to the note. A watcher also passes future house-rule edits into running Claude sessions at a normal tool or prompt boundary, while task handoffs still use a short message.
How to add it
Tell both agents in their standing instructions to use the skill automatically when working together, with one owner and a shared file outside disposable checkouts.
Keep the objective, current code version, decisions, evidence and next action in the note, with links to longer records.
Have the owner update it at a milestone or handoff, checking that its contents have not changed since the last read.
Send a short message naming the file, its version and the requested action, and have the recipient report which inputs it used.
Keep existing review and permission rules, and measure note reads and updates along with any reduction in repeated prompts.
Detailed notes: A shared task note for Claude and Codex
What prompted it
I read a tip about using a shared Markdown file when Claude and Codex work together. A brief can keep the current task visible without carrying a whole conversation into each review. The file still takes tokens to read, so I have not attached a saving to it.
One owner and one file
The new shared-handoff skill gives both agents the same template. The task owner maintains the note, while the other agent returns its findings in a response or an assigned output file. The note lives outside the code checkouts, where removing a finished checkout will not remove it.
The note names the objective, the code or input version, decisions still affecting the work, evidence for completed checks, and the next action. Longer logs stay in their own files. A test result carries the version it checked, so a pass on yesterday's code does not become a claim about today's.
When the note changes
The Python helper prints a revision and a hash when the owner reads the file. An update must supply that hash. If another update has happened, the helper leaves the file alone and asks the owner to reconcile the newer contents. An operating-system lock prevents two helper updates from running at once, and the new file replaces the old one only after it has been written.
The owner label catches an accidental update from the wrong participant. It does not authenticate the person or model running the command. The existing rules still decide who owns the task and which actions are authorized.
What still needs a message
A changed file does not wake another agent. The owner sends a short request naming the file, its revision and the next action. The recipient checks those inputs and reports which version it used. If the current request still names the same exact commit, the recipient reviews that commit and reports the newer note or branch state as well. A changed or withdrawn request goes back to the owner before work continues.
Claude reviewed a redacted copy of the skill and helper. Its review caught a problem with recording a request as sent: that edit would change the hash in the message. Delivery receipts now stay in the transport record until the next substantive update. A confirmed transfer of the task also gets a new note under the new owner, with a link back to the old one.
The skill keeps existing code-review and shared-data handoffs in place. A reviewer restricted to one checkout receives an allowed snapshot instead of wider access to the machine. Notes stay brief, and the agents do not poll an unchanged file.
17 November: use it without a reminder
I asked for both agents to use the skill whenever they work together, so I would not have to remember its name. The shared house rules now tell them to load it before a handoff or review and when joint work resumes. The task owner reuses the existing note and updates it at a substantive milestone.
The rule is kept in the Claude instructions and copied into the Codex instructions by the existing sync. The skill description names the automatic trigger, and its Codex metadata explicitly allows automatic invocation. The rule applies when the agents are already working together; it does not ask them to start another model or turn a solo task into a joint one.
17 November: reach sessions already running
I also wanted sessions that were already open to get the new rule without interrupting their work. A one-time reminder now carries the updated section into each named session after a tool finishes or when its next prompt arrives. Idle sessions wait for normal activity. Nothing is restarted or woken just to read the reminder.
The reminder is limited to the sessions that were open when it was queued. It skips subagents and sessions that have already received its output, and it leaves existing permissions and tool results alone. I checked the reminder markers in live transcripts and confirmed that those sessions kept their original processes. The delivery record distinguishes reminders already emitted from ones still waiting; it is not evidence that every agent has acted on the rule yet.
I asked for the same behaviour after future changes to the shared house-rules file. The watcher now compares the current file with the version each parent session last received. It supplies the current changed sections and names sections that have been removed. A session that has been idle through several edits gets the latest version when its work continues.
Unchanged rules produce no new context. A new fingerprint must be seen twice at least two seconds apart so a save can settle; the check never sleeps or pauses the task. New sessions record the rules they load at startup. A session without a baseline, a changed section order, or a missing old snapshot can require the full current file.
The permanent watcher replaces the earlier one-time reminder hooks. It makes no separate model call and leaves tool results and permissions alone. The local checks cover updates, removals, reversions, idle catch-up and competing events. Each of seven selected checks failed when its corresponding behaviour was removed, and the watcher then detected the real house-rule edit in running sessions.
A review after each session, checked before I installed it
A small public skill runs the US Army's after-action review on a finished AI session and writes down what to change. I had every file read and scanned at a pinned commit before it went in, with one section added. It has not run on a real session yet.
The problem
I wanted to try a small public skill that runs an after-action review on a finished AI session. It asks the US Army's four questions, writes down concrete lessons, and proposes fixes to the rule and skill files the agent reads next time. It came from a repository I did not write, and its instructions let the agent edit those files once I say "apply". I wanted every file checked before it came onto my machine.
The solution
A session read all five files at a pinned commit and ran a static scanner over them. The one script is 125 lines of standard Python that makes no network call and reads and writes a single lessons file. The skill went in as a house copy with one added section: its edits to my rules and skills go through the same checked routes as any other change, and a scheduled run only proposes. A house file records the source commit and that section. The skill has not run on a real session yet.
How to add it
Fetch the repository at the commit I read, and read all five files before anything is installed.
Git Bash, macOS or Linux: the repository at the commit I read
Copy the instructions, the scripts folder and the licence into a folder named aar-loop under your skills folder.
Decide where its fixes may go. If your rules or skills have a checked route for changes, add a short section to the skill that sends its edits through that route and has unattended runs propose only.
Write down the commit you copied and your changes next to the skill.
Detailed notes: A review after each session, checked before I installed it
What happened
On 15 November I asked a session to check a small public repository, coopersimson96/aar-loop, and to install it if it was safe. It is a skill for Claude Code and similar agents that runs an after-action review on the session that just ended. The method is the US Army's, four questions asked in order: what was supposed to happen, what actually happened, why there was a difference, and what to do the same or differently next time. From the answers the agent writes one to three lessons that are specific enough to check later. It proposes edits to the rule or skill files it will load next time, and it appends each lesson to a file named LESSONS.md.
The repository is five files: the skill's instructions, one Python script, a README, an MIT licence and an ignore file. The session read every one at the latest commit, the repository's third, from 26 July. The script is 125 lines and uses only the standard library. It reads and writes one file, the lessons file it is pointed at. It makes no network call, starts no other program and reads no credentials. The instructions are plain text with no hidden characters.
The session then ran SkillSpector over the same files, without its model pass. My setup already runs that scanner on a repository before a command fetches it. It scored the skill 47 out of 100, medium, and found nothing of the kinds that stop a fetch here: prompt injection, supply chain, or a known malware signature. Its one high finding was the line .env in the ignore file, which only tells Git to leave such a file out of a commit. The medium findings were a path to a skill file in one of the examples, no declared list of tools, a file that persists between sessions (which is what the skill is for), and the rule that lets the agent apply its fixes when I say "apply".
What changed
The README suggests pasting a one-line prompt that asks the agent to install the skill globally. I had it installed as a house copy pinned to the commit that was read, through the checked flow every skill change here takes. The script and the licence are the repository's files, unchanged.
The one change is a short section at the end of the instructions. Upstream says that once I approve a fix plan, or when I ask for the review with "apply" or "fix it", the agent edits the target files the way it makes any other edit. Here a change to a skill goes through a scratch copy with its own checks, a change to a repository goes through that task's worktree, and my global rules and settings change only when I approve the exact edit. The added section says that "apply" skips the question about the plan and never those routes. It also gives the script's full path, has a lessons file inside a repository written in the task's worktree, and has a scheduled run propose fixes without applying them. A house file beside the skill records the source commit, what the read found and this section, so a later sync with upstream can put it back.
The read found two limits that I left as they are. The script rewrites the whole lessons file on each append and takes no lock, so two sessions appending in the same moment can lose an entry. Its tag filter matches part of a word, so a search for api also finds rapid.
Before the skill went in, the session ran the script on a scratch file. It added two lessons and listed them by tag as the instructions describe.
What to copy
Read a skill's whole repository at a pinned commit before you install it, and install the files you read. When a skill is allowed to edit your rules or your other skills, check what "apply" would let it touch, and send those edits through whatever route your other changes take. Keep the commit and your changes written down next to the skill.
Still open
The skill has not run on a real session yet, so I cannot say whether its lessons are worth keeping. My sessions already keep notes in Claude Code's memory folder, and I have not decided which of the two a lesson about how I work should go to.
A finished checkout still held a second Python environment. Another held test results I wanted to keep. My close-out now counts the files Git leaves out of its status report.
The problem
One session had merged its branch, and Git reported a clean checkout. Its Python environment still occupied nearly half a gigabyte. In another clean checkout I found scratch files whose contents I could not find in the main project data.
The solution
Before I archive a session, it now counts the files in its worktree, including the ones Git ignores. If it finds what looks like a copy, it checks the contents against a file I will still have after cleanup. Codex sends Claude the list for a decision before removing anything. When I give Claude the cleanup, Claude checks the files and does the removal itself.
How to add it
From the task worktree, check both groups of files that Git does not track.
Compare suspected duplicates by content with the originals. Give unique test results a permanent home before removing their checkout.
Check who holds the worktree just before removing it. A desktop app can hand the same folder to another session.
Detailed notes: What a clean worktree can still hold
The environment and the experiment
I went looking for files left by finished sessions. In one checkout, every file in the Python environment matched the one in the main checkout. In another, I could account for the input files, but the results of the experiment existed only in the trial folder as far as I could tell. Both checkouts looked clean in Git.
Before I archive a session
The session now reports how much space its worktree takes and which folders hold files outside Git. If it encounters a link or another checkout inside the first one, it names that path for a separate look. I want the close-out to tell me which folder I can remove and where I will find anything worth keeping afterward.
The daily cleanup for copied project data still has its own job. It can clear a copy after a session has archived. The new check also catches the environment and scratch results while the session still knows what they were for.
Who does the removal
I wanted Claude to review the list while the files were still in place. Codex now gives Claude the list and waits for its reply. If I ask Claude to do the cleanup, Codex hands it over. A folder that has changed since the check goes back for another look.
Replaying a day of sessions from their transcripts
Anthropic's post on agent memory describes dreaming, an offline pass over past transcripts that corrects the notes later sessions trust. As a first step here, a script with no model and no network reads a day of my Claude Code transcripts in about 4 seconds and writes my messages and each session's questions to me, with their answers, to a dated folder outside every repository. Building it showed that a message I type while a session works is kept as an attachment, where a reader of ordinary messages never looks, and the other coding agent's review found that questions I had answered still read as open. From 11 November a scheduled task runs the replay every morning and writes a page of proposals beside its digest. On 30 November that page gained a section on my skills shown without their descriptions, a change with an entry of its own.
The problem
My sessions and I both make forecasts that are sealed when they are made and graded later against what happened. Grading needs what each session said and asked me and what I answered, and all of that sat in the transcripts, so the session doing the grading had it only when I passed it on. A day here writes about 770 MB of transcripts, most of it tool output, which is too much to hand a model whole. Anthropic's engineering post of 6 November, "The components of agent memory", describes dreaming: an offline pass over past transcripts that corrects wrong notes and keeps the context every session starts with small. The research preview of dreaming, Dreams, works on sessions of Anthropic's Managed Agents service and cannot read the transcripts Claude Code keeps on my machine.
The solution
A script now reads a day of my Claude Code transcripts, with no model and no network, and writes two files to a dated folder outside every repository, since they hold my words. The first lists each event with the file and line it came from: what I said, what each session asked me and my answer, the new sessions proposed or started, the tool calls refused, and Claude's sentences that read as a forecast or a recommendation, found by pattern and never judged. The second is a digest of the same for a reader: my words by session, the questions still waiting for my answer, the candidate sentences, the new sessions and the refusals grouped by reason. Most of a transcript is tool output, so the script parses only the lines that hold one of five markers, and a day's 770 MB takes about 4 seconds. From 11 November a scheduled task runs it every morning and writes one page of proposals beside the digest, and it changes nothing else.
Where my words sit in a transcript, and the two kinds a reader of ordinary messages misses. A drawn figure, not a screenshot.
How to add it
Find your transcripts: Claude Code writes one JSONL file per session, with the session's id as its name, in a folder under ~/.claude/projects (on Windows, %USERPROFILE%\.claude\projects) named for the directory the session ran in.
Before you trust a reader of ordinary messages, count the ones you typed while a session was working, which a transcript keeps as queued_command attachments.
Python 3, saved as queued.py and run with python queued.py
"""For each Claude Code session changed in the last day, count
the messages you sent it and the ones you typed while it was
working, which its transcript keeps as queued_command attachments."""
import json
import time
from pathlib import Path
def human(d):
origin = d.get("origin")
return isinstance(origin, dict) and origin.get("kind") == "human"
since = time.time() - 24 * 3600
projects = Path.home() / ".claude" / "projects"
for path in sorted(projects.glob("*/*.jsonl")):
if path.stat().st_mtime < since:
continue
sent = queued = 0
with open(path, encoding="utf-8", errors="replace") as f:
for line in f:
if '"kind":"human"' not in line:
continue # most lines are tool output: not parsed
try:
d = json.loads(line)
except ValueError:
continue
if d.get("isSidechain") or d.get("isMeta"):
continue
a = d.get("attachment")
if d.get("type") == "user" and human(d):
sent += 1
elif (isinstance(a, dict) and human(a)
and a.get("type") == "queued_command"):
queued += 1
if sent or queued:
print(f"{path.stem}: sent {sent}, typed while it worked {queued}")
Write the replay in code, with no model: parse only the lines that hold a marker of what you want, give each event its transcript's file and line so it can be checked, and write the output outside every repository, since it holds your own words.
Link a question to its answer by the id of the tool call that asked it, since an answer picked in the question's own dialog comes back as that call's result.
Count the same words sent twice as two messages, and when a moved session leaves an older copy of its transcript, read the newest copy first and count each event once.
Detailed notes: Replaying a day of sessions from their transcripts
What happened
On 10 November I asked whether the reports that AI benefits from "sleep" had anything to do with my own work. My sessions and I both make forecasts that are sealed when they are made and graded later, and grading needs what each session said and asked me and what I answered. All of that sat in the transcripts Claude Code writes, and the session doing the grading had it only when I passed it on.
The main report was Anthropic's engineering post of 6 November, The components of agent memory. It describes an agent's memory in four layers: the transcripts, notes, structured pages, and the context injected into every session. Dreaming, in its terms, is offline reflection over the transcripts that corrects wrong notes, merges duplicates, adds index pages and keeps the injected layer small. The risks it names apply to my memory folder too: wrong notes that later sessions trust, notes that go stale, bloat, long instruction files that sessions follow less closely (a session in my main folder starts with about 60 KB of injected rules and notes), and two writers overwriting one page.
Anthropic's research preview of dreaming, Dreams, takes a memory store and up to 100 sessions of its Managed Agents service and writes a new store without changing the input. It cannot read the transcripts Claude Code keeps on my machine, and those are large: in one day 89 of them changed, about 770 MB, most of it tool output and request records. So the first step was a replay in code, with no model and nothing that changes a note.
What changed
The script, night.py in my hooks repository, takes a window of time, the last 24 hours unless told otherwise, and reads each transcript under ~/.claude/projects that changed in it. It writes a folder named for the window under ~/.claude/night and refuses an output folder inside a git repository, because what it writes holds my words. It sends nothing over the network, and the only thing it writes is that folder, with two files in it:
events.jsonl, one event a line, each with its transcript's path and line number, so any event can be checked against the line it came from. The events are what I said; each end-of-turn box, with its recap, its question and the button it put first; each question a session asked me, with the answer its dialog returned; each new session proposed or started; and each tool call refused, or prompt I answered by hand. Claude's sentences that read as a forecast or a recommendation are listed too, as candidates found by pattern and never judged.
digest.md, the same for a reader: my words by session, the questions still waiting for my answer, the candidate sentences, the new sessions, and the refusals grouped by tool and reason.
Every text taken from a message, a tool's input or a tool's result goes through a redaction first, which covers the key formats my setup knows and the secret values in its environment. The identifiers beside it, such as the transcript's path, the session's id and a tool's name, are written as the transcript has them. A subagent's own turns, compaction summaries and messages from other sessions are not my words, and the replay leaves them out.
What the transcripts showed
The transcript keeps a message I type while a session is working as an attachment of type queued_command. In the 80 newest transcripts, 74 of the 79 messages I typed that way were kept only there, so a reader of ordinary messages alone would miss them. Each one counts on its own. None was found stored a second time as an ordinary message, since no pair with the same words came within two minutes of each other in 1,462 transcripts, and the 15 pairs of the same words that did turn up, 6 to 63 minutes apart, were me sending them twice.
The replay also takes out the system reminders injected into a message, which 1,154 of my 5,957 typed messages held.
A transcript moves with its session's folder, and a move can leave an older copy behind: 14 of 1,461 transcripts had one. The replay reads the newest copy first, and an event that a copy holds again counts once. After a move an event's path can go stale, but the session's id, which is the file's name, finds the transcript again.
Most of the bytes are tool output and request records, so a line is parsed only when it holds one of five markers. The last 24 hours, 89 transcripts and 770 MB, took 4 seconds, and a week, 852 transcripts and 4.6 GB, took 24.
How it was checked
Its selftest runs 21 cases on made-up transcripts in a temporary folder. Before the review, the session that built it broke eight pieces of the script one at a time in a copy, and the selftest failed each time on that piece's own check.
The other coding agent then reviewed it in one round and raised seven findings, none of them a blocker. The session sorted them by how they can happen, as my rule for review findings asks:
Two happened on real transcripts, and both were fixed. A question I had answered in its own dialog read as open until I next said something, which was true of 24 of a week's 112 questions. Its answer is now linked to it by the id of the call that asked it, and with that link the count fell to none. The other was a rule that merged a queued message and a typed one with the same words within 30 minutes. It erased messages I had really sent twice, and no message in 1,462 transcripts was stored twice that way, so the rule is gone.
Three could happen in an ordinary run and went on record: a moved transcript's copy holding a new session or a question without its result, a new session's outcome read from after the window closed, and a rerun of the same minute's window failing between its two writes.
Two needed an input nothing produces and went on record: identifiers written without redaction, which cannot hold a secret, and a link planted under the output folder.
The selftest gained the four cases the round showed missing. Seven pieces, the two fixes among them, were then taken out one at a time, and each time their check failed. On the real transcripts of the last day, 14 sampled events of every kind matched the lines they cite, and parsing every line found the same 293 events that the markers found.
What to copy
If you want your sessions to learn from earlier days, the transcripts are already on your disk, and a script can pull out what matters in seconds before any model reads it. Look first at how your tool stores a message typed while a session works, since that decides whether a count of your own words is right. Link an answer to its question by the call's id: taking the next message as the answer is what made answered questions look open here. Keep a repeated message as two until you have found a real duplicate. The script in the steps counts, for each session of the last day, the messages you sent and the ones typed while it worked.
Still open
Nothing runs the replay on a schedule yet. A nightly step that reads the digest and writes proposals beside it, such as fixes to my notes, rows for the graded record and the questions still open, may follow, and this entry will get a dated section if it lands. That step would write proposals and change no note itself. Trimming the memory index that every session reads is a separate step.
10 November, evening: the nightly step
The nightly step in "Still open" above came the same evening. It is a scheduled task in the desktop app, set for 04:30 every day, and the app's fixed offset for it starts it at 04:37. The session that made it ran in bypass mode, so the task was saved in bypass, and I switched it to the default mode in the app's task editor, so it runs on three exact allow rules.
Each morning it runs the replay, reads the digest and writes one page beside it, in five sections: what waits on me, the prompts and refusals to fix in code, Claude's calls and what followed each (taken, declined, or no word from me yet), possible memory notes, and the night's numbers. The calls are candidates for the graded record. Each possible note is checked first against my memory index files. It only proposes: it changes no note, row or file of mine.
Three runs started by hand each found something the one before could not:
The first could not read the digest. The script that checks a task's prompt against its allow rules had taken a path with a placeholder in it, the folder the replay names when it runs, as inside the task's own folder, where a read needs no rule. It now reports such a path as unknown.
The second, with exact rules for both, read the digest but had its write of the page refused. Claude Code 2.1.321 checks a write into a .claude folder before it reads any allow rule, and only a person can approve one. The same goes for .git and .vscode folders and some sensitive file names, and the checker now reports those as a gap no rule covers. So the replay's default output moved out of the .claude folder to one inside the task's own working folder, which is no repository. That run had also marked itself done in its run record in the same step as the refused write, so the prompt now waits for the write's result before it closes the record.
The third wrote the page, 43 lines, with nothing refused.
My scheduled tasks are also kept in git, in a registry that writes them into the app. It refused the new task at first: the app had stored a field on it that the registry does not carry, useWorktree set to false. The app reads that value the same as no setting, and now the registry does too. The other coding agent reviewed that change and found no defect, and one older limit went on record: if the field later turned to true, nothing would notice.
The first page held a few questions still waiting on me and 13 refusals by my house gate for one reason, and it counted by tool the prompts I had answered by hand. It listed four of Claude's calls, two taken and two with no word from me yet, and one possible memory note beside two more that my notes already held.
If you schedule a model over such a digest, have it propose and change nothing, and start it by hand a few times before you trust the schedule. Keep its output out of any .claude folder, since Claude Code asks a person before any write there, whatever the allow rules say.
30 November: the skill listing
On 30 November the replay began reading the full skill listing each session gets, and the morning page gained a section that names any skill of mine a session saw by name alone, without its description. That change, and the budget behind it, has an entry of its own.
Scheduled runs no longer wait on a prompt nobody sees
One of my scheduled tasks sat for three days on a permission prompt nobody saw, after its run typed a command no rule allowed. A hook now reads the run's transcript, and when the schedule started the run and nobody has typed into it since, it denies the prompt at once with a reason the run can act on. Every other session still gets the prompt.
The problem
My scheduled tasks run in the Claude desktop app with nobody watching. One run typed a command that no allow rule covered, a PowerShell read of its own saved tool output piped into a ForEach-Object script block, although its prompt said to read files with the file tools. It sat on a permission prompt that nobody saw for three days, until a readiness check found it on 5 November. I had reworded every task's prompt on 21 October, and that had not stopped runs from improvising.
The solution
A Claude Code hook now answers the prompt when nobody is there to. It runs on the PermissionRequest event, which fires only when a prompt is about to show, so it has no rules of its own to match. It reads the session's transcript, and when the latest turn from a person or a schedule came from the schedule, it denies the call with a reason: use only the commands the task's prompt names and the file tools, and name the denied call in the run's report. A person typing into the run, and every ordinary session, still get the prompt, and an error in the hook prints nothing, so the prompt shows. In a live test with a one-time scheduled task the call was denied at once, and the run finished in 18 seconds.
How to add it
Add a PermissionRequest hook in Claude Code that reads the session's transcript, and when the latest turn from a person or a schedule came from the schedule, denies the call with a reason the run can act on.
Python, saved as ~/.claude/hooks/unattended.py: a hook in the same shape as mine
"""A PermissionRequest hook: when a scheduled run is about
to show a prompt nobody will see, deny it with a reason."""
import json
import sys
REASON = ("This is an unattended scheduled run, so nobody is "
"here to answer a prompt. Use only the commands your "
"task's prompt names, read and search files with Read "
"and Grep, write with Write and Edit, and name this "
"denied call in your report.")
def unattended(path):
# The latest turn from a person or a schedule decides.
last = None
with open(path, encoding="utf-8", errors="replace") as f:
for line in f:
if '"turnOrigin"' not in line:
continue
try:
origin = json.loads(line).get("turnOrigin")
except (ValueError, AttributeError):
continue
if origin in ("human", "scheduled"):
last = origin
return last == "scheduled"
try:
event = json.load(sys.stdin)
if unattended(event["transcript_path"]):
print(json.dumps({"hookSpecificOutput": {
"hookEventName": "PermissionRequest",
"decision": {"behavior": "deny", "message": REASON},
}}))
except Exception:
pass # print nothing, so the prompt shows as usual
~/.claude/settings.json, with your own user folder in place of you
Before you turn it on, feed it a made-up transcript: a scheduled run should get the deny, and the same run after a person types into it should get nothing.
Git Bash: a made-up scheduled run, which prints the deny, then a person typing into it, which prints nothing
Test it live with a one-time scheduled task in the default permission mode. A task created from a session in bypass mode is saved in bypass and never prompts, so change its mode in the app's task editor first.
Make the test command one with a script block, such as a file read piped into ForEach-Object, because Claude Code 2.1.309 runs a pipeline like Get-Item piped to Select-Object as read-only and it never reaches the hook.
Detailed notes: Scheduled runs no longer wait on a prompt nobody sees
What happened
My scheduled tasks run in the Claude desktop app with nobody watching, each from a prompt that names the commands its run may type. I reworded every task's prompt on 21 October, and that had not stopped runs from improvising. One run wanted to read its own saved tool output and typed a PowerShell command for it, a file read piped into a ForEach-Object script block, although its prompt said to read files with the file tools. No allow rule covered the command, so Claude Code put up a permission prompt, and in an unattended run nobody sees one. The run sat on it for three days, until a readiness check found it on 5 November.
What changed
Claude Code runs a hook on its PermissionRequest event only when a permission prompt is about to show. A hook there needs no rules of its own to match: whatever would have prompted reaches it, and nothing else does. Mine, unattended_gate.py in my hooks repository, reads the session's transcript, where turns carry a turnOrigin, and finds the latest one that is scheduled or human. When that turn is scheduled, the run is on its own, and the hook prints a deny:
The message tells the run to use only the commands its prompt names and the Read, Grep, Write and Edit tools, and to name the denied call in its report. Like the house gate, it refuses with a reason the session can act on. When I type into a scheduled run, the latest turn is mine and the prompt shows as usual, and an ordinary session has no scheduled turn at all, so it always gets the prompt. On any error the hook prints nothing, which also leaves the prompt to show.
The Claude Code docs say that when a host answers permissions through a canUseTool callback, as the desktop app does, PermissionRequest hooks run alongside it and whichever decides first applies.
How it was checked
The hook's selftest has 24 cases, and each of five deliberate breaks in its code was caught. I also ran its reader over 1,185 real transcripts from ten days: every current scheduled run read as unattended and every other session did not, and the slowest read took 0.24 seconds, on a 146 MB file.
Then I tried it live, with a one-time scheduled task in the default permission mode. Its call was denied at once, and the run finished in 18 seconds. Two traps came up on the way, and both are worth knowing before you try it:
A scheduled task created from a session in bypass mode is saved in bypass mode. It never prompts, so it cannot test the hook. The app's task editor changes the mode.
Claude Code 2.1.309 reads a pipeline like Get-Item ... | Select-Object Name, Length as read-only and runs it with no prompt. Only a script block, or a cmdlet it cannot prove read-only, reaches the hook, so the test command needs one.
What to copy
If you schedule Claude Code runs that nobody watches, a run can stall on a prompt you never see, and rewording the prompt did not stop that here. The sample in the steps is a shorter version of my hook. Make its refusal say what the run should do instead, and let any error in it fall back to the prompt.
Keeping private files out of reviews by the other agent
One of my projects keeps files that must never leave my machine, and the other coding agent's review rounds read them anyway: the project's instructions for that agent told it to follow the usual reading order, and that order opens a status page full of private details. A repository now lists those paths once. A review request from it says they are out of bounds and runs in a throwaway copy of the branch that does not hold them, and afterwards a script reads every command the reviewer ran for any that mentioned one.
The problem
Before some branches land, a script sends them to a second coding agent for review in a read-only sandbox, which keeps the agent from writing but lets it read any file. In a project whose files carry private details, three rounds in a row opened its status page and its session note in their second command, because the instructions file the agent loads on start told it to follow the project's reading order. The session had moved the data folder out first and searched the agent's log afterwards for the data folders alone, so it called all three rounds clean. Later sessions walled the folder off by hand with scripts of their own, and one of those was cut off before its cleanup ran and left the documents in a holding folder. A week later private names and their figures reached the agent from the branch itself, through a commit message the request quoted, comments in the changed code and a notes file in the diff.
The solution
A repository now lists its private paths once, in its own git config, and every worktree reads the same list. Each review request from it opens on a paragraph that puts those paths, every commit message and every other checkout out of bounds, lists the commits by id alone, and describes the change only in the session's own words. A branch whose diff changes a listed file is refused, since a folder can be emptied but its history cannot. The script runs the agent in a throwaway worktree of the branch with the listed files taken out and removes it whatever the run's exit, so no file in a real checkout ever moves. When the reply is back, the script reads every command the agent ran from the agent's own log and names any that mentioned a listed path or another checkout.
How to add it
List the paths in your repository that must never reach another model: data folders, status pages, notes, and configuration that names private details.
Name them once in the repository's own git config, so every worktree reads the same list.
In the repository: the setting, with your own paths in place of these
Start every review request with a paragraph that says what is out of bounds, quote no commit message in it, and refuse a branch whose diff changes a listed file.
Run the reviewer in a throwaway worktree of the commit, with the listed files deleted and marked skip-worktree so that git status there reads clean, and remove it whatever the run's exit.
After each reply, read the reviewer's own log of the commands it ran and flag any that mentioned a listed path or another checkout, then take each piece of the change out in turn to watch its test fail.
Detailed notes: Keeping private files out of reviews by the other agent
What happened
Before some branches land in my repositories, the other coding agent, Codex, reviews them first. A script drafts the request, sends it to Codex's command line in a read-only sandbox and brings the reply back. The sandbox keeps Codex from writing anything, but it can still read any file, and a reviewer opens whatever it wants to check.
One of my projects keeps files that must never leave my machine: folders of captured data, a status page a script builds from them, a note each session starts from, and notes and configuration that name the private details the project works with. Its instructions file for Codex, which Codex loads when it starts in a folder, told it to read the project's main instructions in full and follow the reading order they give, and that order opens the session note and then the status page. On 26 and 27 October three review rounds in a row read both in their second command. The session had moved the data folder out of the worktree before each send, and afterwards it searched Codex's log for the data folders alone, so it called all three rounds clean. It found the reads at the third round, with a wider search.
After that, the session moved every private document out of the folder with a script and put them back after the reply, and later sessions did the same with scripts of their own. One test run of such a script was piped into a command that stops reading after a few lines, so the script was cut off before its cleanup, and the documents sat in the holding folder until they were put back by hand. On 2 November private details reached Codex from the branch itself: the request quoted a commit message that named two of them beside their figures, comments in the changed code named them too, and Codex's first command printed the diff of a notes file.
What changed
The skill that drafts and sends the review reads a list of private paths from the repository's own git config, set once and read by every worktree. Each value is a file, or a folder ending in a slash, and a repository that lists nothing works as before. Where something is listed:
The request opens, below its first line, on a paragraph that puts every listed path, every commit message and everything outside the folder it runs in out of bounds, the main checkout and every other worktree included, whatever the repository's instructions or a reading order say. It names no checkout's folder and lists the commits by their ids alone. The account of the change comes only from the session's own words, which the draft now requires.
A branch whose diff changes a listed file is refused before anything is sent. Taking files out of a folder does not take lines out of the history, so those lines are committed after the round.
A review, and a question sent outside one, run Codex in a throwaway worktree made for that run in the temp folder, detached at the commit. Every tracked file under a listed path is deleted there and marked skip-worktree in that worktree's own index, so git status there reads clean, and the worktree is removed whatever the run's exit. No file in a real checkout moves, so a run that is killed leaves behind at most one throwaway checkout, and every document stays where it was.
When the reply is back, the script reads Codex's own log of the run, takes the strings of every command in it, and names each one that mentioned a listed path or another checkout, with the count, in the round's record.
The project's instructions file for Codex now says that a review or a question from the script reads only what the request names. On that project the throwaway checkout takes about five seconds to make, holds the code and the instructions file and nothing else, and is gone a second and a half after the run. Thirteen new checks in the skill's own test cover the change, and each of its 23 pieces was taken out in turn to watch its check fail.
What to copy
The pattern fits any setup that sends code to a second model for review. Keep a list of what must stay home and put it at the top of every request. Run the reviewer in a copy that does not hold those files, refuse a change whose diff carries them, and read the reviewer's own record of what it ran. The throwaway copy is plain git: git worktree add --detach at the commit, the listed files marked with git update-index --skip-worktree and deleted, and git worktree remove --force when the run ends.
Still open
A comment, a test fixture or a string in the code under review still goes with the diff, so a branch that goes to review keeps private details out of its code and uses made-up figures in its fixtures.
A skill run under Codex in its writable sandbox is not walled off, since its folder is the session's own choice.
A request pasted by hand runs wherever its thread runs, with nothing taken out, and the skill says so when it puts one on the clipboard.
Clearing copied data out of worktrees the app reuses and deletes
The census of 31 October found most of the space it counted in copies of one project's data inside worktrees. While a session built the step that clears them, the app's own log showed that the app hands an idle worktree to the next session with every ignored file still in it, and deletes the spare ones for good with whatever was kept inside. Each copied file is now matched by hash against the main checkout before anything goes, and the daily run was allowed to clear only after six review rounds by the other coding agent, the last with no findings. On 15 November I added a close-out check for the other files Git ignores.
The problem
To test a change, my sessions copy a project's private data into their worktrees, the separate checkouts they each work in, and the first census found about 128 GB in them, nearly all of it in seven such copies. The desktop app keeps these worktrees in a pool: when a session is archived it takes its worktree back if git calls it clean, and git does not count ignored folders such as the copies. It hands an idle worktree to the next new session in the project with every ignored file still in it, and deletes the idle ones beyond the two or three it keeps, for good. On 1 November it took back 29, handed on 3 and deleted 19, and files that one session had set aside in its own worktree to keep went with one of them. Another deletion stopped partway because a file inside was open, and left a folder of about 23 GB that git no longer listed.
The solution
The census skill gained a step that clears these copies. Each copied file is matched by hash against the main checkout: what the main checkout holds goes to the Recycle Bin one folder at a time, each folder proved again right before it goes, and what it lacks moves into the main checkout inside the handoff my sessions run before they write shared data. A session clears its own copy when it closes out, and a run every morning at 05:20 clears the worktrees whose sessions are all archived. The run was allowed to clear on its own only after six review rounds by the other coding agent, with each fix and guard given a test that fails when it is taken out, 77 in all, and the sixth round found nothing. The rounds kept finding narrower races, such as a worktree swapped for a link to another folder partway through a run, or the app handing a worktree to a new session during the 22 seconds the step spends reading the app's records.
How to add it
Before you leave anything you want to keep in a worktree, find out what your tool does with the worktree once its session ends. The Claude desktop app on Windows logs each worktree it takes back, hands on or deletes.
PowerShell, with the Claude desktop app on Windows: what its pool did with each worktree
Before anything deletes a copy, hash each of its files and match it against the original, and move every file the original lacks to a place the tool never deletes, checking each by hash after the move.
Send the rest to the Recycle Bin a folder at a time, and check each folder again right before it goes: its files unchanged, the original's copy hashed afresh, room left in the bin, and no link or junction on the way.
Have another agent review the clearing code before it runs unattended, and take each fix out in turn to watch its test fail.
Detailed notes: Clearing copied data out of worktrees the app reuses and deletes
What happened
The first census of what my sessions leave on disk, on 31 October, found about 128 GB in worktrees, nearly all of it in seven copies of one project's private data. The census entry tells how those copies come to be made. The weekly census first ran on 1 November, report only, and that day I asked whether it could free the space as well, and run every day if it did. I picked three changes: a session clears its own copy when it closes out, the census clears the copies in worktrees whose sessions are all archived, and the report runs every day.
One session had cleared its own copy that day, on my word, and its close-out became the recipe. Every file was hashed against the main checkout, about 10 GB went to the Recycle Bin, and the 2,787 files whose bytes were found nowhere else moved into a folder inside the same worktree, to keep.
What the app does with a worktree
While the step was being built and reviewed, the app's own log showed that the desktop app keeps the worktrees it makes in a pool. When a session is archived, the app takes its worktree back if git calls it clean, and git does not count ignored folders, so a worktree holding gigabytes of copied data still counts as clean. An idle worktree goes to the next new session in the same project with every ignored file still in it, which is how three of the seven copies had reached sessions that never made them. Beyond the two or three idle worktrees it keeps for each project, the app deletes the rest for good, with everything inside. On 1 November it took back 29 worktrees, handed on 3 and deleted 19.
One of the 19 belonged to the session whose close-out had become the recipe. It archived itself that evening, and an hour and a quarter later the app deleted its worktree, with the 2,787 kept files and the session's scratch folder inside.
Another deletion did not finish. The app moves a worktree aside before it deletes it in the background, and that night the move failed because a file inside was open: the clearing step's first plan was reading that very worktree. The app fell back to git's forced removal, which stopped partway. By then it had deleted the folder's link to git and 2,316 of the copied files for good, and it left about 23 GB in a folder that git no longer listed. The next day, on my word, the 2,638 files in it whose bytes the main checkout lacked went into the main checkout with its scratch folder, and the rest, about 22.5 GB, went to the Recycle Bin.
What changed
The census skill gained a clearing step, and the close-out a session runs before it is archived gained an item that calls it.
Every file of the copy is hashed and matched against the main checkout: the same bytes at the same path, the same bytes at another path there, other bytes at that path, or bytes found nowhere. The main checkout's hashes are cached to plan a run, and the cache only plans: nothing goes on its word.
Files whose bytes the main checkout lacks, and files that cannot be read, are keepers. In the recipe they stayed inside the worktree, which is what the app deletes. Now they move into the main checkout, to a folder that no stage of the project reads, and each is checked by hash after the move. The move happens inside the handoff my sessions run before they write shared data (the handoff entry has how it works), so it never lands while another session is writing there.
Everything else goes to the Recycle Bin one folder at a time, and a folder goes only once it has been proved again right before it: every file in it hashed again and unchanged, the main checkout's matching file hashed afresh and reached with no link on the way, the folder's listing as planned, room in the bin with a gigabyte to spare, the check for other writers still clear, the app's record of who holds the worktree as it was at the start, and, last, no link or junction at the worktree or above it. The call that sends it runs in a child process that is stopped after five minutes, so a warning that nobody is there to answer cannot hold an unattended run.
A session clears its own copy at close-out, and only in a worktree made for that session and used by no other live session. A run every morning at 05:20 clears the copies of 100 MB or more in worktrees whose sessions are all archived and none pinned or starred, and leaves a worktree that no session record names for me to decide.
Anything it cannot be sure of stops it: a folder git does not list, a record it cannot read, a hold on the worktree it cannot account for, a second clearing run, a check for other writers that is not plainly clear, or a bin that would delete for good.
I chose to clear worktrees sitting idle in the app's pool as well, since clearing one first spares the next session a stale copy, and accepted the race that comes with it.
Six review rounds
The other coding agent reviewed the clearing code before the daily run was allowed to clear anything: six rounds, each at its highest effort and each on my pick. The first round found seven serious problems and five smaller ones, among them the hash cache taken as proof and a worktree that was itself a junction (the Windows link from one folder to another). Each finding was fixed with a test, and each fix was then taken out on its own to watch its test fail. The later rounds kept finding narrower cases of the same races.
The second round found that the check for other writers could go stale during the minutes the hashing takes. It now runs again before the keepers move and right before each folder goes.
In the third, a keeper's move could follow a junction, into the main checkout's own data or back into a worktree the app was about to delete. Every step at both ends of each move is now read again right before it.
The fourth found that the worktree itself could be swapped for a junction between two keepers' moves, since its links were checked only once, before the first. The worktree and the folders above it are now read again before every move and before every folder goes to the bin.
It also found that the app could hand the worktree to a new session during the 22 seconds the step spends reading the app's session records, and the step noted who held the worktree only after that read, so a handover during it would have passed as the starting state. Who holds it is now read on both sides of the read, and each holder is checked against the records.
In the fifth, a file in the main checkout offered as proof could be a junction back into the very folder it was proving, so its fresh hash would be that folder's own bytes. The proof now refuses a file reached through a link.
The sixth round found nothing that would make it hold the unattended run. By then the step had 82 checks, and 77 pieces of it, every fix and every guard, had each been taken out one at a time with its check failing. On 2 November the scheduled run moved to every morning at 05:20, with clearing on.
6 November: a branch now gets three review rounds at most, and a fourth is my decision. Each finding is sorted by whether it can happen before it is fixed (A review finding counts where it can happen has the rule).
What to copy
If your coding tool makes worktrees for you, find out what it does with one after its session ends, before you leave anything in it. The Claude desktop app on Windows logs each worktree it takes back, hands on or deletes, and the command in the first step lists them. Count a worktree as gone at archive, and first move anything you want to keep to a place the tool never deletes.
To clear a copy of data, prove each file before it goes. Hash every file against the original, keep whatever the original lacks, and send the rest to the Recycle Bin a folder at a time, checking each folder again right before it goes, since a run that takes minutes leaves time for things to change under it. On Windows, check for links and junctions last, because a folder swapped for a junction passes every check made of its own files. When a review keeps finding narrower cases of one race, take each fix out in turn and watch its test fail before you let the run go unattended.
Still open
If the app hands an archived worktree to a new session while the daily run is clearing it, that session finds the folders cleared before then gone. Only an agreement with the app's pool about which worktrees it may hand on would close that.
Each check is made right before its step, and a short window between the two remains. The gigabyte kept free in the bin is not reserved: if another program deletes more than that in between, Windows can drop the bin's oldest items, which need not be these copies.
The Recycle Bin gives the space back only when I empty it.
15 November: files outside the copied stores
A finished checkout still held a whole Python environment. I added a file check before archive to catch environments and scratch results as well.
A faster financial reader led to a review of repeated downloads and data lookups. I now have a skill that asks for a measured saving and the checks that make reuse safe. The first fixes are merged, and a replay of saved pages passed the capture write guard.
The problem
A previous change made my financial reader much faster by reusing work it had already checked. I wanted to know whether the same idea would help elsewhere. Some parts of the workflow already skipped unchanged inputs. Others removed duplicates only after paying to fetch them, so a tidy output hid the repeated work.
The solution
The efficiency-review skill follows one input through the workflow and counts its expensive operations. Each finding names what can be reused, when it becomes stale and how to check the result. A small offline test can prove that a request repeats, but a production speed claim still needs a measured run. The review also records where the existing workflow is already efficient. The first fixes now reuse successful downloads and skip completed work while keeping explicit refreshes and retries available.
How to add it
Pick one workflow and find where it downloads, parses or sends material to a model.
Use saved inputs or a simulated service to count repeated operations before adding a cache.
State what makes a saved result reusable and which changes or failures require a fresh attempt.
Compare the output before and after the fix, including completeness and source references, and measure the saving on the same inputs.
Detailed notes: Checking which work an agent can reuse
31 October: where the repeated work was
A previous change made my financial reader much faster by reusing work it had already checked. I asked for the same kind of review of document capture and an outside data service. Some parts already had useful caches. Others removed duplicates only after downloading them, when the network cost had already been paid.
The review used saved calls and small tests with a simulated browser. One test showed page images being downloaded again as the viewer scrolled over pages it had already seen. Another showed that running the same document harvest twice added the same job twice. These tests reproduced the repetition; they did not measure a faster production run.
The review skill
I now have an efficiency-review skill for Claude and Codex. It follows an input through the workflow and asks where the expensive work happens. It counts requests and separates the data provider's allowance from the model's tokens. A cache that saves one may leave the other unchanged.
Before recommending reuse, the reviewer has to say what makes two inputs the same and what would make a saved result stale. A changed document or parser may need a fresh read. A failed download must still be retried. Two identical slide images can be different numbered pages, so removing one can leave an incomplete document.
Use it in your own setup
Ask for an efficiency review of one workflow and give the agent its entrypoint and recent logs.
Have it reproduce repeated work with saved inputs or a simulated service. Keep private material and live writes out of the test.
Require each finding to name the repeated operation, its cost and the conditions under which its result can be reused.
For a fix, compare the old and new output on unchanged inputs, then change an input and make a request fail. The new path must still refresh or retry when needed.
What remained open on 31 October
The skill is installed. The capture changes are recommendations from the review and still need implementation and checks on the affected paths. One part of the workflow had little repetition to remove; the report says that too.
1 November: checking the fixes
The first fixes are now merged. The viewer reuses successful image downloads within one capture attempt. Identical document jobs in one batch are run once, and completed captures can be skipped with an explicit refresh for changed material. Failed or interrupted attempts stay eligible for retry.
Review found cases the first tests missed: two offers writing to one destination, an interrupted refresh, and a damaged page that still contained a valid-looking heading. Each fix gained a regression test, checked again with that fix removed. I also had the saved pages replayed through the capture write guard on an independent copy. The original files and retained evidence were checked by hash before and after that copy was removed. These checks passed; a live performance comparison is still open.
A session that only hashed a script held another session's landing for 79 minutes, because the check before a shared write matched the script's name anywhere in a shell's command line. The check now reads that line command by command and sets a name aside only where a reader reads it. The other coding agent reviewed it for security three times. Most holes in the second review were in exceptions I had added for false alarms, so the version now live keeps only exceptions on plain words and counts a writer when it is unsure.
The problem
Before a session here writes shared data, or lands a branch in the project that holds it, a check looks for other writers: it reads the command line of every process on the machine for the names of the scripts that write. On Windows, Claude Code's Bash tool runs each command as bash -c with the whole command in that line, so a command that only reads a script shows its name just as one that runs it does. On 29 October a session landing its own branch printed a short hash of one of those scripts along the way, the check took its shell for a writer, and another session's landing waited 79 minutes. On 23 October a background test loop that ended with the same hash had been read the same way.
The solution
The check now reads a shell's line the way the shell does, command by command, and sets a script's name aside only where a hash, a file listing or a text reader such as grep takes it and the output reaches nothing that runs code. Anything else, and any line it cannot follow, is matched as before. The other coding agent then reviewed it for security three times on 31 October, and the second review found most of its holes in exceptions I had added to clear more false alarms. The version now live keeps only exceptions on plain words, with nothing expanded, and counts a writer whenever it is unsure. Of the 23,509 past commands the old check counted as writers, 14,784 now read as no writer.
How to add it
Before you match names in process command lines, look at what your coding agent's shell puts there, since Claude Code's Bash tool on Windows carries the whole command.
Parse the line the way the shell does, set a name aside only where a hash, a listing or a text reader takes it and the output goes nowhere that runs code, and match everything else whole.
When a review keeps finding holes in exceptions you added for false alarms, take them out instead of patching them, and let the check count a writer when it is unsure.
Rebuild your past commands as process lines and measure each version of the check against them, so you know what it clears and what it still counts.
Have another agent review the check for security, reproduce each finding before you fix it, and take each piece out in turn to watch its test fail.
Detailed notes: Reading a script no longer counts as running it
What happened
Two coding agents and a dozen sessions work in the same repositories here, and a write to shared data starts only after a handoff: a check for other writers, a marker that names what the session is about to run, and a notice to the other sessions. The entry of 23 October has more on the markers. The check for other writers reads the command line of every process on the machine and looks for the names of the scripts that write, and a landing in the project that holds the data waits for the same check before it moves the main branch. For that project's store, a script's name counted anywhere in a shell's line.
That was too wide for the way Claude Code runs a shell command. On my Windows machine its Bash tool starts bash.exe with -c and a wrapper around the command, so the command shows in full in the process's line, and every subshell it forks carries the same line. A command that only reads a script carries the script's name exactly as one that runs it does. On 29 October a session landing a branch from its own worktree printed a short hash of a pipeline script along the way: md5sum in a command substitution inside an echo, in a subshell that wrote to a log. The check read that shell as a writer, and another session's landing waited 79 minutes for it. On 23 October a background test loop that ended with the same hash had been read the same way, each fork of its shell showing up in turn. Commands run through the PowerShell tool do not show this way, since its script travels in an environment variable and never appears in a process line.
What changed
The check now reads a bash or sh -c line the way the shell would. It splits the Windows command line into words as the C runtime does, takes the string after -c, and parses it: lists and pipelines, subshells and braces, if, while, until and for, quotes, command substitutions, redirections and here-documents. A string given to eval, or to another bash -c inside it, is read in its command's place. The parser keeps every word that may run a script, and the list of writers is matched against those words.
A script's name is set aside in two places only. One is where a hash or a file listing such as md5sum, wc, ls or stat takes it as an operand. The other is where a text reader takes it: cat, grep, cut, diff or echo, git commands such as status, diff, log and show, or sed when its commands only print or substitute. Even then the reader's output must reach nothing that runs code. It may pipe only into other readers, and a text reader, whose output can be the script's own code, may write to no file. A name is never set aside in a for loop's list or an assignment's value, for a reader with a variable set in front of it, or when it is handed to python, bash, source, eval, exec, xargs or a loop.
Anything else is matched whole, as before: python lines, whatever they name in their code or their arguments, apart from a few such as those of my own review and handoff tools, which name a script only in their text; a driver run with bash; cmd and PowerShell lines; and any string the parser does not follow, such as a case statement, a function, an array or an unclosed quote. Setting a name aside cannot hide a writer that runs the normal way. A pipeline writer runs as its own python process whose line names its script, or as bash running a driver, and both lines are still matched whole. A shell can start one only by naming the script where it runs, as a command, as an interpreter's operand, inside code an interpreter is given, or through a reader's output piped into one, and none of those is a place where a reader takes the name.
Three security reviews
A hole in this check would let two writers run at once, so I had Codex, the other coding agent I run, review it for security at its highest reasoning effort. It reviewed it three times on 31 October, and each review found holes to close.
The first found eleven, and a session reproduced each one in Git Bash before fixing it. Most were ways to hide a writer from the new parser: a reader's output copied onto a file through a file descriptor; readers that run a program through one of their own options, such as ripgrep's --pre or git grep's -O; printf -v, which writes into a variable; a sed program built by a substitution; an alias; $'...' strings left undecoded; a here-document line that runs on to the next. Some were older than the parser. Any line that held the handoff script's own name was skipped, which hid a shell that chained the check to the write it guarded, and 150 commands in my history had done that. A line that ran writers of two stores held only one of them.
With those fixes came the exceptions I had approved to clear more false alarms: the lines of my own tools that name a script only in their text, read-only subcommands of the pipeline's drivers, awk, sort and uniq as readers, a loop list or an assignment that waited until something used it, values tracked through the line, and any substitution that printed only digits, treated as data. The second review found thirteen more holes, most of them in those exceptions: a value tracked across a subshell, a += or a read; git's options read without knowing its subcommand; commands assumed to print only digits that can print a name; an export the waiting rule missed; an awk program kept in a variable.
So the third version took those exceptions out instead of patching them, which is what reviews of another of my skills had taught on 23 October. It no longer tracks what a variable holds or waits to see how one is used: any variable, or any substitution that prints more than digits, in the words of sed, awk, git, ripgrep, sort or uniq counts the line. What stayed were a few exceptions on plain words, such as those tools' lines and the drivers' read-only subcommands.
The third review found three real faults. One of the third version's own fixes, which read each command on its own, broke the rule that counts any script run with a writing flag when the script reached python through a pipe. A writer of a known store could still hide one whose store the check did not know. And an ordinary git process line crashed the check. The rest were lines written on purpose to fool the check, such as brace expansion, or a digit that a substitution prints landing inside a sed program. A session following my rules would not write them, but each still got a cheap catch on the safe side. The fourth version, the one now live, reads a pipeline at a time and lets those readers take only plain words, with no expansion of any kind.
What it measured
A session rebuilt every Bash command in my transcripts as the line Windows shows for it, with a wrapper the tests check byte for byte against a real one. Of the 23,509 distinct commands the old rule counted as writers, leaving out the handoff's own, 14,784 now read as no writer. Each round's fixes made the check count more: against the third version, the fourth counts 735 more commands as writers and clears none that the third counted. The cost is a short wait again behind some reads, such as a loop over script names, sed or git with a substitution in their words, or a commit message that names a script and is built with a here-document. Two searches of what the early versions cleared, for a script named where something could run it, found no writer: the hits were grep patterns, commit messages, file listings, read-only subcommands and test probes. When the first version went live, the one writer then running was found by both the old check and the new one. The skill's own tests went from 70 checks to 236, and the pieces of each version were taken out one at a time to watch a test fail, though in the last version a few overlapping catches share a test.
What to copy
If a gate of yours finds writers by matching names in process command lines, look first at what your coding agent's shell puts in that line. On Windows, Claude Code's Bash tool carries the whole command there, so a name matched anywhere catches every read of the script as well. Read the line the way the shell does, set a name aside only where it cannot run, and match whole anything you cannot follow. When a review keeps finding holes in exceptions you added for false alarms, take the exceptions out and live with the false alarms: a false hold costs a session a wait, and a missed writer can let two writes run at once. Then measure each version against your own past commands, so you know what it clears and what it still counts.
Still open
Some paths stay outside the check, and its own notes name them. A hash or a listing whose output goes to a file that a later command of the same shell runs can name a script the check does not see until that script's process starts. Git's own settings can run a program on a file, though none in that repository runs one on a script. A pipeline script that another python program imports and runs inside its own process, under no name of its file, is seen by no version of the check. The markers and notices still cover those. A python line that names a script anywhere still counts, apart from those few, because python can run a file it is given in more ways than its line shows. And a fourth review is mine to call: after three rounds that each made the check count more, what the last found beyond its three real faults were lines written to fool the check.
What my sessions and tests leave on disk, and who it belongs to
A session tidying its own temp folders found a gigabyte that another script had left there, by chance. Every week a read-only census now goes through each place my sessions and tests leave things and names an owner for each item. Its first run found 128 GB, most of it in seven copies of one project's data, and by the end of the day most of what was making the leftovers had been fixed at the source. Since 2 November it runs every morning and clears such copies too, each file matched by hash against the main checkout first; that change has an entry of its own.
The problem
Early on 31 October a session clearing up its own temp folders found 231 more that another script had left there since September, about a gigabyte. It found them by chance, because nothing on the machine looked for leftovers. My sessions each work in a separate checkout of a repository and my tests write to the temp folder, and nobody knew how much had piled up there or whose it was. Without an owner for each item nothing could safely go, and whatever made the leftovers kept on making them.
The solution
A read-only script now goes through every place my sessions and tests leave things, from the worktrees, with their copied data and the sessions that used them, to the temp folder grouped by name, and names an owner for each item. It removes nothing: each item goes to its owner, or to me where the owner cannot answer, and a scheduled task runs it every Sunday, report only. Its first run found about 128 GB in 24 worktrees, nearly all of it in seven copies of one project's data. The same day a tracked copy tool replaced the script that made those copies, and most of the tests and renders that leaked into the temp folder were fixed at the source. The first guesses about two of the largest temp groups were wrong, and matching times and watching processes corrected both.
What the first census found on 31 October, by place, and where each place's items go. A drawn figure with rounded numbers, not a screenshot.
How to add it
List every place your sessions and tests leave things, such as worktrees, scratch folders, the temp folder and any workspace a tool keeps.
Write a read-only script that sizes each place and names its owner: the session a worktree was made for and whether it is archived, or the code that names a temp folder's prefix.
Have the script remove nothing, send each item to its owner, and run it on a schedule that reports what changed since the last run.
Before you trust a guess about what made a leftover, run the suspect with TEMP, TMP and TMPDIR pointed at an empty folder, or match the leftovers' times against what was running.
Python 3.10 or later, saved as boxed_run.py: the wrapper I use
"""Run one command with TEMP, TMP and TMPDIR in a fresh folder,
list what it left there, then remove the folder.
Usage: python boxed_run.py <command> [args...]"""
import os
import subprocess
import sys
import tempfile
from pathlib import Path
box = tempfile.TemporaryDirectory(
prefix="box-", ignore_cleanup_errors=True)
env = dict(os.environ,
TEMP=box.name, TMP=box.name, TMPDIR=box.name)
windows = os.name == "nt" # a .cmd such as npm needs the shell
proc = subprocess.run(sys.argv[1:], env=env, shell=windows)
rc = proc.returncode
files = Path(box.name).rglob("*")
left = sorted(str(p.relative_to(box.name)) for p in files)
print(f"exit {rc}; left in its temp folder: {len(left)}")
for name in left[:20]:
print(" " + name)
box.cleanup()
sys.exit(rc)
Fix each producer so it cleans up after itself, with a test that checks its folder is gone, and on Windows pass --disable-extensions to any headless Chrome you start yourself.
Python: a test's temp folder, removed and then checked
import tempfile
from pathlib import Path
box = tempfile.TemporaryDirectory(ignore_cleanup_errors=True)
try:
pass # the test's work, under box.name
finally:
# cleanup() clears read-only bits, such as git's objects on
# Windows, which rmtree(ignore_errors=True) skips in silence
box.cleanup()
assert not Path(box.name).exists(), "temp folder left behind"
Detailed notes: What my sessions and tests leave on disk, and who it belongs to
What happened
Early on 31 October a session clearing up its own temp folders found 231 others beside them, about a gigabyte in all, left there since early September by a script in the same project. The script built a full copy of the project's records at every check and every report it ran, and never removed it. A side session fixed the script that morning and moved the 231 folders to the Recycle Bin on my word. They had been found by chance, since nothing on the machine looked for leftovers, so I asked whether any others would turn up on their own or whether something should look for them.
What the census reads
By the same morning the answer was a skill of its own: one read-only script that goes through every place my sessions and tests leave things and gives, for each, its size, its file count, its newest file and an owner.
The project's worktrees, the separate checkouts my sessions work in, the other coding agent's among them. For each it reads the branch, whether the main line holds it, any uncommitted change and any copy of the project's data inside it, and, from the app's own records, the sessions that worked there: the one it was made for, those that only ran there, which of them are archived, and whether I pinned or starred one to keep.
The project's own scratch folder, by subfolder, with the session whose transcript first names each one.
The workspaces where my skills are edited, with the ones their own clean-up would take.
Every session's scratchpad.
The temp folder, grouped by name, with the place in code that names each group's prefix, where there is one. A match is where to look and no more, since code that only reads a name holds it too.
It removes nothing and writes nothing but its own report. Even git status can write, since it refreshes the index, so every git command the census runs carries --no-optional-locks. It counts a link or a junction and never follows one, and its selftest checks that a throwaway tree is byte for byte as it was after a run. Each item goes to its owner: a worktree whose session is still open goes to that session, and anything whose sessions are all archived, or that has no owner on record, comes to me. A worktree with a session I pinned or starred is never touched. A scheduled task runs the census every Sunday morning, report only, compares the run with the one before, and tells me only when something new could go or a place has grown by a gigabyte or more.
What the first run found
It counted about 128 GB in 24 worktrees, 12 GB in the temp folder, 7 GB in the project's scratch folder and 6 GB in the session scratchpads. Nearly all of the worktrees' share sat in seven of them, each holding its own copy of the project's private data.
The project's scripts read their data from the checkout they run in, and my rules let a worktree copy the inputs it reads but forbid linking back to the main checkout's data, so a session that tests a change in a worktree copies the data in first. An untracked script did the copying. It had started in a session's scratchpad and been carried from worktree to worktree since, and it mirrored everything but the scratch and backup folders. About 60% of each full copy was videos that no reader in the project opens. Three of the seven copies had been made by an earlier session in the same folder: the app hands an archived session's folder to the next session, ignored files and all, and by the files' dates nobody had refreshed those three since.
About 8 GB of the temp folder was Chrome's half-finished installs of Adobe Acrobat's extension, the install packages and the folders they are unpacked in. Acrobat's installer registers its extension for every Chrome profile, so each new profile fetches it. No code named those folders. The session that wrote the first report saw that some packages were locked and had been made while my own Chrome was the only one running, guessed that my browser was looping on a failed install, and told me to restart it. A second session matched the folders' times against every shell command in both coding agents' logs instead. Each staging folder's name carries the process id of the browser that made it, and in nearly every burst of folders made within seconds of each other, no two shared an id. One browser left running, like mine, would have put the same id on all of them. Headless renders had made every one, each a fresh profile that began the install and closed before it finished. The locked files the report had counted as packages were the empty file that every running Chromium process keeps in the temp folder while it lives.
About 2 GB was the unpack folders of yt-dlp, a video downloader. Its one-file Windows build, like any one-file PyInstaller program, unpacks itself into a _MEI folder in the temp folder at each start and removes the folder when it exits normally. The first report put these down to the feed fetchers in my content project, which run yt-dlp every day. A watch over every yt-dlp process and the chain of processes that started it saw the fetchers' runs clean up after themselves, and led instead to a test in the project whose worktrees the census reads. The test checks that a download growing past its size limit gets stopped, and it stopped yt-dlp with a forced kill, which left a folder behind at every run. It runs in every check before a branch of that project lands, and 63 of the 95 folders had been made while one of those checks was running.
What changed the same day
A session of its own built a tracked copy tool. It fills a worktree with what the project's readers open and nothing else, about 10 GB in place of about 24, with the videos left out and each rule written in the code with its reason. The reader those worktrees exist to test wrote the same output from a narrowed copy as from a full one, byte for byte, once its own read times were set aside. The tool writes a marker into each copy that names the session that made it, when, from which commit, what it left out and whether it finished. The census reads the marker, so a copy made by another session, or before the current one began, shows as inherited with its maker named. A stale record in the worktree is moved aside and never deleted, since it may be the only copy.
Every headless Chrome start on my content project's main line and in two rendering skills now passes --disable-extensions. With the flag none of 15 test renders left a package, against all 15 without it, and a real card came out byte for byte the same. Playwright and Remotion pass the flag on their own, so the leaks came from scripts that start Chrome themselves, and a test on the content project's main line reads every such start and names any that arrives without the flag.
yt-dlp now gets its fetch's work folder as its temp folder, and the code removes that folder when the fetch ends, so a forced kill leaves nothing behind; the stop test checks that nothing is left.
Many of the smaller groups were folders that tests had left. Eight test suites in three of my repositories now remove their folder at the end and check that it has gone, seven of them through Python's TemporaryDirectory, and the public copy of the seat log from the cheaper-seat entry has the same fix. On Windows, shutil.rmtree with ignore_errors=True cannot delete git's read-only object files and says nothing, so two selftests that built a throwaway git repository had left a folder at every run; TemporaryDirectory's clean-up clears the read-only bit first. Another test killed a child process that held a lock file and deleted the folder without waiting for the child to exit, and on Windows a killed process's open file blocks the delete until the process has gone.
Two groups had nothing left to fix. Their code already removed them on a normal run, and they came from runs that were stopped, or from runs of my fix-checking skill, which takes a clean-up out of the code on purpose to show that a test fails without it. So that skill, the landing skill's checks and the skill editor's selftests now give every command they run a temp folder of its own, removed when the command ends, and whatever a reverted clean-up or a stopped run leaves goes with it. All three of TEMP, TMP and TMPDIR have to be set, because Python reads TMPDIR first and the Bash shell my sessions use points it at the real temp folder.
What to copy
Write one read-only script that sizes every place your sessions and tests leave things and names an owner for each, run it on a schedule, and read what changed since the last run. Have it remove nothing and send each item to whoever owns it, since a folder that looks abandoned may hold another session's only copy of something. Count files as well as folders. Something on my machine, most likely Windows' own temp clean-up, deletes each file in the temp folder about a week after it was written and leaves the folder, so 206 of those first 231 folders were already empty when they were found.
When a temp folder leaks, find what makes it before you fix anything. Run the suspect with TEMP, TMP and TMPDIR pointed at an empty folder of its own and list what it leaves. Keep that folder's path short: two of my selftests went past Windows' 260-character path limit when it sat deep in a session's scratchpad. For a folder no code names, match its times against what was running, or watch the processes, and read a lock as naming whoever holds a file now, which may not be whoever made it. On Windows, pass --disable-extensions to any headless Chrome you start yourself, and clean up test folders with TemporaryDirectory rather than rmtree(ignore_errors=True).
Still open
The seven copies made before the tool are still in their worktrees. Each waits on its session's word, or on mine, and the files only that copy holds are matched by hash against the main checkout before it goes.
Two templates on unmerged branches of my content project still start Chrome without the flag. Whoever lands one adds it, and the test on the main line names any start that arrives without it.
The census named four producers that are not fixed yet: three scripts in the project whose worktrees it reads, and one that sessions copy between their scratchpads. Two of their groups have passed a thousand folders each.
The weekly census has not run yet. Its first run is due on Sunday 1 November, and this entry gets a dated line when a report shows something new.
Since then
The weekly census first ran on Sunday 1 November. On 2 November it moved to every morning and gained a step that clears the copies of data in worktrees: each file is matched by hash against the main checkout, the files the main checkout lacks move into it, and the rest goes to the Recycle Bin. Building that step showed that the app hands an idle worktree to the next session with every ignored file still in it, and deletes the spare ones for good with everything inside. The step, and the six review rounds it went through before it was allowed to run unattended, are in an entry of their own.
The review gate learns which files are content and stops asking for a waiver
This site's update and resource pages are TypeScript files beside the Worker's code, so every entry I landed read as a change to the Worker, and twelve landings in two days each carried a written waiver of the other agent's review round. A repository now names its content files once in its own git config, and the two skills that read a branch's kind read them as documents.
The problem
Before a branch lands here, a script decides whether the other coding agent must review it first. Anything under the folder the Worker is built from counts as code, and so does a line that mentions sign-in, billing or an API key. This site keeps its update and resource pages as TypeScript files in that folder, with the text of each entry in an HTML fragment beside them. So every entry I wrote read as Worker code, and some read as member data because a file name or a line mentioned sessions. Twelve landings in two days each needed a waiver written by hand, and my own rule says a prompt that keeps coming is a defect to fix in code.
The solution
A repository now names its content files once, in its own git config, and every worktree reads the same value. The two scripts that decide a branch's kind read those files as documents, as they already read tests and docs, with no trigger from their paths or from the words in them. A branch that changes only those files lands on its tests, and the record says which files were read as content and that a deploy is still due. The Worker's own code beside them is still code, and a value that names the Worker's entry or its config, or a folder holding one, stops every command, so the exemption cannot swallow the Worker. The first branch under the setting was the previous entry's, which had stopped at the review gate earlier the same day.
How to add it
List the files in your repository that are writing rather than code but live where the code lives, such as a registry of entries or a folder of fragments.
Give your review gate one setting in the repository's own config that names them, a file or a folder with a trailing slash, so every worktree reads the same list.
In the repository: the setting as this site has it
Have the gate read those files as documents, outside the code paths and the word triggers, and print which files it read that way in each landing's record.
Refuse a value that names your deploy entry or its config, or a folder that holds one, and keep the reminder that content still deploys with the code.
Take each piece of the change out in turn and check that its own test fails before you trust the gate.
Detailed notes: The review gate learns which files are content and stops asking for a waiver
What happened
Before a branch lands in any of my repositories, a script reads what it changed and decides whether the other coding agent reviews it first. The review class is the work where a bug costs money or reaches a reader: a database migration, the code of a Cloudflare Worker, a paid call to a model or a search service, a scheduled write to live data, and anything that touches sign-in, billing or member data. The script reads the paths of the changed files and the changed lines for those triggers. A Worker's code is anything under the folder its wrangler config points to, and everything outside the class lands on its tests.
This site is a Worker, and its update and resource pages are TypeScript registries inside the Worker's folder, src/updates.ts and src/resources.ts, which import the entries' HTML fragments from a content folder beside it. So every branch that added an entry read as Worker code. The words in the entries did the rest: a fragment with sessions in its name, or a line that named a cookie beside a session, read as member data, and a how-to that mentioned an API key read as a paid call. On 25 and 26 October twelve landings here carried a waiver of the round, written into the landing's record by hand, and six of them had changed nothing but an entry and its registry line. The same week I had made a rule that a prompt which keeps coming in a session is a defect to fix in code, never answered by hand as routine, and a waiver written twelve times is that prompt.
What changed
A repository now names its content files once, in its own git config, beside the two settings the gate already reads there (the name of its main branch, and whether it has members at all): git config --add review-round.content-paths "src/updates.ts src/resources.ts content/". Each value is one or more paths from the repository's root, a file or a folder ending in a slash, and every worktree of the repository reads the same value, since they share its git config. The two skills that read a branch's kind, the one that lands a branch and the one that drafts the other agent's round, read those files as documents, as they already read tests, docs and lock files: out of the Worker's paths, and out of the changed lines the word triggers read. A branch that changes only them lands on its tests, and the gate's line says what it read as content, in this form: lands on its tests (no trigger in 2 files): 2 read as content, not code (review-round.content-paths): content/updates/2026-10-27-cheaper-seat.html, src/updates.ts. The landing's record carries an empty kind, and its next line still says that a deploy from main is due, as it does for Worker code, because the site serves the registries and no entry reaches a reader until the Worker is deployed again.
The setting has two limits. The Worker's entry file or its wrangler config beside the registries is still Worker code, so a branch that changes the page's own template along with an entry still reads as code and gets its round. And a value that names the wrangler config or the Worker's entry file, or a folder holding one, such as the whole source folder, stops every command of both skills and names the setting and the file. The setting is an exemption from a gate, and a careless value would take the Worker out of the review class with it.
Each piece of the change has a check that fails when the piece is reverted: the registries read as documents, the Worker's entry refused in the setting, the line naming the files, the split of several paths in one value, the folder's trailing slash, the gate's detail and the deploy line. Seven pieces were reverted one at a time, and each one's check failed; two mutations of the landing skill, its detail dropped and its deploy line turned off, failed their checks the same way. Then the branch of the previous entry, which had stopped at the review gate earlier the same day, read every gate open under the new copy. I asked the other agent for a round on it anyway. It found one wording to fix, and the branch landed on its tests.
Why the setting lives in the repository
The triggers are shared by every repository on this machine, and a path that is copy in one is code in another: a file under the source folder is a route in most of them and a list of entries in this one. Only the repository knows which of its files are writing, so the exemption is a setting of the repository rather than a pattern in the shared skill, which would have to guess for all of them. It is read from the git config so that no file in the repository has to carry it and every worktree sees the same list. And the record names the files it exempted each time, so that anyone reading a landing can see that the exemption was applied, and to what.
What to copy
If your review gate reads a repository by its paths and its words, give it one setting per repository that names the files that are content, kept in the repository's own config so that every checkout reads the same value. Have the gate read those files as documents, out of the code paths and out of the word triggers, and have it print the files it read that way in each landing's record. Refuse a value that names your deploy entry or its config, or a folder that holds one. Keep the reminder that content still ships with the code. Then take each piece of the change out in turn and watch its own test fail before you trust it.
Still open
The episodes registry, src/episodes.ts, has the same shape as the two named and is not in the setting, since the brief for the change named the two registries; one more git config command puts it in. The waiver stays for anything the setting does not name. The record's line names the files read as content each time, so a branch that slipped past as content could be found in the log.
A daily check that two sessions did not edit one file
Rules say which session owns a task. Before building a lock to enforce them, a script reads the session transcripts of the past day for a file two sessions edited within six hours, and it now runs every morning. What it reads, what it folds away, what it cannot see, and the number that would make me build.
The problem
The session rules leave one question open: are written rules enough, or do I need a lock that stops two sessions touching one thing? One reading of the logs is not an answer. I wanted the record to decide, day by day. That meant a check that runs on its own and tells me only when something is wrong.
The solution
A script reads every session's transcript and the app's own records. It lists each file that two different sessions edited within six hours, and tells a handoff from an accident. A scheduled task runs it every morning at 6:50 and sends me a note only when the count is above zero. Two such files in a week, or any lost work, is the signal to build the lock.
What the morning count reads: two unrelated sessions on one file within six hours count, a handoff does not. A drawn figure with made-up labels, not a screenshot.
How to add it
Find where your tool keeps its session transcripts and what each edit line looks like.
Write a script that lists files edited by two sessions within a window, and leave out shared notes.
Run it on a schedule, keep each day's report, and set the threshold that would make you build a lock.
Detailed notes: A daily check that two sessions did not edit one file
What happened
The entry One task, one session ends on the question the rules leave open: are rules enough, or does the machine need a lock, a hook that records which session claims a folder or a file and stops the next one? The week's logs answered it once, with three files edited by two sessions in seven days and none of them the duplicate's. A single reading could not say whether that would hold. On 25 October I asked for the read to run every day, so that the record decides when a lock gets built, and the script became a skill with a scheduled task behind it.
What it reads
Every Claude Code session keeps a transcript on disk, one line per event, under the .claude folder in the user's home, and the desktop app keeps a record of every session it shows: the title, the session that started it, and when. The script reads both. From each transcript it takes every file edit with its path and its second, and every git command that commits, merges, rebases, pushes, makes a worktree or starts a branch, placed in the folder the command names or, failing that, the transcript's project. Then it lists each file that two different sessions edited within six hours, and each folder where two sessions ran such a git command inside the window.
Two things had to be settled before the count meant anything. A session can be forked or continued, and the copy carries its parent's whole transcript, so the first seven-day count had 398 false pairs around the three real ones. Now any two transcripts that share three identical events, the same second and the same file, fold into one lineage, along with every id the app's record gives one session. And shared notes are not overlap: memory files, the notes folder that sessions leave each other, scratch folders, the calendar, the read-me and hand-over documents are left out, because two sessions writing the same notes is the setup working as meant.
Each pair is marked from the app's record of who started whom: a handoff when one session started the other, siblings when one session started both, unrelated otherwise. A handoff is the normal flow, a child landing its parent's branch, and counts for nothing. Unrelated and sibling files are the case the rules exist to prevent, and the shape the October duplicate would have taken had it reached a file. The report's first line is the signal: how many unrelated and sibling files, how many handoffs, how many folders with two sessions committing.
What changed
A scheduled task runs the scan at 6:50 every morning over the previous day with the six-hour window. It saves the day's report and one summary line, reports the first line, and sends a notification only when the count of unrelated or sibling files is above zero. It writes nothing else, reads no session's content beyond the edit paths and the commands, and judges nothing. I read the report.
The threshold, until the record says otherwise: one unrelated or sibling file in a week on a code file gets read, which two sessions and why and whether anything was lost, and said to me. Two in a week, or any that lost work, is the signal to build the lock, and the saved reports are its test data. The first one-day reading, on 25 October, found one unrelated file: my settings file, edited by three sessions in five hours, each wiring a hook. It is the one shared file to watch, and it is not code. The scheduled runs begin on 26 October.
What it cannot see
Two sessions offering one task before either edits a file, which is how the October duplicate began. The rules' check before a card is proposed covers that, and no file scan can.
Sessions of the other coding agent I run, whose transcripts live elsewhere.
Edits older than the transcripts the app keeps.
So a zero means no file was touched twice that day, and no more than that.
What to copy
Before you build a lock between your sessions, count. The transcripts are already on disk with every edit's path and time, and a short script answers whether two sessions touched one file in a day. Fold forks and continuations first, or every copied transcript reads as a collision, and leave shared notes out. Then write down the number that would make you build, and read the line each morning.
Still open
Whether the count ever reaches two in a week. If it does, the lock gets built, and this entry and the one above get a dated line.
Some folders showed twice in the sidebar, once as my group and once under Sessions. A script now files each session into the group named for its folder, and a hook runs it after every unarchive. Building it turned up two traps: a move into a group unpins a session, and the sync between my accounts took every move as mine.
The problem
The app's sidebar showed some of my project folders twice: once as the group I had made, and once under Sessions for the sessions nobody had filed. Sessions that came back from the archive always came back in no group. It made the sidebar hard to read with many sessions open.
The solution
A script reads the app's own files and finds, for each unfiled session, the one group named for its folder. A session makes the move with the app's sidebar tool, after checking the live state right before it. A hook after every unarchive files the restored session the same way. Pinned sessions and scheduled runs are left alone, because the first run showed that moving a pinned session removes its pin.
Before: one folder, two headers. A drawn figure with made-up labels, not a screenshot.After: one group per folder, filled by a script and kept by a hook. A drawn figure with made-up labels, not a screenshot.
How to add it
Name your sidebar groups after the project folders they hold.
Have a session list the sessions in no group and the group each belongs to, and move them with the app's own tool.
Before any move of something you arranged by hand, have the session read what the move does to it.
Detailed notes: A tidy sidebar: one group per project folder
What happened
The Code tab's sidebar shows each group I made under a header of its own, and every session in no group under Sessions, where they sit by folder. So a session left out of the group named for its folder puts that folder's name on screen twice, once as my group and once under Sessions. Two of my project folders showed twice. Some of the sessions behind it had never been filed. Others had come back from the archive, and a restored session returns in no group.
I asked a session to merge the duplicates and to make sure a session restored later lands in its group.
What changed
A script reads the app's own files and never writes them. For each session in no group it finds the one group named for its folder, by the folder's name or by that name with a site's ending such as .io after it. When two groups could match, it leaves the session where it is.
It leaves alone a session already in a group, a pinned one, a scheduled task's runs (the app files them under the task and refuses to group them), a side session (it moves with the session that started it) and an archived one.
A session makes the move with the app's own sidebar tool, after four checks right before it: the plan read again, the live sidebar (the session still in no group and still not pinned), the group (still named so, and still the only one named for the folder), and last the account sync below. A check that cannot be made means no move.
A hook after every unarchive tells the session that restored one where it belongs, with the same checks.
The first run filed four sessions. Of the 178 archived sessions I still have to look through, one would have come back outside its group.
Two traps
Moving a pinned session into a group unpins it. The app's tool says so in its own description, and I found out the other way: the first merge moved a session I had pinned, and the pin was gone. The session put it back that night. A pin is one of my marks (Sessions I mark stay), so no move touches a pinned session now.
The second trap was quieter. I use several Claude accounts, and a sync script keeps their sidebar groups the same. It takes any move it did not plan as my own choice and carries it to every account. A move made a few seconds late, after the sync had learned a different filing from another account, would have overwritten that filing everywhere. The moves now go through the sync: it records the filing only while it holds none for that session and counts the move as its own step, so a filing it learns afterwards still wins. The sync's own steps had the same gap with pins, and leave pinned sessions alone now too.
Codex reviewed the change six times. The first five rounds each found something that had to be fixed before it could land, the two traps among them. The sixth found two small things.
What to copy
Before a script moves anything a person arranged, read what the move does to it. Here it removed one of my marks. Read the live state right before each move, since the files on disk can lag what the app shows, and make no move when something the move depends on cannot be read. If you sync state between places, mark the changes your own tools make as theirs, so the sync never takes them for yours.
Still open
A pin set in the few seconds between the last check and the move is still undone. The app's move tool has no "only if unchanged" form, so nothing on my side can close that.
Building websites: a design skill and a page check
Two skills from a video, one installed with house additions and one left out, and a quality floor every page clears before a deploy: seven checks at two widths, which found the same phone failure on all three sites.
The problem
I build my websites with Claude Code and I am not a designer. The look of each site lived in its CSS and in nobody's notes. There was no check that a page worked on a phone, had readable contrast, or showed keyboard focus. A video recommended two skills for this, and I wanted to know if either was worth installing.
The solution
One skill, Anthropic's own, went in as a house copy with four additions of my own. The other bundle stayed out. The checks became a script that loads a page at desktop and phone widths and reports overflow, low contrast, missing focus, missing alt text, small tap targets and animations that ignore reduced motion. Its first run found the same phone failure on all three of my sites, and the fixes followed.
How to add it
Install a design skill, but write your own additions down next to it.
Git Bash, macOS or Linux: Anthropic's frontend-design skill, the one I started from
Keep one design file per site with its colours, type and layout.
Put the page checks in a script and run it before every deploy; tap targets at the phone fail most often.
Detailed notes: Building websites: a design skill and a page check
What happened
On 25 October I asked for better website building skills, starting from a video that builds a site with Claude Code and two skills. One is Anthropic's own frontend-design skill. The other is a bundle of seven, with paid image APIs and tables of stock picks for fonts and colours. The review found the first worth a house copy and the second nothing my sites needed. It also found that none of my six sites had a design file or any accessibility tooling: the look lived in each site's CSS, and the checks lived in whoever happened to be looking.
What changed
The skill went in as a house copy, scanned first and its dashes rewritten, with four additions written down beside it. The brief comes first, with the brand assets, the sections and the page's job. Each site keeps its palette, type and layout in one design file, read before any change to its look. Nothing is invented on a page, so a placeholder stays visible and gets listed. And every page is checked at 1440 and 390 px before it ships. A house file records the source version and each change, so an update from upstream can be reapplied.
The check became a script the same day, because a check that lives in a skill's prose runs when someone remembers. It loads a page at desktop and phone widths, and again with reduced motion on, and reports sideways overflow, text under 4.5 to 1 contrast, links and buttons with no visible focus when tabbed to, images with no alt text, tap targets under 44 px at the phone, animations still moving under reduced motion, and where the hero meets the fold, with a full-page screenshot per width. It fails loudly and changes nothing.
Its first run, on this site's seven public pages, passed everything except tap targets at the phone, on every page: header links 25 to 36 px tall, footer links 20 to 22 px, the Copy buttons 23 px. The other two sites' public pages failed the same way, and the fixes started that afternoon. This site's landed the same day, the investing site's landed that evening, and the directory's is still to do. One more lesson came out of the run. A link-listing fetch tripped one site's own bot trap, which refuses a machine for 24 hours, and the session waited the day out rather than check those pages from a fresh local server. A check that sidesteps a site's bot rule is not a check I want.
What to copy
Install a design skill if you like, but write your own additions down next to it, and keep a design file per site so the next session changes the look on purpose. Then put the floor in a script and run it before every deploy. The seven checks above are a good start, and the phone's 44 px tap targets are the one that fails most.
Still open
None of the six sites has its design file yet. Each gets one on its first design pass under the skill.
Seven weeks from a knowledge base to skills and scheduled tasks that draft, cut, check and post: generators that refuse what must never ship, an approval record with a hash, posts that email me first, and a desk I write to.
The problem
My social media posts come from the same sessions as my code. The first carousel shipped with two real mistakes because nobody had checked the sources. Posting under my own name through an API means a bad line goes out before I see it. I needed the drafting, the checking and the posting to be safe by construction.
The solution
Each piece lives in one folder with a script that writes the slides and the caption and refuses anything that must never ship: a dash, a banned word, a machine tell. Every post goes through the humanizer. An approval record hashes what I approved, and Instagram cards are emailed to me first and post only when I reply. A desk session answers briefs I email myself, and a trial loop keeps a ledger of every render.
From a brief to a post, with the checks in the way. A drawn figure with made-up labels, not a screenshot.
How to add it
Put the things that must never ship into the generator, so a run aborts instead of a reader noticing.
Keep approvals as a record with a hash of what was approved, not a status field a script can flip.
Let anything that posts under your name email you first and act on your reply.
Detailed notes: Posting to social media safely from Claude Code
What happened
The content side started in early September as a knowledge base and became, in seven weeks, a set of skills and scheduled tasks that draft, cut, check and post. The first carousel set the tone: it shipped with two real defects because nobody had opened the source libraries it drew on. Everything since has been built so that a mistake of that kind cannot reach a reader.
What changed, in order
One folder per piece, from 8 September. A generator script writes the slides, the canvas and the caption from one copy file, so the artboards and the words can never drift apart.
Gates, 15 September. No dashes in anything published. The humanizer skill went in that day and runs on every caption, frame and script. The generator refuses a never-list word, a dash or a strong machine tell and aborts the run; a later layer refuses leak words and stray digits. The order is fixed: draft, check for tells, rewrite if needed, then the house checks again, because a rewrite is one more draft. In late October one more rule arrived after a quote went out reading "24, 48 hours", a transcription's comma in place of a range's hyphen: a range keeps its hyphen.
Delivery by mail, 18 to 20 September. I email footage to myself; a skill fetches it, cuts it to a shot list with ffmpeg and mails the finished video back. A loudness baseline followed in October, with a daily task that deletes the originals only after I reply "done".
First unattended runs, 26 to 28 September: a morning news desk on weekdays and a read of the feeds I follow, both writing into the project and never committing.
Quotes, 28 September. Short lines of my own for X, repurposed as cards for Instagram. Forty approved the first day, and a daily task posts one each morning. Its gates refuse a dash, a never-list word, a strong tell, a performance figure, a family reference and anything over 280 characters.
A calendar system, 5 October: a grid of slots, a register of experiments and an inbox of ideas, so that every piece tests one call from the playbook.
A trial loop, from 13 October. Trial reels post to my own account through the publishing API, recuts are a system with one lever changed per variant, and every render goes into a ledger. The first live batch went out on 14 October, eleven reels in a day with none refused. On the first Sunday turn 27 postings were logged, and after the app refused a session's second live batch, a scheduler sits beside the reels instead. Four review rounds that day all turned on one post sent twice.
Reel template skills, 13 to 22 October: a remix skill after Instagram's own Remix went away, a takes engine whose rule is that the last attempt wins, a response-reel skill and a script drafter.
The approval record, 21 to 24 October. A security pass showed that a status field in a file was enough to post under my name. Decisions moved to an approvals file that hashes everything a line will post, with the destination accounts bound to it; a card's photos go on record after one card drew the same three photos as the previous week's; and since 24 October every Instagram card is emailed to me first and posts only on my reply "post", read hourly through the day.
The content desk, 25 October. I email myself "Claude reel" or "Claude post" with the brief in the body. A small poller reads the inbox every thirty seconds with no model in it and answers "Got it"; a standing session with Remote Control on drafts the piece and replies in the same thread, and I answer there until I say done. Its review found a real blocker before it went live: a stranger's mail wearing the desk's own header would have read as the desk's.
Five tasks run unattended today, plus a few one-time reminders, each behind the run guard the harness entry describes.
What to copy
Put the things that must never ship into the generator, so a run aborts instead of a reader noticing. Treat approval as a record with a hash of what was approved, never a status field a script can flip. Let anything that posts under your name email you first and act on your reply. And keep a ledger of every render with the one lever you changed, or the trial teaches you nothing.
Still open
The newsletter is not built. A video framework installed in October has not touched a reel yet, and a chat automation flow is drafted and not live.
One name for each shared store, and a pass reported only once it runs
One morning a session and a scheduled pass marked the same data under two names, so neither showed up in the other's check, and passes started by hand were reported as running when they had skipped. The handoff now reads one name per store and starts a pass through a command that reads whether it ran. Since 31 October its check also reads a shell's command line command by command; that change has an entry of its own.
The problem
Before a session here writes shared data, it runs a handoff: a check for other writers, a marker that says what it is about to run and for how long, and a notice to the sessions that might write the same data. A check finds a marker by the store's name. One morning a session marked a project's data under a second name while a scheduled pass held it under the first, so every check of that store found no marker. The same morning three passes started by hand never ran, because another session's tests made each one skip itself, and two of them were reported to other sessions as running.
The solution
The check now reads a store's other names as the same store, so a marker under any of them holds it. A check of one store also lists the live markers on the others, marked as not counting, so a session sees what else is being written. A pass started by hand goes through one command, which refuses while the passes are held, while a pass runs or while the pass would skip itself. Once it starts the task, it reads the pass's own run record and says running, ran, did not run or unknown.
How to add it
Give each store your sessions share one name, and map every other spelling a session uses onto it in the check itself.
Have a check of one store print the live markers on the others too, marked as not counting against it.
Before you start a scheduled task by hand, test the conditions under which it skips itself, and refuse to start it then.
Report a scheduled run from its own record, such as a lock it holds while running or a line it writes when it ends. The start command returning says only that the task was asked to start.
Detailed notes: One name for each shared store, and a pass reported only once it runs
What happened
Two coding agents and a dozen sessions work in the same repositories here, and shared data has a rule: two writers never run at once, and a write starts only after a handoff confirms the other writer has stopped. The handoff is a skill. It checks for writer processes, the scheduled passes and the markers other sessions left, writes a marker of its own that names the command and how long it should take, and prints the notices the session sends to the others. A marker is a file named for the store it covers.
At 09:04 on 23 October a session marked one project's data store under one spelling of its name, for a refresh and a publish, while a scheduled pass held the same store under another spelling until 09:21. Markers matched by name, so the session's mark was not refused, and every check of the pass's store printed no marker. Three sessions waiting for the pass's done message could have started between its steps. The same morning my sessions started a pass by hand three times, and each time it skipped itself: a pass will not start while another session's scripts are running, and another session's tests were running each time. Two of those starts were reported to other sessions as passes that were running.
What changed
The skill reads the store's three spellings as one store in every command, so a mark under any of them is held by the same check. A check of a store lists the other stores' live markers as well, shown and never counted against it. A new command starts a pass by hand. It refuses while the passes are held, while a pass is already running, or while the pass's own busy check names a running script. Then it starts the scheduled task and reads the pass's own record within ninety seconds: the lock the pass holds while it runs, and the line it writes when it ends. It says RUNNING, RAN and ended, DID NOT RUN with the skip's reason, or UNKNOWN, and exits with success only when the pass runs or ran. Fifteen checks came with it, seventy in the skill's selftest.
What to copy
If your sessions share a store, give it one name and make the check read every other spelling as that name, since a check that matches by name cannot see a marker written under another one. Show the other stores' markers too, so a session knows what else is being written without counting it against its own store. A scheduled task's start command only asks the task to run, so read the task's own record before anyone is told it ran.
Since then
On 31 October the same check changed again. It now reads a shell's command line the way the shell does, so a command that only hashes or reads a script no longer counts as a writer and holds up another session. That change, and the three security reviews that shaped it, are in an entry of their own.
Why the app says it is low on memory, and what helps
Twenty sessions on a 16 GB laptop, and the app said it was low on memory. The notice reads what Task Manager reads, it never paused a session with Remote Control on, and the check that names which session holds what is now a skill.
The problem
My laptop has 16 GB of memory and I run twenty or more sessions at once. The app warned me about low memory every day for a week, git died twice, and every session was slow. I did not know what the warning measured or what each session cost. The app's own pause for idle sessions never fired, because every session had Remote Control on.
The solution
A session read the app's code: the warning reads Task Manager's Available and Committed figures, not In use. Each session holds about 600 MB of commit charge, so twenty idle sessions are 12 GB. The Remote Control default went off, heavy jobs run one at a time, and memory errors are read as casualties to rerun, not bugs to debug. A memory-check skill reads the same figures and names the sessions holding the most.
Twenty idle sessions on a 16 GB machine, in rounded numbers. A drawn figure with made-up labels, not a screenshot.
How to add it
Open Task Manager's Performance tab and watch Available and Committed, not In use.
Turn off the app's Remote Control default, so idle sessions can be paused.
Run one heavy job at a time and archive sessions you are done with.
Detailed notes: Why the app says it is low on memory, and what helps
What happened
My laptop has 16 GB of memory and runs twenty or more Claude Code sessions at once in the desktop app. By 23 October the app had been telling me it was low on memory every day for more than a week. Git had died twice with "Out of memory, malloc failed", a Node test suite had died with a heap error, and every session was slow, whether or not it was doing anything. I asked whether the notice meant the memory Task Manager shows, and whether running so many sessions was what cost me.
A session read the app's own code for the answer. The app has a governor that polls every ten seconds and takes the lower of two ratios: available memory over total memory, and the commit charge still free over the commit limit. Under 5 percent is a warning, under 2 percent is critical. Those are the Available and Committed figures on Task Manager's Performance tab, not the In use figure and not the Memory column of the process list. Windows has a notice of its own as well, Event 2004 in the System log, which names the processes holding the most. That day the machine had 23 session processes, 52 GB committed against 16 GB of RAM, a page file that had grown to 48 GB, and a disk reading 35 to 55 MB a second of pages that should have been in memory. The day before, the governor had logged 273 critical readings.
The governor is also meant to pause sessions. It pauses only idle ones, and only while the count of live session processes is over a cap, six on 16 GB. A session with Remote Control on is never paused, and the app's default was to connect every new session to Remote Control, so every session I had was exempt. The log said so each time: zero evicted of zero idle, 23 effective. Twenty idle sessions sat untouched. Each session process holds about 600 MB of commit charge with the two helper servers beside it, about 100 MB of it resident, so twenty idle sessions are 12 GB of commit on a 16 GB machine.
What changed
The Remote Control default went off the same day. Sessions that already had it on keep it until I switch it off one by one.
Exit 134, "JavaScript heap out of memory", "malloc failed", "spawn ENOMEM" and Windows error 1455 are read as memory casualties. The job is run again with fewer sessions open, and nobody debugs the code for them. The script that lands branches classifies a failed check the same way.
One heavy job at a time: an encode, a transcription, a test suite, a batch. Never beside twenty live sessions.
The check became a skill. One pass reads Task Manager's figures (total, available, committed, the commit limit, the page file, the hard-fault rate), Windows' low-memory events of the last seven days, every live session process with what it spawned, the other process names holding the most, and the governor's pressure lines of the day from the app's log. What a session spawned is usually where the big numbers are: a dev server, a browser it drives, a batch. It saves each reading as a snapshot and compares two, so I can see what closing sessions gave back. It closes nothing.
Two days later it learned to name the sessions. A session's process carries an id at most, and a side session or a scheduled run carries not even that. The skill matches each process to the app's own session records: by the id, by which session started it and when, or by the record created within three minutes of the process. When no record fits, it takes the first prompt from the session's transcript. Then it prints the chart I had been assembling by hand: one row per session, with its title, the gigabytes it holds, when it was last active and a note. A starred or pinned session is listed and never touched.
What to copy
When the app says it is low on memory, open Task Manager's Performance tab and read Available and Committed, since those are the two figures behind the notice. Count your session processes. Each warm session holds its memory until it is paused, archived or the app restarts, and a session with Remote Control on is never paused for memory, so switch it off on the sessions you never open from your phone. Treat an out-of-memory death in git or Node as a casualty of the count: run it again with fewer sessions open before you debug anything. Run heavy jobs one at a time.
Still open
Two fixes are mine to make rather than a session's, and neither is done: a page file of fixed size, so it never grows in the middle of an allocation, and more memory in the laptop's two slots, which hold 8 GB each.