ai-character-swap: Open-Source Agent Skill for Automated Short-Form Video Character Replacement in Claude Code and Codex
ai-character-swap, an open-source agent skill for Claude Code and Codex, automates end-to-end video character replacement—from reference video inspection and pr
On October 3, 2026, developer DDJCXX released ai-character-swap on GitHub, an open-source agent skill that enables AI coding assistants like Claude Code and OpenAI Codex to automate end-to-end character replacement in short-form videos.

Image source: @DDJCXX
In conventional AI video workflows, replacing a subject in an existing viral clip requires tedious manual steps: analyzing keyframes, crafting intricate diffusion model prompts, managing external generation APIs, and assembling side-by-side comparison videos in non-linear editors (NLEs). With ai-character-swap, users provide a single character reference image and a source video, issue a natural language command like "replace the person in this clip," and let the coding agent autonomously execute the entire pipeline.
Agent Skill Architecture for Video Character Replacement
The ai-character-swap project is structured as a standardized Agent Skill (SKILL.md), allowing seamless integration into terminal-based coding agents.
- Native Agent Integration: Compatible out-of-the-box with Anthropic's Claude Code CLI and OpenAI Codex environments without requiring standalone GUI software or heavy desktop dependencies.
- Minimal Input Requirement: Operates on just two inputs—one character reference image (portrait or concept art) and one reference video file or URL.
- Unified Multimodal Toolchain: Chains vision-based analysis for motion and scene understanding, generative video backends for character synthesis, and local media processing utilities within a single agent session.
By offloading the intricacies of prompt engineering and video assembly to the AI agent, creators can bypass manual video editing mechanics and focus purely on content curation and viral ideation.
Automated End-to-End Pipeline: From Video Analysis to Side-by-Side Cuts
The core utility of ai-character-swap lies in its comprehensive six-stage autonomous execution loop:
- Video Inspection: Automatically audits the reference clip's structure, motion trajectory, camera dynamics, and scene parameters.
- Context-Aware Prompt Synthesis: Generates optimized prompts that preserve the original video's camera dynamics and choreography while substituting the target character's visual identity.
- Video Generation: Dispatches requests to generative video backends to render the character-swapped footage.
- Asset Download: Downloads the generated video files directly into the local workspace.
- Side-by-Side Comparison Assembly: Automatically stitches the original reference footage and the newly generated clip into a dual-panel comparison video for rapid quality validation.
- Social Copywriting and Caption Generation: Produces ready-to-publish social media captions, copy, and promotional text tailored to the generated clip.
Practical Considerations and Production Caveats
For independent creators, growth marketers, and video teams exploring agent-driven content production, ai-character-swap provides a streamlined blueprint for programmatic video iteration.
However, several operational and technical factors should be considered before deploying the workflow into high-volume production:
- External Video Generation Costs: Invoking video generation backends may require external API credits or platform subscriptions.
- Motion Complexity and Artifacts: Footage featuring rapid camera pans, fast-paced acrobatic movements, or severe object occlusions may exhibit temporal inconsistencies or quality variations.
- Copyright and Likeness Compliance: Practitioners must ensure that reference video footage and character assets adhere to fair use standards, likeness rights, and respective platform terms of service.
The source code and skill definitions are publicly accessible on GitHub, allowing developers and creators to load ai-character-swap directly into their local agent configurations.
Sources
- GitHub Repository: 10291124jcjc-dotcom/ai-character-swap
- Source Social Signal: @DDJCXX Post on X