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.
| Size | Tokens | What fits |
|---|---|---|
| Pebble | <5K | A single focused task, small file edits, quick questions |
| Stone | 5-20K | Baseline session startup in a typical repo, a CLAUDE.md file + a few files loaded |
| Rock | 20-50K | A moderate coding session, several files + conversation history |
| Boulder | 50-150K | Complex multi-file refactors, full feature implementation |
| Mountain | 150-200K | Near 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
Repomix: Packages your entire codebase into a single AI-friendly file
repomix-output.xmlvibe-rules CLI tool for managing and sharing AI rules (prompts, configurations) across different editors and tools
Extended Thinking Mode (Anthropic) - Documentation on Claude’s thinking capabilities
Crystal: A tool for managing Git worktrees for Claude Code
Seth Hobsons Claude Code Plugins: Orchestration and Automation
Live LLM Token Counter VSCode extension for calculating token cost/count of active file in the status bar
Claude Code Cheat Sheet
Basics
esc+esc: Cancel current taskalt+Poroption+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 yourCLAUDE.mdfile (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.mdunder 5K tokens with project patterns, architecture decisions, coding standards, and key relationships CLAUDE.mdfiles 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
llmsentry 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
alwaysApplyandglobsconfigurations.