The Deska blog
Research Code and Agents: Reproducibility First
Learn how to use research code and agents to ensure reproducibility in scientific computing and academic software development workflows.
· 14 min read
Academic software development faces a unique set of challenges that distinguish it from commercial engineering. The primary goal is often the discovery of new knowledge rather than a polished product, which frequently leads to scripts that are difficult to replicate. As the complexity of scientific simulation and data analysis grows, the integration of research code and agents has emerged as a strategy to bridge the gap between experimental exploration and rigorous reproducibility. These autonomous and semi-autonomous tools can assist researchers in documenting environments, refactoring legacy scripts, and ensuring that a codebase remains functional across different hardware configurations.
The Reproducibility Crisis in Scientific Software
Reproducibility is the cornerstone of the scientific method. In the context of software, it means that an independent researcher should be able to take your code and data to achieve the same results. However, many academic projects suffer from "bit rot" where dependencies change, APIs are deprecated, or custom local environments are never fully documented.
When researchers write code, they often prioritize the immediate result. This results in script-heavy repositories with hardcoded paths and missing requirements files. AI agents can help solve this by auditing code for non-portable patterns. By using coding agents, a researcher can automate the generation of setup scripts and environment configurations that would otherwise be an afterthought.
Integrating AI Agents into the Research Workflow
AI agents are not merely autocomplete tools. They are capable of reasoning over entire directories and executing commands. In a research setting, they can be utilized for several specific tasks:
- Automated Testing of Hypotheses: An agent can iterate through different hyperparameters in a simulation and log the results systematically.
- Legacy Code Refactoring: Many labs rely on older scripts written in Fortran or Python 2. Agents can assist in translating these to modern equivalents while preserving the underlying logic.
- Documentation and Meta-data: Agents can scan a folder of scripts and generate a comprehensive README that describes the execution flow and necessary dependencies.
The key to success is keeping the human in the loop. While an agent can write the boilerplate, the researcher must validate the scientific validity of the output. Using an infinite canvas allows a researcher to see the agent's output, the terminal where code is running, and the original source code all at once. This spatial organization prevents the "black box" effect where a researcher loses track of what the AI has modified.
Comparing Agent Architectures for Research
Different agentic frameworks offer various advantages for academic work. Some focus on speed, while others focus on deep reasoning and file system interaction.
| Feature | Claude Code | Codex CLI | OpenCode |
|---|---|---|---|
| Interaction Style | CLI Terminal | Command Line | Collaborative Panel |
| File System Access | High | Moderate | High |
| Specialized for Research | No | No | Yes |
| Primary Strength | Fast iteration | Simple tasks | Context awareness |
These tools differ in approach when it comes to how they handle local files. Some require uploading snippets to a cloud, while others operate on your local machine. For researchers handling sensitive data or proprietary datasets, a local-first approach is often mandatory to comply with institutional ethics and privacy requirements.
Deska as a Research Environment
Deska provides a specialized workspace for those working with research code and agents. It does not replace your specialized tools but rather orchestrates them. Instead of switching between a terminal, a browser for documentation, and a text editor, you can place them as panels on an infinite canvas.
You can run Claude Code, Codex CLI, and OpenCode side by side in different panels. This allows you to compare how different models approach the same scientific problem. If one agent gets stuck in a loop, you can use Ask Deska, the built-in voice and chat assistant, to open a new terminal or check the status of another session. Because Deska uses a BYOK model for its lifetime tier, researchers can use their own institutional API keys to maintain control over their budgets and usage limits.
Managing Long Running Experiments
Scientific computations often take hours or days. A significant risk in remote research is losing the connection to a running session. Deska addresses this through its mobile app and secure relay system. Researchers can pair their phone directly with their desktop. This allows you to monitor the output of a long running simulation while away from your desk. You can see the terminal output in real time and even send commands to stop or modify the experiment if the logs indicate a failure. This connection is established directly between devices without exposing open ports to the public internet, which is a common security concern in university networks.
Best Practices for Reproducible Research Code
- Use Version Control Consistently: Never run an experiment on uncommitted code. Use agents to write meaningful commit messages linked to the experiment ID.
- Containerize Your Environment: Use agents to help write Dockerfiles or Conda environment files early in the process.
- Decouple Data and Code: Ensure your scripts take data paths as arguments rather than hardcoding them.
- Record Everything: Use notes and notebooks within your workspace to capture the "why" behind specific architectural choices in your code.
FAQ
How do I start using research code and agents for my thesis?
Begin by setting up a local environment where you can run an agent like Claude Code alongside your scripts. Focus first on using the agent to document your existing code and generate a requirements.txt file. This establishes a baseline for reproducibility before you start adding new features.
Are AI agents reliable for scientific data analysis?
Agents are excellent at writing the syntax for data analysis, but they do not understand the underlying physics or statistics. You must verify their logic. Use them to boilerplate the visualization code and data cleaning steps, but manually review the mathematical transformations they apply to your raw data.
Is it safe to use agents with proprietary research data?
Safety depends on the tool's architecture. Prefer tools that follow a local-first philosophy where your files stay on your hardware. If you use a managed inference service, check the provider's privacy policy regarding data training. Using your own API keys typically gives you more control over how your data is handled.
Conclusion
The integration of research code and agents represents a shift toward more robust and verifiable science. By automating the tedious aspects of software maintenance and environment configuration, researchers can spend more time on discovery and less on debugging. Deska offers a flexible, local-first environment to manage these complex workflows, providing the tools needed to keep experiments organized and reproducible.
To see how an infinite canvas and integrated agents can improve your research workflow, you can download the application for your operating system.