How to use AI - Tips and Tricks
This post is a practical guideline: the tools worth using, the habits that make the biggest difference, and the commands to keep around when everything needs a reset
AI assistants are now part of the everyday workflow as a developer. After a lot of trial and error, a setup emerges that keeps productivity high without burning through tokens or drowning the model in noise.
The assistant: Claude Code
Claude Code is where most of the AI-assisted work happens: writing new code, refactoring existing modules, and polishing technical details. Everything else in this post exists to make it work better.
Skills
Skills are reusable instructions and capabilities plugged into an assistant. These are the ones worth having.
rtk: fewer tokens from shell output
rtk intercepts shell command output before it reaches the AI context, so the model receives the same information in far fewer tokens. Commands like git status or test runs can be very noisy, and rtk trims that noise.
Install the CLI with Homebrew and initialize it for Claude Code:
brew install rtk
# Claude Code / Copilot (default)
rtk init -g
After restarting the assistant, test it by running git status. Then run rtk gain to see how many tokens were saved.
caveman: why use many token when few token do trick
caveman makes the AI respond in a much more compact style, cutting down output verbosity.
npx skills add JuliusBrussee/caveman -a claude-code --with-init
To check that it's working, run /skills inside Claude Code.
ccusage: monitor spending
ccusage analyzes Claude Code usage to show where tokens (and money) go. For example, to see the last two weeks:
npx ccusage@latest weekly --last 2
To skip typing the full command every time, add a shortcut to ~/.bashrc (use ~/.zshrc on zsh):
echo "alias ccusage-weekly='npx ccusage@latest weekly --last 2'" >> ~/.bashrc
source ~/.bashrc
From then on, running ccusage-weekly shows the last two weeks of usage.
graphify: turn a codebase into a knowledge graph
Graphify turns any codebase, along with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. It works as a /graphify skill for Claude Code using local deterministic AST parsing. Every edge is explained and there is no vector store involved.
pipx install graphifyy
# detects the assistant (Claude Code) and registers the skill
graphify install
Then, inside the project, type /graphify in your AI coding assistant and it maps your entire project (code, docs, PDFs, images, videos) into a knowledge graph you can query instead of grepping through files.
/graphify .
By default, an assistant explores a codebase by grepping and opening files one by one. That costs tokens, and it can miss how things connect across files.
Graphify parses the project once into a knowledge graph, where concepts are nodes and calls, imports and inherits are edges. The assistant then queries the graph instead of searching raw files.
Bonus: using Claude Code with OpenRouter
Claude Code can also run through OpenRouter, which makes it possible to pick the model behind it.
Install Claude Code:
curl -fsSL https://claude.ai/install.sh | bash
Then add the environment variables to the shell profile:
# CLAUDE CODE
export OPENROUTER_API_KEY="<your-openrouter-api-key>"
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY="" # Important: must be explicitly empty
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
# CLAUDE CODE - CUSTOM MODEL
export ANTHROPIC_DEFAULT_FABLE_MODEL="openai/gpt-6-luna-pro"
export ANTHROPIC_DEFAULT_OPUS_MODEL="openai/gpt-6-luna-pro"
export ANTHROPIC_DEFAULT_SONNET_MODEL="openai/gpt-6-luna-pro"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="openai/gpt-6-luna-pro"
export CLAUDE_CODE_SUBAGENT_MODEL="openai/gpt-6-luna-pro"
Keep the API key out of version control, and replace the model name with whichever one should be used.
MCPs
MCP (Model Context Protocol) servers connect the AI to external sources of truth.
- Context7 connects the AI to up-to-date documentation and framework references in real time. This avoids the classic problem of the model suggesting APIs that were deprecated two versions ago.
- Figma MCP reads designs, extracts tokens and components, and generates production-ready frontend code from them.
Tools: Flow Companion for PR review
For pull requests, Flow Companion works as a second pair of eyes. It supports the review process and helps catch things that might otherwise be missed.
Habits that make a difference
Tools matter, but habits matter more:
- Give files as context. Pointing the AI at the exact files avoids wasted effort searching the codebase, and the answers come out better.
- Start new conversations. Long chats are expensive and noisy because the entire history is sent as context with every message. When a task is done, start fresh.
- Keep an
AGENTS.mdin every project. This file guides the AI and helps it understand the project's structure, conventions, and commands. - Write in English. Communicating with the AI in English tends to give the most consistent results.
Resetting Claude Code
When things get messy (too many skills, MCPs, or plugins), these commands help clean up and start over:
# Remove all global skills
rm -rf ~/.claude/skills/
# List MCPs, then remove a specific one
claude mcp list
claude mcp remove MCP_NAME
# List plugins, then remove a specific one
claude plugin list
claude plugin remove PLUGIN_NAME
Wrapping up
A good AI setup comes down to two ideas: give the AI good context (docs, designs, project guidelines) and keep that context lean (token-saving skills, short conversations, targeted files). Tools will keep changing, but those two principles have held up so far.
Author
Mathias Artur Schulz
Senior Software Engineer
Bachelor's degree in Computer Science and Postgraduate degree in Software Engineering
Email:mathias@schulz.net.br