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

标签:#code

找到 312 篇相关文章

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

I Replaced grep-Based Code Review with a Knowledge Graph + MCP. Here Are 3 Bugs Vector Search Missed.

For about a year, my AI code review setup looked like this: AI gets a PR, AI greps for related code, AI reads way too many files, AI says "looks fine." It mostly worked. Until the bugs that didn't show up in grep started shipping. The problem wasn't the model. It was the retrieval. Vector search and keyword grep are great at finding files that mention auth.py . They're terrible at finding files that depend on auth.py through three import hops, an event bus, and a decorator. That's where the bugs live. I rewired the retrieval layer with a code knowledge graph plugged in through MCP. Three bugs surfaced in the first week that vector search had been quietly missing. Here's what changed and the bugs themselves. Why grep + vector search missed these Vector search retrieves by semantic similarity . "Find code about authentication" finds auth.py , login.py , password_validator.py . Useful. Knowledge graphs retrieve by structural relationship . "What depends on auth.py ?" returns the call graph -- including event_handlers/login_event.py , which never mentions auth in its variable names but listens to a login event whose payload changes when auth.py changes. Both are valid. They answer different questions. The bugs that ship to production tend to live in the second question. The setup: code KG as an MCP server The Model Context Protocol (MCP), released by Anthropic in late 2024, lets you expose tools to a model in a standard way. By 2026 it's supported by Claude Code, Cursor, Windsurf, Zed, VS Code, and (as of GA in May 2025) the official MCP Registry hosts hundreds of servers. I used code-review-graph , an open-source tool that builds a property graph of your codebase and exposes it as an MCP server. The setup is a three-line ritual: pip install code-review-graph code-review-graph build ./my-project code-review-graph install # auto-detects Claude Code / Cursor / Windsurf The graph contains nodes for files, classes, functions, and tests, with edges for imports, calls, inheri

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

Google Antigravity Comes to VS Code: Agentic Coding Without Leaving Your Editor

If you've tried an "agentic" AI coding tool recently, there's a good chance it asked you to switch editors entirely. Google's own agent-first IDE, Antigravity, launched in November 2025 with exactly that trade-off: full agentic power, but only inside its own dedicated desktop application. That trade-off just went away. Google has shipped Antigravity extensions for VS Code, Visual Studio, JetBrains, and Zed , bringing the same agent, the same review workflow, and the same account into the editor you've already spent years configuring exactly the way you like it. This post walks through what the VS Code extension actually is, how it fits into Antigravity's broader architecture, how to install and configure it, and most importantly; how its permission system keeps an agent that can read files, run terminal commands, and drive a real browser from doing anything you haven't explicitly allowed. By the end of this article, you will be able to: Explain how the extension relates to the full Antigravity 2.0 desktop app and the agy CLI Install and authenticate the extension inside VS Code Work through the agent side panel, implementation plans, and walkthroughs Configure the permission engine so the agent only does what you approve Lock down its browser subagent so it never touches your personal Chrome data New to Antigravity generally? Start with Google's own primer: Antigravity 2.0 Overview Prerequisites To follow along hands-on, you'll need: VS Code version 1.90 or later, on macOS, Linux, or Windows A Google Account on any Antigravity plan (the free tier is enough), or an enterprise account enabled for Gemini Enterprise About five minutes for the first-time sign-in and backend install You can also read this purely as an architecture and workflow walkthrough; every step is explained, not just shown. 1. Where the Extension Fits in Antigravity's Architecture It helps to know there are actually three doors into the same house: [ Antigravity 2.0 ] ── the full desktop app, a dedi

2026-08-29 原文 →
AI 资讯

LeetCode ~ first 30 Hard problems, with solutions

Pulled live from leetcode.com/problemset/?difficulty=Hard on 29 Aug 2026 (895 hard problems in the Algorithms list). "First 30" = the 30 lowest problem numbers. Everything below is Python 3 . How to use this Open the problem on LeetCode and make sure the language selector says Python3 . Select all the text in the code editor and delete it. Paste the block below in its place — each block already contains the class Solution signature LeetCode generated for that problem, plus any commented-out ListNode / TreeNode header. Press Submit . Do not add import statements or redefine ListNode / TreeNode — LeetCode injects typing.List , typing.Optional , heapq , math.gcd and the node classes automatically. The blocks are written to rely on exactly that. Verification Every solution was executed locally against an independent brute-force reference on randomised and edge-case inputs ( 4,637 assertions, all passing ), then stress-tested at each problem's documented maximum input size ( 31/31 within budget ). Two real defects were found and fixed during that pass — see the notes on #127 and #149. 4. Median of Two Sorted Arrays https://leetcode.com/problems/median-of-two-sorted-arrays/ Approach. Binary search on the cut position of the shorter array. O(log(min(m,n))) , O(1) space. Constraints (from the problem page). nums1.length == m nums2.length == n 0 <= m <= 1000 0 <= n <= 1000 1 <= m + n <= 2000 -10 6 <= nums1[i], nums2[i] <= 10 6 class Solution : def findMedianSortedArrays ( self , nums1 : List [ int ], nums2 : List [ int ]) -> float : # Binary search on the shorter array's cut position. O(log(min(m, n))). if len ( nums1 ) > len ( nums2 ): nums1 , nums2 = nums2 , nums1 m , n = len ( nums1 ), len ( nums2 ) lo , hi = 0 , m total = ( m + n + 1 ) // 2 while lo <= hi : i = ( lo + hi ) // 2 # take i elements from nums1 j = total - i # take j elements from nums2 l1 = nums1 [ i - 1 ] if i > 0 else float ( ' -inf ' ) r1 = nums1 [ i ] if i < m else float ( ' inf ' ) l2 = nums2 [ j - 1 ]

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

Junior AppSec Engineer Overwhelmed by Massive Code Reviews: Strategies for Efficiency and Confidence

Introduction: The Systemic Failure in Application Security Onboarding Consider the scenario of a junior Application Security Engineer tasked with securing a 2-billion-line codebase, written in unfamiliar languages, within a one-month deadline. This is not a theoretical exercise but the lived experience of a recent graduate in India, whose public appeal for assistance reveals profound deficiencies in how organizations integrate and support junior AppSec talent. The pressure is unrelenting, the tools are insufficient, and the expectations are disconnected from practical realities. This case is not an isolated incident but a symptom of a broader organizational failure to address the complexities of application security in high-stakes environments. The engineer’s experience underscores a critical misalignment: the exponential growth in codebase complexity has outstripped the resources and guidance provided to those responsible for securing them. Absent a senior AppSec mentor, with limited proficiency in critical languages such as Laravel/PHP and C#, and equipped only with rudimentary tools like grep and Codex, the engineer is forced to navigate an environment rife with unseen risks. The consequences are twofold: individual inefficiency and self-doubt, compounded by organizational exposure to unmitigated security threats. The causal pathway is unambiguous: massive codebases + unrealistic deadlines + subpar tools + absent mentorship → overwhelmed engineers → cursory reviews → undetected vulnerabilities → systemic security compromise. The risks extend beyond individual burnout to include data breaches, financial liabilities, and reputational damage. This is not an edge case but a predictable outcome of organizational neglect. The urgency is undeniable. As software systems increase in complexity and cyber threats proliferate, the demand for competent, adequately supported AppSec professionals has never been more critical. Yet, organizations persist in failing to bridge the

2026-08-28 原文 →
AI 资讯

Day 4: Bag-of-Words and Text Vectorization

Previously, on Day 3: Explained stopword removal, stemming, and lemmatization in NLP, including how they simplify and normalize text for analysis using practical examples and Python code. Text Vectorization: Turning Words into Numbers Computers work with numbers, not text. To handle language, a Natural Language Processing (NLP) system must convert words, sentences, or documents into numerical data. Usually, this means turning them into vectors—ordered arrays of numbers. This process is called text vectorization . A vector is a mathematical summary of a piece of text. The details and meaning behind the numbers depend on which vectorization method is used, but all serve a common purpose: to translate language into something a machine can process. For example, imagine building a program to filter spam emails. The program can't directly understand words like "WINNER" or "sale." Every word must be mapped to a number before the program can look for patterns in messages. What is the Bag-of-Words Model? Bag-of-Words (BoW) is the simplest and most common way to vectorize text. BoW ignores grammar and word order. It treats each document as a "bag" containing words, just counting how many times each word appears. For example, the sentences "dog bites man" and "man bites dog" will produce the same vector in a BoW system. Both have the words "dog," "bites," and "man," each once. The meaning is very different to a human, but to BoW, they're identical. This straightforward approach makes BoW fast and effective for many tasks, especially where quickly spotting key words is enough—for example, spam detection. From Words to Vectors: Building a Vocabulary The first step in BoW is to build a vocabulary . This is a list of all unique words seen across your dataset (called a "corpus"). Suppose your dataset contains two sentences: "cat sat on the mat" "dog sat on the log" List all unique words: ["cat", "sat", "on", "the", "mat", "dog", "log"] The word order in the vocabulary doesn't matte

2026-08-28 原文 →
AI 资讯

OpenAI’s executive exodus has one big winner

Today on Decoder, I’m talking to Verge senior AI reporter Hayden Field about some pure Decoder bait: the seemingly-endless org chart changes at OpenAI, and how all of them seem to consolidate power under cofounder Greg Brockman, the company’s president. While Sam Altman is the CEO and still OpenAI’s most public face, Brockman has amassed […]

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

Craftsmanship as service: why clean code is an act of care

In virtually every software engineering team, the temptation of the 'quick and dirty' fix surfaces sooner or later. The sprint deadline is looming, stakeholders are eager for a release, and a code snippet exists that barely passes the happy path. The logic is undocumented, edge cases remain unaddressed, and the design is brittle, yet the ticket can technically be moved to 'Done'. In the short term, everyone appears satisfied: the feature ships and the milestone is recorded. But before long, the consequences arrive: subtle bugs surface in production, extending the codebase becomes perilous, and teammates spend frustrating hours attempting to decipher undocumented logic. What began as a brief shortcut solidifies into technical debt and team friction. At the core of Christian ethics lies the command to love your neighbour as yourself. While that principle is often discussed in abstract theological terms, in modern software engineering it takes on direct, tangible significance. Who is your neighbour in a development team? Your neighbour is the colleague who will maintain, debug, or extend your pull request six months from now. Your neighbour is the junior engineer looking to existing code for guidance. And your neighbour is the end user relying on the system to function reliably and securely. When you deliberately invest effort in clear naming conventions, modular architecture, comprehensive documentation, and thorough automated tests, you provide genuine service to your peers. You choose to carry the cognitive burden today so that someone else does not suffer tomorrow. That is Christian care translated into code. Craftsmanship extends beyond syntax; it shapes the cultural atmosphere of an engineering team: Honesty regarding technical debt: Having the courage to articulate when architectural shortcuts threaten system sustainability, rather than passively allowing brittle code into production. Constructive peer reviews: Conducting code reviews with the intention of mento

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

Intent Alignment Reviews: Justify Every Line of Code

A program can produce the right answer and still contain work that does not help it reach that answer. Tests pass, the output looks correct, and unnecessary computations survive because they appear harmless. This becomes easier to miss in AI-generated code. A model can produce a plausible implementation in seconds, but plausible code often includes variables, conversions, or branches that the requirement never asked for. An intent alignment review adds one question to the usual correctness check: Does every instruction help achieve or explain the stated goal? This does not require a formal proof or an exhaustive line-by-line exercise. The useful result can be concise. Correctness and intent Correctness asks whether the observable behavior matches the specification. Intent alignment looks for code that contributes neither behavior nor useful clarity. The goal is not to produce the fewest possible lines. A named constant or helper function can be worthwhile even when the program could run without it. The concern is accidental complexity: code that suggests requirements or design decisions that do not actually exist. AI can help by reading the requirement and implementation together. It can confirm the working behavior, identify unnecessary instructions, and explain whether those instructions are harmful or simply unhelpful. A small Fibonacci example Consider this specification: The function should print to stdout the first hundred elements of the Fibonacci sequence. The phrase "first hundred" does not specify whether the sequence begins with 0, 1 or 1, 1 . For this review, we assume the intended convention begins with 0, 1 and prints one value per line. def print_fibonacci_100 (): a , b = 0 , 1 sequence_limit = 100 display_width = len ( str ( sequence_limit )) for index in range ( sequence_limit ): current_value = int ( a ) print ( current_value ) a , b = b , a + b checkpoint = ( index + 1 ) % 10 == 0 final_pair = ( a , b ) print_fibonacci_100 () Review The implementa

2026-08-26 原文 →
AI 资讯

Codex Memory Internals: What It Remembers, Who Decides, and How It Compares to OpenCode

I began this investigation with a specific question: can Codex autonomously add, modify, and delete its own memories? The product documentation already says that it has memory. What I wanted to know was who actually decides what survives. When an old chat contains a useful build command, does deterministic application code copy it into a database? Does the active coding model call a memory tool? Does another model summarize the chat later? When the command becomes obsolete, is the old fact overwritten, invalidated, aged out, or simply left where future agents may still find it? Those questions led to a more interesting result than a feature checklist. Codex has a genuine cross-session memory subsystem, but its behavior is split between model judgment and deterministic lifecycle code. Models decide what a rollout means and how durable guidance should be rewritten. Runtime code decides which rollouts are eligible, which evidence remains in the working set, when old records are deleted, and when the consolidation model is allowed to run. That makes the short answer precise: With local memories enabled, Codex can autonomously add, modify, merge, and remove persistent memory without a user approving each write. User-requested corrections follow a separate append-only note path, while retention, thread deletion, and reset provide additional forms of forgetting. The rest of this article explains why each word in that answer matters. This analysis is pinned to OpenAI Codex commit 8444cf63b50a8a88521e0d2970d49f659b48eac7 , checked on August 25, 2026. The feature is marked stable in that source tree but remains off by default, so this describes implemented behavior, not behavior every Codex user is currently receiving. Key Takeaways Codex local memory is a background two-model pipeline. One model extracts reusable material from each eligible rollout. A second model consolidates those outputs into a global file-based memory workspace. The LLM owns semantic CRUD, but not lifecy

2026-08-26 原文 →
AI 资讯

The function you wrote last month is a third-party API

There is a habit I have for other people's libraries that I do not have for my own code: before I call something, I read what it returns. With my own functions I skip that, because I wrote them, so I know. Three times in three days that turned out to be false, and the third time I caught it before it cost anything only because I had started treating my own modules like somebody else's. The version I had already been burned by twice I maintain qbofile , a set of browser-based converters between the file formats accounting software uses. It is a small codebase: a parser per input format, a generator per output format, and pages that wire one to the other. Wiring a new pair felt like plumbing, so I estimated it like plumbing. Two new pages, both reusing an existing parser and an existing generator: no new code. I said that out loud before opening either end. The generator had no column for the thing the parser produced. The parser could read the category a user had assigned to each transaction; the CSV generator emitted six fixed columns and category was not one of them. Not a bug — it had simply never needed one, because the format it was originally written for does not carry categories. That is a strange kind of wrong. Nothing was broken. The code did exactly what it always had. My model of it was built from the function name. The same evening, in the same pair of modules, the second one: L . push ( `P ${ sanitizeText ( tx . description )} ` ); P is the payee field in that output format. M is the memo. Two fields, and upstream, description was defined as memo || payee . So for any transaction that had a memo, the memo took the payee slot and the actual payee was dropped. Silently — the file is valid, it imports fine, and the missing name never announces itself. The two minutes that caught the third one After the second one I wrote down a rule and did not really believe I needed it: before wiring two components together, open both ends and read what actually crosses.

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

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

Codex CLI with any model: the "codex router" setup in one config block

OpenAI's Codex CLI is a genuinely good coding agent, but out of the box it runs OpenAI models on OpenAI billing. Sometimes you want Claude Opus for a gnarly refactor, Kimi K2.7 Code for cheap long sessions, or a model served from EU infrastructure because your client asks where tokens go. What most people miss: Codex has custom providers built in. It speaks the Responses API to whatever base_url you give it, so any gateway that implements the Responses API can act as the router behind Codex. No forks, no proxies, one config block. Option 1: the config block Codex reads ~/.codex/config.toml . Add a provider and a profile: [model_providers.opper] name = "Opper" base_url = "https://api.opper.ai/v3/compat" env_key = "OPPER_API_KEY" wire_api = "responses" [profiles.opus] model = "anthropic/claude-opus-4-7" model_provider = "opper" [profiles.kimi] model = "moonshot/kimi-k3" model_provider = "opper" I'm using Opper here (disclosure: I work there), an EU-hosted gateway with 700+ models behind one API key that implements the Responses API. Export the key and launch with a profile: export OPPER_API_KEY = "your-key" codex --profile opus That's the whole router. Yes, that means Claude running inside OpenAI's own CLI, which never stops being funny. Option 2: one command If you don't want to touch config files, the Opper CLI writes exactly that block for you (with sentinel markers, so it never clobbers your existing config and can cleanly remove itself): npm install -g @opperai/cli opper launch codex It detects Codex (installs it with --install if missing), configures the provider, and starts it with preset profiles. opper launch codex --model moonshot/kimi-k3 picks a model at launch. Which models actually make sense in Codex openai/gpt-5.3-codex : the model Codex was built for, via API billing. Honest note: if you already have a ChatGPT plan, Codex is included there and that's the cheaper path for this one model. The router play is for everything else. anthropic/claude-opus-4-7

2026-08-25 原文 →
AI 资讯

Free AI App Builder with Backend: FastAPI Microservice Guide

If you need a free AI app builder with backend to get a FastAPI microservice running today, you can do it with a handful of platforms that bundle hosting, a database, and auth for zero cost. The catch is that the free tiers have hard limits, and they expose the same failure modes you’ll hit in production if you’re not careful. Below I walk through the exact steps, show the code that works, compare the popular builders, and explain how to transition to a production-grade stack when the free tier starts to choke. What free AI app builder platforms include backend services? The short answer is: Cursor , Bolt , and Lovable all ship with a “one-click deploy” that creates a container, wires up a PostgreSQL instance, and adds optional OAuth. They are marketed as “no-code AI app builders,” but you can drop in any Dockerfile – including one that runs FastAPI – and they’ll handle the rest. Platform Backend offering Free tier limits Auth support Cursor Managed container + Postgres 13 500 MB RAM, 1 CPU, 100 k requests/mo Google, GitHub, email Bolt Container + SQLite (upgrade to Postgres) 256 MB RAM, 0.5 CPU, 50 k requests/mo Magic link, JWT Lovable Container + MySQL 5.7 300 MB RAM, 1 CPU, 75 k requests/mo Email/password, OAuth All three let you push a Git repo and they rebuild automatically. That’s the “free AI app builder with backend” you’re after – you get a place to run your FastAPI code without paying for a VM. How do I build a FastAPI AI microservice and deploy it with a free builder? The first thing most builders break on is the cold-start latency of a Python container that pulls a large model at import time. I’ve been bitten by this on Cursor: the first request took 30 seconds, then timed out because the free tier caps request time at 15 seconds. The fix is to load the model lazily or move it to a separate worker. Below is a minimal FastAPI app that calls Claude via the anthropic SDK. The code fits in a 30-line file and works on any of the three platforms. # main.py fro

2026-08-25 原文 →