Cleanup Command

stamp context clean Command

Remove all generated context artifacts from your project. Safe by default (dry run), requires --all --yes to actually delete files.

Syntax

stamp context clean [path] [options]

[path] (optional) – Directory to clean. Defaults to the current working directory. Paths can be relative (./src) or absolute.

Default (dry run)

Shows what would be removed without actually deleting anything. This is safe and allows you to preview the cleanup operation.

With --all --yes

Actually deletes all context artifacts. Both flags are required to prevent accidental deletions.

Options

OptionDescription
--allInclude all context files in the deletion operation
--yesConfirm deletion (required with --all)
--help, -hShow help message

Files Removed

The clean command removes:

context_main.json

Main index file

**/context.json

All folder context files (recursively)

.logicstamp/

Cache directory (if present, automatically included)

The command automatically detects and includes the .logicstamp/ directory if it exists. You don't need a separate flag for this.

Examples

# Show what would be removed without deleting stamp context clean

Safety Features

Dry run by default

The command shows what would be removed without deleting anything unless both --all and --yes flags are provided

Requires both flags

Both --all and --yes must be specified to actually delete files, preventing accidental deletions

Ignores build directories

Automatically ignores node_modules/, dist/, build/, and .next/ directories when searching for context files

Use Cases

Reset and regenerate

# Clean all context files stamp context clean --all --yes # Generate fresh context stamp context

Clean before switching branches

# Remove context files that might conflict stamp context clean --all --yes # Switch branch and regenerate git checkout feature-branch stamp context

Integration 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 compare