Skip to content

Instantly share code, notes, and snippets.

View karthiks's full-sized avatar
🎯
Focusing

Karthik Sirasanagandla karthiks

🎯
Focusing
View GitHub Profile
@karthiks
karthiks / builtin-slash-commands.md
Created March 22, 2026 14:40
List of Built-in Slash Commands in Claude Code
/help #shows complete command list
/help compact #shows detailed syntax for the compact command

/init #scans package.json, tsconfig.json, etc., and creates a 15-30 line CLAUDE.md file with detected conventions
/doctor #runs 5-8 checks in under 15 seconds and reports any issues with green (OK) or red (failure) status

/compact #compresses current session
/clear #use when switching topics or after 20+ exchanges; keyboard shortcut Ctrl+L
/rewind #runs once to undo one turn; can be run multiple times to go back further
@karthiks
karthiks / ClaudeCode-Memory.md
Created March 21, 2026 09:54
The Two Pillars of Memory in Claude Code

The Two Pillars of Memory

Claude Code uses a dual-memory system to balance your explicit instructions with its own learned observations.

Feature CLAUDE.md (Static Memory) MEMORY.md (Auto Memory)
Who Writes It? You (Manual) Claude (Automated)
Content "Project rules, architecture, tech stack." "Patterns, ""gotchas,"" and user preferences."
Location Your Project Root (git-tracked). ~/.claude/projects/ (system-local).
Persistence Permanent and shared with your team. Local to your machine; session-dependent.
@karthiks
karthiks / claude-session-context-window.md
Created March 21, 2026 07:56
Session Context Window (200k total)
Session Context Window (200k total)
┌────────────────────────────────────────────┐
│ System Prompt + Tools: 15.9k (8%)          │ ← Fixed allocation
│ CLAUDE.md + Memory: 2.8k (1.4%)            │ ← Fixed allocation
├────────────────────────────────────────────┤
│ Messages (grows over time): 89.5k (44.7%)  │ ← This grows
├────────────────────────────────────────────┤
│ Free Space: 59k (29.5%)                    │ ← This shrinks
│ Autocompact Buffer: 33k (16.5%) │ ← Reserved
@karthiks
karthiks / ClaudeCode-Context-ReferenceTable.md
Created March 20, 2026 18:11
Practical Reference Table for what healthy, warning, and critical levels look like for each category of consumers of memory context in Claude Code

Here's a practical reference table for what healthy, warning, and critical levels look like for each category:

Category Healthy Warning Critical Breach Consequences
System Prompt <5k tokens 5-8k tokens >8k tokens Reduced context for actual work; slower responses
System Tools <10k tokens 10-20k tokens >20k tokens Context starvation; frequent compacting; tool failures
Memory Files <1k tokens 1-2k tokens >2k tokens Important instructions being truncated; Claude "forgetting" conventions
Messages <40% of total 40-60% of total >60% of total Rapidly approaching limit; autocompact ineffective
Free Space >30% 15-30% <15% Autocompact may fail; Claude may refuse new tasks
Autocompact Buffer >20% 15-20% <15% Summaries become poor; important context lost
Total Usage <70% 70-85% >85% Performance degradation; risk of hitting limit mid-task
@karthiks
karthiks / claudecode-cache.md
Last active March 21, 2026 05:32
Flowchart - Clearer Visual of the Cache Flow
flowchart TB
    subgraph Request1[Request 1: Cache Write]
        A1[System prompt<br/>CLAUDE.md + Tools] 
        A2[User message 1]
        A3[Cache Storage]
        
        A1 --> A3
        A2 --> B[Process full request]
 A3 --&gt; B
@karthiks
karthiks / wsl2winhost.sh
Created February 28, 2026 15:17
Accessing Windows Host from WSL2 Linux using Hostname
### Check out detailed blog post at https://blog.codonomics.com/2026/01/accessing-windows-host-from-wsl2-linux.html
### Start: Adding Windows Host IP to WSL2 Hosts File
# Add to the end of ~/.bashrc or ~/.zshrc
echo "Updating Windows host IP in /etc/hosts..."
# Get Windows IP from default route
WIN_HOST_IP=$(ip route show | grep -i default | awk '{print $3}')
# Check if we got a valid IP
if [ -n "$WIN_HOST_IP" ]; then
@karthiks
karthiks / miniconda_cheatsheet.sh
Created August 13, 2025 06:13
miniconda cheatsheet
# =============================================
# MINICONDA CHEATSHEET (Python Environment & Package Management)
# =============================================
# Lightweight version of Anaconda for Python environments.
# Install: https://docs.conda.io/projects/miniconda/en/latest/
# Docs: https://conda.io/projects/conda/en/latest/commands.html
# ---------------------------------------------------------------------
# 1. INSTALLATION & SETUP
# ---------------------------------------------------------------------
@karthiks
karthiks / uv_cheatsheet.sh
Created August 13, 2025 06:03
uv cheatsheet
# =============================================
# UV CHEATSHEET (Python Package & Env Management)
# =============================================
# Astral's ultra-fast alternative to pip/venv.
# Install: curl -LsSf https://astral.sh/uv/install.sh | sh
# Docs: https://github.com/astral-sh/uv
# ---------------------------------------------------------------------
# 1. VIRTUAL ENVIRONMENTS
# ---------------------------------------------------------------------
@karthiks
karthiks / ollama-commands-reference.sh
Last active March 2, 2026 15:48
Ollama Commands Cheat Sheet
##### Server Management #####
# Start ollama server using commands - start or serve
ollama start
ollama serve
# Check if server is running
ollama ps
ollama ps --verbose # Check system resources
@karthiks
karthiks / PythonProjectSetupChecklist.md
Created December 31, 2024 14:28
Python Project Setup Checklist
  • Define project directory structure in ASCII format in your README.md, like below:
    - ProjectRoot
      - src
      - tests
        - data
        - unit
        - integration
      - docs
  • examples