Phase 3 excluded all of dot_claude/, but the plan always intended CLAUDE.md to be the one agent file that ships publicly. Adds it plus the codex and pi AGENTS.md, so a throwaway VM gets sane agent behaviour with no credential. Specialized agents, skills, hooks and the language rule sets are deliberately absent -- they live in a separate repository now. The Active Rule Sets section is rewritten to say so rather than dangle a reference to a rules/ tree this repo does not carry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4.9 KiB
Global Codex Configuration
Tool Preferences
Search And Navigation
- Always use
rgovergrepfor code search. - Prefer narrow searches over broad sweeps.
- Use precise file globs and code-aware navigation when available.
- Prefer MCP tools when they provide better precision than shell commands.
Code Manipulation
- Read the relevant code before editing.
- Prefer structural understanding over blind text replacement.
- Make the smallest change that solves the problem.
- Do not rewrite surrounding code without a concrete reason.
Verification
- Every change needs verification.
- Verification can be tests, a build, a targeted command, or frontend validation with Playwright.
- For non-trivial work, state the verification method before implementing.
Language Patterns
Python
- Prefer
blackorruff formatfor formatting. - Prefer
rufffor linting. - Use type hints on public code.
- Prefer
pytest. - Check for
.venv/orvenv/before assuming interpreter paths.
Go
- Use
gofmt. - Prefer
go vetfor linting andgo test ./...for verification. - Check
go.modfor module structure. - Do not ignore errors with
_unless there is a defensible reason.
TypeScript
- Prefer
prettierandeslintwhen present. - Check
package.jsonfor the repo's actual test and build commands. - Check
tsconfig.jsonbefore changing compiler-sensitive code. - Prefer strict typing patterns.
Workflow Principles
Research First
Before changing unfamiliar code:
- Identify the relevant files and relationships.
- Understand the local pattern in that area.
- Check for similar implementations elsewhere.
- Look for tests that define expected behavior.
Plan Before Implement
For non-trivial work:
- State what is changing and why.
- Name the files or components likely to change.
- Define how the change will be verified.
- Note obvious risks or breakpoints.
Preserve Context
- Keep findings compressed and structured.
- Reuse existing project artifacts like
.claude/progress.md,PITFALLS.md, and projectCLAUDE.mdwhen they exist. - If a repo already uses
.claude/planning or checkpoint files, continue to respect them rather than inventing a second system.
Session Workflow
Starting A Session
- Check for
.claude/progress.mdand load it as prior context when present. - Read
PITFALLS.mdif present. - Read project instructions from
AGENTS.md. Codex is also configured to treat projectCLAUDE.mdas a fallback instruction file.
During Work
- Research unfamiliar areas before editing.
- Make plans for non-trivial work.
- Review changes before commit when risk is non-trivial.
Ending A Session
- If the repo uses
.claude/progress.md, update it when useful. - If there are uncommitted changes, leave the next session enough context to resume cleanly.
Shell
- Use zsh-compatible syntax when writing shell commands or scripts.
- Assume
~/.zshrccan affect shell behavior.
Anti-Patterns
- Do not search broadly and read dozens of files without narrowing scope.
- Do not change code before understanding the local pattern.
- Do not skip verification.
- Do not rewrite code that does not need to change.
- Do not add comments, docstrings, or annotations to untouched code without a clear reason.
System Knowledge Journal (Obsidian)
Maintain a running journal of host/environment changes in the Obsidian vault at Tech/Infrastructure/, using the shared sysjournal helper (on PATH). This is for system administration, NOT ordinary work inside a code repo.
Trigger — the task changes the machine/environment, not just repo code: system config; services/daemons (systemd/launchd/cron); networking/DNS/VPN/firewall; VMs & host-level containers; drivers/kernel/boot; disks/mounts; build toolchains & global/system package installs; or wiring an app into the host (a systemd unit, cron job, opened port, service account).
Do NOT journal feature work, bug fixes, refactors, or tests inside a project repo. Discriminator: does it change state outside the repo, on the host? If no → skip. Straddle case (you build an app and install it as a service): journal only the host-wiring part (the unit/cron/port), not the app code.
- Recall first. Before diagnosing or acting on such a task, search the journal and read relevant hits:
sysjournal search <keywords>(e.g.sysjournal search systemd relay port) - Journal after. Once the change is made or the problem resolved:
sysjournal new "Short Descriptive Title" --type change --status deployed --tags systemd,relayThen fill in the created note (its path is printed): Why, What changed, Design decisions / gotchas, Verify (command + observed result), Status / follow-ups. Link related notes with[[wikilinks]].
Keep it a real record — what changed, why, the gotcha you hit, how you verified. sysjournal help for the frontmatter schema (the System Log MOC.md Dataview index depends on it).