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

标签:#claudecode

找到 87 篇相关文章

AI 资讯

How to take over a design built in Figma Make and develop it with Claude Code

From February to April 2026, I launched four web apps, each starting from a code bundle that Figma Make (Figma's AI feature that generates a working front-end code bundle from a design) had spat out: a beauty-curation site, a gift-record app, a plush-toy album, and a UI mock for an AI development tool. Every one of them starts its repository in a state where "the look is already finished." In this article I look back — from the actual config files and commit history — at what I did to get those generated outputs into a state where I could take over development in Claude Code (Anthropic's CLI coding agent) and start working on them, and at how far each of the four repositories progressed or stalled. The starting point: what shape does a Figma Make output come in? A Figma Make export runs as-is with npm run dev . The README tells the story. # Beauty Information Curation Site This is a code bundle for Beauty Information Curation Site. The original project is available at https://www.figma.com/design/ <id> /... ## Running the code Run `npm i` to install the dependencies. Run `npm run dev` to start the development server. A README that says "the original lives in Figma." That symbolizes the character of the output: the code is a projection of the Figma design, and the code is not the source of truth. On top of that, if you look at package.json , every dependency is exact-pinned. { "dependencies" : { "next" : "15.3.4" , "react" : "19.1.0" , "react-dom" : "19.1.0" , "lucide-react" : "0.487.0" , "motion" : "12.23.24" , "tailwind-merge" : "3.2.0" } } Fixed versions with no ^ . As a snapshot of the moment it was generated, it is highly reproducible, but leave it as-is and it grows stale with no one ever updating it. There is no data layer either. The screens are pretty, but behind them everything is mock data — no persistence, no authentication. "It runs, but there is no foundation to grow it on" — this was the common starting point across all four repositories. [画像: The READ

2026-09-07 原文 →
AI 资讯

Nushell in three spoonfuls: when does a structured shell actually help an agent?

Prelude — Does structure actually help? In late August 2026, I heard Lorenzo Carbonell of atareao.es discuss Nushell and its advantage when working with structured data. One question stayed with me: could that structure genuinely improve my workflow? The Unix shell works well, but many of its pipelines depend on text, column positions, and options whose behaviour can differ across implementations. 1 Nushell takes a different approach: it preserves tables and typed values—dates, numbers, or file sizes, for example—throughout the pipeline. 2 I did not want to replace zsh . I used Nushell as a selective route instead, then tested the decision against three possible outcomes: improvement , if accuracy rises enough to justify the cost; regression , if it adds time, tokens, or complexity without compensating benefits; no material difference , if the technical route changes but the relevant outcome does not. To test this, I wrote a skill (a rule that guides an agent on when to use a tool) and collected 380 runs : 200 pipeline comparisons, 100 A/B runs on a tuned corpus, 50 runs on held-out tasks, and 30 observations from a real aggregate case inspired by the reconstruction of my master's thesis. That is a large number of repetitions across only a few task families. Part of the integration was also tuned during the process. The results are therefore bounded exploratory evidence, not a universal test . The question is not whether Nushell is better than Bash: When does a structured route improve an agent's work, when does it make it worse, and when does it make no material difference? Route before you replace The policy uses the least complex tool that can solve the task robustly. Level Preferred tool Preferred use 1 git , systemctl , pacman , ssh , rsync The operation already has a direct interface. 2 rg , jq , yq , awk , fd A specialised utility handles the transformation. 3 Nushell Several transformations over tabular or typed data. 4 DuckDB, Python, Polars, or R The volum

2026-09-07 原文 →
AI 资讯

CLAUDE.md for an iOS Team: What to Put In It (and What to Leave Out)

My first CLAUDE.md for a client project ran 400 lines: architecture diagrams, the full MVVM-vs-TCA debate, a style section that just repeated SwiftLint's config in prose. Claude Code reads that file in full on every single turn, and it still missed rules buried near the bottom, because by line 340 they're competing with everything else for the model's attention. I cut it to 60 lines over two weeks. Same team, same codebase, fewer violations of the rules that actually mattered. It's not documentation The instinct is to treat CLAUDE.md like a README: a place to record everything true about the project. A README gets read once by a human who skims for the one section they need. CLAUDE.md gets read in full, by a model, every turn, and every line you add dilutes every other line's share of attention. That's the whole design constraint, and most CLAUDE.md files ignore it. What earns a line Non-obvious conventions. Not "we use MVVM," that's visible in five minutes of reading the code. "ViewModels never import UIKit" earns its place only if it's a rule someone actually broke once and it cost a day. Constraints invisible in the diff. App Store review requirements, a minimum OS version the code doesn't yet reflect, a performance budget on one screen because a past ship got rejected for jank. An agent has no way to infer any of that from the code alone. Repo-specific workflow gotchas. Which branch triggers a real deploy, which test suite is a known-flaky non-gate versus a hard one, where the actual source of truth lives when two files disagree. I run a merge gate across a few of my own repos, code only merges once CI is green and review found nothing blocking, and the single highest-value line in each CLAUDE.md is the sentence explaining that the gate exists and why a raw git merge is bypassing something on purpose. What the agent never touches unsupervised. For me that's deploy config and anything security-sensitive. Naming the boundary explicitly is cheaper than discovering

2026-09-04 原文 →
AI 资讯

Run your AI subscription 24 hours a day — use the quota you already pay for

Let me start with a question. Why did I fear development done by artificial intelligence? The answer is plain. AI can build software, and on top of that, it never rests. AI has no labor law People rest. There are labor laws. We sleep at night. We need weekends. Work too many days in a row and the body breaks. So there is a ceiling on how much work a person can move forward in a day. For a long time, we treated that ceiling as a given. But AI has no labor law. It works at night. It works on weekends. Give it an instruction once, and it does not stop until morning. It never says it is tired. It takes no breaks. It keeps working for hours at the same quality. This difference did not fit inside the word "convenient." What I felt was fear. This was not a story about one more handy tool. It was a story about the ground under the speed of work changing at the root. Claude Code came out about a year and a half ago. That is when I understood. The company that runs it 24 hours takes the first-mover advantage. And the company that can punch with money wins. This is not a cynical take. It is the obvious consequence. The first mover wins — that story is not new. Whoever enters a market early takes the ground. They set the standard. Everyone after them chases the gap. AI widens that gap by the day. A company that moved ten hours forward overnight and a company that stood still overnight are ten hours apart by morning. The gap compounds daily. Can you catch up by hiring more people? You cannot. Hiring takes time. Post the opening, interview, teach, wait for people to settle in. That takes months. Meanwhile, the other side's AI keeps moving through the night. The speed of adding people cannot match the speed of adding AI. So the moment a small company steps into a contest of headcount, it loses. It was a ring we should never have entered. Companies that can punch with money win — obviously Why can I say it becomes a contest of money? Because there is no ceiling on how fast you can

2026-09-03 原文 →
AI 资讯

7 of My 8 Claude Code Agents Had Zero Calls in 30 Days: Finding Dead Agents Automatically

I had eight custom agents defined in Claude Code. When I finally counted, seven of them hadn't been called once in the last 30 days. What keeps my ¥1.2M/month automation setup running isn't clever prompting. It's an environment that keeps checking, automatically, whether the things I built are actually doing anything. Why this setup works Claude Code lets you define custom agents by dropping .md files into the ~/.claude/agents/ directory. You define specialists like architect (architecture design), code-reviewer (code review), and security-reviewer (security audits), and expect Claude Code to pick the right one on its own. It's a natural assumption. But when you actually tally the logs, the results are surprising. Take my environment as an example. ~/.claude/agents/ currently holds eight agent definition files. architect.md code-reviewer.md database-reviewer.md INDEX.md planner.md python-reviewer.md security-reviewer.md typescript-reviewer.md ~/.claude/logs/agent-invocations.jsonl holds 682 records spanning May 28 to August 30, 2026. Aggregating the last 30 days gives this breakdown: === Agent usage (last 30d) === total invocations: 23 unique types: 3 Top 10: agent calls errors Explore 19 0 general-purpose 3 0 code-reviewer 1 0 0-call agents (defined locally but not used in 30d): 7 - INDEX - architect - database-reviewer - planner - python-reviewer - security-reviewer - typescript-reviewer Of the eight defined agents, exactly one, code-reviewer , was called even once in 30 days. The other seven had zero calls . 87.5% of the agents I'd defined might as well not have existed. Narrow it to the last 7 days and it gets worse: code-reviewer drops out too, and the zero-call list grows to eight. === Agent usage (last 7d) === total invocations: 3 unique types: 2 0-call agents (defined locally but not used in 7d): 8 - INDEX - architect - code-reviewer - database-reviewer - planner - python-reviewer - security-reviewer - typescript-reviewer This isn't just a "what a waste" sto

2026-09-02 原文 →
AI 资讯

Prompt Engineering Is Dead. Long Live Harness Engineering.

I spent 3 months perfecting prompts. Then I deleted half of them. In late 2023 I had a directory called prompts/ with 47 carefully tuned templates. Few-shot examples, Chain-of-Thought scaffolds, a tiny ReAct loop I was very proud of. I'd A/B tested wording. I'd argued on Twitter about whether "Let's think step by step" still worked. By mid-2025 I deleted 23 of them. They weren't wrong. They just weren't the bottleneck anymore. The thing that broke my agents in production was never the prompt. It was the environment around the prompt — the tools they could call, the files they could see, the moment the loop should stop, the rollback when a tool returned garbage. The prompt was a polished doorknob on a house with no foundation. That's the story of the last three years of AI engineering, compressed: we keep renaming the layer where the real problem lives. A 40% failure rate, and it's not the model's fault Here is the number that should embarrass us. In 2026, around 40% of AI agent projects fail in production . Y Combinator's DevTool Day surveyed CTOs and CPOs in March 2026 and found a strikingly consistent post-mortem: "the difference between success and failure isn't the model." 75% of YC enterprise companies have already deployed coding agents. Most of them hit the same wall: the demo works, the prod deploy collapses. Linear declared in March 2026 that "issue tracking is dead" — meaning if your coding agent gets the issue context directly, you don't need a human ticketing layer at all. Enterprise workflows are being redesigned around agents. In that environment, shipping an agent without understanding the harness around it is like merging onto a highway without a seatbelt. You'll go fast. You'll go through the windshield on the first curve. So how did we get here? Three stages. Stage 1: Prompt Engineering (2022–2023) Scope: one input string. Prompt engineering optimized a single message. Few-shot examples. Chain-of-Thought. ReAct. The deliverable was the wording itse

2026-08-30 原文 →
AI 资讯

Running multiple claude code accounts on Linux

If you use Claude Code for both work and personal projects, you've probably hit this: switching accounts means logging out, logging back in, and losing whatever session state you had. It's a small friction that adds up fast if you're context-switching several times a day. The fix is one environment variable: CLAUDE_CONFIG_DIR for both work and personal projects, you've probably hit this: switching accounts means logging out, logging back in, and losing whatever session state you had. It's a small friction that adds up fast if you're context-switching several times a day. Running Multiple Claude Code Accounts on Linux - Writing Run separate Claude Code accounts on Linux with CLAUDE_CONFIG_DIR — manual setup, an automation script, direnv auto-switching, and VS Code integration. sakibullah.me

2026-08-30 原文 →
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 资讯

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 资讯

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 资讯

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 资讯

From kanban to harness: when the tracking tool becomes the orchestrator

When I shipped KittyClaw two weeks ago, the tool did one thing: serve as a board. The Claude agents ran alongside - first by hand, then via a dispatcher.mjs : a Node script polling KittyClaw's API, triggering the right agent based on who was assigned to which ticket. The dispatcher worked great. It orchestrated Aekan's 13 agents for weeks. But it was an external process : one more node dispatcher.mjs to launch, a state file ( dispatch-state.json ) to keep in sync, logs to dig up in .agents/channel/debug.log , a config to copy-paste across projects in JS. Today, the dispatcher doesn't exist anymore. Orchestration lives inside KittyClaw . I run dotnet run on KittyClaw, nothing else. Aekan's 13 agents still run - but the infra that drives them is now a first-class citizen of the board. This shift from "dispatcher on the side" to "dispatcher inside the board" is small in lines of code, but it completely changes what the tool is. And how I work. This piece documents KittyClaw , the kanban orchestrator at the center of the Ekioo agent-fleet R&D. Alongside Bloomii (constructive-journalism media) and Kalceo (regulatory B2B SaaS for construction contractors), KittyClaw runs the AI agents that drive these projects in production. Before: two processes to run, two places to look The old setup was three stacked layers: KittyClaw - the board, with its UI and REST API. dispatcher.mjs - a separate Node script in the project's .agents/channel/ , launched manually in a terminal. Claude Code - the agents themselves, launched by the dispatcher. It worked. But every project had its own dispatcher.mjs , usually forked from Aekan and hand-adapted. Patterns duplicated: 30s polling, code lock, evaluator debounce, daily budget. Adding a feature (say boardIdle or subTicketStatus ) meant re-coding it in every dispatcher, or accepting that one project had it and others didn't. And visually, orchestration was invisible from the board . To see an agent's live activity, I'd pop a terminal, tail -f

2026-08-21 原文 →
AI 资讯

A 2-Token Prompt and a 39,966-Token Bill: Measuring What My Agent Actually Costs

There is a small cluster of posts going around right now about auditing your LLM invoice, and about how cost calculators get the numbers wrong. I went to check mine and hit a problem before I got to the arithmetic: my pipeline doesn't produce an invoice, and the plumbing I built two months ago is the reason why. This project has a script, git_commit.py , that turns a staged git diff into a Conventional Commit message. It shells out to the Claude CLI. There is no ANTHROPIC_API_KEY anywhere in the project, on purpose — an early version used urllib against the API directly and broke immediately for anyone running on an OAuth session instead of a raw key, so every AI call in the repo goes through a claude -p subprocess instead. That decision is still right. It also means there is no API key, so there is no per-key usage dashboard, so there is no line item to audit. For several months this script has been making a model call on essentially every commit, and I have never once known what any of them cost. The call site throws the numbers away Here is the actual invocation, trimmed: raw = subprocess . check_output ( [ " claude " , " -p " , " --safe-mode " , SYSTEM + " \n\n " + diff ], text = True , timeout = 20 , env = _claude_subprocess_env (), ) subprocess.check_output returns stdout. With the CLI's default output format, stdout is the commit message string and nothing else. Every number I would want — tokens in, tokens out, dollars — is computed on the other side of that call and then discarded, because I asked for a string and a string is what I got. This is the part I want to flag for anyone wiring up a headless model call the same way. It isn't that the metering is missing. It's that the default output format is lossy in exactly the dimension you'd later want to audit, and you won't discover that by reading your own code, because your own code looks fine. It asks for text, it gets text. The fix is one flag: raw = subprocess . check_output ( [ " claude " , " -p " , " -

2026-08-19 原文 →
AI 资讯

One terminal, two trust levels — running Claude Code against a real subscription and a cheap proxy

Part of an ongoing series on model routing and trust tiering for agentic coding tools. This one's the boring, working half — no bug hunt, just a setup that's been running clean across two machines. The problem Claude Code does one thing well: careful, scoped edits with a real plan-then-execute loop behind them, backed by a subscription you're already paying for. Not every task needs that. Exploratory reads, "summarize this directory," draft-and-discard scratch work — most of that doesn't need the most capable model watching every token. The fix is a second, cheaper backend for that category of work. The catch: Claude Code only speaks Anthropic's Messages API. It has no built-in notion of "same tool, different model." So the question is how to point it somewhere else without giving up the interface. The stack Trusted agent: claude — real Anthropic subscription, default session Cheap agent: claude-cheap — same CLI, routed through a self-hosted proxy Proxy: LiteLLM, translating Anthropic-format requests to DeepSeek V4 (pro for Sonnet-tier calls, flash for Haiku-tier) served through an OpenRouter API Transport: a persistent SSH tunnel from a small VPS back to each machine The proxy itself wasn't new. It's the same LiteLLM instance already routing a separate content pipeline I run. The actual work here was wiring Claude Code to it: a shell function and a few environment variables. The core trick and it took me a few week to learn this is to point ANTHROPIC_BASE_URL at LiteLLM's /v1/messages endpoint, not the OpenAI-compatible path LiteLLM also exposes. Claude Code only understands the Anthropic shape, so the OpenAI-shaped endpoint fails in ways that look like a client bug and aren't. Once LiteLLM sits on the right endpoint and translates underneath, Claude Code has no idea it isn't talking to Anthropic. The one bug worth flagging Claude Code's Plan Mode attaches a context_management parameter to its requests. Anthropic's API handles it. Most other backends don't recogniz

2026-08-17 原文 →
AI 资讯

Four Failures That Made a Weekly launchd Job Actually Run

Every skill my AI setup learns lives in one folder on my laptop — and none of it reaches the repo I created yesterday. That gap is why I built a weekly job that pushes my accumulated skills into every project on the machine. This is what it does, and the four failures I hit getting it to run unattended. Why this mechanism works Claude Code's ~/.claude/skills/auto/ is essentially a personal "habits library." Workarounds, completion criteria, and verification commands discovered mid-task get written out to skill files automatically by the AI, and can be referenced immediately on the next request — that's how the mechanism is designed. Reality is a little different, though. Skills keep piling up in .claude/skills/auto/ . But a project in a freshly created git repo, a side-gig job opened for the first time in weeks, a set of tools written in another language — those don't have the skills at all to begin with . Unless a human copies them by hand, or I type "refer to that skill" every single time, the habits I so carefully accumulated are completely dead in other projects. The structure of the problem looks like this. Skills accumulate in one place, .claude/skills/auto/ (global) They're actually referenced only "when that project has .agents/ or .claude/skills/ " (local) That bridging doesn't happen each time you create a new project (zero start) This isn't "growing your environment," it's "regrowing it every time." Once monthly revenue crosses a certain line, the number of concurrent jobs rises, and there are weeks where I cut two or three new repos. Each time, noticing the missing skills, copying manually, verifying — that work quietly eats time. Not the duration of a single tool call, but the opportunity cost of "if that skill had been here, this would have taken three minutes." The weekly auto-distribution script solves this. Early every Sunday morning, it scans all git repositories and pours the skills in. Without a human doing anything, the project you open on Monda

2026-08-17 原文 →
AI 资讯

Don't Hand Your Inbox to an Agent

A Reddit thread on connecting Claude Code to a Yahoo Mail account turned into a solid field guide for scoping down what an AI agent is allowed to touch. Here's the distilled version. Don't give Claude Code your Yahoo password or unrestricted mailbox access. The risk isn't only the password leaking, it's that an agent with full access can read private messages, attachments, recovery details, and information about other people, all in the course of doing something mundane. Why "just connect it" is the wrong instinct The thread's most-quoted line frames the problem well: people are casually handing agents the keys to everything at once. People are talking about just giving ai agents access to their entire devices LOL. Emails, passwords, bank accounts like what. The concern isn't that the agent will maliciously steal your data, it's that broad access creates exposure you didn't intend, every time the agent reads something to complete an unrelated task. The issue isnt really theft its exposure. And exposure scales with trust you've already granted, not with anything going wrong: It's all based on trust. Safer ways to connect it 1. OAuth over password Use a connection method where Yahoo shows you exactly what's being requested and lets you revoke it later. Never type your Yahoo login directly into the agent. 2. Least access, read-only Point it at a separate, low-value mailbox if you can. Avoid granting send, delete, forward, or account-settings permissions; the agent shouldn't be able to act as you. 3. Keep credentials out of the agent The safer pattern is a credential vault the agent calls out to, so it can request an authenticated action without ever seeing the raw secret. Before you connect anything ✅ Strip sensitive mail first. One commenter's habit: swap real details for placeholders and dummy data, then substitute the real values back in once the model's output comes back. ✅ Use a throwaway or secondary account. Never connect the address tied to banking, password re

2026-08-16 原文 →