惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Last Watchdog
The Last Watchdog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
C
Check Point Blog
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
S
Security @ Cisco Blogs
IT之家
IT之家
T
The Exploit Database - CXSecurity.com
The GitHub Blog
The GitHub Blog
D
Docker
Engineering at Meta
Engineering at Meta
AWS News Blog
AWS News Blog
S
Security Affairs
U
Unit 42
P
Palo Alto Networks Blog
V
Visual Studio Blog
Y
Y Combinator Blog
D
DataBreaches.Net
Forbes - Security
Forbes - Security
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
Security Latest
Security Latest
aimingoo的专栏
aimingoo的专栏
Simon Willison's Weblog
Simon Willison's Weblog
A
Arctic Wolf
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
博客园 - 司徒正美
博客园 - Franky
宝玉的分享
宝玉的分享
TaoSecurity Blog
TaoSecurity Blog
Latest news
Latest news
Scott Helme
Scott Helme
MongoDB | Blog
MongoDB | Blog
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
I Spent 30 Days Tracking the Re-Read Tax in My Claude Code Bill. 73% Was Redundant.
CataDef · 2026-05-18 · via Hacker News - Newest: "AI"

FIELD STUDY · AI CODING AGENTS

A field measurement of what AI coding agents actually spend tokens on — and a working framework for cutting it.

By Aurelian Jibleanu · Founder, ArgosBrain · 9 min read

Where a $4.20 Claude Code session actually goes — 73% re-reads, 27% productive

A month ago I noticed something strange in my Claude Code bill.

I was running long coding sessions on a 400-file Next.js project — real production work, multi-file refactors, the usual. The bills were creeping up faster than I expected. So I did what every engineer does when a number doesn't match their model: I added logging.

What I found surprised me.

73% of the tokens I was paying for weren't reasoning. They weren't tool calls. They were the agent re-reading files it had already read minutes earlier.

This piece is the methodology, the data, and the design space of fixes — written for anyone whose Claude Code or Cursor bill has started looking less like a tool subscription and more like a tax.


The setup: how I logged the re-reads

You can replicate this on any Claude Code session. Here's what I did.

For 30 days I instrumented every coding session by piping Claude Code's tool-call logs through a small wrapper that captured:

{
  "turn": 47,
  "tool": "read_file",
  "path": "src/lib/auth.ts",
  "tokens_in": 3214,
  "tokens_out": 0,
  "session_id": "...",
  "timestamp": "..."
}

Across 30 days I logged 47 sessions ranging from quick bug-fix runs (~30 turns) to long architectural refactors (1,000+ turns). Total: 18,442 tool calls, ~14 million input tokens.

Then I bucketed every read_file call by file path and counted how many times the same path was read inside the same session.

The result is the "re-read percentage": of all tokens spent reading files, what fraction was redundant — i.e., the agent had already read that file in a previous turn of the same session.

If you want to do this yourself, the wrapper is ~80 lines of shell + jq. The harder part is staying disciplined enough to run every session through it for a month.


The data

Three findings stood out.

1. The longer the session, the worse the re-read tax

On short sessions (<50 turns), re-reads were ~25% of read tokens. Annoying but tolerable.

On long sessions (500+ turns), re-reads were 78%. The agent was, on average, reading every relevant file 4–5 times per session.

Aggregate across all 47 sessions: 73% of all read-tokens were re-reads. Weighted toward long sessions because those are where most of the spend is.

Re-read tokens as % of all read tokens by session length
Re-read tokens as a percentage of all read tokens, bucketed by session length. The pattern is structural — the longer the agent runs, the more it forgets and re-reads.

2. The same handful of files got read over and over

In one 1,237-turn session on the Next.js project, the agent read src/lib/auth.ts eleven times. It read prisma/schema.prisma nine times. It read next.config.mjs seven times. None of these files changed during the session.

Top files re-read in one session
The top 8 most-re-read files in a single 1,237-turn session. Eight files accounted for 62% of all read tokens — and seven of them were configuration or type definitions that didn't change once.

The agent wasn't being stupid. As context filled up, it would lose track of what it already knew, and at the next turn it would re-grep, re-read, and re-load the same file to "remember."

This is structural. There's no prompt-engineering fix for it.

3. The cost adds up faster than you think

For the 1,237-turn session, the math worked out to:

BucketTokensCost
Total in-session input1.4M$4.20
Re-read tokens (73%)~1M$3.07
New / productive tokens~400k$1.13

That's $3 of pure redundancy on a single session.

Multiply by 5 sessions a day, 22 working days = $330/month per developer that's just paying for forgotten context.

Annualized, across team sizes, the picture gets sharper:

Annual re-read tax by team size
Annual re-read tax projected by team size. A 25-engineer team spends ~$99k/year on the agent re-loading context it already had. That's not the tool's fault — it's the structural memory gap, multiplied by people.

If your team has 10 engineers on Claude Code or Cursor Pro, that's $40k/year of re-read tax. Possibly more — that calculation assumes only one model. Switching to Opus for harder reasoning multiplies the bill by 5–7x on the same redundancy.


Why it happens (and why prompt engineering won't fix it)

This isn't a bug in Claude Code or Cursor. It's how every current-generation agent works without a persistent memory layer.

The architecture, simplified:

  1. Turn N starts. Agent has a fresh context window with the system prompt and the last few turns of conversation.
  2. Agent needs to know about a function. It calls read_file or grep to find it. Reads ~3k tokens.
  3. Turn N+1. Some of that context falls out as the conversation continues. Agent finishes the immediate task.
  4. Turn N+47. Agent gets a related question. The earlier read has long since dropped out of context. Agent re-reads the same file. ~3k more tokens. Same content.

The agent has no persistent memory between turns. The chat history is the memory, and the chat history has a hard limit. So at some point — usually around turn 50 — every read becomes a potential re-read.

You can patch this with CLAUDE.md or .cursorrules, but those are flat text files. They tell the agent about your project ("this codebase uses Prisma, our auth is in src/lib/auth.ts"), not its actual contents. The agent still has to read the file when it needs the actual code.

Bigger context windows don't fix it either. A 100M-token context window doesn't mean the agent reasons over 100M tokens — it means the file you read three turns ago might still be visible. Helpful but not a structural fix, because (a) bigger windows are slower and more expensive per query, and (b) the agent still hallucinates symbols when the relevant file is buried 80M tokens deep in context.

The real fix is to give the agent persistent, queryable memory of your codebase that lives outside the chat window.


The fix space: three approaches

There are three architectural approaches to giving an agent persistent code memory. Each has real trade-offs, and the right answer depends on your codebase and your tolerance for setup.

The three architectural approaches
Three architectural approaches to persistent code memory for AI agents. None is universally best — the right choice depends on codebase size and query mix.

Approach 1 — Text-based memory (CLAUDE.md, .cursorrules, "memory bank" patterns)

The simplest version. You write a text file describing your project's structure and stuff it into every prompt.

Pros: zero setup, works today, no extra tooling.

Cons: doesn't store actual code. Just metadata. The agent still has to read the file when it wants the function body. Re-read tax barely moves.

When it makes sense: small codebases (<50 files) where the file map matters more than the file contents.

Approach 2 — Embedding-based memory (vector search over your code)

Index every file (or chunk of file) as an embedding. At query time, embed the question, retrieve the top-K matching chunks. This is what most RAG-style code-memory tools do.

Pros: fuzzy queries work — "find code that handles user auth" returns relevant chunks even if "auth" isn't in the function name. Setup is moderate.

Cons: every query costs embedding API calls (real money — typical pricing is $0.02–$0.10 per million tokens for the embedding model itself). Indexing a 100k-LOC codebase ranges from ~$50 to ~$900 just for the embedding pass, depending on which model you pick. Retrieval is probabilistic — you sometimes get the wrong chunk back, which leads the agent to confidently reason over the wrong code. And you need a vector database running somewhere.

When it makes sense: when fuzzy semantic search dominates your workflow and you don't mind the per-query cost.

Approach 3 — Graph-based memory (deterministic symbol index)

Parse the codebase into an abstract syntax tree (AST), extract every symbol — function, class, import, call site — and store it as a graph. At query time, the agent asks deterministic questions: "does function X exist?", "where is X called from?", "what does X import?" The answer is a sub-millisecond graph lookup, not a probabilistic search.

Pros: zero per-query cost (just graph traversal). Deterministic — the agent gets a definitive yes/no instead of a maybe. Hallucinated symbols drop to zero because the agent can verify a symbol exists before using it. Indexing once gives you reliable answers forever (until the code changes).

Cons: doesn't handle fuzzy semantic queries as well as embeddings. Requires the parser to support every language in your codebase. The index has to update when code changes (mostly automatic with file-watchers, but a real engineering concern).

When it makes sense: large codebases where most agent queries are structural (find this function, who calls this, does X exist) rather than fuzzy (find code that does X-ish thing).

In practice, you can combine approaches. Some tools layer embeddings on top of graph indexes for fuzzy queries, falling back to deterministic lookups for structural ones. There's no single right answer.


What the math looks like with persistent memory

I rebuilt the same 1,237-turn Next.js session with a persistent graph-based memory layer running in the background. Same agent. Same prompts. Same model. Same task.

The difference:

Before vs after persistent memory
Same task, same agent, same model — twice. Persistent graph memory cut read calls 9.8×, input tokens 5.8×, hallucinated symbols to zero, and per-task cost 10×.

That's a 10x reduction on this run. The hallucinations going to zero matters as much as the cost — every hallucinated symbol cost me debugging time downstream.

Caveats: this is one session, on one repo, with one task profile. The reduction varies. On simple bug fixes (single-file changes), the gain is smaller — sometimes negligible — because there isn't much re-reading to eliminate. On long architectural sessions across many files, it's bigger.

I'm publishing 30 of these comparisons next month with full methodology and raw logs. The headline finding (~70% reduction on long multi-file sessions) seems to hold across repos, but I want enough data points before I claim it as universal.


How to test this on your own bill

If you're paying for Claude Code or Cursor, here's the cheapest, most honest version of this experiment you can run:

  1. Pick one real session you ran this week. A long one — 200+ turns ideally.
  2. Pull the tool-call log from your Claude Code session history (it's in ~/.claude/sessions/ for Claude Code).
  3. Count read_file calls per file path. If any file appears more than twice, those reads after the first one are your re-read tax.
  4. Multiply. Average re-read tokens per file × times re-read = your tax for that session. Annualize it for a sanity check.

I'd bet your number is between 50% and 80%. Mine averaged 73%. DM me yours — I'm collecting data points for the longer benchmark.


What I built

I'm Aurelian, founder of ArgosBrain. We took the graph-based approach: SCIP + LSP + tree-sitter fused into one local Rust binary. Sub-50ms symbol lookups, $0/query, branch-aware so it survives git checkout. MCP-native, so it plugs into Claude Code, Cursor, Codex and any MCP-compatible agent.

We've benchmarked it on Kubernetes (~2M LOC) and VS Code-scale repos because that's where the existing tools tend to break. Free tier indexes one project, no card required — argosbrain.com if you want to try it on your codebase.

But the bigger point isn't ArgosBrain. It's that the re-read tax is real, structural, and not solved by bigger context windows or better prompts. If you're paying for Claude Code or Cursor at any volume, this number is hiding in your bill. Find it. Fix it with whichever tool fits your workflow.

I'd love to hear what your re-read percentage looks like. Reply, DM me on X, or email [email protected]. I'll post the aggregated numbers (anonymized) once I've collected ~50 data points.