Newcontext-mode—Save 98% of your AI coding agent's context windowLearn more
MCP Directory
ServersClientsBlog

context-mode

Save 98% of your AI coding agent's context window. Works with Claude Code, Cursor, Copilot, Codex, and more.

Try context-mode
MCP Directory

Model Context Protocol Directory

MKSF LTD
Suite 8805 5 Brayford Square
London, E1 0SG

MCP Directory

  • About
  • Blog
  • Documentation
  • Contact

Menu

  • Servers
  • Clients

© 2026 model-context-protocol.com

The Model Context Protocol (MCP) is an open standard for AI model communication.
Powered by Mert KoseogluSoftware Forge
  1. Home
  2. Clients
  3. claude-code-tips

claude-code-tips

GitHub
Website

practical patterns for agentic coding: hooks, agents, automation. built from hundreds of claude code sessions

21
2

EN | ZH | ES | HI | PT | JA

claude-code-tips

CI
GitHub stars
last commit
tested with
license

my claude code setup, open source. hooks, agents, tips, and a plugin that mines your usage data.

if this saves you time, star it. it helps others find it.

quick start

/plugin marketplace add anipotts/claude-code-tips   # add marketplace (one time)
/plugin install mine@cc                             # install mine (session analytics)
/plugin install cc@cc                               # install cc (cross-session messaging)

then: copy safety-guard.sh to block dangerous commands. read a tip. done.


the numbers

hundreds of sessions across dozens of projects. $200/mo max plan.

same usage would cost ~$12K on the API with caching, ~$95K without. no autonomous loops. no cron jobs. every session starts with me typing a prompt. how the cost math works →

<img src="./gifs/mine-stats.gif" width="100%" alt="mine stats showing sessions, tokens, costs, and projects" />

install the mine plugin

/plugin marketplace add anipotts/claude-code-tips   # add marketplace (one time)
/plugin install mine@cc                             # install mine (session analytics)
/plugin install cc@cc                               # install cc (cross-session messaging)

you get mine · session mining to sqlite. costs, search, error memory, pattern detection. all data stays local at ~/.claude/mine.db.

/mine                     today's sessions, cost, top tools
/mine search "websocket"  full-text search across all conversations
/mine mistakes            error patterns claude keeps repeating
/mine hotspots            most-edited files across sessions
/mine loops               repeated patterns across sessions

start with mine + the safety-guard hook. add more as you go. mine docs &rarr;


cc plugin

cross-session messaging. see what other claude code sessions are doing, send messages between them.

/plugin install cc@cc
/cc                          show active sessions
/cc send merizo "pause"      message another session

the 3 things that changed how i code

hooks

hooks are the difference between "claude does what i want" and "claude does whatever it feels like." CLAUDE.md gives guidance. hooks give enforcement. one is a suggestion, the other is a wall.

this repo has 9 hooks you can drop into any project. safety-guard blocks force pushes, rm -rf /, and curl | bash. no-squash blocks squash merges. context-save preserves state before compaction. pick the ones that fit your workflow. hook guide &rarr;

agent teams

multiple claude instances working simultaneously on the same codebase, each in its own git worktree. the coordinator assigns tasks, collects results, merges the best approach.

i use this for parallel research, trying risky changes safely, and comparing approaches side-by-side without touching my working tree. how i use agent teams &rarr;

prompt caching

this is why the $200/mo plan is the best deal in AI coding. claude code caches your system prompt, tools, and CLAUDE.md as a prefix. 91% of my input tokens hit the cache, meaning i pay 10% of the input cost on 91% of my reads.

the key: keep your CLAUDE.md short and stable. every edit breaks the prefix cache. mine is 30 lines and changes maybe once a week. the full cost breakdown &rarr;


tips

short, standalone techniques. each one is something you can use in your next session.

tipwhat you learn
prompt cachingget 97%+ cache hit rates, slash your bill
safety hooksblock force pushes and rm -rf in 5 minutes
settings hierarchyproject vs global vs local settings
session lengthwhy shorter sessions are more efficient (with data)
ultrathinkforce extended thinking for complex problems
context managementcompaction strategies, active tool rate, keeping sessions tight
plan modewhen planning saves time vs when it wastes it
fast modesame model, faster output, the tradeoff
pluginsbuild a plugin from scratch, what makes one worth installing
subagentsagent teams, worktree isolation, when parallel pays off
mcp integrationwire up MCP servers, use them inside sessions
hooks v2command vs http vs prompt hooks, the async pattern

hooks

copy one, wire it up, done. each is a standalone bash script. full guide &rarr;

hookeventwhat it does
safety-guardPreToolUseblocks force push, rm -rf /, DROP TABLE, curl-pipe-sh
no-squashPreToolUseblocks squash merges
panopticonPostToolUselogs every tool call to sqlite
context-savePreCompactsaves context before compression
notifyNotificationroutes to macOS, Slack, ntfy
<details> <summary>4 more hooks</summary>
hookeventwhat it does
commit-nudgePostToolUsereminds you to commit after N edits
version-stampSessionEndauto-updates "tested with" stamps
stale-branchSessionStartwarns about gone tracking branches
md-lint-fixPostToolUseauto-fixes markdown lint on save
</details> <img src="./gifs/hook-safety.gif" width="100%" alt="safety-guard blocking a dangerous command" />

example agents

copy to .claude/agents/ and invoke with /agent <name>. each teaches a different pattern. guide &rarr;

agentpatternwhat it does
watch-testsdaemonwatches files, runs tests, proposes fixes
try-worktreeworktreetries risky changes in isolated worktrees
arch-reviewquick reviewfast architecture smell-test
write-prgit integrationPR descriptions from your diff

commands i use

commandwhat it does
/mineusage data · costs, sessions, search, patterns
/shipstage, commit, push, open PR in one command
/improvepropose CLAUDE.md updates from git history

plus 2 example commands you can copy: /sweep, /quicktest.


my personal takes

what
cost realitywhat claude code actually costs, the prompt caching math
mistakes i madewhat burned me so you can skip it
automationthe 12 CI pipelines that maintain this repo
session workflowhow i work day-to-day with claude code
worktreesparallel exploration with the desktop app

vs the alternatives

diplomatic, data-driven, no FUD. every claim cites a source.

vs cursor &middot; vs codex &middot; vs gemini &middot; vs antigravity &middot; pricing


examples

  • CLAUDE.md templates · starter configs for TypeScript, Python, Rust, Next.js
  • example agents · 4 agents, each teaching a different pattern
  • example commands · 2 commands you can copy to any project
  • handoff plugin · PreCompact context preservation
  • broadcast plugin · async notifications on git events

how this repo works

this repo runs on its own patterns.

  • 12 CI workflows · docs audit, competitive intel, community digest, freshness check, stale cleanup, dependabot, releases, plugin smoke test, PR quality gate, validation, claude responder, upstream watcher
  • 11 hooks running on every session
  • <$1/month CI cost · AI-powered workflows use haiku
  • 0 manual maintenance · everything that doesn't require taste is automated

automation details &rarr;


tools i built from these patterns

these all came out of living in claude code every day. each solves a specific problem i kept hitting.

  • mine · session mining to sqlite. costs, search, error memory, pattern detection
  • claudemon · real-time session monitoring across projects and machines
  • cc · multi-session awareness. see what other sessions are doing, send messages between them
  • imessage-mcp · MCP server for read-only iMessage history. 26 tools, zero network requests

more from me

  • anipotts.com/thoughts · long-form
  • buttondown.com/anipotts · newsletter
  • @anipottsbuilds · short-form

MIT &middot; built by anipotts

Repository

AN
anipotts

anipotts/claude-code-tips

Created

February 25, 2026

Updated

April 13, 2026

Language

Python

Category

AI