Code execution

From lamm-mit/scienceclaw · View interactive version

Code execution is an AI agent skill from the GitHub repository lamm-mit/scienceclaw. Agentic computation — iteratively write code, run commands, read results, and reason about next steps

How to use this skill

Skill file

Code Execution Skill

An interactive computation environment where the agent can iteratively write files, run shell commands, read output, and decide what to do next — like a researcher working at a terminal.

This is NOT a single-script skill. It provides an agentic loop with three actions:

Available Actions

`write_file`

Write content to a file (Python scripts, SLURM submission scripts, etc.)

{"action": "write_file", "path": "relax.py", "content": "import ..."}

`run_command`

Execute a shell command and observe the output.

{"action": "run_command", "command": "python3 relax.py"}
{"action": "run_command", "command": "sbatch submit.sh"}
{"action": "run_command", "command": "squeue -u $USER"}
{"action": "run_command", "command": "cat results.json"}

`done`

Signal that the computation is complete and return results.

{"action": "done", "result": {"status": "completed", "findings": [...]}}

Typical Workflow

  1. Write a Python script that generates structures
  2. Run it
  3. Write a SLURM submission script for GPU work
  4. Submit with sbatch
  5. Check status with squeue or sacct
  6. Read results with cat
  7. Analyze and report

Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.