AI Blocks › Build and ship software
Session to script exporter
Ask to save your session. Get one clean MATLAB script that reruns the work from start to end.
Session to script exporter is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · BSD 2 Clause licence · Made by MathWorks · Level: beginner · Thinking: low
Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.
What it does
One clean MATLAB script that reruns your whole session from start to finish. Ask to export it and Claude walks back through the conversation, collects each MATLAB block that ran, and builds a single .m file. It keeps only the final working version of any block that was retried, and drops shell commands, tool wrapper text, debugging one-liners and helper print lines meant for the assistant. Blocks are ordered as setup, model, configuration, analysis and plots, with %% section headings and parameters moved to the top. Figure settings that hid windows are removed, so the script works when you run it by hand. The file is saved in a Results folder with a descriptive name.
You give it
- A MATLAB session with code that ran
- A script name (optional)
- A working folder
- Codebase (optional)
You get
- A single runnable .m script
- Section headings for each step
- Parameters gathered at the top
- A saved file in the Results folder
Use it when
- You finished an analysis with Claude and want to rerun it yourself.
- You need a script to hand to a colleague after a MATLAB session.
- Your session had many failed attempts and you want only the working code.
- You want parameters collected at the top so you can change them.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run MATLAB.