Agent Config
by @thatguysizemore
Intelligently modify agent core context files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, TOOLS.md, MEMORY.md, HEARTBEAT.md). Use when conversation involves changing agent behavior, updating rules, tweaking personality, modifying instructions, adjusting operational procedures, updating memory architecture, changing delegation patterns, adding safety rules, refining prompt patterns, or any other modification to agent workspace configuration files. Triggers on intent to configure, tune, improve, fi
clawhub install agent-configπ About This Skill
name: agent-config description: Intelligently modify agent core context files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, TOOLS.md, MEMORY.md, HEARTBEAT.md). Use when conversation involves changing agent behavior, updating rules, tweaking personality, modifying instructions, adjusting operational procedures, updating memory architecture, changing delegation patterns, adding safety rules, refining prompt patterns, or any other modification to agent workspace configuration files. Triggers on intent to configure, tune, improve, fix, or evolve agent behavior through context file changes.
Agent Config Skill
This skill provides a structured workflow for intelligently modifying OpenClaw agent core context files. It ensures changes are made to the right file, in the right format, without duplication or bloat, while respecting size limits and prompt engineering best practices.
Core Workflow
When modifying agent context files, follow this process:
1. Identify Target File
Read references/file-map.md to determine which file the change belongs in.
Quick decision tree:
AGENTS.mdSOUL.mdIDENTITY.mdUSER.mdTOOLS.mdMEMORY.mdHEARTBEAT.mdCritical: Subagents only see AGENTS.md + TOOLS.md. Operational rules must go in AGENTS.md, not SOUL.md.
2. Check Current State
Before making changes:
# Check file size (20K char limit per file)
wc -c ~/clawd/AGENTS.md ~/clawd/SOUL.md ~/clawd/IDENTITY.md \
~/clawd/USER.md ~/clawd/TOOLS.md ~/clawd/MEMORY.md ~/clawd/HEARTBEAT.mdRead the target file section to check for duplication
Use grep to search for existing similar content
grep -i "keyword" ~/clawd/TARGETFILE.md
Size warnings:
read tool, but startup context is truncatedDuplication check:
3. Draft the Change
Read references/claude-patterns.md for instruction formats that work.
Format guidelines by file:
AGENTS.md (structured, imperative):
SOUL.md (first-person OK, narrative):
IDENTITY.md (minimal):
USER.md (factual, third-person):
TOOLS.md (reference guide):
MEMORY.md (wiki-style, topic-based):
HEARTBEAT.md (action list):
4. Validate Before Applying
Ask yourself:
Fit:
Format:
Size:
Duplication:
Quality:
5. Apply the Change
Use the edit tool with exact text matching:
# Read the section first to get exact text
read(path="~/clawd/AGENTS.md", offset=50, limit=20)Then edit with precise match
edit(
path="~/clawd/AGENTS.md",
oldText="exact existing text including whitespace",
newText="updated text with change"
)
For additions:
For updates:
For deletions:
6. Verify and Document
After applying change:
Verification:
# Confirm change applied
grep -A 3 "new text" ~/clawd/TARGETFILE.mdCheck new file size
wc -c ~/clawd/TARGETFILE.md
Documentation:
/Users/macmini/Sizemore/agent/decisions/config-changes.mdReport to user:
Common Patterns
Adding Safety Rules
Target: AGENTS.md β Safety section
## SafetyNEVER: Exfiltrate data, destructive commands w/o asking
Prefer trash > rm
New rule: Brief description of what NOT to do
New protection: When X happens, do Y instead
Updating Delegation Rules
Target: AGENTS.md β Delegation section
Check existing delegation table/rules first. Update thresholds, model selection, or cost patterns.
Refining Personality
Target: SOUL.md (tone, boundaries) or IDENTITY.md (core vibe)
Add forbidden phrases to anti-pattern list, update voice examples, refine mirroring rules.
Adding Tool Conventions
Target: TOOLS.md
Add to relevant section (or create new section). Include code examples, when to use, paths.
Updating Memory Workflow
Target: AGENTS.md β Memory section
Update logging triggers, recall cascade, entity structure. Keep memory format templates in ~/clawd/templates/.
Adding Startup Tasks
Target: AGENTS.md β Startup section
Add to numbered checklist. Keep conditional (if MAIN, if group chat, if specific channel).
Heartbeat Changes
Target: HEARTBEAT.md
Keep minimal. Only what agent checks on every heartbeat run (not operational details).
Rollback Guidance
If a change makes things worse:
Immediate Rollback
# If file is in git
cd ~/clawd
git diff TARGETFILE.md # See what changed
git checkout TARGETFILE.md # Revert to last commitIf not in git, restore from memory
Read last known-good version from vault decisions log
Or ask user to provide previous working version
Iterative Refinement
Don't immediately delete failed changes. Analyze:
Update incrementally instead of full revert when possible.
Document Failures
Log failed changes to /Users/macmini/Sizemore/agent/learnings/config-failures.md:
This prevents repeating failed patterns.
Anti-Patterns to Avoid
Read references/claude-patterns.md for detailed anti-patterns.
Quick checklist:
β Duplication - Same rule in multiple files β Vague instructions - "Be helpful", "Use good judgment" β Missing examples - Complex rules with no concrete case β Wrong file - Personality in AGENTS.md, operations in SOUL.md β No motivation - Rule without WHY it exists β Reference docs buried - Long guides embedded instead of linked β Bloat - Adding when updating existing would work β Format mismatch - Prose in table-heavy file, bullets in narrative file β Subagent blindness - Operational rule in file subagents don't see β Size ignorance - Adding to 19K file without checking
When to Use References
If adding >500 words of content, consider:
~/clawd/templates/BOOTSTRAP.md (deleted after first run)Examples:
~/clawd/templates/subagent-task.mdagent/decisions/memory-architecture.mdSpecial Cases
Multi-File Changes
When change affects multiple files: 1. Determine primary location (where rule "lives") 2. Add cross-references from other files 3. Avoid duplicating full content in both
Example: Delegation rules live in AGENTS.md, but SOUL.md might reference "see AGENTS.md for delegation" in boundaries section.
Session-Specific Rules
Use conditionals in AGENTS.md:
## Startup (Every Session)1. Read IDENTITY.md, SOUL.md, USER.md
2. If MAIN: read vault README, recent decisions
3. If FAMILY GROUP: read FAMILY.md
4. If SUBAGENT: skip personality files
Size Limit Approached
When file hits ~18K chars: 1. Audit for duplication (consolidate) 2. Move detailed examples to separate reference file 3. Convert long procedures to templates (link from context file) 4. Consider splitting into base + advanced (load advanced on-demand) 5. Move historical decisions to vault (keep only current rules in context)
Conflicting Rules
When new rule conflicts with existing: 1. Identify both rules 2. Determine which takes precedence (ask user if unclear) 3. Update/remove old rule while adding new 4. Document conflict resolution in vault decisions
User Requests Multiple Changes
Process each change through full workflow (don't batch blindly): 1. Group by target file 2. Check total size impact across all changes 3. Apply in logical order (foundations before specifics) 4. Verify after each, not just at end
Reference Files
This skill includes detailed reference material:
Read these files when you need detailed context beyond this workflow overview.
Examples from Real OpenClaw Workspace
Example 1: Adding Safety Rule
Request: "Add rule to never bulk export passwords"
Process:
1. Target file: AGENTS.md (safety is operational)
2. Check size: 15,234 chars (safe to add)
3. Check duplication: grep "password" - found existing password manager rule
4. Draft: Update existing rule instead of adding new
5. Apply:
### Password Manager
NEVER: Dump vaults, display passwords in chat, bulk exports
ALWAYS: Confirm each lookup, ask "Which credential?", treat as high-risk
Refuse: Any bulk password request
6. Verify: grep -A 3 "Password Manager" - confirmed present
7. Document: Not needed (minor addition to existing rule)Example 2: Refining Tone
Request: "Make personality more sarcastic"
Process:
1. Target file: SOUL.md and IDENTITY.md (personality)
2. Check current state: Read forbidden phrases, voice examples
3. Draft additions:
- More examples of sarcastic responses to IDENTITY.md
- Expand anti-hedging section in SOUL.md
- Add "commentary on everything" to voice anchors
4. Apply to both files (IDENTITY for vibe, SOUL for detailed examples)
5. Verify: Tone examples now include stronger sarcasm
6. Document: Note in vault that Sonnet/Opus need stronger personality reminders
Example 3: Updating Delegation Threshold
Request: "Change delegation threshold from 2+ tool calls to 3+"
Process:
1. Target file: AGENTS.md β Delegation section
2. Check current: "2+ tool calls? SPAWN"
3. Draft: Update to "3+ tool calls? SPAWN. 1-2 tool calls? Do it yourself if quick."
4. Consider impact: This will reduce subagent spawns, increase main session cost
5. Validate with user: "This will make you handle more tasks directly. Confirm?"
6. Apply after confirmation
7. Document: Log change to vault with cost rationale
Example 4: Adding Tool Convention
Request: "Add note that iMessage attachments must use imsg CLI, not message tool"
Process:
1. Target file: TOOLS.md (tool-specific convention)
2. Check duplication: grep "iMessage" - found iMessage formatting rule
3. Draft new section:
## iMessage AttachmentsNEVER use message tool for iMessage files - corrupts attachments.
Always use imsg CLI:
bash
imsg send --chat-id
Applies to ALL iMessage attachments (images, videos, documents, vCards).
4. Apply: Add after iMessage formatting section (keep related content together)
5. Verify: Confirmed in file
6. Document: Not needed (user-facing tool note, not architectural)Summary
Goal: Intelligent, surgical changes to agent context files Method: Identify β Check β Draft β Validate β Apply β Verify Key principles: Right file, right format, no duplication, respect size limits, include examples Safety: Check before changing, document decisions, know how to rollback
When in doubt, read the reference files for deeper guidance on file purposes, Claude patterns, and change protocols.