Sync Agent Context
Merge all AGENTS.md files into CLAUDE.md for unified agent context
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Sync Agent Context is
Sync Agent Context is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Sync Agent Context gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Sync Agent Context
Claude Code
- Download sync-agent-context.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/productivity/agent-context-manager/commands/sync-agent-context.md, shared under the repository's MIT license. Read the full file on GitHub.
Command: /sync-agent-context
Purpose: Permanently merge all AGENTS.md files in the project into CLAUDE.md under a dedicated section, ensuring agent-specific instructions are always loaded alongside project context.
What This Command Does
- Finds all AGENTS.md files in the current project directory (searches recursively)
- Reads each AGENTS.md file and extracts its content
- Updates CLAUDE.md by adding or updating the "## Agent-Specific Instructions" section
- Maintains both files: Keeps original AGENTS.md files as the source of truth
- Creates backup: Saves a backup of CLAUDE.md before making changes
Execution Steps
Step 1: Find All AGENTS.md Files
Search the current project for all files named AGENTS.md:
find . -name "AGENTS.md" -type fExpected output:
./AGENTS.md
./subproject/AGENTS.mdStep 2: Read Each AGENTS.md File
For each found file, read its full content using the Read tool:
File: ./AGENTS.md
Content: [full content of AGENTS.md]
File: ./subproject/AGENTS.md
Content: [full content of subproject AGENTS.md]Step 3: Check if CLAUDE.md Exists
if [ -f "./CLAUDE.md" ]; then
echo "CLAUDE.md found - will update"
else
echo "CLAUDE.md not found - will create new file"
fiStep 4: Create Backup of CLAUDE.md
cp CLAUDE.md CLAUDE.md.backup.$(date +%Y%m%d-%H%M%S)Example: CLAUDE.md.backup.20251023-143022
Step 5: Merge AGENTS.md into CLAUDE.md
Add or update the following section in CLAUDE.md:
---
## Agent-Specific Instructions
<!-- AUTO-SYNCED from AGENTS.md files - Last updated: 2025-10-23 14:30:22 -->
<!-- Source files: ./AGENTS.md, ./subproject/AGENTS.md -->
### Root Directory Agent Rules (./AGENTS.md)
[Content from ./AGENTS.md]
### Subproject Agent Rules (./subproject/AGENTS.md)
[Content from ./subproject/AGENTS.md]
---Step 6: Verify and Report
✅ Agent Context Sync Complete!
📋 Summary:
- Found 2 AGENTS.md files
- Created backup: CLAUDE.md.backup.20251023-143022
- Updated CLAUDE.md with agent-specific instructions
📂 Synced files:
1. ./AGENTS.md → CLAUDE.md (Section: Root Directory Agent Rules)
2. ./subproject/AGENTS.md → CLAUDE.md (Section: Subproject Agent Rules)
⚠️ Note: Original AGENTS.md files remain unchanged (source of truth)
💡 Next time you start Claude Code, both CLAUDE.md and AGENTS.md will be loaded automatically.When to Use This Command
Use /sync-agent-context when:
- Initial setup: First time using agent-specific instructions
- AGENTS.md not auto-loading: If the proactive skill isn't triggering
- Permanent merge desired: Want agent rules always in CLAUDE.md
- Multiple AGENTS.md files: Have agent rules across different directories
- Manual control preferred: Want explicit control over when rules are merged
Don't use this command if:
- Automatic loading is working fine (skill handles it)
- You want AGENTS.md and CLAUDE.md to remain separate
- You frequently update AGENTS.md (would require re-running sync)
Merge Strategy
If "Agent-Specific Instructions" section exists in CLAUDE.md:
Replace the existing section with updated content from all AGENTS.md files.
## Agent-Specific Instructions
<!-- OLD CONTENT - WILL BE REPLACED -->
↓↓↓ BECOMES ↓↓↓
## Agent-Specific Instructions
<!-- NEW CONTENT FROM AGENTS.MD FILES -->If "Agent-Specific Instructions" section doesn't exist:
Append new section to the end of CLAUDE.md.
[Existing CLAUDE.md content]
---
## Agent-Specific Instructions
<!-- NEW SECTION ADDED -->
[Content from AGENTS.md files]Conflict Resolution
If both CLAUDE.md and AGENTS.md have conflicting rules:
The sync command will:
- Keep original CLAUDE.md content intact
- Add AGENTS.md content in dedicated section
- Document in the header: "In case of conflicts, Agent-Specific Instructions take precedence"
Example merged output:
# CLAUDE.md
## General Project Instructions
- Use TypeScript for all code (from original CLAUDE.md)
---
## Agent-Specific Instructions
<!-- In case of conflicts, these rules take precedence for agent workflows -->
- Use JavaScript for agent-generated code (from AGENTS.md) Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Sync Agent Context?
Sync Agent Context is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Merge all AGENTS.md files into CLAUDE.md for unified agent context
How do I install Sync Agent Context in Claude Code?
Download sync-agent-context.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Sync Agent Context in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Sync Agent Context safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Resource Usage Tracker Track and optimize resource usage across the stack Plugin · jeremylongshore/tons-of-skills-marketplace
- Response Time Tracker Track and optimize application response times Plugin · jeremylongshore/tons-of-skills-marketplace
- Resp Writes incident response playbooks, containment runbooks, and post-incident reviews following the PICERL framework — contain first, preserve evidence, never blame. Use when building IR readiness or handling an active incident. Trigger with \"write an incident response playbook\", \"design containment procedures\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Retellai Pack Claude Code skill pack for Retell AI (30 skills) Plugin · jeremylongshore/tons-of-skills-marketplace
- Teleprompter Convert video scripts to teleprompter format with auto-scroll, timing marks, Slash Command · jeremylongshore/tons-of-skills-marketplace
- Sugar Thinking View Claude's thinking logs for task execution Slash Command · jeremylongshore/tons-of-skills-marketplace
- Template Save and reuse successful video templates including scripts, thumbnails, Slash Command · jeremylongshore/tons-of-skills-marketplace
- Sugar Task Create a comprehensive Sugar task with rich context and metadata Slash Command · jeremylongshore/tons-of-skills-marketplace