New here? Start with the OpenCairn Setup Guide for installation and first-run setup.


Context Management

The core skill. Context windows degrade at 50-60% fill. Everything else on this page matters less if you don’t manage context.

  • Use /context to check usage
  • Use /compact when responses get sloppy
  • Scope conversations - one per feature/task
  • Start fresh for new major topics
  • External memory (scratchpad.md, plan.md) persists across sessions

Boris Cherny (creator): Runs 5+ Claude instances in parallel, hands off between terminal and claude.ai using & and --teleport.


Workflow Patterns

Plan mode โ†’ Execute

  1. Shift+Tab twice to enter Plan mode
  2. Explore, ask questions, refine approach
  3. Get alignment on the plan
  4. Switch to auto-accept edits for execution

“A good plan is really important” - Boris Cherny

Park before compacting

When approaching the context limit:

  1. /park to capture open loops and state to the vault
  2. /compact to reclaim context
  3. Keep working โ€” the vault has the lossless version of what /compact summarised

Session handoff

When ending a session:

  1. /park captures open loops and state
  2. Next time: /pickup restores context

Keyboard Shortcuts & Commands

Shortcut/CommandWhat it doesWhen to use
Shift+Tab (x2)Enter Plan modeStart of any non-trivial task
Esc EscFork/rewind to checkpointWhen things go wrong
/compactSummarise conversation, free contextLong sessions, ~60% context
/contextShow current context usageCheck before complex task
/ultrathinkMaximum reasoning depthPhilosophy, architecture, hard problems
Ctrl+RSearch prompt historyFind previous prompts
@filenameMention file in promptReference specific files
#Add to CLAUDE.mdWhen correcting same mistake twice

Conversational Patterns

These phrasings work well:

Say thisClaude understands
“Read the file first”Don’t guess, actually look at the content
“Show me the grep”Prove claims about what exists in codebase
“What’s the actual error”Don’t summarise, show raw output
“Plan mode this”Explore before committing to approach
“Diff these two files”Compare and highlight differences
“MCP into [service]”Use MCP server for that service
“yt-dlp this: [URL]”Extract and process YouTube content

Diffing Documents

Ask Claude to “diff” two files or pieces of content to get a structured comparison:

"Diff config.old.json against config.json"
"Diff the current version with what I pasted"
"What changed between these two versions?"

Useful for:

  • Comparing config file versions before/after changes
  • Reviewing what changed in a document revision
  • Spotting differences between two similar files (e.g., dev vs prod configs)
  • Understanding what edits someone made to a draft

Claude reads both files, compares them, and reports meaningful differences - not just a raw diff output, but an explanation of what actually changed and why it matters.


Git Snapshots for Safety Net

Automated git commits on your Obsidian vault (e.g., every 10 minutes via cron) provide a safety net against accidental changes, ransomware, or AI mistakes.

Implementation (cron):

*/10 * * * * /path/to/obsidian_vault_backup.sh

Commit only .md files to prevent bloat from media.

Why this matters with Claude Code: AI can make sweeping edits. Git snapshots let you git diff or git checkout specific files if something goes wrong, without restoring entire backups.


Setup & Configuration

claudeyolo alias

Skip the permission prompts when you trust what you’re doing:

# Add to ~/.bashrc or ~/.zshrc
alias claudeyolo='claude --dangerously-skip-permissions'

Use case: Batch operations, known-safe scripts, when the y/n prompts slow you down.

API outage failover

Updated Aug 2026 โ€” this section previously described a claude-code-proxy + Gemini recipe. Providers now expose Anthropic-compatible endpoints, so the local proxy (and its schema-sanitisation patches) is no longer needed.

When Anthropic’s API goes down, point stock Claude Code at another provider’s Anthropic-compatible endpoint. Your CLAUDE.md, slash commands, MCP servers, and hooks all keep working โ€” only the model changes.

# Add to ~/.bashrc โ€” usage: claudeor [claude args...]
claudeor() {
    ANTHROPIC_BASE_URL="https://openrouter.ai/api" \
    ANTHROPIC_AUTH_TOKEN="${OPENROUTER_API_KEY:?set OPENROUTER_API_KEY}" \
    ANTHROPIC_API_KEY="" \
        claude "$@"
}

OpenRouter’s Anthropic-compatible endpoint (their “Anthropic skin”) speaks Claude Code’s native protocol and maps it onto whatever model you configure โ€” GPT, Gemini, Grok, or open-weight models โ€” passing tool use, streaming, and multi-turn context through. For open-weight models, DeepInfra has a direct equivalent: ANTHROPIC_BASE_URL=https://api.deepinfra.com/anthropic.

Gotchas: (1) Set ANTHROPIC_API_KEY explicitly blank, per OpenRouter’s docs โ€” the auth token must be the only credential sent. (2) Don’t append /v1 to ANTHROPIC_BASE_URL โ€” Claude Code adds /v1/messages itself. (3) Never point a third-party endpoint or harness at your Claude subscription login โ€” subscriptions stopped covering third-party harnesses in April 2026, and it’s an account-ban trigger; use a separate API key for the failover provider. (4) Anthropic-specific features (extended thinking, prompt caching) degrade to whatever the mapped model supports โ€” treat failover sessions as reduced-capability.

VAULT_PATH environment variable

If you’re using Claude Code with an Obsidian vault, set a single configuration point for all commands:

export VAULT_PATH=/path/to/your/obsidian/vault

All commands that need vault access can derive paths from this. Change once, works everywhere.

Terminal setup (Wezterm + global hotkey)

See: Wezterm setup guide

Wezterm with a global hotkey gives you instant Claude access from anywhere. Faster than switching windows.

Speech-to-text dictation

See: Global Dictation with Whisper

System-wide Whisper-powered dictation via hotkey. Dump thoughts faster than typing. Works with any application.


MCP Servers (External Integrations)

MCP connects Claude to external services. The ones I actually use:

ServerWhat it doesSetup
Google CalendarQuery/create/modify calendar events@cocal/google-calendar-mcp - needs your own Google Cloud OAuth client
ObsidianRead/write vault files when Obsidian is runningobsidian-mcp-server - requires Local REST API plugin
FirecrawlWeb scraping with JS renderingNeeds API key from firecrawl.dev

Pattern: “MCP into [service]” - Claude understands this as “use the MCP server to interact with X”

Example: “MCP into my calendar and find all events this week”


Task Management with TaskCreate/TaskList

For multi-step work, tell Claude to create a task list:

“Create a task list for this and work through it”

Benefits:

  1. Ensures nothing gets missed in multi-stage prompts
  2. Shows progress with checkboxes as it works
  3. Good scaffolding for sequential tasks with less supervision

The to-do list renders in the terminal as Claude completes each step.


Skills System

Skills are reusable markdown instructions you invoke by typing /name โ€” or that Claude loads automatically when relevant. Commands and skills have merged: a file at .claude/commands/foo.md and a skill at .claude/skills/foo/SKILL.md both create /foo and behave the same way.

  • Location: .claude/skills/<name>/SKILL.md is the newer, preferred spot โ€” a skill can bundle a whole directory of supporting files. .claude/commands/*.md is the older location and still works.
  • Invocation: by default a skill is both user-invocable and auto-loadable. Frontmatter opts out โ€” disable-model-invocation: true (manual only), user-invocable: false (auto only).

OpenCairn ships its functionality as markdown files in .claude/commands/ โ€” e.g. /park (end session, capture open loops), /pickup (resume), /morning / /afternoon / /goodnight (daily rhythm).


Content Extraction Patterns

yt-dlp for YouTube

Extract transcripts, audio, or video:

# Transcript only (fast)
yt-dlp --write-auto-sub --skip-download -o "%(title)s" "URL"

# Audio only (for long content)
yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" "URL"

# Full video
yt-dlp -f "bestvideo[height<=1080]+bestaudio" -o "%(title)s.%(ext)s" "URL"

Conversational shortcut: “yt-dlp this: [URL]” - Claude will extract and process.

JavaScript snippets for social media

X/Twitter thread extraction (run in browser console):

// Select all tweet text elements and join
[...document.querySelectorAll('[data-testid="tweetText"]')]
  .map(el => el.innerText)
  .join('\n\n---\n\n')

Reddit thread extraction (run in browser console):

// Get all comment bodies
[...document.querySelectorAll('.md')]
  .map(el => el.innerText)
  .join('\n\n---\n\n')

Copy output, paste into Claude for analysis.

NormCap for screen OCR

When you need to copy text that can’t be selected (images, toasts, pop-ups):

Install:

flatpak install flathub com.github.dynobo.normcap

Setup hotkey in KDE:

  1. System Settings โ†’ Keyboard โ†’ Shortcuts
  2. Click + Add Application โ†’ search “NormCap”
  3. Add custom shortcut (e.g., Meta+Shift+T)

Workflow: Hotkey โ†’ drag to select region โ†’ text copied to clipboard.

Reading something too big for one Read

The Read tool caps at ~256KB per call, independent of how big the context window is. Two options, in order:

Spawn a sub-agent. It reads in its own isolated context and only its summary comes back. No setup, and it’s the right default.

Read /path/to/large-file.txt and summarise what’s in it โ€” key points and structure, not line-level detail.

Or a CLI summariser, when you want a deterministic command you can pipe into scripts, or a cheap pass over a batch:

summarise-file /path/to/large-file.txt
cat large-file.txt | summarise-file

A small bash script over the Gemini API โ€” useful for logs, transcripts, minified code. Note the Gemini free tier trains on your prompts; the paid tier doesn’t. Google states this per-model on its pricing page under “Used to improve our products”, and the split is worth understanding before you send anything real through it.


Further Reading

Sources