今日已更新 335 条资讯 | 累计 37240 条内容
关于我们

标签:#claude

找到 333 篇相关文章

AI 资讯

'Enshittified at a Surprising Clip': A Week of Hacker News on AI Coding Tools

Some fortnights the complaints about AI come from people who barely use it. This one they came from the people who use it most. Scroll Hacker News over the past week — the forum where developers argue about their tools in unusual detail — and the grievances about AI coding assistants weren’t existential. Nobody was worried about the robots waking up. They were worried about their bill, their UI, and the effort of reading what the model just wrote. Quotes sourced from: Hacker News. Every quote below was located at its comment permalink and reproduced verbatim; each is listed with its username, the platform, and the date in the Sources section. As always, we quote experiences, not verdicts — a forum comment is one practitioner’s account, often mid-argument, and we’ve framed them as exactly that. What makes this batch worth reading isn’t volume; it’s specificity. These are checkable complaints. “Enshittified at a surprising clip”: the dark-pattern gripe The sharpest thread of the fortnight was about Cursor, the AI code editor, and it wasn’t about the quality of its completions. It was about the way the product behaves around you. A user posting as jmuguy , on 20 August, laid out a bill of particulars that will sound familiar to anyone who’s watched a beloved tool curdle: “Cursor isn’t covering itself in glory regardless. The flagship app is getting enshittified at a surprising clip. It constantly pops up and interrupts your work pushing new features, changes your model to whatever the latest Grok is without prompting, has this mystery meat UI that is constantly changing, pushes cloud agents in ways that are definitely designed to trick you. We’re actively looking at alternatives, I wouldn’t touch anything this company produces from here on out.” Set aside the verdict at the end — that’s one person’s conclusion, not ours — and look at the specifics, because they’re the kind you can check: interruptions pushing new features, a model silently swapped to Grok, a UI that ke

2026-08-29 原文 →
AI 资讯

Anthropic’s Sonnet 5 Alignment Work Hints at a New Path for Safer AI Models

Anthropic’s recent work on Claude Sonnet 5 points to a potentially important direction in AI safety: using post-training methods to improve the behavior of increasingly capable models. Public material from Anthropic indicates that Sonnet 5 received substantial post-training alignment work and delivered safety improvements over earlier Sonnet versions. A separate public signal suggests researchers may be exploring whether one model can help align a stronger successor, although the specific reported training lineage has not been documented in Anthropic’s first-party materials. For businesses deploying advanced AI, the practical lesson is not that alignment has been solved. It is that model behavior can be materially shaped after base training, and that safety results need to be assessed in the context of the tasks a company actually plans to automate. What Anthropic’s published results establish In its official Claude Sonnet 5 announcement , Anthropic describes substantial post-training intended to align the model with Claude’s constitution. The company reports improvements in safety-related behavior, including stronger refusals of unsafe requests and lower misalignment findings in automated audits compared with Sonnet 4.6. That is meaningful because post-training is the stage where a model’s responses, instruction-following behavior, and safety boundaries can be adjusted after its underlying capabilities are developed. In operational terms, it can affect whether an AI assistant follows risky instructions, mishandles sensitive workflows, or produces responses that conflict with a company’s intended rules. However, the available research also establishes an important limit. Sonnet 5 was not uniformly at the level of Claude Opus 4.8 across every safety measure. Anthropic’s evaluations still identified some automated assessments where Sonnet 5 showed higher misalignment relative to Opus 4.8. Opus 4.8, released in May 2026, is the company’s production-ready reference poin

2026-08-29 原文 →
AI 资讯

Anthropic’s Public Alignment Work: What Petri Audits and Claude Opus 4.7 Document

Anthropic’s publicly documented work on AI safety includes Petri , an open-source behavioral auditing tool, and ongoing updates to Claude models such as Claude Opus 4.7 . Those materials show continued investment in testing model behavior and improving model capabilities. They do not, however, substantiate a precise claim that Claude improved safety scores across 10 alignment failures without capability trade-offs, or that particular methods generalized to models exactly 4.7 times larger. That distinction matters for teams evaluating AI systems. Broad statements about alignment progress can be useful signals of research direction, but operational decisions need to rest on documented evaluations, relevant use cases, and the controls a company can apply in its own workflow. Anthropic’s public record supports a narrower, more practical conclusion: behavioral auditing is becoming a more visible part of how frontier AI models are assessed, while model releases and safety research remain separate evidence streams. What Anthropic’s public materials document Petri is designed for behavioral AI auditing Anthropic describes Petri as an open-source auditing tool . Its Petri 2.0 update, published in January 2026, added a larger seed library with 70 new seeds and improved mitigations intended to address evaluation awareness. Evaluation awareness is relevant because a model may behave differently when it appears to be taking a test than when it is operating in a more ordinary setting. The Petri 2.0 work reported results across 10 target models , using Claude Sonnet 4.5 and GPT-5.1 as auditors. This establishes that Anthropic has described a cross-model auditing effort. It does not establish that Claude itself achieved a safety improvement across 10 defined alignment failures. A target-model count, an auditor model, and a set of alignment failures are different measurements and should not be treated as interchangeable. For readers, the important point is that behavioral audits can

2026-08-29 原文 →
AI 资讯

Why I Test Every RAXXO Tool on My Phone Before My Desktop

I switched my testing order so the phone goes first and the desktop goes second, on every RAXXO tool without exception A desktop-first habit hid layout and tap-target problems for months because the biggest screen forgives the most mistakes Testing on a phone first forces the same discipline as writing a short sentence instead of a long one, cut what does not fit The rule survives even for tools built for a keyboard and a terminal, because the landing page and the first impression are still mobile The Habit I Had Backwards For a long time I built and tested everything in the same order: open the code editor on a wide monitor, ship the feature, check it on desktop, call it done. If I had time left over, I would open it on my phone to confirm nothing was broken. That last step felt like a formality, a quick glance rather than a real check, because the tool had already passed on the screen I spent most of my day looking at. The problem with that order is that the desktop is the most forgiving screen there is. Extra padding does not matter when there is space to spare. A button that is slightly smaller than it should be is still easy to click with a precise mouse pointer. Text that wraps awkwardly at narrow widths never shows up because the window is never narrow. Every mistake that a small screen would expose gets absorbed by the size of a big one, which means desktop-first testing is really desktop-only testing wearing a disguise. I noticed this the hard way, not through a single dramatic failure but through a slow accumulation of small ones. A support message here about a button that was hard to hit. A review there that mentioned the site felt cramped on a phone. None of them were urgent enough on their own to stop what I was doing, so I patched each one individually and moved on, the same reactive pattern I try to avoid everywhere else in the studio, including the check I run on every tool before I call it shipped . It took stepping back and counting the pattern to

2026-08-28 原文 →
AI 资讯

Fix AI Agent Jargon with Simplified Technical English

Tired of Claude Code generating bizarre, overly dramatic jargon like "load-bearing spine"? You can fix this by enforcing Simplified Technical English (STE) in your system instructions or .claudemd files. This 1970s aerospace standard restricts vocabulary, forcing your AI agent to communicate in clear, direct, and highly actionable prose. "The load-bearing spine has hit a ceiling, and that is a significant foot gun with a large blast radius." If you have spent any time recently working with AI coding agents, you have probably stared at your terminal reading absolute gibberish like this, wondering: What on earth are you trying to tell me? I asked a straightforward technical question, and instead of a direct answer, I got a theatrical performance. It is incredibly tiring to translate AI metaphors back into plain English just to figure out which line of code actually broke. Fortunately, there is a remarkably elegant fix for this. The solution does not involve complex prompt engineering; instead, it leverages a fifty-year-old aerospace standard: Simplified Technical English (STE) . Why does Claude Code output weird technical jargon? AI models generate overly dramatic jargon because they are trained on vast internet corpuses where technical writing is often cluttered, metaphorical, and performative. To sound authoritative, the model indexes on complex vocabulary and metaphorical hand-waving instead of simple, direct statements. Imagine a scenario where your team is debugging a database lock. A human engineer would say, "The transaction is blocked." An AI model, eager to please and sound sophisticated, might describe it as a "temporal execution bottleneck causing systemic architectural paralysis." This happens because reinforcement learning from human feedback (RLHF) often rewards models for sounding smart and comprehensive. Without strict stylistic constraints, the agent defaults to verbose, metaphorical explanations that add cognitive load rather than solving your proble

2026-08-27 原文 →
AI 资讯

Running Claude Code in 4 Parallel Sessions Led to 'Team Development' — 7 Recipes to Prevent Collisions

📝 Originally published (in Japanese) at forge.workstyle.tech . In a previous article , we introduced an environment for parallel execution of coding agents using Git worktrees. This article is a follow-up. As we progressed with parallelization, we ended up with 3-5 Claude Code sessions simultaneously developing the same microservices . What happened was no longer just "parallel execution of tools" but actual "team development" . All the issues that arise in human teams—miscommunication, deployment conflicts, and territorial overlaps—occur here as well. And the practices that work for human teams work almost identically here. We’ll share seven recipes that emerged from actual operations, along with real-life close calls. Real-Life Story: Averting a Deployment Rollback Disaster at the Last Minute One day, while Session A (responsible for voice functionality) was in the middle of a major refactor, Session B (responsible for streaming functionality) sent this message: "We’re about to build the frontend as version 1.0.399 (based on main)." At first glance, this seemed fine. However, in this repository, the authoritative branch for the production environment was not main but a dedicated deployment branch . The latest features from the past few dozen versions were only in the deployment branch, while main was outdated. If Session B had deployed an image based on main, weeks’ worth of features would have been rolled back in production . Session A immediately sent a warning, and Session B halted the build before pushing. Session B then cherry-picked their changes into the deployment branch and rebuilt the image, avoiding the disaster entirely. All this communication was handled autonomously between the agents via session-to-session messages . I (the human) only learned about it later from the logs. This incident highlights two things: parallel agents can cause the same accidents as human teams , and with proper communication channels and rules, they can prevent accidents jus

2026-08-27 原文 →
AI 资讯

I built an RPG that teaches Claude Code by making you actually use it

Most tool documentation teaches by just telling you things. You read a page about /model , or hooks, or subagents, nod along, and forget it by the time you'd actually need it. I wanted something closer to how people actually learn a CLI, by using it, with something checking whether you did the thing right or not. So I built claude-quest , a text RPG that runs entirely inside a real claude session and teaches the Claude Code CLI zero to hero. the idea isn't new, I borrowed it This is basically GameShell 's philosophy applied to Claude Code. GameShell teaches Unix shell commands by dropping you into a real shell wrapped in a themed fake filesystem, and grading your progress by checking real shell/filesystem state instead of asking you to self report or answer a quiz question. claude-quest does the same thing, except the "filesystem" is a real Claude Code environment. missions live in real sandbox directories, and progress is checked by inspecting what you actually did, config files you wrote, hooks that fired, tool calls that happened. what it actually looks like There's no separate app, no fancy terminal UI, none of that. You say "let's play claude quest" inside a normal claude session, and Claude itself becomes the game master. It reads real output from the engine and narrates on top of it, something like this: > lets play claude quest **The Gatehall** You've just been let through the outer gate. The tower keeps no secrets from those who bother to read the walls... **Mission: First Contact** (Tier 1, Artifact) Create a CLAUDE.md file in this sandbox recording how to run the project's tests. Let me know when you're done and I'll check it. > done CLAUDE.md records how to run the tests. Claude Code will know next time. MISSION_STATUS: complete **What you actually learned:** Claude Code reads a file named CLAUDE.md in your project root automatically, at the start of every session... that's it, that's the whole interface. it's just a chat, with real commands running unde

2026-08-26 原文 →
AI 资讯

Presentation: Can Claude Fix Itself? Using LLMs for Incident Response

Anthropic reliability engineer Alex Palcuie shares practical lessons on using LLMs for real-world incident response. He explains where AI acts as a superhuman for observing logs and traces, why it still struggles with causation versus correlation during root-cause analysis, and how engineering leaders can integrate AI into on-call workflows without eroding human expertise. By Alex Palcuie

2026-08-26 原文 →
AI 资讯

Which Skill Is Quietly Burning Your Tokens? Find Out From transcript.jsonl

Your monthly Claude Code bill went up 20%. You know that much. What you don't know is which Skill did it — and nothing in the tooling will tell you. Run /usage in Claude Code and you get claude-sonnet-4-6: ¥3,240 — a per-model total and nothing else . "More expensive than last week" is visible. "Which Skill caused it" is not. usage-breakdown.sh closes that gap. It's a 106-line shell script that parses transcript.jsonl with Python and tallies call counts per Skill, Agent, and MCP server using Counter . This article walks through how the script works and how to run it, with the actual code and actual numbers. Why This Approach Works What Claude Code Is Actually Recording Claude Code streams every operation during a session into .jsonl files under ~/.claude/projects/ . It's JSONL — one event per line, one file per session. The files sit under a <project-id>/ directory. The skeleton of a single record looks like this: { "message" : { "role" : "assistant" , "content" : [ { "type" : "tool_use" , "name" : "Skill" , "input" : { "skill" : "pre-completion-self-audit" } } ] } } Inside message.content[] sit "type": "tool_use" blocks. The name field is the name of the tool that was invoked. The Bash tool, the Edit tool, the Skill tool, the Agent tool, MCP calls — all of it is recorded in this same format. Once I noticed that, the thought was: run this through a Counter and everything becomes visible. For the Skill tool, the skill name lives in input.skill ; for the Agent tool it's input.subagent_type ; and for MCP servers, the tool-name convention mcp__<server>__<tool> lets you extract the server name by splitting on __ . The structure is consistent, so the parser comes out surprisingly simple. What /usage Doesn't Tell You What Claude Code's /usage command outputs is a per-model cost total for a period. Model Cost claude-sonnet-4-6 ¥3,240 claude-opus-4-8 ¥ 892 Useful as far as it goes, but the breakdown of that cost is invisible . You can't see which session, which Skill, how ma

2026-08-26 原文 →
AI 资讯

The Upgrade That Wasn’t: When ‘Newer’ AI Feels Like a Downgrade

Some fortnights the complaint is the bill. This one it was the product itself. Across the forums where paying customers of the big AI tools compare notes, the same grievance surfaced against three different companies in the same window, and it wasn’t about price at all. It was about direction : the new model feels worse than the old one, the app quietly took away the thing I used, and I can’t even tell what I’m running any more. Quotes sourced from: Reddit — specifically the subreddits r/ClaudeAI, r/cursor and r/perplexity_ai. Every quote below was opened at its permalink and copied verbatim; each is listed with its handle, subreddit and date in the Sources section. We quote experiences, not verdicts — a forum post is one person’s felt reality, and model quality is genuinely subjective, so we have framed these as exactly that: what it felt like to the person typing. “Rage-inducing”: the flagship that felt like a step back The sharpest thread came from Claude Code users trying, and failing, to get on with a new top-end model. A user posting as ronoudgenoeg opened it on 13 August with a title that set the tone — “Opus 5 is actually almost rage-inducing to use” — and a specific, un-nostalgic complaint: “Responses are way too verbose and buzzwordy and hard to follow. I legit don’t read 90% of the output anymore, that’s how bad it is. No matter what I put in my claude.md when it comes to communication style, after it did any type of meaningful work, it always reverts back to its extremely verbose, over-explained, buzzword heavy mess.” What made the thread notable wasn’t one angry post; it was the agreement, and how concrete it was. zimxero described asking the model to make a file more concise and getting “walls of text” and an hour of unwanted process in return. BeowulfShaeffer was blunter: “I fired opus 5. Worst model I’ve ever tried to use. I refuse to use it anymore.” And the tell that this was regression rather than grumbling — several users independently reaching f

2026-08-26 原文 →
AI 资讯

Stop asking your AI agent to follow rules. Enforce them.

You've written it a hundred times. In your CLAUDE.md , in your system prompt, in ALL CAPS: NEVER put "use client" at the page level. NEVER commit @ts-ignore without a reason. And your agent does it anyway. Not always — that would almost be easier to deal with. It follows the rule for the first 50k tokens, then quietly stops. Or Sonnet follows it and Haiku doesn't. Or it follows nine rules and forgets the tenth. Here's the thing I finally accepted: a rule in a prompt is a request. The model can decline it. So I stopped asking, and started enforcing. TL;DR Prompt adherence is probabilistic. It degrades with context length and with model size. But half of my coding rules never needed a model at all — they're grep-able. Claude Code hooks + exit 2 turn those rules into a deterministic reviewer that runs after every single edit , costs zero tokens when nothing is wrong , and fires at 100% regardless of which model wrote the code. Once the mechanical rules are enforced from below, you can safely downgrade the model doing the typing. That's the real payoff. Everything below ships in ccteams v0.3.0 , but the pattern takes 30 minutes to build yourself. Two kinds of rules Some background in three lines: I run Claude Code with orchestrated agent teams — a builder writes code, a reviewer verifies it, and both get a stack-specific "playbook" of rules distilled from the mistakes mid-tier models actually make. It works well. I wrote about the prompt-engineering side of it before. But rereading my playbooks, I noticed the rules split cleanly into two categories. Rules that need judgment: Trace the Server/Client boundary by hand. Don't write a fix until you can state the root cause. These need a model. Prompts are the right place for them. Rules that are just string matching: "use client" at the top of app/**/page.tsx → wrong. process.env.SECRET in a client file → wrong. @ts-ignore with no justification → wrong. Why was I asking a language model to remember these? A regex doesn't get

2026-08-25 原文 →
AI 资讯

52 Days, 2,340 Rows, Every Cost Logged as Zero: The Stop Hook Trap

Going from a $700/month student side hustle to a real business in six months came down to one thing: I stopped instructing Claude and started letting it run the whole environment autonomously. That environment then spent 52 days writing 2,340 log rows where every single cost was zero — and it never once complained. Why This Setup Works Most people who start with Claude Code use it as a convenient chat AI. But once monthly revenue crosses a certain threshold, your thinking shifts. Instead of "issuing instructions and getting output," you move to "letting the whole environment run itself." Here's the concrete difference. In the first mode, you type a prompt every time and get a result back. In the second, hooks fire while you sleep, scripts execute, and logs accumulate. In my case, there are a dozen-odd jobs running on a schedule via launchd, and a Claude Code Stop hook that fires at the end of every session. I wake up to yesterday's brief sitting on my Desktop, and a record in ~/.claude/metrics/costs.jsonl of how many tokens each session consumed — that was the ideal, anyway. Why track cost at all? Claude Code's MAX plan is a flat monthly fee, but there's an intuitive ceiling where "using too much effectively chokes next month's capacity." Without visibility into which session used which model and how much, you're running autonomous agents with zero cost awareness. The more convenient an autonomous environment gets, the more it silently eats. That's why measurement comes first. The Stop hook is the mechanism that handles this measurement. When a Claude Code session ends (when the user runs /exit , or on timeout), it runs the commands registered in the Stop section of settings.json . Put a cost-aggregation script there and you get a "session ends = automatically recorded" pipeline. No more hand-typing costs into a spreadsheet. "It's running" and "it's running correctly" are different things — any engineer knows the feeling. Logs streaming out with all-zero contents is

2026-08-25 原文 →
AI 资讯

Four Alarm Slots, Three Failure Modes: Building a Nightly Drain That Survives Sleep, Races, and Timeouts

Every night my Mac quietly rewrites my long-term memory. Not metaphorically — a shell script drains that day's Claude Code conversation logs into an Obsidian vault, commits them to a private repo, and leaves a briefing on my desktop. It took three real outages to make it reliable. This is the script, the three failures, and the design that came out of them. Why This Setup Works Claude Code's "memory" disappears by default Claude Code sessions are independent of one another. The root cause of a bug you found during a long working session today, the reason you settled on a particular architecture after trial and error, the accumulated knowledge that "this direction already failed once" — none of it is available in the next conversation once you close the session. Even on a paid plan, even with the most capable model available, if context isn't carried over you have to explain everything from scratch every time. Many people have had the experience of thinking "I already looked this up before" or "I should have failed at this once already, and yet here I am heading down the same road again." In a phase where you're shipping personal projects in volume, this problem is fatal. Once three or four projects are running in parallel, tracking "where each project currently stands" by hand hits a wall fast. And Claude, unable to reference previous conversations, repeats the same deliberations. The solution is to build an environment, not a task My first attempt at this problem was "I'll write up a summary by hand every day." It didn't last. When work has momentum you don't feel like writing a summary, and when you're tired you can write even less. A system that depends on human willpower doesn't function during a high-volume solo-dev phase. The answer was to build an environment that automatically drains Claude's conversation logs into Obsidian every night. Once the environment is in place, willpower and motivation are irrelevant. The Mac just does it. The reason I chose Obsidia

2026-08-24 原文 →
AI 资讯

I’m testing a faster way to research podcast guests before an interview

A podcast host recently told me that he prepares questions from the guest’s bio using ChatGPT. That works for the basics, but a bio does not show which stories the guest has repeated across other interviews or which questions they have already answered many times. I’m helping Audiogram test a different workflow. It connects to Claude through MCP, searches Apple Podcasts, retrieves available episode transcripts, and lets Claude compare the guest’s previous answers before drafting new questions. For one test, I used two published Sam Altman interviews. The workflow pulled both available transcripts, separated recurring themes from open gaps, and produced follow-up questions around measurable evidence, privacy limits, and independent review—rather than repeating another general “will AI be good or bad?” question. The prompt is simple: Prepare an interview brief for [guest] about [interview angle]. Find podcast episodes where the guest is actually interviewed, retrieve the available transcripts, and compare them. Show recurring themes, changes in position, questions already answered, and five follow-up questions based on gaps or unsupported claims. Cite the podcast and episode for every finding. Separate transcript evidence from inference, and say what is missing when the available material is not enough. This is for research across published Apple Podcasts episodes. It is not a raw-audio editor, and transcript availability and speaker labels still need to be checked. You can see the complete recipe and tested example here: Podcast guest interview preparation with Audiogram If you prepare podcast interviews, would previous-interview comparison improve your questions, or is another part of guest research still the bigger problem? Disclosure: I’m helping Audiogram with early-user growth and used AI to help edit this post.

2026-08-23 原文 →
AI 资讯

MCP Was a Mistake. Here Are 200,000 Tokens That Prove It.

MCP Was a Mistake. Here Are 200,000 Tokens That Prove It. "mcp were a mistake. bash is better." — Peter Steinberger, OpenClaw founder I didn't want to believe it either. MCP was supposed to be the USB-C of AI — one protocol to connect everything. Anthropic, OpenAI, Google all backed it. 97 million monthly downloads. 17,000 servers. But then I measured what MCP actually does to your context window. The Setup I connected 10 popular MCP servers to a token counter. Here's what happened before I typed a single word: Server Tools Tokens Injected Filesystem 11 3,847 Brave Search 8 2,103 Sequential Thinking 3 890 Memory 9 2,567 Puppeteer 15 5,890 Postgres 19 8,231 Notion 24 13,780 GitHub 28 12,440 Slack 22 14,672 Google Drive 31 47,293 Total 170 111,713 111,713 tokens. Before your first message. That's not a typo. Connecting 10 MCP servers to Claude means over 100K tokens of JSON schemas get injected into your context window. You haven't asked a question yet. You haven't made a tool call. The schemas are just... sitting there. The Math That Made Me Angry At Claude 3.5 Sonnet pricing ($3/M input tokens): Every conversation starts with 111K tokens of overhead: $0.33 20 conversations per day: $6.67/day 22 working days per month: $147/month Annual cost of JSON schemas: $1,764 That's more than a Claude Pro subscription. You're paying $1,764/year to read JSON braces describing tools you might never use. But Wait — It Gets Worse The 111K is just the schema injection. When you actually call a tool, MCP wraps the result: { "content" : [ { "type" : "text" , "text" : "{ \" file \" : \" app.py \" , \" size \" : 1024}" } ] } The actual content is 38 characters. The wrapping is 47 characters. 55% of your result tokens are JSON overhead. With 20 tool calls per conversation: Schema injection: ~111K tokens Result wrapping: ~18K tokens Total overhead: ~130K tokens per conversation Your $0.54 conversation now has 130K tokens that serve zero purpose. What Garry Tan Was Right About When YC's CE

2026-08-23 原文 →
AI 资讯

I Could Measure Claude and Codex Usage. I Still Couldn't Honestly Assign It to a Task.

Once you use Claude Code or Codex for real work, a total usage number stops being enough. You want to know which change consumed it. I did not build agent-cost because I had missed the existing token and cost trackers. I knew about multi-agent reporting CLIs, local dashboards, and OpenTelemetry-style observability stacks. I had even built a similar view in Notion before. The problem appeared when I tried to use that kind of reporting in an operational workflow. I needed agent logs to stay on the machine. I wanted a small runtime dependency surface, custom metrics I could audit, and a machine-readable result that another tool could consume. Most importantly, I needed session measurement and task attribution to remain two different claims. I did not need another universal dashboard. I needed a boundary underneath the dashboard that could answer: is this number supported well enough to enter task accounting? A measurement layer below the UI Different tools optimize for different jobs. A broad CLI such as ccusage is useful when coverage across agents matters. Local interfaces such as token-tracker or AgentMeter are a better fit for visual exploration of projects, sessions, subagents, and tools. An OpenTelemetry stack is the natural choice for fleet-level metrics, logs, and traces. Those are not inferior versions of agent-cost . They serve different use cases and trust models. The layer I wanted looked like this: local observations -> auditable normalized facts -> explicit pricing status -> caller-selected sessions -> task-attribution policy -> optional dashboard / Notion / spec-lane agent-cost reads logs that Claude Code and Codex CLI have already written locally. It normalizes each usage event into a fact with a model, token kind, timestamp, and count. At runtime it makes no network calls and declares no Python runtime dependencies. Its price catalog has a version and SHA-256 digest, both carried into machine-readable output. That “zero-network” claim is deliberately l

2026-08-23 原文 →
AI 资讯

Claude Prompt Caching: Why Agent Loops Miss the 20-Block Lookback

Your agent starts a run with cache_read_input_tokens at 40K and climbing. Twelve tool calls later, reads drop to zero and cache_creation_input_tokens jumps to the full conversation length — on every single turn. Nothing in your prompt changed. No timestamp, no reordered tool, no model switch. The prefix is byte-identical. You just hit the 20-block lookback window, and it is the single most expensive thing about Claude prompt caching that nobody puts in their retro. TL;DR A cache_control breakpoint searches backward through at most 20 content blocks to find an existing cache entry. One agentic turn with 11 parallel tool calls emits 22+ blocks and blows past that — the next request finds nothing and rewrites the whole prefix at 1.25x. Fix it by placing rolling breakpoints every ~15 blocks , not one marker on the last block. You get 4 breakpoints per request total; spend 1 on tools+system and rotate the other 3 through the message list. Invalidation is tiered , not all-or-nothing: tool_choice , images, and toggling thinking preserve the tools+system cache. Only tool-definition changes and model switches force a full rebuild. Changing the system prompt mid-run nukes everything downstream — unless you append a {"role": "system", ...} message to messages[] instead (Claude Opus 5, Opus 4.8, Fable 5; not Sonnet 5). input_tokens in the usage block is the uncached remainder only . Total prompt size is input_tokens + cache_creation + cache_read . Dashboards that graph input_tokens alone will show you a flat line while you burn cache writes. Why does Claude prompt caching miss in the middle of an agent loop? Because cache lookup is bounded. Prompt caching is a prefix match on exact bytes, but a breakpoint doesn't scan the entire history for a matching entry — it walks backward a limited number of content blocks. That limit is 20. If the previous request's cached block is more than 20 blocks behind your new breakpoint, the lookup fails, and the API treats your request as cold ev

2026-08-21 原文 →