Skip to main content
Texas Tech University

Running AI coding agents on the HPCC cluster

AI coding agents are not allowed on the login nodes. This includes Claude Code, OpenAI Codex, Gemini CLI, Aider, OpenCode, and Cursor Agent. They are stopped automatically there. If one is started again within 24 hours, it is stopped right away.

Run your agent on a compute node, inside a Slurm job that you are actually working in. The agent and everything it runs (builds, tests, scripts) then use the cores and memory of your job. Compute nodes reach Anthropic and OpenAI directly, so no proxy setup is needed.

This guide covers Claude Code (Anthropic) and Codex (OpenAI, signed in with your ChatGPT account). Pick the section that matches how you work:

Rules that apply to every AI tool

These come from the login node policy and apply wherever you run an agent on the cluster:

  • Do not use confidential, sensitive, or regulated data with any AI tool. This includes FERPA-protected student records, health data, export-controlled or controlled unclassified data, and data covered by a data use agreement. Your prompts and the files the agent reads are sent to the AI provider.
  • No prohibited technologies. AI models and services banned by TTU or by Texas or federal law may not be used anywhere on the cluster. This includes agents that use such a model through an API, and models you download and run yourself. Check TTU Prohibited Technologies and the Texas list; for example, DeepSeek is on the Texas list.
  • You are responsible for what the agent does under your account, including the jobs it submits, the files it changes or deletes, and the resources it uses.
  • Your own account with the AI provider. At this moment, TTU has no university-wide agreement with these providers, so their terms and any costs are between you and the provider.
  • University-wide AI guidelines are being developed. When they are published, they apply too.
You use the agent...

Before you start: keep your terminal connected

Your interactive session lives only as long as the terminal that started it. If you close that terminal, or the connection drops (Wi-Fi change, laptop sleep, VPN timeout), the session ends and so does the job. The agent is stopped in the middle of its work.

  • Files it already wrote are kept.
  • You can usually pick up the conversation again in a new session with claude --continue or codex resume.
  • Anything it was running is lost.

Keep your computer awake while the agent works. Use a batch job for long tasks that do not need you.

Install and sign in (once)

  • Do this inside an interactive session (e.g: interactive -c 2 -p nocona), not on a login node. Your home directory is the same on all nodes, so the install and sign-in are done only once.

Needed for the terminal, the Codex desktop app, and batch jobs. The Claude desktop app installs and signs in by itself, so skip this if that is all you use.

Install the agent into your home directory, following the vendor's instructions:

Claude Code
Codex CLI

To sign in:

  • Claude Code: run claude and follow the link it prints.
  • Codex: run codex login --device-auth and enter the code it shows in your browser. Device code sign-in must first be turned on in your ChatGPT security settings (for a workspace account, your workspace admin must allow it).

1. Terminal

  1. Log in to a login node.
  2. Start an interactive session on the partition you need, for example:
    interactive -p nocona -c 8 -t 08:00:00
  3. For a GPU node, use
    interactive -p matador -c 8 -g 1 -t 08:00:00
    Without -t, sessions last 12 hours; the maximum is 48 hours.
  4. When the prompt shows a compute node, load your modules, go to your project directory, and start the agent: claude or codex.
  5. When you are done, leave the agent and type exit to end the session and free the node.

2. Claude or Codex desktop app

Both desktop apps can run the agent on a remote host over SSH. They start a server on the host they connect to. Connect them to the compute node of your interactive session, never to login.hpcc.ttu.edu.

What is hpcc-node?

Compute nodes cannot be reached directly from your computer, and your interactive session lands on a different node each time. hpcc-node solves both problems. It is not a real computer name. It is a nickname that you define once in your SSH config file (step 2 below):

your computer  -->  login node (runs hpcc-connect)  -->  compute node of your running job

When ssh or a desktop app connects to hpcc-node, your computer first logs in to a login node and runs the HPCC helper hpcc-connect. The helper finds the compute node of your running interactive session and passes the connection through to it. So you always connect to the same name, hpcc-node, whichever node Slurm gave you. The agent then runs on that compute node, not on the login node.

One-time setup on your computer

The desktop apps run on macOS and Windows. On a Linux computer, use the terminal instead (section 1). The SSH setup below also works on Linux, for example for connecting other tools.

The apps connect without a password prompt, so set up an SSH key first.

Step 1: create an SSH key and copy it to the cluster

ssh-keygen -t ed25519
ssh eraider@login.hpcc.ttu.edu "mkdir -p ~/.ssh; chmod 700 ~/.ssh"
type $env:USERPROFILE\.ssh\id_ed25519.pub |
  ssh eraider@login.hpcc.ttu.edu "cat >> ~/.ssh/authorized_keys"

MobaXterm users: keep using MobaXterm for your terminal work, including section 1 and starting the interactive session in step 1 below. The desktop apps do not use MobaXterm's sessions, keys, or settings. They use Windows' own SSH files in C:\Users\<you>\.ssh. So do steps 1–3 here in PowerShell, not in MobaXterm's terminal.

To use the same key in MobaXterm too, edit your MobaXterm session and set Advanced SSH settings > Use private key to C:\Users\<you>\.ssh\id_ed25519.

If you already log in to HPCC with a MobaXterm key (.ppk file from MobaKeyGen), you can reuse it. In MobaKeyGen, load it, choose Conversions > Export OpenSSH key, and save it as C:\Users\<you>\.ssh\id_ed25519. Then skip ssh-keygen in step 1. The public key is already on the cluster.

ssh-keygen -t ed25519
ssh-copy-id eraider@login.hpcc.ttu.edu

  • On Windows 10 and 11 the SSH client is built in. If PowerShell says ssh is not found, add OpenSSH Client under Settings > System > Optional features (Windows 11) or Settings > Apps > Optional features (Windows 10). The Claude desktop app needs a recent version of it. See the Windows note in Each time, step 3.

Step 2: create the SSH config file  

Copy the block for your system, paste it into PowerShell (Windows) or Terminal (macOS/Linux), and press Enter. It asks for your eRaider ID and writes the SSH config file for you. Do this only once.

  • Windows (PowerShell, also if you use MobaXterm; do not use Run as administrator):

Please copy the following lines and paste them all together into PowerShell. Do not copy and paste line by line. The code will ask for your eRaider username; once you enter it, it will add it in the correct spot in the config file.

$id = Read-Host "Your eRaider ID"
@"
Host hpcc-login hpcc-node hpcc-node-*
    User $id
    IdentityFile ~/.ssh/id_ed25519

Host hpcc-login
    HostName login.hpcc.ttu.edu

Host hpcc-node hpcc-node-*
    ProxyCommand C:\Windows\System32\OpenSSH\ssh.exe -q hpcc-login hpcc-connect %h
"@ | Add-Content -Encoding ascii $env:USERPROFILE\.ssh\config
Please copy the following lines and paste them all together into the terminal. Do not copy and paste line by line. The code will ask for your eRaider username; once you enter it, it will add it in the correct spot in the config file.

read -p "Your eRaider ID: " id
cat >> ~/.ssh/config <<EOF
Host hpcc-login hpcc-node hpcc-node-*
    User $id
    IdentityFile ~/.ssh/id_ed25519

Host hpcc-login
    HostName login.hpcc.ttu.edu

Host hpcc-node hpcc-node-*
    ProxyCommand ssh -q hpcc-login hpcc-connect %h
EOF
 

What this does:
  • It writes the file C:\Users\<you>\.ssh\config (Windows) or ~/.ssh/config (macOS/Linux). If the file already exists, it adds these lines at the end and keeps what was there.
  • The first block applies to both the login node and the compute node. Its IdentityFile line tells ssh and both desktop apps which key to use: the one you created in step 1.
  • MobaXterm's built-in Linux terminal has its own home directory and its own ~/.ssh/config, which the desktop apps never read. That is why Windows users run this in PowerShell, even if they use MobaXterm.
  • To look at or change the file later, run notepad $env:USERPROFILE\.ssh\config (Windows) or open -e ~/.ssh/config (macOS). For example, if your key has a different name (such as id_rsa), change the IdentityFile line. Do not create the file in Notepad yourself: Notepad saves a new file as config.txt, and ssh ignores that name.
  • You never need to edit this file again. hpcc-node always leads to the compute node of your running interactive session, whichever node it is on.

Step 3: test the login node

In Terminal (macOS/Linux) or PowerShell (Windows), run

ssh hpcc-login hostname

If it asks whether you trust the host (Are you sure you want to continue connecting), answer yes. It must then print a login node name without asking for a password. You test hpcc-node later, once you have an interactive session running (see Each time, step 2).

If it fails:
  • Could not resolve hostname hpcc-login: ssh does not find the config file. On Windows, run:
    • Get-ChildItem -Force $env:USERPROFILE\.ssh

      If it lists config.txt, rename it with
    • Rename-Item $env:USERPROFILE\.ssh\config.txt config
  • It asks for a password: check the user name in the prompt (<user>@login.hpcc.ttu.edu's password). If it is not your eRaider ID, fix the User line in the config file. If it is, the key from step 1 was not copied to the cluster; repeat step 1.
Each time
  1. In a terminal, log in to a login node and start an interactive session with the resources the agent's work needs, as in section 1:
    interactive -p nocona -c 8 -t 08:00:00
    Leave this terminal open while you use the app.
  2. Check the connection (required the first time, before you use the app). On your own computer (not in the HPCC terminal), open a second Terminal (macOS/Linux) or PowerShell (Windows) window and run:
    ssh hpcc-node hostname
    1. The first time, it asks whether you trust the host hpcc-node. Answer yes. The app cannot show this question, so it would wait forever if you skip this step.
    2. It should then print a line like
      hpcc-connect: job 26509174 (INTERACTIVE) on cpu-24-51
      followed by the node name, without asking for a password.
    3. If it asks for a password, your SSH config is wrong. Check the User line (your eRaider ID) and the IdentityFile line (your key).
  3. Connect the app to hpcc-node:

    1. In the app, open Settings > Connections, under SSH, click 'Add', enable hpcc-node, and choose your project folder. You do this only once. The list also shows hpcc-login. Never enable it: agents are not allowed on login nodes and are stopped there.
    2. The app has no SSH key field. It uses the key on the IdentityFile line of your SSH config file, so make sure that line names your key.
    3. The app starts codex on the node and uses the Codex sign-in stored there, not the app's. So install and sign in (codex login --device-auth) on the cluster first.
    4. Optional check: with your interactive session running, run this on your computer:
      ssh hpcc-node 'bash -lc "which codex"'

      It should print the path of codex. If it prints nothing, the app cannot find codex either. Make sure the folder it was installed in is added to your PATH in ~/.bashrc.

    1. First time only: add the connection.
      1. Open the Code tab. Under the prompt box, click the environment selector and choose New environment at the bottom of its menu.
      2. On the SSH tab of the dialog, open the Host list and choose Add SSH connection….
      3. Fill in Name: HPCC node (any label you like) and SSH host: hpcc-node. Leave SSH port and Worktree folder empty.
      4. SSH key: leave it empty. The app then uses the key on the IdentityFile line of your SSH config file. You can also enter the key's path, for example ~/.ssh/id_ed25519 (Windows: C:\Users\<you>\.ssh\id_ed25519). It must be an OpenSSH key file, not a PuTTY or MobaXterm .ppk file.
      5. Click Add SSH connection, choose your project folder on the cluster, and click Create environment.

      The first connection installs the app's server under ~/.claude/remote in your HPCC home directory. That takes about a minute, and the server is reused later.

    2. After that, each time: click the environment selector under the prompt box and choose HPCC node under SSH. Then type your task.
    3. Windows: the app can use hpcc-node only through Microsoft's OpenSSH client, version 9.4 or later, and only if you downloaded the app from claude.com (not the Microsoft Store). In PowerShell, run ssh -V. It must show OpenSSH_for_Windows_9.4 or higher. MobaXterm's SSH does not count, so check in PowerShell, not in MobaXterm. If your version is older:
      • On Windows 11, install all Windows updates, including version 24H2, which includes a new enough OpenSSH.
      • Or, in PowerShell opened with Run as administrator, run winget install "openssh preview". On a TTU-managed computer, ask your IT staff.

      Then quit and reopen the Claude app. If neither is possible, use the terminal (section 1).

  • If your key has a passphrase (both apps): the apps cannot type it for you. Load the key into your computer's SSH agent before you connect:
    • macOS: run ssh-add --apple-use-keychain ~/.ssh/id_ed25519 once. macOS then remembers it.
    • Windows: once, in PowerShell opened with Run as administrator, run: Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service
      Then, in a normal PowerShell, run ssh-add. Windows then remembers the key.
  1. Work as usual. The agent runs inside your interactive session's job and uses its cores.
  2. When you are done, close the session in the app, then type exit in the interactive session.
More than one interactive session
  • Give each session a name with -J, and connect to hpcc-node-<name>:

interactive -J proj1 -p nocona -c 8 -t 08:00:00

The app lists only names written out in the config file. Add the name once to the last Host line (the one above ProxyCommand), for example Host hpcc-node hpcc-node-proj1 hpcc-node-*.
Add one more connection as above, with the SSH host set to hpcc-node-proj1. No changes are needed in the SSH config file.
 

  • You can also use the job ID instead of a name, for example hpcc-node-26505780.

Good to Know

  • hpcc-node connects only while you have a running job. Without one, the connection fails with hpcc-connect: you have no running job.
  • hpcc-node picks your newest interactive session. If you have none, it picks your newest running job. To reach a specific job, use hpcc-node-<name> or hpcc-node-<jobid>.
  • The app's connection depends on your interactive session. When the session ends, the app loses its connection and its sessions stop. The session ends when you type exit, when the time limit is reached, or when its terminal closes or loses its connection.
  • A new interactive session may run on a different node. hpcc-node follows it, and your earlier conversations are kept in your home directory.

3. Unattended work (batch job)

Both agents can run a task without a person at the keyboard. Run them as a normal batch job:

Example:

#!/bin/bash
#SBATCH --job-name=agent-task
#SBATCH --partition=nocona
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=8
#SBATCH --time=04:00:00
#SBATCH --output=%x-%j.out

cd "$HOME/myproject"

TASK="Run the test suite, fix any failing tests, and summarize the changes."

# Claude Code: -p runs one task and exits.
# acceptEdits lets it change files; --allowedTools Bash lets it run commands.
claude -p "$TASK" --permission-mode acceptEdits --allowedTools Bash

=== OR ===

# Codex: exec runs one task and exits.
# --full-auto lets it change files in this directory.
codex exec --full-auto "$TASK"

Save it as agent_task.sh and submit it with sbatch agent_task.sh, and read the result in agent-task-<jobid>.out. These options let the agent change files and run commands without asking, so give it a narrow task and run it in a project directory that has a backup or is under git. Check what the agent changed before you rely on it. Working in a git repository makes that easy.

Common questions

I use VS Code with an AI extension (Claude, Codex, Copilot). How do I keep working?

Run VS Code on a compute node instead of a login node. Your files, terminal, image viewer, and AI extensions then all run inside your job, and everything works as before. There are two ways:

  • CS Bridge (recommended). This is the HPCC-supported way. It is one extension next to Remote-SSH. It submits the job for you, waits for the node, and opens a VS Code window on it. Follow the VS Code with CS Bridge guide.

  • Remote-SSH only. If you do not want another extension, connect Remote-SSH to the node of an interactive session:
    1. Do the one-time SSH setup.
    2. Start an interactive session (Each time, step 1).
    3. Run Remote-SSH: Connect to Host and enter hpcc-node. Keep the interactive session's terminal open while you work.

Do not install other extensions to run agents around the login-node rule.

Is there a way that needs nothing installed on my computer?

Yes. Open OnDemand at https://ondemand.hpcc.ttu.edu offers Code Server, which is VS Code in your web browser, running on a compute node. You can also open a terminal there and run claude or codex. Off campus, connect to the TTU VPN first.

Can I just run a short agent session on the login node?

No. Even short sessions are stopped, and a restart within 24 hours is stopped right away.

Why are agents not allowed on the login nodes?

Many HPCC users share each login node. Agents run for hours, start builds and tests, and keep many files open in your home directory. On a shared login node, this slows everyone down. In one case, it hung the node's home file system.
 

Questions

Please contact HPCC support at hpccsupport@ttu.edu if you have any questions.