Claude Focus — Development skill for Claude Code
Three hooks that fix Claude Code's attention drift.
How to install Claude Focus
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open assafkip/claude-focus and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Focus does
Three hooks that fix Claude Code's attention drift. Cited research, one-line install.
Alternatives in Development
- Ecc Guide — Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su 243.5k ★
- Fix Py Line Too Long 71.9k ★
- Bib Filter — Filter a LaTeX project's bibliography to the entries actually cited 130 ★
README
claude-focus
**Three hooks that stop Claude Code from drifting, lying about "done," and burning tokens.** ~550 lines of Python. Zero dependencies. MIT. Drop them into `~/.claude/hooks/` and wire three lines of settings.
git clone https://github.com/assafkip/claude-focus.git ~/.claude/hooks/claude-focus
cp ~/.claude/hooks/claude-focus/examples/settings.example.json ~/.claude/settings.json
Open Claude Code. The hooks are live. If you already have a `~/.claude/settings.json`, merge the `hooks` block instead of overwriting.
The three hooks are `token-guard.py` (circuit breaker), `verification-gate.py` (catches false "done" reports), and `echo-of-prompt.py` (re-injects the original task so the model stops drifting). They run as PreToolUse / UserPromptSubmit / Stop hooks. No LLM call sits in the hot path, so they are fast and deterministic.
Version 1.1 - updated 2026-05-28
How do I stop Claude Code from running away and burning tokens?
Add a `PreToolUse` hook that counts tool calls and blocks the turn when it sees a runaway pattern. `token-guard.py` is that hook. It catches the model retrying a failed call three times, making 50 tool calls with no user input, spawning subagents that produce nothing, or hammering an MCP server. When a pattern trips, it blocks the turn (exit code 2) and tells the model what to do instead.
| Trigger | What it catches | Action |
|---|---|---|
| Same tool + same input, 3x | Retry loops without diagnosis | Block |
| 50 tool calls since last user message | Runaway execution | Block |
| 25 subagents since last user message | Agent-spawn storm | Block |
| 30 MCP calls in 60s | API hammering | Block |
| 3 edit attempts on same file | Wrong-approach edit spiral | Block |
Attempted edit to .env, .pem, .key |
Accidental secret exposure | Block |
| 15 consecutive reads, no write | Grep drift | Warn |
| Same file read 3x | Re-read loop | Warn |
| 5 greps since last write | Searching instead of wo |
Related Skills
St Ask
Read-only codebase Q&A: parallel facet research, file:line-cited claims, confidence, contradictions, blocked l
Claude Pings
Never miss a Claude Code response again. Windows toast notifications with 150 witty messages, feature tips, an
Innovate
Draft N novel sparse-attention submissions in one shot — algorithm-innovation focus, all must compile, no benc
Skill Anthropic Grade Optimizer
Audits Claude-directing artifacts (CLAUDE.md, SKILL.md, subagent, hook, MCP, prompts, api_config) against 189
Hatch3r Ask
Answer a free-form question about the user's codebase, read-only. Triages question breadth, fans out one hatch
Review Changes
Use when asked to review changes in this repository. Focus on bugs, regressions, API contract drift, retrieval
Related Agents
Readme Validator
Validate and fix every claim in a README. Line-by-line verification of install commands, features, endpoints,
Amm Specialist
AMM-specific audit specialist. Uniswap V2/V3/V4, Curve, Balancer, Berachain BEX, custom AMMs. Use when the tar
What If
Opus 5 plan prober that walks a handed plan against a facet checklist and returns ranked blind-spot probes, ea