Articles
Articles
Practical writing on building digital products, cybersecurity, and AI in a developer's daily work.
More topics (2)
3 min read#AI#Developer toolsRepeating the same instructions to Claude Code? Put them in a skill
A Claude Code skill is a SKILL.md file with your instructions, which Claude uses when relevant or when you type its name after /. The description decides when.
3 min read#Developer tools#Web developmentNeed to force push after a rebase? Use --force-with-lease
git push --force-with-lease overwrites the remote branch only if it is still at the value you expect, so you do not wipe a teammate's commits. Add --force-if-includes when something fetches in the background.
3 min read#Web development#Developer toolsSeveral workers grabbing the same job? Use SKIP LOCKED in PostgreSQL
With FOR UPDATE SKIP LOCKED, each worker takes a row nobody has locked and skips locked rows instead of waiting. That turns a plain PostgreSQL table into a job queue.
3 min read#AI#Developer toolsclaude -p runs a repo's hooks without asking: use --bare in scripts
Without --bare, claude -p runs the repo's hooks and connects its MCP servers even if you never trusted it, and asks nothing. In scripts and CI, run it with --bare and name the tools.
3 min read#Web development#Developer toolsTwo edits at once and one is lost? ETag and If-Match stop it
The ETag header gives each version of a resource a tag. With If-None-Match the server answers 304 with no body, and with If-Match it refuses a save with 412 if someone edited first.
3 min read#Web development#Developer toolsInstalling a package just to read .env? Use node --env-file
Node.js reads your variables file itself with the --env-file flag, no package needed. But a value already in the environment wins over the file, and a missing file stops the start.
3 min read#AI#Developer toolsbudget_tokens returns 400 on newer Claude models: move to adaptive
From Claude 4.7 on, a request with thinking type enabled and budget_tokens gets a 400 error. Remove the budget, set type: adaptive, and control depth with effort.
2 min read#Web development#Developer toolsA new index froze every write: CREATE INDEX CONCURRENTLY in PostgreSQL
A plain CREATE INDEX locks the table against writes until it finishes. With CONCURRENTLY writes continue and the build takes longer, but it can't run inside a transaction, and a failure leaves an INVALID index to drop.
3 min read#Developer tools#Web developmentNode.js tests without a library: node:test and node --test
Node.js ships its own test runner, the node:test module, stable since v20.0.0. You write test(), describe() and it() as usual, and run every test file with one command: node --test.
2 min read#Developer tools#Web developmentTwo changes in one file, one commit? Use git add -p
git add -p shows a file's changes hunk by hunk, and you choose what goes into the next commit and what stays out. If a hunk holds two changes, s splits it and e opens it in your editor.
3 min read#Developer tools#Web developmentTwo requests, one duplicate row? PostgreSQL ON CONFLICT fixes it
INSERT with ON CONFLICT DO UPDATE in PostgreSQL inserts the row or updates the existing one in a single command, and the documentation guarantees an insert or update outcome even under high concurrency. It needs a unique index on the conflict column.
2 min read#Developer tools#Web developmentLost a commit after a reset? git reflog brings it back
git reflog records every time HEAD or a branch tip changed in your local repository. So you can find a commit lost after a reset or rebase there, and put a new branch on it with one command.
3 min read#Developer tools#Web developmentIndex only the rows you search: PostgreSQL partial indexes
A partial index covers part of a table, set by a WHERE condition, so it holds only the rows that match. But the query's condition must imply the index condition, and parameterized values do not work with it.
2 min read#Supply chain security#Developer toolsDoes npm install run code you never read? Stop install scripts
With npm install, any package in your dependency tree can run a preinstall, install or postinstall script on your machine. The ignore-scripts setting stops them, and npm's own docs say their only valid use is compiling on the target machine.
2 min read#Web development#Developer toolsYour error just says 'save failed'? Keep the reason with cause
When you catch an error and throw a new one with a clearer message, pass the original in the cause option. Per MDN, the cause property holds the original reason, and it has worked across browsers since September 2021.
2 min read#Web development#Developer toolsNeed every page from an async generator in one array? Array.fromAsync
Array.fromAsync() builds an array from an async iterable and returns a Promise. Per MDN, it awaits each value one after another, while Promise.all awaits them all at once, so choose by the job.
2 min read#Web development#Developer toolsThe error that never reaches catch: how Promise.try catches it in JS
Promise.try calls your function straight away and puts its result in a promise, whether it returns a value, throws, or returns a promise. So a synchronous error reaches the same catch as an async one.
3 min read#Web development#Developer toolsPHP 8.6 is out: what changes in your code, from clamp() to finally
PHP 8.6 adds partial function application, clamp() and defaults for readonly properties, deprecates return inside finally because it swallows exceptions, and makes sessions safer by default.
2 min read#Developer tools#Web developmentFound a mistake three commits back? git commit --fixup fixes it in place
Instead of a "small fix" commit at the end of the branch, git commit --fixup makes a commit tied to the wrong one, and git rebase --autosquash folds it in before you open the pull request.
2 min read#Web development#Developer toolsUser text inside new RegExp? RegExp.escape keeps a dot a dot
If you put text inside new RegExp without escaping it, every dot becomes "any character" and other symbols change the pattern. RegExp.escape escapes them for you, and it is Baseline 2025 in browsers.
3 min read#AI#Developer toolsWant JSON that fits your schema from Claude? Use structured outputs
Structured outputs in the Claude API make the response follow a JSON Schema you give it in most cases, except when Claude refuses or stops at max_tokens. Put the schema in output_config.format, or strict: true on a tool.
2 min read#Web development#Developer toolsA bad URL from a user crashed your code? URL.parse returns null instead
new URL throws if the URL is invalid, so it needs try and catch. URL.parse returns null instead of throwing, so you check a URL with one if line, and it is Baseline 2024 in browsers.
3 min read#AI#Developer toolsClaude API returned 529 or 429? When to retry and when to fix
Claude API errors come in two kinds: temporary ones you retry after a wait, like 529, 500 and most 429s, and ones in the request itself that retrying will not fix, like 400 and 401. The official SDK retries twice on its own, and you decide the rest.
2 min read#Web development#Developer toolsNeed the first 3 of a million? map and filter on JavaScript iterators
JavaScript iterator helpers like map, filter and take work on the iterator directly and lazily: they compute the next value only when you ask for it. So they stop once you reach the first results you need, and they even work on a sequence with no end.
3 min read#AI#Developer toolsIs your Claude Code session getting heavy? Let a subagent dig for you
A Claude Code subagent is a specialized assistant that runs in its own context window, with a prompt and tools you choose. It does the long search and hands back the result, so your main conversation stays clean.
3 min read#Developer tools#Web developmentMid-feature and an urgent fix lands? Use git worktree, not stash
git worktree gives you a second working folder for the same repository, with another branch in it. You fix the urgent issue there, and your original work stays as it is, with no stash and no half-done commit.
3 min read#AI#Developer toolsTold Claude Code to lint after every edit and it forgot? Use a hook
Hooks in Claude Code are commands that run on their own at set points, such as after every file edit or before any tool. Put the rule in a hook instead of asking for it in words, and use exit 2 to block the tool or send the error back to Claude.
3 min read#Developer tools#Web developmentSomething broke and you don't know which commit? git bisect finds it
git bisect runs a binary search between a good commit and a bad one: each step halves what is left until it reaches the first commit that broke things. With git bisect run, a script tests each step for you.
3 min read#AI#Developer toolsMany Claude requests and no rush? Send a batch at half the cost
The Message Batches API takes many requests at once and works on them in the background, at 50% lower cost. Most batches finish in under an hour, and results come back with each request's custom_id.
3 min read#Web development#Developer toolsNeed resolve outside the Promise? Promise.withResolvers in one line
Promise.withResolvers() gives you a promise with its resolve and reject in one object, instead of declaring two let variables and filling them inside new Promise. Useful when an event or a callback outside the function settles it.
4 min read#Security updates#Web developmentChrome 157 has 213 security fixes: how to check you're updated
Chrome 157 brings 213 security fixes, and 7 of them are rated Critical. Open About Google Chrome and press Relaunch if it shows, so the update applies.
6 min read#Supply chain security#Developer toolsGitHub blocks pull_request_target in public repos from December 2
From December 2, 2026, GitHub Actions blocks pull_request_target by default in public repos unless an event policy allows it. A two-hour brownout runs on November 16.
3 min read#App security#Developer toolsCan one git push leak a secret key? Turn on push protection
GitHub push protection scans every push before it reaches the repository and blocks it if it contains a key or token. For users it is on by default for public repositories only; for a repository you turn it on in Settings.
3 min read#Web development#Developer toolsComparing two lists with filter and includes? Use Set methods
JavaScript Set now has methods for intersection, difference and union, and each returns a new Set. They work in current browsers since June 2024, and the argument must be a Set or set-like object, not an array.
3 min read#AI#Developer toolsDid Claude's reply stop mid-sentence? Check stop_reason first
Every Messages API response has a stop_reason field that tells you why Claude stopped. If it says max_tokens, the reply hit the token limit you set and was cut off, so do not show it as complete.
3 min read#Web development#Developer toolsDid sort() change your original array? Use toSorted instead
sort() sorts the same array in place and returns the same reference, so the original changes. toSorted() returns a new sorted array and leaves the original as it was, and numbers still need a compare function.
3 min read#AI#Developer toolsKnow the size of your Claude prompt before you send it
The count_tokens endpoint in the Claude API tells you how many input tokens a request has before you send it, in the same shape as a message request. Counting is free, with its own rate limit.
3 min read#Web development#Developer toolsStill grouping arrays with reduce? Use Object.groupBy
Object.groupBy splits any array into groups in one line, based on a value a callback returns, and gives you an object with no prototype. When the key is an object rather than a string, use Map.groupBy.
3 min read#AI#Developer toolsSame instructions in every Claude request? Cache them
Prompt caching in the Claude API stores the part of your request that repeats, and reading it back costs a small fraction of the input price. The cache matches the prefix exactly, so put the fixed part first.
3 min read#Web development#Developer toolsA fetch call that never ends? Give it a timeout
Pass fetch a signal option, AbortSignal.timeout(5000), and the request stops after 5 seconds with a TimeoutError. If you also want a cancel button, combine both signals with AbortSignal.any.
3 min read#Web development#Developer toolsCopied an object through JSON and lost the Date? Use structuredClone
structuredClone makes a deep copy that keeps Date, Map, Set and circular references, which JSON.parse(JSON.stringify()) breaks. Functions and DOM nodes still can't be copied.
4 min read#Developer tools#Web developmentPushed a bad commit to a shared branch? Undo it with git revert
git revert records a new commit that reverses the bad one, so history stays as it is and your teammates lose nothing. Keep git reset and push --force for branches only you use.
4 min read#AI#App securityOne email your AI agent reads can leak your inbox: limit its tools
There is no sure way to stop instructions hidden in what your agent reads, so the protection is in its tools: give it the least access it needs, and make a person approve every risky step.
3 min read#Developer tools#Web developmentSlow PostgreSQL query? Read EXPLAIN ANALYZE without breaking your data
EXPLAIN shows PostgreSQL's estimated plan for a query, and EXPLAIN ANALYZE actually runs it and puts the real numbers next to the estimates. Here is how to read the gap, and how to try it on an UPDATE without changing your data.
2 min read#Security updates#Developer toolsFive Python versions in one day: an expedited security release
Python 3.15.2, 3.14.10, 3.13.18, 3.12.16 and 3.11.18 are expedited security releases that block the compromised eMudhra CA keys in ssl and close a tarfile flaw.
2 min read#Developer tools#Supply chain securityWhat is Zip Cloaking? A file that scans clean and extracts dirty
The Rust zip crate through 9.0.4 reads a file two ways: scanners see the archive index name, the streaming reader writes the other name to disk. Fixed in 9.0.5.
4 min read#Security updates#Developer tools.NET out-of-band update: a Brotli flaw reads your app memory
On Oct 25 Microsoft shipped out-of-band security updates for .NET 8, 9 and 10: a Brotli buffer overflow lets an unauthenticated attacker read or corrupt process memory. Update the runtime and republish your app.
3 min read#Security updates#Developer toolsMongoDB Compass before 1.53.1 trusts recoverable eMudhra certificates
On Oct 24 MongoDB warned: Compass before 1.53.1 trusts certificates issued by eMudhra intermediate CAs described as recoverable, because the app relies on Electron's own certificate store. Update to 1.53.1.
4 min read#AI#Developer toolsMicrosoft open-sourced Agensh: 1,024 coding agents, no orchestrator
On Oct 24 Microsoft Research open-sourced Agensh under MIT: a harness scaling coding-agent teams to 1,024 agents with no central orchestrator, with published results on the hardest ProgramBench tasks.
3 min read#Supply chain security#Developer toolsHow did the poisoned LiteLLM ship? A key leaked in May, never revoked
LiteLLM published its post-mortem of the poisoned 1.107.0 release: a master key exposed in May was never revoked, and it led the attacker to GitHub tokens and to the release on Oct 21.
9 min read#AI#Developer tools75,000 AI agents in a Raspberry Pi's memory: what is AWS's Infinity?
AWS open-sourced Infinity under Apache 2.0, part of the Hydro project with UC Berkeley: a runtime that suspends an agent at a tool call like async/await, so about 75,000 idle agents fit in 8 GB.
5 min read#Supply chain security#Developer toolsThe testmetest npm worm: what it steals, and why not to revoke first
15 npm packages ending in testmetest, and their malicious versions carry a worm that steals SSH, npm, cloud and AI tool credentials, and wipes your home folder if you revoke the stolen GitHub token before you clean up.
5 min read#AI#Developer toolsUpgraded the Claude SDK? Any request that sends temperature gets a 400
Claude API version 2026-10-21 removed temperature, top_p and top_k, and any request that sends them gets a 400, even at the default value. The new major SDK versions send this version on their own, so upgrading means changing your code.
4 min read#Developer tools#App securityCopilot features you never set are turning on: check by October 26
Since October 22, 2026, GitHub has been giving Copilot Business and Enterprise features left Unconfigured the value of the global default. If nobody picked a value, they turn on. Open AI Controls and decide before the rollout ends on October 26.
11 min read#Supply chain security#Developer toolsHow do you protect GitHub Actions if someone moves an action's tag?
The gh actions-lock command writes an actions.lock file that pins every action and its dependencies to a specific commit, so GitHub Actions runs the locked commit even if the tag moves.
11 min read#Developer tools#Web developmentTypeScript 7.1 Beta: up to 1.9x faster type checking. Try it now?
According to Microsoft's numbers, TypeScript 7.1 Beta finishes type checking 1.2 to 1.9 times faster than 7.0 and with less memory. Try it now on a separate branch, because it has a change that can break the build.
11 min read#AI#Developer toolsAI Scan and Claude Code Review: do they review PHP, and at what cost?
GitHub's AI Scan scans PHP code in pull requests and uses credits even on a public repository. Claude Code Review has no official list of languages, and it's billed by tokens.
10 min read#AI#Developer toolsWhy did your model leave Copilot or Codex, and what replaces it?
GPT-5.5 left Codex for ChatGPT sign-ins on October 14, Copilot removed 6 models on October 19, and 3 more leave on November 16. Here is each model's replacement and where to change its name.
