codomyrmex
CLAUDE.md10 starsChanged 38 days agoMITView on GitHub
Version: v1.3.0 | Last Updated: October 2026 We use ggshield (GitGuardian) to prevent secret leaks. Codomyrmex is a modular development platform with 132 top-level modules under src/codomyrmex/ organized in a layered architecture (see docs/reference/inventory.md):
- Installs packages
In this repository47 other files it gives its agents.
- .agent/AGENTS.mdAGENTS.md
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .agents/skills/agent-interop/AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- .agents/skills/first-principles/AGENTS.mdAGENTS.md
- .agents/skills/mcp-tool-use/AGENTS.mdAGENTS.md
- .agents/skills/red-team/AGENTS.mdAGENTS.md
- .agents/skills/systems-thinking/AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- config/AGENTS.mdAGENTS.md
- .cursor/skills/AGENTS.mdAGENTS.md
- .cursor/skills/codomyrmex/AGENTS.mdAGENTS.md
- .cursor/skills/desloppify/AGENTS.mdAGENTS.md
- .cursor/skills/fractals/AGENTS.mdAGENTS.md
- data/AGENTS.mdAGENTS.md
- .devcontainer/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- evaluations/AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/commands/AGENTS.mdAGENTS.md
- .github/ISSUE_TEMPLATE/AGENTS.mdAGENTS.md
- .github/scripts/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .jules/AGENTS.mdAGENTS.md
- .pipelines/AGENTS.mdAGENTS.md
- projects/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- .workflows/AGENTS.mdAGENTS.md
- agent-interopSkill
- first-principlesSkill
- mcp-tool-useSkill
- red-teamSkill
- systems-thinkingSkill
- agent-interopSkill
- first-principlesSkill
- mcp-tool-useSkill
- qmdSkill
- red-teamSkill
- systems-thinkingSkill
- CodomyrmexSkill
- desloppifySkill
- Fractals orchestratorSkill
- CodomyrmexSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
38 rules. About 0 are common, 22 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 204
Run specific categories: uv run pytest -m unit
- Distinctive: line 220
Prefer real measurements, benchmarks, and full test runs over estimates or assumptions.
- Distinctive: line 222
Never trade away correctness, safety, or clarity for short-term convenience or minor performance wins.
- Very specific: line 226
Use @pytest.mark.skipif for tests requiring: network access, API keys, or heavy SDKs not installed.
- Very specific: line 227
Never skip tests for core codomyrmex modules — use uv sync --extra <module> instead.
- Very specific: line 232
All dependencies are managed in pyproject.toml:
- Very specific: line 242
When multiple Claude Code instances or AI agents run concurrently, git operations can conflict on .git/index.lock.
- Very specific: line 247
Atomic stage+commit: Always git add -A && git commit --no-verify in one shell command to minimize lock time
- Very specific: line 248
Check lock before writing: Run ls .git/index.lock 2>/dev/null before any git write operation
- Very specific: line 249
Clear stale locks: If no git process is running (ps aux | grep git) but lock exists > 60s, remove it: rm -f .git/index.lock
- Very specific: line 250
Large files: Check for files > 50MB before committing (find .
- Very specific: line 251
Use worktrees for parallel work: Run /codomyrmexWorktree for managed worktree creation — each gets its own index
- Very specific: line 277
MUST run impact analysis before editing any symbol: Before modifying a function, class, or method, run impact({target: "symbolName", …
- Distinctive: line 279
MUST warn the user: if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
- Very specific: line 280
When exploring unfamiliar code, use query({search_query: "concept"}) to find execution flows instead of grepping.
- Very specific: line 281
When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use context({name: …
- Very specific: line 286
NEVER edit a function, class, or method without first running impact on it.
- Distinctive: line 287
NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
- Very specific: line 288
NEVER rename symbols with find-and-replace — use rename which understands the call graph.
- Very specific: line 289
NEVER commit changes without running detect_changes() to check affected scope.
- Distinctive: line 339
When unsure about context or project history, ALWAYS search memory first via memory_search.
- Distinctive: line 340
ALWAYS search memory first via memory_search.
- Distinctive: line 341
When you need info from PRD or docs, use file_search INSTEAD of reading the entire file.
- Distinctive: line 342
INSTEAD of reading the entire file.
- Distinctive: line 346
When memory_search returns a fact marked with ⚠ STALE:
- Distinctive: line 348
ALWAYS read the source file and verify the fact still holds
- Distinctive: line 349
If the fact changed -> update it via memory_write
- Distinctive: line 350
NEVER make changes based on STALE facts without verification
- Distinctive: line 354
When you discover something important during work, SAVE IT IMMEDIATELY:
- Distinctive: line 362
DO NOT wait for /harvest — session may crash.
- Distinctive: line 366
After completing each task AUTOMATICALLY update session bridge: session_bridge(action="save", content="Progress: ....
- Distinctive: line 372
Before ANY deploy, push, ssh, pm2, docker, db migration:
- Distinctive: line 373
ALWAYS call verify_identity(action_type="...") first
- Distinctive: line 374
If it returns BLOCKED — STOP and ask the user
- Distinctive: line 375
If it returns VERIFIED — READ the target server to the user and request confirmation
- Distinctive: line 379
Commit often, small atomic changes.
- Distinctive: line 380
commit = Tier 1 (do it yourself).
- Distinctive: line 394
No changes or facts in this session.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- The GitNexus and CogniLayer tools append sections that start with H1 markers. --><!-- markdownlint-disable MD025 -->CLAUDE.md
Version: v1.3.0 | Last Updated: October 2026
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build & Development Commands
# Install dependencies (uv recommended)
uv sync
# Set up git submodules (run once after cloning, or after submodule updates)
# Initializes all 5 submodules and installs hermes/evolution Python deps
bash scripts/setup_submodules.sh
# Or via Makefile:
make submodules # submodules only
make setup # install + submodules together
# NOTE: Never run `uv sync` inside src/codomyrmex/agents/hermes/evolution/ —
# its `darwinian` optional extra requires a non-PyPI package and will fail locking.
# The setup script handles this correctly via `uv venv --seed` + pip.
# Install with optional module dependencies
uv sync --extra <module-name> # e.g., uv sync --extra spatial
uv sync --all-extras # Install all optional dependencies
# Run all tests (no coverage — fast default)
uv run pytest
# Run tests with coverage and the 60% gate (same idea as `make test`).
# Makefile exports HYPOTHESIS_NO_NPY=1; for raw pytest, prefix the command so Hypothesis
# initializes before conftest (see tests/RUNNING_TESTS.md).
HYPOTHESIS_NO_NPY=1 uv run pytest --cov=src/codomyrmex --cov-report=html --cov-fail-under=60
# Pre-tag / release checklist: ruff + ty + full test tree with 60% coverage floor
make verify-release
# Run specific test file or module
uv run pytest tests/unit/<module>/test_<module>.py
uv run pytest -k "test_name" # Run tests matching pattern
# Code formatting and linting
uv run ruff format src/
uv run ruff check src/
uv run ty check src/
# CLI usage
codomyrmex --help
codomyrmex check # Verify environment setup
codomyrmex modules # List available modules
codomyrmex status # System status dashboard
codomyrmex shell # Interactive shell
codomyrmex workflow list # List workflows
codomyrmex project list # List projects
codomyrmex ai generate # AI code generation
codomyrmex analyze <path> # Code analysis
codomyrmex build <path> # Project build
codomyrmex test <module> # Run module tests
codomyrmex fpf fetch <url> # FPF fetch/parse/export
codomyrmex skills list # Skill managementSecurity Scanning
We use ggshield (GitGuardian) to prevent secret leaks.
# Install ggshield globally via uv
uv tool install ggshield
# Authenticate with GitGuardian
ggshield auth login
# Scan the entire repository for secrets
ggshield scan repo .
# Scan the current staging area before committing
ggshield scan pre-commitArchitecture Overview
Codomyrmex is a modular development platform with 132 top-level modules under src/codomyrmex/ organized in a layered architecture (see docs/reference/inventory.md):
Layer Hierarchy (dependencies flow upward only)
- Foundation Layer - Core infrastructure used by all modules:
logging_monitoring- Centralized structured loggingenvironment_setup- Environment validation, dependency checkingmodel_context_protocol- Standardized LLM communication interfacesterminal_interface- Rich terminal output and formatting
- Core Layer - Primary capabilities:
agents- AI agent framework integrationsstatic_analysis- Code quality, linting, security scanning (incoding/static_analysis/)coding- Code execution sandbox and reviewllm- LLM infrastructure (Ollama, providers)pattern_matching- Code pattern recognition (incoding/pattern_matching/)git_operations- Version control automation
- Service Layer - Higher-level orchestration:
ci_cd_automation- Pipeline management (includes build automation)documentation- Doc generationcontainerization- Docker/K8s managementorchestrator- Workflow execution
- Application Layer - User interfaces:
cli- Command-line interface (entry point:src/codomyrmex/cli/core.py)system_discovery- Module discovery and health monitoring
Module Structure
Each module is self-contained with standard structure:
__init__.py- Module exportsREADME.md- Module documentationAPI_SPECIFICATION.md- Programmatic interfacesMCP_TOOL_SPECIFICATION.md- Model Context Protocol tool definitionstests/- Module-specific tests (unit tests intests/unit/<module>/)
Key Patterns
- Model Context Protocol (MCP): Standardized interface for AI/LLM integration across modules
- Upward dependencies only: Higher layers depend on lower, preventing circular dependencies
- Lazy module loading: Modules load on-demand to reduce startup time
- Auto-discovery: Modules with an
mcp_tools.pysubmodule using@mcp_tooldecorators are automatically discovered and surfaced via the PAI MCP bridge — no manual registration needed. Currently 154mcp_tools.pyfiles are undersrc/codomyrmex/(non-test); seedocs/reference/inventory.md.
Extended Modules (auto-discovered via MCP)
Beyond the core layers above, these modules expose MCP tools via @mcp_tool decorators:
formal_verification- Z3 constraint solving and model checkingcontainerization- Docker build, scan, and runtime managementcrypto- Key generation, hashing, hash verificationevents- Event bus with emit, history, and type registrysearch- Full-text, fuzzy, and indexed searchconfig_management- Get/set/validate configurationcloud- Cloud instance and S3 bucket managementcerebrum- Case-based reasoning and knowledge retrievalperformance- Benchmark comparison and regression detectionscrape- HTML content extraction and text similaritymaintenance- Health checks and task managementplugin_system- Plugin discovery and dependency resolutionrelations- Relationship strength scoringagents/core- ThinkingAgent reasoning traces and depth controlagentic_memory- Agent memory store, retrieve, and semantic searchcalendar_integration- Calendar event management and schedulingdata_visualization- Chart/dashboard generation and HTML exportemail- AgentMail inbox/message/thread management and webhook registrationgit_analysis- Git history analysis, contributor stats, and commit pattern detectionlogging_monitoring- Centralized structured logging and monitoring integrationcollaboration- Multi-user session management and collaborative editingdocumentation- Documentation generation, linting, and publishing workflowssecurity- Vulnerability scanning, secret detection, and security auditingskills- Skill discovery, listing, and invocation managementvalidation- Schema validation, config validation, and validation summaries
PAI Integration
Codomyrmex serves as the toolbox for the PAI system (~/.claude/PAI/). Key integration points:
- Detection: PAI is present when
~/.claude/PAI/SKILL.mdexists - MCP Bridge:
src/codomyrmex/agents/pai/mcp_bridge.pyexposes 9 static proxy tools + auto-discovered module tools viapkgutilscan of allmcp_tools.pysubmodules; production sources contain 632@mcp_toollines and 154mcp_tools.pyfiles (132 top-level packages). Seedocs/reference/inventory.md. The Codomyrmex PAI Skill surfaces dynamic tools with 3 resources and 10 prompts - Trust Gateway:
src/codomyrmex/agents/pai/trust_gateway.pygates destructive tools (write, execute) behind explicit trust - Workflows:
/codomyrmexVerifyaudits capabilities;/codomyrmexTrustenables destructive tools - RASP Pattern: Each module has
PAI.mdalongsideREADME.md,AGENTS.md,SPEC.md— these describe AI capabilities the module offers - Bridge Doc:
/PAI.mdis the authoritative document mapping the PAI Algorithm phases to codomyrmex modules - Agent Mapping: PAI subagent types (Engineer, Architect, QATester) consume codomyrmex agent providers and tools — see
src/codomyrmex/agents/PAI.md - Detailed Reference:
docs/pai/— Architecture, tools, API, workflows for PAI-Codomyrmex integration
Key PAI system references (in ~/.claude/PAI/):
SKILL.md— Algorithm CORE (v3.5.0)PAIAGENTSYSTEM.md— Agent types and delegationSKILLSYSTEM.md— Skill architectureTHEHOOKSYSTEM.md— Hook event patterns
Test Markers
Tests use pytest markers defined in pyproject.toml ([tool.pytest.ini_options]):
@pytest.mark.unit- Unit tests@pytest.mark.integration- Integration tests@pytest.mark.slow- Long-running tests@pytest.mark.performance- Performance and benchmarking tests@pytest.mark.examples- Example validation tests@pytest.mark.network- Tests requiring network@pytest.mark.database- Tests requiring database access@pytest.mark.external- Tests requiring external services@pytest.mark.security- Security-related tests@pytest.mark.asyncio- Asynchronous tests@pytest.mark.crypto- Cryptography tests@pytest.mark.orchestrator- Orchestrator/workflow tests
Run specific categories: uv run pytest -m unit
Zero-Mock Policy
This project follows a strict zero-mock/stub/fallback/hardcoded policy:
- No mocking: Tests never use
unittest.mock,MagicMock, orpytest-mock. External dependencies use@pytest.mark.skipifguards. Narrowmonkeypatchuse is allowed for environment-variable isolation (setenv/delenv),chdir, andtmp_pathfixtures — not for replacing methods with stubs. See docs/development/testing-strategy.md § Zero-Mock Policy (clarified) and issue #175. - No production stubs: Production code never returns placeholder/fake data. Unimplemented features raise
NotImplementedError. - No silent fallbacks: Fallback patterns that silently degrade functionality are prohibited. Failures must be explicit.
- No hardcoded values: URLs, ports, and connection strings use
os.getenv()with centralized defaults fromconfig_management.defaults. - No obsolete aliases: Compatibility layers must have documented deprecation timelines or be removed.
Hard-Right Execution Standard
Codomyrmex agents should bias toward the hard right thing over the easy option:
- Prefer real measurements, benchmarks, and full test runs over estimates or assumptions.
- Favour changes that are reversible, well-documented, and auditable, even if they take longer to implement.
- Never trade away correctness, safety, or clarity for short-term convenience or minor performance wins.
Test Skip Policy
Use @pytest.mark.skipif for tests requiring: network access, API keys, or heavy SDKs not installed.
Never skip tests for core codomyrmex modules — use uv sync --extra <module> instead.
Pattern: skip at module level (not per-test) to keep collection fast.
Dependency Management
All dependencies are managed in pyproject.toml:
- Core dependencies:
[project.dependencies] - Module-specific optional:
[project.optional-dependencies.<module>] - Development tools:
[dependency-groups.dev]
Module-specific requirements.txt files are not maintained; do not modify them.
Multi-Agent Git Coordination
When multiple Claude Code instances or AI agents run concurrently, git operations can conflict on .git/index.lock. Follow these rules:
Rules
- Use
--no-verifyfor all agent commits — pre-commit hooks on 900+ files take 20+ minutes and block the lock - Atomic stage+commit: Always
git add -A && git commit --no-verifyin one shell command to minimize lock time - Check lock before writing: Run
ls .git/index.lock 2>/dev/nullbefore any git write operation - Clear stale locks: If no
gitprocess is running (ps aux | grep git) but lock exists > 60s, remove it:rm -f .git/index.lock - Large files: Check for files > 50MB before committing (
find . -not -path './.git/*' -size +50M). GitHub rejects files > 100MB. - Use worktrees for parallel work: Run
/codomyrmexWorktreefor managed worktree creation — each gets its own index
Quick Reference
# Safe: read-only (no lock needed)
git status; git log; git diff; git show
# Unsafe: acquires lock — coordinate first
rm -f .git/index.lock && git add -A && git commit --no-verify -m "msg"
# Clean stale worktrees
git worktree prune && git branch --list 'worktree-agent-*' | xargs git branch -D 2>/dev/nullSee /codomyrmexWorktree for detailed workflow.
<!-- gitnexus:start -->GitNexus — Code Intelligence
This project is indexed by GitNexus as codomyrmex (207963 symbols, 302104 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
Index stale? Run
node .gitnexus/run.cjs analyzefrom the project root — it auto-selects an available runner. No.gitnexus/run.cjsyet?npx gitnexus analyze(npm 11 crash →npm i -g gitnexus; #1939).
Always Do
- MUST run impact analysis before editing any symbol. Before modifying a function, class, or method, run
impact({target: "symbolName", direction: "upstream"})and report the blast radius (direct callers, affected processes, risk level) to the user. - MUST run
detect_changes()before committing to verify your changes only affect expected symbols and execution flows. For regression review, compare against the default branch:detect_changes({scope: "compare", base_ref: "main"}). - MUST warn the user if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
- When exploring unfamiliar code, use
query({search_query: "concept"})to find execution flows instead of grepping. It returns process-grouped results ranked by relevance. - When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use
context({name: "symbolName"}). - For security review,
explain({target: "fileOrSymbol"})lists taint findings (source→sink flows; needsanalyze --pdg).
Never Do
- NEVER edit a function, class, or method without first running
impacton it. - NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
- NEVER rename symbols with find-and-replace — use
renamewhich understands the call graph. - NEVER commit changes without running
detect_changes()to check affected scope.
Resources
| Resource | Use for |
gitnexus://repo/codomyrmex/context | Codebase overview, check index freshness |
gitnexus://repo/codomyrmex/clusters | All functional areas |
gitnexus://repo/codomyrmex/processes | All execution flows |
gitnexus://repo/codomyrmex/process/{name} | Step-by-step execution trace |
CLI
| Task | Read this skill file |
| Understand architecture / "How does X work?" | .claude/skills/gitnexus/gitnexus-exploring/SKILL.md |
| Blast radius / "What breaks if I change X?" | .claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md |
| Trace bugs / "Why is X failing?" | .claude/skills/gitnexus/gitnexus-debugging/SKILL.md |
| Rename / extract / split / refactor | .claude/skills/gitnexus/gitnexus-refactoring/SKILL.md |
| Tools, resources, schema reference | .claude/skills/gitnexus/gitnexus-guide/SKILL.md |
| Index, status, clean, wiki CLI commands | .claude/skills/gitnexus/gitnexus-cli/SKILL.md |
<!-- gitnexus:end -->qmd Skill
This project is configured with the qmd skill for local hybrid search of Markdown notes and docs.
| Task | Read this skill file |
| Search notes, docs, or knowledge base | .claude/skills/qmd/SKILL.md |
=== COGNILAYER (auto-generated, do not delete) ===
CogniLayer v3 Active
Persistent memory is ON. ON FIRST USER MESSAGE in this session, briefly tell the user: 'CogniLayer v3 active — persistent memory is on. Type /cognihelp for available commands.' Say it ONCE, keep it short, then continue with their request.
Memory Tools
You have access to the cognilayer MCP server:
- memory_search(query) — search memory semantically
- memory_write(content) — save important information
- file_search(query) — search project files (PRD, docs...)
- decision_log(query) — find past decisions
When unsure about context or project history, ALWAYS search memory first via memory_search. When you need info from PRD or docs, use file_search INSTEAD of reading the entire file.
VERIFY-BEFORE-ACT — MANDATORY
When memory_search returns a fact marked with ⚠ STALE:
- ALWAYS read the source file and verify the fact still holds
- If the fact changed -> update it via memory_write
- NEVER make changes based on STALE facts without verification
PROACTIVE MEMORY — IMPORTANT
When you discover something important during work, SAVE IT IMMEDIATELY:
- Bug and fix -> memory_write(type="error_fix")
- Pitfall/danger -> memory_write(type="gotcha")
- Exact procedure -> memory_write(type="procedure")
- How components communicate -> memory_write(type="api_contract")
- Performance issue -> memory_write(type="performance")
- Important command -> memory_write(type="command") DO NOT wait for /harvest — session may crash.
RUNNING BRIDGE — CRITICAL
After completing each task AUTOMATICALLY update session bridge: session_bridge(action="save", content="Progress: ...; Open: ...") This is Tier 1 — do it yourself, don't announce, it's part of the job.
Safety Rules — MANDATORY
- Before ANY deploy, push, ssh, pm2, docker, db migration:
- ALWAYS call verify_identity(action_type="...") first
- If it returns BLOCKED — STOP and ask the user
- If it returns VERIFIED — READ the target server to the user and request confirmation
Git Rules
- Commit often, small atomic changes. Format: "[type] what and why"
- commit = Tier 1 (do it yourself). push = Tier 3 (verify_identity).
Project DNA: codomyrmex
Stack: unknown Style: [unknown] Structure: .agent, .benchmarks, .desloppify, .gemini, .github, .gitnexus, .mypy_cache, .pipelines Deploy: [NOT SET] Active: [new session] Last: [first session]
Last Session Bridge
[Emergency bridge — running bridge was not updated] No changes or facts in this session.
=== END COGNILAYER ===
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

