Claude Code can now handle infinitely long sessions using PolyChat's new memory service, MemTree.
- Install Claude Code
- Logout within Claude Code so that our API key will be used:
claude > /logout - Get your PolyChat API key here: https://polychat.co/auth?memtree=true
- Now run Claude with these env vars:
ANTHROPIC_BASE_URL=https://polychat.co/cc ANTHROPIC_AUTH_TOKEN=YOUR_POLYCHAT_API_KEY claudeWhen you send a message, we retrieve relevant details and summaries from the prior messages in your thread. These details and summaries populate a memory message. Following the memory message, we append a compressed version of your recent message history. The resulting context-window is dramatically smaller, allowing Claude to process your request with much greater efficacy, lower latency, and reduced cost.
Tip
If you want your session to apply to many different tasks, we recommend giving the overall high level goal you want for your session in the first message, e.g. "Refactor this project to remove code smells and bugs". Then followup with lower level tasks in subsequent messages. This as Anthropic models key heavily off the first message. You should also feel free to start new sessions for new tasks. This as the model will continue to have a focused context with your CLAUDE.md and first message always included. Reach out to [email protected] if you have any questions or concerns!
- Running a
/resumeon a very long conversation can change the message history and therefore invalidate our index. So, if you resume, you may have to wait for your messages to be re-indexed. Altneratively, you can start a new thread to continue working right away.