stamp context clean Command
Remove all generated context artifacts from your project. Safe by default (dry run), requires --all --yes to actually delete files.
Remove all generated context artifacts from your project. Use this to reset your context files and start fresh.
stamp context clean [path] [options][path](optional) – Directory to clean. Defaults to the current working directory. Paths can be relative (./src) or absolute.
Behavior
Default (dry run): Shows what would be removed without actually deleting anything. Safe way to preview the cleanup.
With --all --yes: Deletes all context artifacts. Both flags are required to prevent accidental deletions.
Options
| Option | Description |
|---|---|
--all | Include all context files in the deletion operation |
--yes | Confirm deletion (required with --all) |
--quiet | -q |
--help, -h | Show help message |
Files Removed
Removes:
context_main.json– Main index file with folder metadata**/context.json– All folder context files (recursively, JSON format)**/context.toon– All folder TOON format bundles**/context_*.toon– TOON format variants (e.g.context_main.toon).logicstamp/– Cache directory (if present, automatically included)
Automatically detects and includes the .logicstamp/ directory if it exists. No separate flag needed.
Examples
Preview what would be removed (dry run)
# Show what would be removed without deleting
stamp context cleanOutput:
🧹 This will remove:
- context_main.json
- src/components/context.json
- src/hooks/context.json
- src/ui/context.json
- .logicstamp/
💡 Run with --all --yes to confirm and delete these files.Actually delete all context artifacts
# Delete all context files
stamp context clean --all --yesOutput:
🧹 This will remove:
- context_main.json
- src/components/context.json
- src/hooks/context.json
- src/ui/context.json
- .logicstamp/
🗑️ Removing files...
✓ Removed context_main.json
✓ Removed src/components/context.json
✓ Removed src/hooks/context.json
✓ Removed src/ui/context.json
✓ Removed .logicstamp/
✅ Cleaned 4 file(s) and 1 directoryClean specific directory
# Clean context files in a specific directory
stamp context clean ./src --all --yes
# Suppress verbose output (quiet mode)
stamp context clean --all --yes --quietClean when no files exist
# When no context artifacts are found
stamp context cleanOutput:
✅ No context artifacts found to clean
Safety Features
- Dry run by default – Shows what would be removed without deleting anything unless both
--alland--yesflags are provided - Requires both flags – Both
--alland--yesmust be specified to delete files, preventing accidental deletions - Ignores build directories – Automatically ignores
node_modules/,dist/,build/, and.next/when searching for context files
Use Cases
Reset and regenerate
# Clean all context files
stamp context clean --all --yes
# Generate fresh context
stamp contextClean before switching branches
# Remove context files that might conflict
stamp context clean --all --yes
# Switch branch and regenerate
git checkout feature-branch
stamp contextClean specific output directory
# Generate context to custom output directory
stamp context --out ./output
# Later, clean that directory
stamp context clean ./output --all --yesIntegration with Other Commands
The clean command works well with other LogicStamp commands:
# Clean → Generate → Validate workflow
stamp context clean --all --yes
stamp context
stamp context validate# Clean → Generate → Compare workflow
stamp context clean --all --yes
stamp context
stamp context compareNotes
- Safe by default – Requires explicit confirmation (
--all --yes) to delete files - Files are searched recursively but build directories (
node_modules,dist,build,.next) are automatically ignored - The
.logicstamp/directory is automatically included if it exists (no separate flag needed) - Exit code is
0on success (whether files were found or not)
Related Commands
stamp context– Generate context filesstamp context compare– Detect drift in context filesstamp context validate– Validate context files
Related Commands
init command →
Configure .gitignore, project config, and onboarding files
context command →
Generate AI-ready context bundles
Watch Mode →
Incremental rebuilds while you work
style command →
Compile bundles with Tailwind and style metadata
validate command →
Validate bundles, contracts, and missing dependencies
compare command →
Detect drift between snapshots or git baselines
Next Steps
Explore other commands or browse the Reference section for schema and contracts.