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

Balance a Telegram Role-Playing Game with Simulation Runs

Overview

Use Claude Code to separate a Telegram role-playing bot's combat rules from its chat code, then write and run a battle simulator that pits every character class against the others so you can tune the numbers.

Problem or Objective

More in Games and Simulations

AI Agents and Models

Tools and Integrations

Tools
Claude Code · Telegram
Prerequisites
Claude Code with a Claude subscription or Console account, the source code of your Telegram bot, and a place to run the bot.

How It Works

Start Claude Code in the repository of your game bot. Ask it to read the code and move the combat rules (stats, damage formulas, abilities, random rolls) into one module that has no Telegram dependency, with unit tests that pin the current behaviour. Next, ask it to write a command-line simulator that runs many fights for every pair of classes with a fixed random seed and writes win rates, average fight length and damage per turn to a CSV file. Run the simulator, review the table with Claude, and choose small changes to the class numbers yourself; have Claude apply them on a branch, rerun the tests and the simulator, and show the before and after tables. Only when you are happy, merge the branch and restart the bot on your own server.

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, Telegram.
  3. Check the prerequisitesClaude Code with a Claude subscription or Console account, the source code of your Telegram bot, and a place to run the bot.
  4. Gather your detailsCollect what the prompt asks for: Character classes, Telegram bot library you use, Fights per class pair, Random seed.
  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: Build a combat simulator for my bot

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

Preview
Read this repository. Move the combat rules for [Character classes] into a module with no [Telegram bot library you use] imports and add unit tests that lock in the current behaviour. Then write a simulator that runs [Fights per class pair] fights for every pair of classes with seed [Random seed] and writes win rate, average turns and damage per turn to results.csv. Run it and summarise the outliers. Propose number changes but ask me before applying them, and work on a branch; do not merge or restart the bot.

Approve the proposed number changes yourself, read the diff, and merge and restart the bot only after the tests and a second simulator run look right.

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 Claude Code overview says it reads your codebase, edits files and runs commands, which covers refactoring the combat code, writing the simulator and running it. Nothing on the pages covers Telegram bots or game balance, so whether the resulting classes feel fair to players is something only playtesting can tell. The Telegram bot platform and your hosting were not verified here.

Limitations and Considerations

A simulator only measures the rules you coded: abilities that depend on player choices need a simple strategy model, so treat the win rates as a guide and confirm with real players. Keep the bot token in an environment variable, out of the repository and out of prompts. Review every diff before merging, since changed numbers affect existing players' characters. Most Claude Code surfaces require a Claude subscription or Anthropic Console account. 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.

Related Videos

About anthropics/claude-code

About anthropics/claude-code

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

Sources

  1. 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, runs commands, and integrates with your development tools.
    • Claude Code is an AI-powered coding assistant that helps you build features, fix bugs, and automate development tasks.
    • Most surfaces require a Claude subscription or Anthropic Console account.
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