Context Mode (@contextmode) header
Context Mode (@contextmode) profile picture

Spend less on coding agents. Control what they do.

London, England
Joined May 2026
Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)Photo by Context Mode (@contextmode)
Context Mode retweeted
We benchmarked 4 ways to run our AI gateway on Durable Objects: celld, workerd cluster, Rivet/OpenOrange (self-host) and Cloudflare. Same code, same tests, real numbers. All four pass quality. Each has a real weak spot. Which one should we go with for air-gapped self-host? @rough__sea @KentonVarda @ajoshhoward @dillon_mulroy @NathanFlurry @CloudflareDev contextmode.ai/blog/four-way…
5
8
1
67
5,384
Context Mode retweeted
Yesterday the NSA, CISA and the White House told every organization to speed up the move to post-quantum cryptography. The same day, Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI, Oracle and SpaceX signed a joint statement behind it. Their reason was not quantum computers. It was AI models solving math problems that had stayed open for years. Now check your Mac. On macOS 26, Apple's /etc/ssh/crypto.conf moves classic ECDH to the front of the list. Your SSH sessions skip post-quantum key exchange, even when the server supports it. Anyone who records that traffic today can try to decrypt it later. OpenSSH has a name for this, "store now, decrypt later", and it now prints a warning about it. Every git push your coding agents run goes over that same connection. Your source code. Your server sessions. Check it now: ssh -v [email protected] 2>&1 | grep "kex: algorithm" ecdh-sha2-nistp256 or curve25519-sha256 means the session is not post-quantum. Do not paste the viral fix yet. Run this first: ssh -Q kex | grep mlkem If nothing comes back, your OpenSSH is older than 9.9, and the mlkem line will break ssh. We tested it on 9.6: Unsupported KEX algorithm "mlkem768x25519-sha256"
Do not ignore this. Do not underestimate it. Yes, we were briefed on something. Yes, it’s a big deal. No, we can’t give you all the details yet. But it is urgent to move encrypted systems to post-quantum (maybe more appropriately called post-AI) standards.
1
3
3
641
Context Mode retweeted
1,000 people now run their agents through Context Mode Gateway. When we started, the goal was simple: give teams one place to control what their agents cost, remember and see. Thank you to every early user who tried it, broke it, and told us what to fix. You built this with us. Next stop: 10,000. contextmode.ai
1
3
7
276
Context Mode retweeted
some think protect means blocking a few dangerous commands. that is only the beginning, because protect is security governance: when the moment calls for it, you can close off a single website url, and every decision your agents make is written into an audit log that belongs to you, your team and your company. so why would a company that cares this much about security trust us with its agents? because every agent runs inside an isolated durable object, on a dynamic worker sandbox built on v8 isolates, and for teams that want everything behind their own walls, we sign self-hosted enterprise contracts. managing policy through a dashboard the way azure does already feels slow and out of date, and i believe security teams should govern their agents with a cli and skills, the way they already work. it is time to stop wrestling with kernel and os sandboxes. a private ai gateway should have solved this for you already.
Thesis: every AI gateway solves the wrong problem. @Azure, @LiteLLM and @pydantic AI Gateway watch your spend. None of them changes what your coding agent reads. @contextmode does. 90 days, 6 agents, 339K requests: $57,820 bill became $36,388. 37% saved. Saving. Memory. Recall. Skills. Protect. A budget tells you what you burned. Context Mode stops the burn. contextmode.ai
3
1
4
360
Context Mode retweeted
On a warm turn, 98.71% of a coding agent's prompt is read from cache, and the tool definitions are 65.2% of the turn's cost. So our gateway makes the prefix smaller and keeps its bytes the same. How Context Saving works, on @Cloudflare:
3
1
2
208
Context Mode retweeted
Claude Code sends Anthropic Messages. Codex sends OpenAI Responses. Our gateway @contextmode runs one pipeline for both. The Worker translates a Codex turn to the Anthropic shape before the pipeline and back to Responses after it. How that works on Cloudflare:
5
2
7
332
Context Mode retweeted
The Context Mode gateway now loads at most one skill per turn and keeps it until the task ends. Clef on Workers AI picks it with one typed question. On 10 recorded turns where the old 70B judge and Clef disagreed, the 70B model was right on 4 and Clef on 10.
1
1
2
166
Context Mode retweeted
you can't clear the context when the context is the debug session. claude code compacts it into a summary. early instructions can get lost. 4 steps (no bs): ① set your base url to the gateway ② passing tests fold, failures stay ③ full output archived ④ recall: it never compacts @contextmode gateway. prove me wrong.
A troubleshooting session in Claude Code eats through most of my usage limit. The longer Claude struggles with a problem, the more expensive every next attempt gets. And I can’t exactly clear the context when that context is the troubleshooting session. Should I go back to Codex?
4
2
1
289
Context Mode retweeted
62 of 72 real agent incidents had no attacker. The agent did it alone. That's the threat Protect is built for. Context Mode's gateway checks every Claude Code and Codex tool call against your team's policy before it runs, and logs every decision. The destroy never reaches your shell. Turn your agent loose and try to get a drop table past it.
Your AI agent just wiped the database — and there was no hacker behind it. In 72 real incidents, 62 had no attacker at all. That's what ROGUE-AI set out to prove. It rebuilds reported agent security incidents offline, each paired with a control that removes only the blamed cause. Across 108 replications, 89% reproduced the reported harm. Five current GPT, Claude, Gemini and DeepSeek models repeated the same mistake in 18%–33% of runs with the cause present — and under 1% without it. The twist: accidents with no attacker caused more harm than prompt injection did, and injection defenses can't catch them — there is no injected instruction to find. What did work was a warning after each tool output, naming the hazard and its consequence. Does anything — or anyone — flag the risk out loud after each step your agent takes? #AISafety #AIAgents arxiv.org/abs/2611.26553
2
1
2
213
Context Mode retweeted
LiteLLM gives away the gateway and sells the enterprise license. PostHog gives away the code and sells the cloud. I'm thinking about doing the same with Context Mode's gateway. Fully open source, self-host it free, pay only for SSO, audit logs and support. Would you self-host it, or would you rather just pay and not think about it?
1
1
127
Context Mode retweeted
Dax is right. Selling safety behind a sales call is the worst upsell in the agent era. So I'm thinking about open sourcing Context Mode's gateway. Self-host it free, SSO and audit logs included. Enterprise would pay for support and SLAs, not for being safe. Tell me why this is a mistake.
i hate how many security features are gated behind expensive enterprise plans so many products are impossible to use safely even for a small team with agents hacking everything this feels like a bad place to upsell your users
1
2
1
116
Context Mode retweeted
Anthropic just shipped code mode in Claude Code. Experimental, opt-in, Claude Code only. Context Mode's gateway already runs code mode in V8 isolates on Cloudflare Dynamic Workers. The agent writes the script, the isolate eats the raw output, and only the answer hits context. Claude Code, Codex, OpenCode or Pi, same gateway. No flag needed. Try to break it. contextmode.ai
Code Mode is an experimental new feature in Claude Code that can improve both speed and context efficiency when Claude needs to orchestrate multiple steps. Try it out and let us know what you think! It enables Claude to perform multi-step tool calls by writing and running JavaScript. Rather than calling one tool at a time (e.g. Bash, Read, or Edit) and waiting to see the result before deciding what to do next, Code Mode allows Claude to write a simple script to run multiple commands in parallel, passing arguments and filtering outputs for subsequent tool calls to reduce context. I'm excited about this work because Code Mode enables more efficient and streamlined multi-step coding flows. For example, rather than passing large amounts of raw search data into the context window or having to make a large number of sequential calls to perform the same refactoring across dozens of files, Claude can orchestrate these tasks programmatically in a single pass. Still, you will be able to interact with Claude as normal through natural prompts. And if you ever need to see the exact JavaScript that Claude generated, you can always use Ctrl+O to expand the collapsed Code rows in the transcript viewer. One of the most exciting practical improvements from Code Mode is its ability to perform long-running operations, like running test suites or complex builds, as background processes. When Code Mode is running in either auto or bypassPermissions mode, scripts can run in the background for up to two hours. You can continue to interact with Claude and perform other work within the same session. The /tasks command provides complete transparency and control over background scripts. Each tool call that is generated within a script is still governed by your current deny and ask permission policies, sandbox constraints, and PreToolUse hooks. Hooks can even be defined specifically for the REPL tool to inspect the generated JavaScript before running, or redact sensitive tokens from the output before reading it into the context. To enable Code Mode, just start your session with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude or set the environment variable in your ~/.claude/settings.json file. Give it a try by running multi-file audits, batch edits, or any type of parallel search-and-filter operation. Code Mode is experimental and the team is actively iterating on it, so please run /feedback in your terminal to let us know what works well and where you hit any edges. Hope it's helpful!
2
1
4
517
Context Mode retweeted
Not everything belongs in an isolate. Some scripts need your files, your shell, your machine. Context Mode's engine runs code mode locally as a subprocess, with whatever runtime you already have. Shell, JS, TS, Python. The agent stops reading raw logs and starts asking questions of them. Your context window was never meant to be a log file. github.com/mksglu/context-mo…
1
1
2
90
Context Mode retweeted
Nathan's benchmark says it: V8 wins for complex, data-heavy scripts, and embedded isolates beat standalone processes. That's exactly where Context Mode's gateway runs code mode. V8 isolates on Cloudflare Dynamic Workers. Your agent writes the script, the isolate eats the raw output, and only the answer hits context. Bring your heaviest session and prove me wrong. contextmode.ai
Code Mode benchmarks: - Lua is the 🐐 for tiny scripts - V8 the 🐐 for complex / data-heavy scripts - QuickJS is, in fact, quick for very simple scripts - Embedded JS isolates are better than standalone processes - dash > bash - LuaJIT only makes sense for complex scripts - Lua needs many C exts to be fast (e.g. JSON parsing) What other languages / runtimes should I bench? ~ These benchmarks are most relevant when separating the harness from the sandbox, since Code Mode is running inside the harness. When there are hundreds of agents running on a single machine, the cost of the dynamic code execution will be a large portion of compute resources. That said, you probably won't be able to tell a huge difference when using < 10 MB of RAM and < 50 ms time to response in practice. ~ Embedded vs Processes: Embedded languages work as a library inside your existing process. This tends to amortize your memory & cold starts. ~ Optimizations: There's plenty of optimizations that can be made across the board, such as: - Prewarming VMs - Process & VM forking ~ Sandboxing: Per-process will require some sort of jailing / sandobxing to run securely. Embedded languages can be risky to trust for sandboxing without extensive security review for things like Spectre & access to stdlibs. ~ Benches attached in thread. There's loads of other more experimental languages & runtime I want to bench too.
1
2
1
153
Context Mode retweeted
context mode v2.2.1 is out a bug-fix release, like a tune-up for your agent's memory. after compaction your agent gets its saved state once, and recall leaves out notes from before that compaction github.com/mksglu/context-mo…
2
5
254
Context Mode retweeted
OpenClaw cut CI usage 95.5% by caching, and @boatdotdev makes CI runs faster. the agent inside CI is next. with @contextmode Gateway: fixing a failing CI run: $0.0502 to $0.0420 (22.8% less) @claude fix on a PR: $0.1113 to $0.0872 (21.6% less) using CI on boat? DM me and your Gateway CI is free contextmode.ai/solutions/ci
been so happy to help the openclaw guys with free CI on boat.dev for everyone using CI on boat, huge perf improvements (via caching and specialized infra) + limits changes coming soon
1
2
209
Context Mode retweeted
Context Mode is like a save point for your coding agent big tool output stays in a local index, so the window fills slower. after compaction, your agent picks up where it left off
Claude Code users, what do you do when the context fills up halfway through a feature? Compact, start fresh, or write a handoff file first?
2
1
5
373
Context Mode retweeted
You told your agent "never touch prod" last week. Today it ran terraform destroy. Context Mode remembers the rule, brings back last week's notes, and Protect blocks the destroy with your team's policy. contextmode.ai
1
1
2
203
Context Mode retweeted
Context Mode is a free, local, open source plugin for 11 coding agents. The agent writes a short script, the script runs in a local sandbox, and only the answer enters the context window. The full output stays in a SQLite index on your machine, so the agent can search it later. 2.0 is a full rewrite: 9 tools, hooks on all 11 agents, one database per project, and a bench you can run yourself.
5
1
1
5
2,747