What You’ll Build
A CLI tool that:- Accepts natural language commands
- Runs AI reasoning in Chucky’s cloud
- Executes file operations and shell commands locally
- Returns results to the user
Architecture
Quick Start
The simplest way is using the Chucky CLI directly:How Possession Mode Works
When--allow-possession is enabled, Claude gets access to Host Tools that execute on the user’s machine:
Claude reasons in the cloud (where your workspace context exists) but these tools execute locally.
Building a Custom CLI
Basic Implementation
With Host Tool Handlers
For tools to execute locally, you need to handle them in your CLI:Use Cases
Code Refactoring
Bug Fixing
Code Review
Test Generation
Documentation
Security Considerations
Recommended Safeguards
- Explicit opt-in: Require
--allow-possessionflag - Confirmation prompts: Ask before destructive operations
- Working directory isolation: Limit to project directory
- Command allowlist: Restrict which commands can run
- Dry-run mode: Show what would happen before executing
Example: Confirmation Flow
Applying Changes
When the AI makes file changes, they’re saved in a git bundle. Use the CLI to apply them:Best Practices
1. Clear System Prompts
Tell Claude what it has access to:2. Progress Feedback
Show users what’s happening:3. Error Recovery
Handle failures gracefully:Next Steps
Possession Mode
Deep dive into Possession Mode
Git Bundles
Managing code changes
Error Handling
Handling errors gracefully
Sessions
Multi-turn conversations