Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Planned, not doneThe source describes an intention, not a finished result.

Run a Restricted Coding Agent Inside a Virtual Machine

Overview

Run Claude Code non-interactively in a locked-down virtual machine with a narrowly scoped Forgejo token, so it can work on issues and open pull requests but never merge or deploy.

Problem or Objective

More in Coding and Code Review

AI Agents and Models

Tools and Integrations

Tools
Claude Code · Forgejo
Prerequisites
Claude Code access, a Forgejo instance with permission to issue scoped tokens, and a virtual machine you can lock down. Also needed: a virtual machine.

How It Works

Build a virtual machine that holds only the repository checkout, with no production credentials and network access limited to your Forgejo server and the model API. Create a Forgejo access token with only the issue and repository scopes the agent needs, and hand it over through a secrets broker or an environment variable rather than a file in the repository. Run Claude Code with claude -p and an explicit list of allowed tools, point it at an issue, and let it push a branch and open a pull request. You review and merge manually, and your normal CI does the deploying.

Implementation Workflow

Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.

  1. Choose the agentSet up Claude Code.
  2. Connect the toolsConnect the tools this workflow relies on: Claude Code, Forgejo.
  3. Check the prerequisitesClaude Code access, a Forgejo instance with permission to issue scoped tokens, and a virtual machine you can lock down. Also needed: a virtual machine.
  4. Gather your detailsCollect what the prompt asks for: Issue number, Repository, Test command, Branch name.
  5. Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
  6. Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.

Practical Starter Prompt: Fix one issue on a branch for review

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
Read issue [Issue number] in the repository [Repository]. Work only inside the checked-out folder, run only [Test command] to check your work, and make the smallest change that fixes the problem. Push the change to a new branch named [Branch name] and open a pull request that links the issue and lists what you changed and what you could not test. Do not merge, deploy, change repository settings or touch other branches, and stop and ask if the fix would need any of those.

Test the setup on a throwaway repository before pointing it at real work.

Expected Results and Benefits

This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.

This is a suggested workflow, not a reported outcome. Anthropic's documentation says Claude Code can edit files, run commands and work with git, and can run non-interactively with the tools you list in advance, and Forgejo's documentation says its access tokens can be limited to selected API routes. Neither covers the virtual machine, the secrets broker or how Claude Code reaches Forgejo, so those parts rest on your own setup and testing.

Limitations and Considerations

A claude -p run connects the servers in the project's .mcp.json without a trust dialog or approval prompt (--bare skips them), so list only servers you trust; the allowed-tools list and the token scopes are your real safety limits, so start narrow and widen them only when a task needs it. Keep deployment credentials out of the machine entirely, and review every pull request as you would a stranger's. The cited pages do not cover how Claude Code reaches Forgejo, so check which API calls, command-line tool or MCP server you use. Results depend on your setup and were not independently reproduced by Top 200 Repos.

GitHub Repositories

AI Agent Repository

Source code of the agent that does the work.

Official Website

The official site of the main tool or project in this use case.

Visit Website (opens in a new tab)code.claude.com

Related Videos

About anthropics/claude-code

About anthropics/claude-code

Independent creators. Listing a video implies no endorsement, sponsorship or partnership.

Sources

  1. Run Claude Code programmatically - Claude Code Docs (opens in a new tab)

    Project documentation · code.claude.com · Undated · Source checked 26 Nov 2026, 17:27 UTC

    What this source supports
    • Runs non-interactively with claude -p, or from Python and TypeScript through the Agent SDK, for scripts and automation.
    • Without --bare, a -p session connects the servers in the project's .mcp.json and shows no workspace trust dialog or per-server approval prompt; with --bare those servers do not run.
    • --allowedTools lets Claude use the listed tools without prompting.
  2. Overview - Claude Code Docs (opens in a new tab)

    Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC

    What this source supports
    • Claude Code is an agentic coding tool that reads your codebase, edits files and runs commands.
    • Claude Code works directly with git: it stages changes, writes commit messages, creates branches and opens pull requests.
  3. Access Token Scope | Forgejo – Beyond coding. We forge. (opens in a new tab)

    Project documentation · forgejo.org · Undated · Source checked 26 Nov 2026, 17:53 UTC

    What this source supports
    • Forgejo supports scoped access tokens, which restrict a token to selected URL routes, with read and write levels.
Report a problem

More with Claude Code

Planned, not done

Create Custom Store Tools Instead of Paying for Subscriptions

Use Claude Code to write small in-house tools for an online shop, such as a reply helper for support mail or a margin report, as an alternative to paying for separate apps, with testing before you rely on them.

code.claude.comanthropics/claude-code
Reported by source

Answer technical questions by letting async agents run experiments

Simon Willison sends research questions to cloud coding agents such as Claude Code for web and Codex Cloud, which write and run experiments in a dedicated repo and open a PR.

simonwillison.net · 6 Nov 2025anthropics/claude-code, openai/codex
Planned, not done

Structure Repeated Browser Research Into Evidence Tables

Give Claude Code the open-source Browser Use CLI with a local browser, ask the same research questions across a short list of pages, and keep every answer as a sourced table row.

github.comanthropics/claude-code, browser-use/browser-use

View all: Claude Code