A place to document how I use AI to assist the development of software.

Context Is King

Managing the context window for your model is the most benefitial thing you can do as the human-in-the-loop.

I have been throttled many times, due to silly context management practices, clinging onto old context when its no longer needed, etc.

I now groom and compact my contexts, plans, preferences, contexts, skills, etc like a maniac, pulling them in when it makes sense to and running /clear regularly between sessions, contextualising the fresh session that most makes sense for the next task at hand.

Token Sizing Guidelines (Pebble → Boulder)

Don’t ship too many context tokens to the model. This can really upset the flow, performance, clarity of decisions and cost you $.

As a rule of thumb I use the below table paired with a token counter such as Live LLM Token Counter to get a rough order of magnitude how “heavy” a piece of context is. If your lugging rocks, boulders or mountains along, it time to rethink how you’re doing things.

SizeTokensWhat fits
Pebble<5KA single focused task, small file edits, quick questions
Stone5-20KBaseline session startup in a typical repo, a CLAUDE.md file + a few files loaded
Rock20-50KA moderate coding session, several files + conversation history
Boulder50-150KComplex multi-file refactors, full feature implementation
Mountain150-200KNear context limit on standard plans—performance often degrades past ~80%

Practical benchmarks from users:

  • A fresh session in a monorepo costs a baseline ~20k tokens (10%) with the remaining 180k for making your change.
  • The autocompact buffer can consume 45k tokens—that’s 22.5% of your context window gone before writing a single line of code.
  • Avoid using the final 20% of your context window for complex tasks, as performance degrades significantly when approaching limits.

Claude Code

Awesome Claude Level Ups

Claude Code Cheat Sheet

Basics

  • esc + esc: Cancel current task
  • alt+P or option+P: Model switcher hotkey

Context Management

It’s key to manage context window “baggage” to get the most out of Claude Code.

  • /context: Lists every single file currently loaded into the context window.
  • /usage: Shows current session token usage, cost incurred, and how close you are to the limit
  • /compact: Takes your conversation history (the back-and-forth chat) and summarises it. When the tool tells your “History is getting long.” It converts 50 messages into a short summary to free up space.
  • /clear: Wipes everything. It forgets the conversation history and unloads all files. It keeps your project configuration (CLAUDE.md), but clears the active session. This is your best friend. Run this between every major task. Treat it like “closing the tab” and starting fresh.
  • /memory: Opens your CLAUDE.md file (the 530k char monster) for editing. Run this regularly and keep it as lean as possible (under 100 lines).

Miscellaneous

  • /plugins: List of ready-to-install plugins from marketplace
  • /rename: Give session a name
  • /stats: Visualisation of your daily Claude Code usage

Caching Codebase Knowledge

CLAUDE.md Files (Persistent Memory)

This is the primary way to persist codebase knowledge across sessions:

  • All memory files are automatically loaded into Claude Code’s context when launched.
  • Keep your CLAUDE.md under 5K tokens with project patterns, architecture decisions, coding standards, and key relationships
  • CLAUDE.md files capture your project’s patterns and standards, custom commands encode repetitive workflows.

API Prompt Caching

If you’re using the API directly:

  • Claude Code automatically enables prompt caching to optimize performance and costs.
  • The cache has a “5-minute lifetime, refreshed each time the cached content is used.”
  • Cache reads are 90% cheaper than standard input tokens
  • There’s also a 1-hour cache option at additional cost

Async Subagents

Subagents are specialised AI assistants in Claude Code that focus on specific domains of software engineering. They provide expert-level guidance, automate complex tasks, and coordinate with other agents to deliver comprehensive solutions.

Importantly each subagent operates in its own context, preventing pollution of the main conversation, helping to keep it focused on high-level objectives.

Tasks can now spawn async subagents that move to the background and work independently.

Skills

TODO

Plugins

TODO

Hooks

TODO

Teleport Sessions

TODO

General Purpose Context Management

vibe-rules

Much of the web dev eco-system provides great LLM context support. Such as TanStack Router using vibe-rules.

In the evolving AI landscape, prompts and context are becoming increasingly crucial components of development workflows. Just like code libraries, reusable AI rules and prompts are emerging as shareable assets.

We anticipate more NPM packages will begin exporting standardized AI configurations, often via a llms entry point (e.g., my-package/llms). vibe-rules embraces this trend with the install command.

npm i -g vibe-rules
vibe-rules install claude-code

vibe-rules cheat sheet:

# Save from a file (e.g., .mdc, .md, or plain text)
vibe-rules save my-rule-name -f ./path/to/rule-content.md

# See all the rules you've saved to the common local store
vibe-rules list

# Load 'my-rule-name' for Claude Code IDE globally (updates ~/.claude/`CLAUDE.md`)
vibe-rules load my-rule-name claude-code --global
# Alias: vibe-rules add my-rule-name claude-code -g


# Most common: Install rules from ALL dependencies/devDependencies for claude-code
# Scans package.json, finds packages with 'llms' export, applies rules.
vibe-rules install claude-code

# Install rules from a specific package for claude-code
# (Assumes 'my-rule-package' is in node_modules)
vibe-rules install claude-code my-rule-package

# Install rules from a specific package into a custom target dir for Roo/Cline
vibe-rules install roo my-rule-package -t ./custom-ruleset/

# Install rules into the project's unified .rules file
vibe-rules install unified my-awesome-prompts

Several editors are supported, here’s how claude code integration works:

  • Appends/updates rules within XML-like tagged blocks in a <!-- vibe-rules Integration --> section in ./CLAUDE.md (local) or `~/.claude/`CLAUDE.md (global).
  • Each rule is encapsulated in tags like <rule-name>...</rule-name> within the single markdown file.
  • Supports metadata formatting for alwaysApply and globs configurations.