Skip to content

Using temp files for code instead of putting code on command line eliminates permission prompts #53

Description

@vsekhar

The skill tells the agent to provide code on the commandline.

bash scripts/execute-code.sh -c "code"
bash scripts/execute-code.sh <<'EOF'

Even after giving Claude Code permission to run execute-code.sh, this usage triggers permission prompts for any complex code block.

The fix is to tell the agent to write its code to a temporary file, execute it, and then clean up the temporary file.

Edit(edit-cell-s2j5.tmp.py)
bash scripts/execute-code.sh edit-cell-s2j5.tmp.py; rm edit-cell-s2j5.tmp.py

Writing the temporary file to the current directory eliminates the permission prompt for access to /tmp or similar. Adding the .tmp.py extension makes it easier to cleanup if the agent misses doing so and allows these files to be added to .gitignore. Permission prompts are suppressed for code of any complexity (once execute-code.sh is allowed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions