SShortSingh.
Back to feed

Claude Code file-guard hooks on 'Read' do not intercept Bash cat commands

0
·1 views

A developer testing Claude Code's PreToolUse hook system found that hooks registered on the Read tool are never triggered when the model accesses a file via the Bash cat command instead. In controlled experiments run on Claude Code versions 2.1.246 and 2.1.258 on Linux, a blocker hook set to exit 2 on Read successfully stopped direct Read tool calls but was completely bypassed by cat, allowing the file's contents to reach the model. By contrast, a deny rule configured in settings.json blocked cat access to the specified file across both Read and Bash tool paths. A follow-up test confirmed the deny rule operates per-file rather than per-directory, despite misleading wording in the tool's response message. The findings, prompted by a GitHub issue filed on 2026-08-26, highlight a significant gap for users relying solely on PreToolUse hooks to keep sensitive files out of model context.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How PaycheckForge Built a Privacy-Respecting Embeddable Paycheck Calculator Using Iframes

PaycheckForge developed an embeddable paycheck calculator that uses a plain iframe with no JavaScript SDK or API key, keeping integration simple for host websites. The tool uses fixed heights per calculator type instead of a dynamic resize protocol, reducing complexity and improving compatibility with restricted JavaScript environments. All salary and tax calculations run entirely in the browser, meaning sensitive financial inputs are never sent to PaycheckForge servers, though the developer acknowledges a standard HTTP request is still made when the frame loads. The embed route deliberately strips out navigation, ads, and analytics, and is marked noindex to avoid duplicate content in search results. Accessibility was also prioritized, with descriptive iframe titles, proper label associations, keyboard-visible focus, and support for reduced-motion preferences built into the widget by default.

0
ProgrammingDEV Community ·

How Staking Reward Pools Work: A Vyper Implementation Using Lazy Accounting

A developer tutorial published on DEV Community explains the mechanics behind onchain staking reward pools, arguing the underlying model is simpler than commonly perceived. The core concept is lazy accounting: instead of pushing rewards to every staker each block, the contract maintains a running index tracking how much a single staked token has accrued since inception. Each user also stores a personal checkpoint, called reward debt, to ensure they are only paid for the time they were actually staked. The guide implements this pattern in Vyper 0.4.3 using the Moccasin framework, drawing on the Unipool and Synthetix staking rewards designs. It highlights key differences from the MasterChef pattern and covers setup, contract structure, and testing practices including fuzz and integration tests.

0
ProgrammingDEV Community ·

Open-Source Skill Lets AI Coding Agents Self-Verify Work Before Claiming Done

A developer frustrated with manually testing AI-generated code has released an open-source tool called 'stop-manual-testing' on GitHub. The skill integrates with AI coding agents such as Claude Code, Codex, and Cursor, instructing them to build and run machine-checkable verification criteria before marking any task complete. Instead of handing off a 'Done' result for human review, the agent iterates within a closed loop until all automated checks pass. For checks that cannot be automated, the tool specifies exactly what the developer needs to verify manually and explains why. The creator claims the approach can eliminate roughly 90% of the manual review time developers currently spend evaluating agent output by gut feel.

0
ProgrammingDEV Community ·

IonQ Shows MacBook Pro Can Handle Error Correction for Million-Op Quantum Systems

Researchers from IonQ demonstrated that a standard Apple M4 Max MacBook Pro can perform real-time quantum error correction at the scale of a hypothetical million-logical-operation machine. The study, conducted by Min Ye, Andrii Maksymov, and Nicolas Delfosse, simulated error data streams for a trapped-ion quantum computer using up to 408 logical qubits and over 11,000 physical qubits. Their optimized decoder added less than 0.3% to total computation time at a 0.01% physical error rate, and stayed under 12% overhead even at 0.05%. The team achieved this efficiency partly by cutting memory requirements by over 90% and allowing multiple decoding processes to run concurrently on a single CPU. The findings suggest that specialized hardware like custom chips or GPUs may not be necessary to support fault-tolerant quantum computing at scale.