claude-configs/CLAUDE.md
Cal Corum b2b024f0e3 Replace gitea-create-pr.sh script with tea CLI
Removed custom PR creation script in favor of native tea CLI tool.

Before: /home/cal/.claude/scripts/gitea-create-pr.sh cal/repo branch main "Title"
After: tea pulls create --repo cal/repo --head branch --base main --title "Title"

Benefits:
- No custom script maintenance
- Native Gitea CLI with better error handling
- Support for labels, assignees, milestones
- Consistent with other Gitea operations

Updated CLAUDE.md with tea pulls create examples.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 15:20:56 -06:00

7.0 KiB

🚨 CRITICAL: @ MENTION HANDLING 🚨

When ANY file is mentioned with @ syntax, you MUST IMMEDIATELY call Read tool on that file BEFORE responding. You will see automatic loads of any @ mentioned filed, this is NOT ENOUGH, it only loads the file contents. You MUST perform Read tool calls on the files directly, even if they were @ included. This is NOT optional - it loads required CLAUDE.md context. along the file path.

Confidently Incorrect Is Worst-Case Scenario

  • If the user asks a question and you are not very confident in your answer, tell the user that you are not sure
  • When this happens, offer your current hypothesis (if you have one) and then offer options you can take to find the answer

Basics

  • User's name is Cal and uses he/him pronouns
  • When writing tests, always include a detailed docstring explaining the "what" and "why" of the test.
  • DO NOT COMMIT CODE WITHOUT APPROVAL FROM THE USER

CRITICAL: Git Commit Approval Checkpoint

Before EVERY git commit or git add command, STOP and verify:

  1. Did the user EXPLICITLY approve this commit?

    • Approval: "commit this", "deploy it", "go ahead", "push to production"
    • NOT approval: Technical comments ("--yes flag"), silence after showing fix, user frustration, ambiguous signals
  2. If NO explicit approval:

    • STOP immediately
    • ASK: "Should I commit and deploy this fix?"
    • WAIT for clear response
  3. Common failure pattern:

    • Going into "fix mode" autopilot: find bug → fix → commit → deploy (WRONG)
    • Correct flow: find bug → fix → ASK → get approval → commit → deploy

This applies to ALL git operations including:

  • git commit
  • git add (staging for commit)
  • git tag
  • git push
  • Any deployment scripts that commit internally

Gitea Operations

ALWAYS use tea CLI for Gitea. Never use gh api --hostname — it's not compatible with Gitea's API.

  • Authenticated: cal@homelab (https://git.manticorum.com)
  • Common: tea repos list, tea pulls list, tea issues list, tea pulls create

Create PR (triggers Gitea Actions)

# From within repo directory
tea pulls create --head <branch> --base main --title "Title" --description "Description"

# Or specify repo from anywhere
tea pulls create --repo cal/major-domo-database --head fix/feature --base main --title "Title" --description "Description"

# With labels, assignees, milestone
tea pulls create --head fix/feature --base main --title "Title" --labels bug,priority --assignees cal --milestone v1.2.0

Common repos: cal/major-domo-database, cal/major-domo-bot, cal/paper-dynasty, cal/paper-dynasty-database

Tech Preferences

  • Preferred language: Python with uv for package and environment management
  • Specific code requirements: Never add lazy imports to middle of file

Memory Protocol (Cognitive Memory)

Cognitive Memory provides persistent, human-readable markdown-based memory across all sessions. Memories are stored as browseable markdown files with YAML frontmatter, organized in a git-tracked repository with decay scoring.

Skill Location: ~/.claude/skills/cognitive-memory/ Data Directory: ~/.claude/memory/ CORE.md: ~/.claude/memory/CORE.md (auto-curated summary, load at session start) REFLECTION.md: ~/.claude/memory/REFLECTION.md (theme analysis and cross-project patterns) Documentation: ~/.claude/skills/cognitive-memory/SKILL.md

REQUIRED: Session Start

  1. Load CORE.md context: ~/.claude/memory/CORE.md
  2. Load REFLECTION.md context: ~/.claude/memory/REFLECTION.md
  3. Recall relevant memories before any significant task:
claude-memory recall "project-name technology problem-type"

REQUIRED: Automatic Storage Triggers

Store memories on ANY of these events:

Trigger What to Store
Bug fix Problem + solution with SOLVES relationship
Git commit MANDATORY — store memory immediately after every successful commit with full context (reasoning, trade-offs, debugging steps), not just the commit message. Use --episode flag. Never skip.
Architecture decision Choice made + rationale + alternatives
Pattern discovered Reusable approach with context
Configuration that worked Setup details that solved an issue
Troubleshooting session Steps taken, what worked, what didn't
Session milestone Log episode entry for chronological context

CLI Usage

All commands support --help. Key patterns:

# Core workflow
claude-memory store --type solution --title "Fixed X" --content "..." --tags "t1,t2" --episode
claude-memory recall "redis timeout" --semantic

# Relationships and search
claude-memory relate <from_id> <to_id> SOLVES
claude-memory search --types "solution" --tags "python"

# Procedures, reflection, maintenance
claude-memory procedure --title "Deploy" --content "..." --steps "test,build,deploy"
claude-memory reflect --since 2026-01-01
claude-memory decay && claude-memory core && claude-memory embed

Memory Types

solution | problem | error | fix | decision | code_pattern | configuration | workflow | general | procedure | insight

Importance Scale

  • 0.8-1.0: Critical - affects multiple projects or prevents major issues
  • 0.5-0.7: Standard - useful pattern or solution
  • 0.3-0.4: Minor - nice-to-know, edge case

Tag Requirements (ALWAYS include)

  1. Project name (paper-dynasty, major-domo, homelab, etc.)
  2. Primary technology (python, docker, proxmox, bash, etc.)
  3. Category (fix, pattern, decision, config, troubleshooting)

Relationship Types

  • SOLVES - Solution addresses a problem
  • CAUSES - One issue leads to another
  • BUILDS_ON - Enhancement to existing pattern
  • ALTERNATIVE_TO - Different approach to same problem
  • REQUIRES - Dependency relationship
  • FOLLOWS - Workflow sequence
  • RELATED_TO - General association

Proactive Memory Usage

At session start: Load CORE.md and REFLECTION.md, then recall relevant memories for current project.

During work: When solving a non-trivial problem, check if similar issues were solved before. Use --semantic for deeper matching.

After milestones: Use --episode flag on store to auto-log episode entries. Or log manually with episode command.

Periodically: Run reflect to cluster recent memories and surface cross-cutting patterns. Check tags suggest for missing tag connections.

At session end: If significant learnings occurred, prompt: "Should I store today's learnings?"

Deprecated: MemoryGraph (Legacy)

MemoryGraph (SQLite-based) has been migrated to Cognitive Memory. The old database is archived at ~/.memorygraph/memory.db.archive. The old client at ~/.claude/skills/memorygraph/client.py still works for read-only access to the archive if needed.

Project Planning

Use /project-plan to generate structured PROJECT_PLAN.json files for tracking refactoring, features, migrations, or audits. See ~/.claude/skills/project-plan/SKILL.md for full schema and usage.