I was tired of seeing "--resume"^W loose so much context. [edit: not --resume, I meant a new session using project memory]
I had the idea of an oracle/apprentice. The idea was that the new session would learn from the old session, like a tutor.
I asked Claude to code a program, so that the old session would launch in loop, being the "oracle", and the new session would use it to connect to the oracle, to ask it questions.
So when I'm doing that, I'm seeing the two Claude sessions discussing between them. It's fun seeing the "apprentice" asking follow-ups questions.
The mechanism (on a Linux machine) is relatively simple : I asked Claude to code a Go tool, to use an abstract socket (\0claude-handoff-<projectname>), and specified that whichever is the first to successfully listen (no EADDRINUSE) becomes the "listen()er/accept()er" and that the second becomes the "connect()er".
So that establishing the socket in whichever order is independent of which of them is the oracle/listener.
I've put the mechanism in a global Claude rules. In the oracle when I'm a 98% usage of the 1M context, I just have to type "handoff <projectname> oracle", and to start a new session with "handoff <projectname> client".
And the "oracle" will loop on the tool (with a subagent, waiting indefinitely), the tool exits with a question on output, and re-call (with a subagent "handoff <projectname> answer") to give back the answer (which automatically waits for the next question).
And since the oracle is doing the call to the handoff tool in a subagent, when you see it answering, you can also type something along the lines of "hey please also precise to the apprentice <some specific information>".
The "transmission of knowledge which matters" is so much efficient, that ~2% of remaining context (20k tokens) is enough to transmis WAY MORE USEFUL information that any memory saving which would miss important informations.
It's not unexpected. It's like real-life. You may have an human put all informations that you want in some documentation, nothing can replace a phone line from the new human to the previous human for specific follow-up questions.
Tho one of the mattering rule specificity is to precise that the oracle should always include in this response the level of confidence in the answer, like if it is certainty/guess/hypothesis.
It's fun seeing the two Claudes discussing like two colleagues. I guess you could also ask Claude to code the tool to instead connect on a localhost IRC server.
I think that if you want this tool, you just have to c/c my text into a new Claude session and to tell it "I want this too, please code it, please also setup the global rule".