Lagosaur (@0xLagosaur) header
Lagosaur (@0xLagosaur) profile picture

agent archaeology / digging through what the model swore it did

Joined March 2021
Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)Photo by Lagosaur (@0xLagosaur)
you started the session with --disallowedTools so it couldn't touch the shell, resumed it this morning without them claude --resume brings back the conversation, the model and the permission mode it doesn't bring back how you launched it the docs list what isn't restored: --mcp-config, --plugin-dir, --add-dir, --settings, --allowedTools, --disallowedTools so the restriction you set yesterday lived only in yesterday's command line and the conversation still reads like you're being careful put it where resume can't lose it, in .claude/settings.json: "permissions": { "deny": ["Bash"] }
2
1
16
683
you pasted an API key into claude, typed /clear, it's still sitting on your disk /clear starts a new conversation, it doesn't delete the old one the old one stays in the picker, one /resume away transcripts are plain files in ~/.claude/projects, and the docs say they're not encrypted at rest claude rm <id> hides a session, and its transcript stays on disk too the one command that actually removes a project's transcripts and checkpoints: claude purge it asks first and it can't be undone then rotate the key anyway, it already left your machine with the request
17
661
you opened the same claude session in two terminals to get twice as much done, and lost half the conversation claude --resume in both, same session id the docs say what happens: both write to one transcript, and messages from one of them can be missing no error, no conflict warning, just a history with holes in it and the next time you resume, claude reads that history as the truth if you want two lines of work from one starting point, fork it instead: claude --continue --fork-session or /branch inside the session, which also keeps the permissions you already granted
1
14
2,472
your subagent rewrote half a folder, Esc Esc put none of it back the docs on rewind are specific about subagents rewinding restores only the files claude had already edited in your main conversation everything else the subagent wrote stays exactly as it left it the one exception is a skill that forks in the foreground so the moment you delegate anything that writes files, your undo is git, not the menu one line before you hand it off: git add -A && git commit -m "before subagent"
11
1,366
the only undo for git push is never running it without you rewind restores files on your disk, nothing else a pushed commit, a migration against the real database, a deleted remote branch, none of it has a checkpoint so the protection has to happen before the command, not after an ask rule makes claude stop for your yes, including in auto mode .claude/settings.json: "permissions": { "ask": ["Bash(git push *)", "Bash(git reset --hard *)", "Bash(npx prisma migrate *)"], "deny": ["Bash(git push --force *)"] } the space before each star matters, it means the command followed by anything commit the file and every teammate's claude gets the same brakes
13
947
you rewound the conversation, closed the terminal, the next morning the messages you threw away were back the files stayed rewound, the conversation didn't the docs list it: rewound messages can return if you exit before your next prompt so you resume, and the plan you already rejected is sitting in the conversation again, where claude reads it as context the fix is one extra step the menu never mentions: /rewind, pick the same prompt, Restore conversation then send any message before you exit
1
1
11
764
your claude code sessions from early october are already gone the oldest transcript on our machine was last touched 31 days ago, nothing older survived claude code deletes transcripts, subagent logs and checkpoint snapshots once they pass cleanupPeriodDays, default 30 with them go resume, continue rewind for every one of those sessions and you can't switch it off, the docs say setting 0 fails with a validation error the debugging session where you finally found the cause is on a timer you never set one line in ~/.claude/settings.json: "cleanupPeriodDays": 365 it only saves what's still inside the window, so today is the day and they aren't encrypted, year of transcripts is a year of everything you pasted
3
19
1,187
you pressed Esc twice to undo what claude just did, and the folder it deleted stayed deleted rewind restores the edits claude made with its own file tools the docs are blunt: a file that only Bash commands changed isn't tracked and stays as it is rm -rf, a formatter across the repo, a sed, a code generator, none of it is in a checkpoint so we put a hook in front of every shell command that saves the whole working tree to a hidden git ref first then ran rm -rf src on a repo with an uncommitted edit and a brand new untracked file one restore brought both back, the index was untouched: git restore --source=refs/claude-snapshots/<latest> --worktree -- . the whole hook is a dozen lines
2
1
18
1,260
claude fixed the bug, pushed the commit, and your CI never ran on it the @claude workflow in your repo has one line that decides this: github_token pass it secrets.GITHUB_TOKEN claude commits with that token github doesn't trigger workflows on commits made the default GITHUB_TOKEN, that's github's rule, not claude's so the pull request shows claude's change with no checks next to it and a reviewer in a hurry reads no red as green leave that line out and the action signs in as the claude github app instead, and your checks run like on any other push: uses: anthropics/claude-code-action@v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
6
19
3,244
your subagent had the tool in its file and still couldn't use it subagents that claude starts from your main conversation run in the background by default, so you keep typing while they work background subagents get a smaller, fixed list of tools: reading, searching, the shell, editing and writing, web fetch and search, and a few others anything else is removed, even if the agent's own file lists it so the agent you built around one specific tool runs, can't reach it, and improvises with what's left and its report comes back sounding just as sure if the job needs a tool outside that list, make claude wait for the subagent instead: "env": { "CLAUDE_CODE_FORK_SUBAGENT": "0" }
1
13
2,033
the job you scheduled to fix failing tests spent the night asking permission from nobody a claude -p run starts in manual mode unless you set one anything that needs approval is denied, there's no prompt and nobody to answer it reads and a few read-only commands like ls and grep still go through running your tests and editing a file, the part you scheduled it for, don't so it reads the code, gets refused, writes you a careful summary of what it would have done every refusal is recorded in permission_denials in the json output, a field almost nobody prints give it the exact commands up front: --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read" "Edit" and print the count every morning: jq '.permission_denials | length' run.json
3
18
1,421
your 2am task built on the half-finished edit you left open at six local scheduled tasks in the desktop app run against whatever state your working folder is in uncommitted changes included, the docs say so in those words so the nightly cleanup reads your broken function as the code, and fixes everything around it and if the laptop was asleep at two, the run didn't happen at all when it wakes, the app starts exactly one catch-up run for the latest missed time and drops the rest closing the lid counts as asleep two settings before you trust it with a night: Worktree on, so it gets its own clean checkout and a schedule for when the machine is actually awake, or a cloud task instead
14
2,519
the scheduled task you set up to update a changelog has access to every connector on your account cloud scheduled tasks belong to your personal account every connector you have connected is included by default, whatever is on that list anything it does through them appears as you, the docs say exactly that and it runs in auto mode, you don't get to pick a permission mode when you create it so a prompt about one repo runs with the keys to everything you ever clicked connect on nothing has gone wrong yet, nobody is watching at 8am when it does when you create the task, open the connectors list and remove every one it doesn't need protect main with branch protection on github, not with a sentence in the prompt
17
2,301
the claude job you scheduled on your subscription bills an API key instead, if one is anywhere in its environment claude code picks one credential from a fixed order, and ANTHROPIC_API_KEY sits above your login above the subscription token in a normal session it asks you once whether to use the key in -p the docs say the key is always used when present so the key you exported months ago for another project quietly takes over every scheduled run nobody is there to see a prompt, the only place it shows up is the invoice and with --bare it can't use the subscription token at all, only a key for a job that should run on your plan: claude setup-token put the result in CLAUDE_CODE_OAUTH_TOKEN for that job, unset ANTHROPIC_API_KEY in the same environment
1
1
16
1,755
your nightly claude job can report success on a night it never ran we ran claude -p with --output-format json on a machine that wasn't logged in "subtype": "success" "is_error": true "result": "Not logged in · Please run /login" exit 1 a script that checks subtype marks that night green and the error came back on stdout as the result, stderr was empty, so a script watching stderr saw nothing either branch on the field that tells the truth: [ "$(jq -r .is_error run.json)" = "true" ] && exit 1 and run claude auth status before anything else, it exits 1 when nobody is logged in
1
30
4,279
a claude -p run executes the hooks of whatever folder it's pointed at, even one you never trusted we tested it on a folder made to look like someone else's repo, with one SessionStart hook that writes a file the cli on that machine wasn't even logged in claude never answered, the run died with not logged in, exit 1 the file was there anyway: hook ran in a folder nobody trusted interactive sessions ask you to trust a folder first, -p runs never ask the docs say it plainly: without --bare, a -p session runs the project's hooks and connects its .mcp.json servers so a pipeline that reviews a pull request runs whatever that branch put in .claude/settings.json, with your credentials in the environment on anything you didn't write, one flag: claude -p --setting-sources user "..."
2
11
2,567
every alert your hook sends now arrives twice you moved the hook into the team plugin and left the original in your settings skills, agents and servers in a plugin get the plugin's name in front of theirs hooks don't, they have no namespace so the copy in settings.json and the copy in hooks/hooks.json are two hooks on the same event, and both fire the formatter formats twice, the guard blocks twice, the notification pings twice moving a hook is two edits, and the second one is the one people forget: add it to hooks/hooks.json delete it from settings.json in the same commit
1
1
16
3,611
your plugin kept its cache next to its own files, and after the first update it couldn't find it installed plugins run from a copy, one folder per version ${CLAUDE_PLUGIN_ROOT} points at that copy, the docs warn it changes when the plugin updates so the node_modules it installed, the log your guard wrote, the list it built, all stay behind in the old version's folder which gets marked orphaned and cleaned up two weeks later there's a folder made for this, kept across updates: mkdir -p "${CLAUDE_PLUGIN_DATA}/cache" it has its own catch: it's deleted when the plugin is uninstalled from the last place it's installed, unless you pass --keep-data and neither variable exists in commands claude runs through the Bash tool, only in hooks, server configs and the plugin's own files
23
3,876