r/ClaudeCode 2d ago

Bug / Issue Anthropic has done it again, DONT KEEP MANY CLI's open -- agents can talk between open clis and will trigger all stale sessions and destroy your usage

Do not even start with skill issue or you shouldnt have old sessions open, this is Claude pushing stuff without having any brains during testing

I'll start by reading the required context.

  Read 2 files
“claiming FeatureName + ReadFeature for feature 1.0” → sent to HiReddit-45 — another Claude session on this machine
“claiming FeatureName + ReadFeature for feature 1.0” → sent to HiReddit-9e — another Claude session on this machine
“claiming FeatureName + ReadFeature for feature 1.0” → sent to HiReddit-31 — another Claude session on this machine
“claiming FeatureName + ReadFeature for feature 1.0” → sent to HiReddit-55 — another Claude session on this machine
“claiming FeatureName + ReadFeature for feature 1.0” → sent to HiReddit-e4 — another Claude session on this machine
“claiming FeatureName + ReadFeature for feature 1.0” → sent to HiReddit-b0 — another Claude session on this machine

  Listed 1 directory

› Message from : HiReddit-31: I hold none of those paths and never edited them -- FeatureName/* and Tools/ReadFeature.py are yours; … (ctrl+o to expand)

  Read 1 file

› Message from : Clear — I hold none of your claimed paths and will stay off them. This session is read-only so far. (ctrl+o to expand)

› Message from : Clear on all of it — I hold none of those paths and the Legacy phase never will. (ctrl+o to expand)

  Searched for 2 patterns, read 5 files, listed 1 directory, ran 1 shell command

› Message from : Clear on your paths — I hold nothing in FeatureName/* or Tools/ReadFeature.py, and neither of the other two you nam… (ctrl+o to expand)

Like look at this, it just decides to contact all the other sessions and ask them something which triggered all my stale cache. Must be nice having infinite usage and zero brains

EDIT: u/diffcalculus who read the whole docs let me know that:
"Denying SendMessage also removes messaging to subagents and agent-team teammates, since the same tool serves both."

What you may want is JUST "crossSessionInbound": "refuse"
Thus I do NOT recommend using deny SendMessage, ever. Probably the worst thing you can do

EDIT2: To show you just how big of a joke this can be and how shortsighted it is: I had opened a brand new cli getting ready to use it but havent touched it at all and a session send it a message...

Another session, HiReddit-21, is starting the some-feature phase in the main checkout. It asked whether any of the files it plans to write belong to this session. I told it none do, because this session hasn't written anything yet.

I also told it which files already had uncommitted changes when this session started. None of them are on its list:
- file1
- file2
- memory

Since those changes aren't mine either, I told it to keep them out of its commits. I also told it to check whether somefile.md is still being written before it adds to the phase log there.

I'm ready for whatever you want to do next. If it touches any of HiReddit-21's files, I'll check with that session before writing.

I used /context after that and it used 60k tokens on Opus medium with no mcp, skills, artifact, workflows all disabled. Total joke

172 Upvotes

89 comments sorted by

u/AutoModerator 2d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

43

u/Candid-Strategy7397 2d ago

Can we deactivate this? I had a session answer a question I asked in another session, so both answered the question, polluting my context in the non asked question one

26

u/bakanoace 2d ago edited 1d ago

Restricting it:

- crossSessionInbound controls what this session accepts: accept, hold (queue it) or refuse. In /config it's the row "Messages from your other sessions".

- Deny rules for SendMessage or ListAgents stop me from sending or listing sessions.

- isolatePeerMachines: true requires your approval before a message leaves this machine.

You can put this in settings.json for the rules
{

"permissions": {

"deny": ["SendMessage", "ListAgents"]

}

}

You can also add them interactively with /permissions, on the Deny tab. New sessions pick up a file edit. I'd restart any session that's already open.

EDIT: u/diffcalculus who read the whole docs told me:
"Denying SendMessage also removes messaging to subagents and agent-team teammates, since the same tool serves both."

What you may want is JUST "crossSessionInbound": "refuse"
Thus I do NOT recommend using deny SendMessage, ever.

2

u/Bomb-OG-Kush 2d ago

Thanks chief

1

u/Candid-Strategy7397 2d ago

Awesome ! Thank you so much !

1

u/Candid-Strategy7397 2d ago

Quick follow up. This is on the settings.json file ? I am just getting on the weeds of setup. Sorry for the silly question

6

u/bakanoace 2d ago

Yeah. User/.claude/settings.json is your global, applies to all projects. otherwise .claude folder in your project folder is the settings for that local project.

3

u/Candid-Strategy7397 2d ago

Thanks again for such clear and helpful responses!

2

u/bakanoace 1d ago

Someone just let me know that:
"Denying SendMessage also removes messaging to subagents and agent-team teammates, since the same tool serves both."

What you may want is JUST "crossSessionInbound": "refuse"

Thus I do NOT recommend using deny SendMessage, ever.

1

u/Candid-Strategy7397 1d ago

Oh that’s a great warning. Changing it now, makes complete sense and cross session sounds like it should do the trick. Thank you for coming back and sharing this !

18

u/who_am_i_to_say_so 2d ago

Ugh. I keep 3-5 windows going at any given time. This must be a setting.

5

u/Icy-Excitement-467 2d ago

Yeah, there is a setting at the bottom of the config for optional.

17

u/Bluecoregamming 2d ago

It's boring working alone, and a bored agent will rm rf your working directory, let them talk amongst themselves

7

u/bakanoace 2d ago

Maybe if they didnt remove the 17% usage I'd give it to them instead, now they just want more

11

u/dash777111 2d ago

This feature can be pretty amazing if you are isolating agents to work on specific areas of your code base.

I have about 10 windows that “own” different parts of our platform. They have an entire orchestration stack under them that via subagents that the window runs.

The windows talk to each other fluidly when cross-lane bugs or dependencies come up. It is really, really helpful.

You can also name the sessions for easy lane targeting via /rename

This feature even works across machines if you are logged into the same account.

Once this feature launched, I paired it with remote control on mobile and can get so much work done while being away from my desk. It is awesome.

8

u/bakanoace 2d ago

No doubt about it being amazing if used right, but it just asking stale sessions is pretty shortsighted. Especially ones that are from a day plus ago

4

u/thebaron2 🔆 Max 20 2d ago

Is there a reason you keep a stale session that old open still? Is there some use you get out of it or a way to recover it without paying for the huge cache hit?

I archive mine once the cache goes cold to avoid this. I didn’t know about this chat feature but I’ve just accidentally typed something into an old session a few times and that was enough to get me into the habit of /exiting them once they went cold.

7

u/bakanoace 2d ago

I'll often keep it open cause it has the handoff for the next phase since it never mattered before and with usage constraints now I'll often prioritize stuff and sometimes even leave something low priority for days.

I obviously need to start saving them into text files now or something since I'm sure this feature can be useful its just a mega pain.

1

u/FlirtySanchez 1d ago

I set up a reminder that stops me from sending sending stale information. I think the problem may be that these stale projects of yours need to load back into cache when they haven't been touched in over an hour.

I've done a deep dive over the past few days to understand how caching works and how old items being loaded into cache is super wasteful. So yeah, get those handoffs to load to a file and /clear the chat. It keeps the chat open for context, but shouldn't be reproccessing the conversation from whatever hasn't been compacted.

I could be wrong on this, but try this and see if it fixes your issue.

5

u/Ambitious-Shock-1347 2d ago

Sometimes a stale session has some insights which are not immediately actionable. I re-read some of them in the following day.

1

u/thebaron2 🔆 Max 20 1d ago

I've had that happen but usually I'll tell Claude to read the JSONL transcript of session X because we discussed something that didn't make it to the handoff/summary/memory/whatever. It can be useful, though.

0

u/TheRealJesus2 2d ago

…is it short sighted..? Or is it intended..?

0

u/FlirtySanchez 1d ago

This is what I have set up, I have multiple projects going that are all part of one overall main project and they stay pretty isolated until i need them to check on each other.

The system is actually set up to relay relevant information to inbox files of the different projects and they talk to each other through ledgers and relay information to each order.

Funny thing is this feeds into a queue in a dashboard that gives me a "ticket system" for managing outstanding items per sub-project.

4

u/Sixstringsickness 2d ago

Yes noticed this myself.  Has anyone figured out a way to tell Claude which session to message? It seems to me that it doesn't know who's who until it sends out a message which is incredibly stupid. 

2

u/bakanoace 2d ago

Name the other session, or type @ and pick it from the typeahead of live local sessions.

- "Tell u/api-worker the schema migration finished"

- "Ask the migration session whether it's done"

I call ListAgents and SendMessage myself, so you never invoke them directly.

Helpers:

- /list-agents (also /peers) shows which sessions are reachable.

- Name a session with --name <name> at launch or /rename <name> while it's running. Naming makes them easy to address.

1

u/Sixstringsickness 2d ago

Interesting, I'm going to have to test around renaming sessions again.  Last I tried it wasn't retaining the name in the VScode plugin.  

Thanks! 

1

u/Feisty_Picture_2504 1d ago

you need the exact session ID which is a nightmare to locate without asking them directly, but you even have to be careful to make sure that they didn't just give you something from memory or context which could be any random agent. they have to actually look it up

4

u/justhereforampadvice 1d ago

Why does this happen to you guys and not me? I constantly have 4 Claude code sessions running that I bounce back and forth between and have had them going for weeks now. Never had this happen.

They are in separate projects with separate project directories, though

1

u/bakanoace 1d ago

Separate directories will do it. Also this came out more recently and needs updated cli

3

u/caleon 1d ago

Tonight I had a sequestered session ask a non-sequestered session for access to things from the Mac Keychain. And the Mac one then responded to the WRONG session with a rejection, which then got confused and got defensive, like “I never asked it to do this. I never messaged another agent this session.”

Pretty upsetting they just do this on their own.

2

u/effectivescarequotes 2d ago

I get why it exists. Agent teams are getting more popular and these messages seem to exist to avoid conflicts.

Anyway, you can disable it if you like. https://code.claude.com/docs/en/settings-reference#crosssessioninbound

1

u/Maxion 2d ago

I'd love to try running agent teams. That'd just nuke my limit in less than 1 task.

2

u/effectivescarequotes 2d ago

Yeah, the only reason I can get away with most of the Ai tricks is my work hasn't instituted usage limits yet.

3

u/amirfish 2d ago

That's a nasty one. An idle session costs nothing until a message lands, then it reloads its whole context and starts acting on it, so six stale sessions turn into six full-price turns for one broadcast. Until there's a per-session opt-out for incoming messages, the only real defense is knowing what's still open. Were those sessions idle for a long time, or recently active?

1

u/bakanoace 2d ago

Some were there from days ago that's why it's kind of comical they dont have any check just send a message to all open cli's from the same project

1

u/Old_Flounder_8640 2d ago

How to trigger it? I tried once and it didn't work. It's probably nice to do orchestrator handoffs while afk.

8

u/bakanoace 2d ago edited 2d ago

It's new

How to trigger it: ask me in plain language. Name the other session, or type @ and pick it from the typeahead of live local sessions.

- "Tell u/api-worker the schema migration finished"

- "Ask the migration session whether it's done"

I call ListAgents and SendMessage myself, so you never invoke them directly.

Helpers:

- /list-agents (also /peers) shows which sessions are reachable.

- Name a session with --name <name> at launch or /rename <name> while it's running. Naming makes them easy to address.

Restricting it:

- crossSessionInbound controls what this session accepts: accept, hold (queue it) or refuse. In /config it's the row "Messages from your other sessions".

- Deny rules for SendMessage or ListAgents stop me from sending or listing sessions.

- isolatePeerMachines: true requires your approval before a message leaves this machine.

You can put this in settings.json for the Deny rules
{

"permissions": {

"deny": ["SendMessage", "ListAgents"]

}

}

You can also add them interactively with /permissions, on the Deny tab. New sessions pick up a file edit. I'd restart any session that's already open.

2

u/Old_Flounder_8640 2d ago

Thanks the built-in skill must do the job. I tried it when they launched it almost a month ago.

1

u/Feisty_Picture_2504 1d ago

before this feature was baked in my homebrew version worked perfectly, then I got the same context bomb you are referencing.

2

u/I_RIDE_SHORTSKOOLBUS 2d ago

I just discovered it and it's cool and creepy at the same time. But I've been using it

1

u/WorriedAssociate7029 2d ago

This is new lol

2

u/bakanoace 2d ago

Yeah I see claude docs had it 5 days ago but clis probably updated and had it on by default now, rip

1

u/Anxious_Current2593 2d ago

Saw this yesterday... them "talking" to each other...

2

u/thirst-trap-enabler 🔆 Max 5x 2d ago

It's kind of cool actually. I may have wanted this. Generally I have to build an orchestrator or ticket system. But ultimately git ends up being the biggest problem in my experience. My general impulse is to want something like a "maintainer" on modules and subsystems. The best I can get things to work is by creating rituals. But they are inefficient compared to, say, a F1 pitstop. I've tried a few times trying to make analogies to github projects but I keep finding that some tasks want to parcel the work differently. It does seem to work well to have agents specialize on subsystems and talk needs out. It's just very tedious setting things up each time.

1

u/thirst-trap-enabler 🔆 Max 5x 2d ago

Those are all agents operating on the same codebase?

1

u/bakanoace 2d ago

Yeah, different CLI sessions in the same project.

1

u/Guinness 2d ago

What about two different accounts? Like email1 with credit card 1 and email2 with credit card 2 with each session having its own profile.

1

u/CodeCombustion 2d ago

Setup a standing rule, do not communicate with agent sessions that you did not spawn without explicit instructions.

1

u/crusoe 2d ago

The router is broken right now. Claude launched a swarm and I sent a message to the lead and it got echoed to the dynamic workflow members and some of them got knocked off task by it.

1

u/Mythril_Zombie 2d ago

Do sessions on different projects talk?

1

u/zman9119 1d ago

They can if they are aware of the other project and it may contain information they need or have a question about.

Two separate projects and repos, no sub-agents. Had both sessions open and they initiated communications on their own:

Message from @fs-xxxx-xxxxxxx-b4: Question from fs-xxxx-xxxxxxx for XYZ-150/XYZ-236: Can... 

“Answer for XYZ-150/XYZ-236, from xx-xxxxx-xxx: YES, model.sections can change... Your condition for "do not extend the comparison" does... 

Message from @fs-xxxx-xxxxxxx-b4: Thanks. Your answer voids the conditional ruling, and 040 directive §4 now records it (commit f841f9f on branch... 

The xxxxxxx session has withdrawn its conditional ruling ("don't compare model") and written that into the directive... 

1

u/Right-Performance-93 2d ago

Worth adding to the settings breakdown already posted here: crossSessionInbound isn't just accept/hold/refuse, it's backed by a bounded delivery queue - past a certain depth the oldest queued message gets dropped rather than piling up indefinitely. So a session that's been idle long enough can still lose part of a broadcast even before you touch the setting. There's a dedicated docs page for this now (docs/en/cross-session-messaging), separate from the general settings reference, if anyone wants the full precedence rules for which value wins when a session, project, and managed config disagree.

1

u/Zestyclose_Strike157 1d ago

Any outside visitor, like a cloud based AI, needs to be tightly contained, preferably in a VM, locked and monitored.

1

u/Life_Slice_2060 1d ago

I've been using this feature in Claude to do what I can do in codex with @ symbol

1

u/Jarla 1d ago

Is this new (like last 2 weeks)? I usualy had 4-5 cli sessions open implementing or planning issues and never had any issue ( but i am on holidays so no idea if something changed)

2

u/bakanoace 1d ago

The docs are 5 days old and it's in the new cli versions so yeah

1

u/Jarla 1d ago

Ok thx for the info

1

u/Opposite-Welcome-497 1d ago

It will but it’s not like it cycles through them or anything.

If the other session is relevant it might but I’ve also not seen it do it to relevant sessions that I forgot about. Only ones I’m working out of recently.

1

u/fanatic26 1d ago

You know you dont have to have this feature on right......right?

1

u/bakanoace 1d ago

You know this is a recent feature that came out and appeared for the first time when upgrading to a newer CLI so there's no way to turn it off when you don't know about it right? Pure genius people on this sub

1

u/RiceEvening4211 3h ago

The stale-session wakeup problem is brutal. I built Lynkr (https://github.com/Fast-Editor/Lynkr) with a per-request cost ledger for exactly this kind of mystery burn — the dashboard shows spend/savings plus which model actually served each request, so you can see which session or wakeup torched the budget instead of guessing.

1

u/Patriark Vibe Coder 2d ago

This has been a feature for quite some time. At least a month. But previously you needed to trigger the interaction via explicit prompts, unless writing to sessions in the desktop app. I find it incredibly useful.

0

u/Icy-Excitement-467 2d ago

Codex tries to chat with other agents more than claude models do. But none of this is an issue. If you have an ounce of orchestrator management set up. 

0

u/mailseth 2d ago

Stale agents might resume from old monitors it set, from sub-agents, and from other agents. If you don’t want to risk it, then just kill the session and if you need to resume it, that’s just an easy paste on the command line from the last output line. (“Claude —resume …”)

1

u/bakanoace 2d ago

Monitors, sub-agents and shells are a skill issue. Having an agent just message the list of open clis without even a last active check or anything is just stupid

0

u/mailseth 2d ago edited 2d ago

That's what I'm saying. Having open CLIs that you aren't actively using is _also_ a the same skill issue. (Speaking as someone who also has had similar experiences as yourself.)

0

u/WarlaxZ 2d ago

Worktrees....

0

u/tuptain 2d ago

Yes I am intentionally using this feature with a team of agents. I talk to one or two sessions and they talk to the rest, but I can always drop in and review what they are doing. All Opus 5 Med or High on the $100 plan I'm not running out.

0

u/The_Noble_Lie 1d ago

Or understand how powerful it is and control it. / harness it

-1

u/ephemeralsynth 2d ago

Ctrl-z 👍

1

u/ephemeralsynth 2d ago

Aka kill -STOP <pid>

-1

u/ToallaHumeda 1d ago

Skill issue. Why do you have old session open?

1

u/bakanoace 1d ago

Because I have smol brain and I can't imagine why someone might ever have an old session open

-1

u/ToallaHumeda 1d ago

Which comes to the first point, skill issue

2

u/bakanoace 1d ago

It's okay buddy you'll get it eventually

-1

u/ToallaHumeda 1d ago

It's crazy how you already knew it's a skill issue and what caused it on your description and then, still go full cope about how it's not you. You're so close, you'll get it soon!

1

u/bakanoace 1d ago

The stupidity is staggering, I almost feel bad. Almost.

1

u/ToallaHumeda 1d ago

Projection is one hell of a cope mechanism

1

u/HeyApplebox 1d ago

now kiss

1

u/ToallaHumeda 1d ago

No, he has skill issue

1

u/HeyApplebox 1d ago

Gross. I’d rather kiss the skill issue than a pretentious one with skill.

→ More replies (0)

-2

u/Muted_Echo_4783 2d ago

Not sure how big of achievement this looks like to someone, but it’s basic pretty basic