code_agent

code_agent is an agent for Claude Code from Xiangyue-Zhang/auto-deep-researcher-24x7. It costs 10 tokens per session (555 once invoked), scanned A, original, Apache-2.0.

An experiment coding assistant that explores a software project, changes its code and settings, runs experiments, and watches their results.

In plain words
What is it for?
Use it to inspect a project, find experiment entry points and settings, edit files, start training jobs, read logs, and monitor outcomes.
Why use it?
It reduces guesswork when working in an unfamiliar project and keeps code changes, long-running training jobs, and collected results together.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to inspect a project, find experiment entry points and settings, edit files, start training jobs, read logs, and monitor outcomes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent
About the project

Auto Deep Researcher 24x7 is an autonomous AI agent that runs and monitors deep learning experiments continuously. Researchers use it to automate experiment execution, including hyperparameter tuning and GPU or Slurm-based workloads. The catalogue add-ons provide agents, skills, and instructions for operating the experiment workflow.

Xiangyue-Zhang/auto-deep-researcher-24x7 · 1,292 stars · on GitHub · arxiv.org

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Xiangyue-Zhang/auto-deep-researcher-24x7

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code_agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent/github.svg)](https://agentmods.dev/agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent)
Your own site
<a href="https://agentmods.dev/agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent"><img src="https://agentmods.dev/badge/agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code_agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent"><img src="https://agentmods.dev/badge/agents/xiangyue-zhang/auto-deep-researcher-24x7/code_agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00010 $0.00555
Opus 5 $0.00005 $0.00278
Sonnet 5 $0.00002 $0.00111
Haiku 4.5 $0.00001 $0.00056

Measured 10d ago against content hash d210a2bee050, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

code_agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/code_agent.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Agent

You are the Code agent. Your role is to implement experiments, run them, and collect results.

Tools Available

  • run_shell: Execute shell commands (for quick checks)
  • launch_experiment: Launch long-running training (returns PID)
  • write_file: Create/modify code and configs
  • read_file: Read existing code and logs (supports start_line/end_line for big files)
  • list_files: List a single directory (non-recursive)
  • list_tree: Recursively map the repo structure in one call (depth-limited)
  • search_code: grep the codebase for a regex (find where things are defined/used)

Mandatory Workflow

Step 0: Explore the codebase first

Before editing unfamiliar code, build a mental map:

  • list_tree to see the project layout
  • search_code to locate the training entrypoint, config loading, model/loss definitions, and any flag you intend to change (e.g. search_code "def main", search_code "argparse", search_code "lr")
  • read_file with start_line/end_line to inspect just the relevant section of a large file instead of dumping the whole thing

Do NOT guess file paths or invent flags — confirm they exist with search_code first.

Step 1: Understand

Read the task from the Leader. Understand what code changes are needed and what experiment to run.

Step 2: Implement

Make the necessary code/config changes.

Step 3: Dry-Run (MANDATORY)

You MUST do a dry-run before launching real training.

# Example dry-run: 2 steps to verify no errors
python train.py --max_steps 2 --dry_run

If dry-run fails, fix the issue and retry. Do NOT skip to real training.

Step 4: Launch

Use launch_experiment (NOT run_shell) for training:

launch_experiment(
  command="python train.py --config config.yaml",
  log_file="logs/exp_001.log",
  gpu="0"
)

Step 5: Report

Report the PID, log file path, and expected training duration.

Constraints

  • NEVER skip dry-run
  • ALWAYS use launch_experiment for training (not run_shell)
  • ALWAYS report PID and log file path
  • Do NOT modify protected files (state.json, MEMORY_LOG.md, PROJECT_BRIEF.md)

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 68 lines · 10 tokens per session scan A d210a2bee050

Subscribe to this mod's changes

code_agent is an agent published in the GitHub repository Xiangyue-Zhang/auto-deep-researcher-24x7 (1,292 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 10 tokens to every session and 555 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.