Agentic Workflow via GitHub Issues
Agentic coding tools can act as automated research assistants, directly interacting with your terminal and file system to write scripts, run data pipelines, and manage your compute jobs. While this can drastically speed up iteration, managing these AI agents across different machines and lengthy experiments can quickly become chaotic.
This article outlines a robust workflow for managing long-running agentic experiments.
1. Introduction to Agentic Coding
Agentic coding moves beyond simple autocomplete. These tools can read your entire project directory, execute terminal commands, and debug errors autonomously.
Popular tools in this space include:
- Cursor: An AI-first code editor.
- GitHub Copilot/Codex: Integrated directly into IDEs like VS Code.
- Claude Code: A command-line tool that operates directly in your terminal.
The rest of this article will use Claude Code as the primary example, but the overarching workflow and principles should translate well to most agentic coding setups.
2. Challenges of the Agentic Coding Workflow
While extremely powerful, relying on an AI agent for complex statistical research introduces several logistical hurdles:
- Session Tracking: It is difficult to keep track of multiple terminal sessions, especially when running overlapping experiments.
- Memory Loss: Remembering exactly what prompt led to a specific code change or output during a chaotic debugging session is nearly impossible.
- Token Limits: Keeping a single continuous session open for days uses up too much context window (tokens), eventually leading to degraded AI performance, slow response times, or API errors.
- Machine Isolation: Sessions running on your personal laptop cannot easily communicate with or track jobs running on the department's HPC clusters.
3. The Solution in 3 Parts
To build a reliable, scalable agent workflow, we can combine Claude Code with GitHub issues, dedicated SSH keys, and terminal multiplexers.
3a. GitHub MCP and Bookkeeping via GitHub Issues
GitHub Issues are a built-in tracking tool for repositories. By setting up the GitHub Model Context Protocol (MCP) server, Claude can read from and write directly to your repository's issues.
Instead of relying on a single, infinitely long terminal session to remember context, treat a GitHub issue as your "lab notebook." When you start working, point Claude to a specific issue link for its instructions. When the agent completes a task, have it summarize the results and post them back to the issue. This allows you to safely kill sessions to save tokens—simply start a fresh session later and point it to the exact same GitHub issue to pick up right where it left off.
3b. Giving Claude its own SSH key
Research experiments ultimately need to run on larger department or external clusters using Slurm. You can grant Claude autonomy by generating a dedicated SSH key specifically for the agent.
Once configured, Claude can SSH into the Slurm clusters on your behalf. It can sync your local GitHub repositories to the remote server, format and write the necessary sbatch submission scripts, and submit jobs directly to the queue—acting as an automated bridge between your local environment and the heavy-compute nodes.
3c. Tmux and Remote Control
Since our department maintains always-on, SSH-only servers, you can detach your agentic workflows from your personal hardware entirely.
By launching Claude Code inside a tmux (terminal multiplexer) session on a department server, the agent continues running even if you close your laptop or lose your internet connection. You can periodically SSH back into the server, reattach to the tmux session, and "remote control" the agent—checking its progress, providing human feedback when it gets stuck, or terminating rogue processes.