agentleFS
go-gostgo-gost/gost/CLAUDE.md

gost

CLAUDE.md7.8k starsChanged 19 days agoMITView on GitHub

CLI binary entry point for GOST (GO Simple Tunnel). This module compiles the gost command. Arguments separated by -- spawn multiple worker processes via exec.CommandContext. Each worker runs as a child process with _GOST_ID set. Any worker's exit cancels all others. This is triggered in init() before flag parsing. All components register via init() side-effects in their packages. cmd/gost/register.go triggers them with blank imports. When adding a new built-in handler/listener/dialer/connector, add a blank import here. Tests are in tests/e2e/ —…

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 2 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 3 mentionsSep 2026: 3 mentionsOct 2026: 5 mentionsNov 2026: 4 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the go-gost/gost repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about go-gost/gost

The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 52

Talked about on GitHub and Bluesky (52 times).

On GitHub · 50

45 more on GitHub

On Bluesky · 2

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All components register via init() side-effects in their packages.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md — gost/

CLI binary entry point for GOST (GO Simple Tunnel). This module compiles the gost command.

Build & Run

cd gost && go build ./cmd/gost/...

# Cross-compile
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" ./cmd/gost/...

# Build all platforms
make all

# Run
./gost -L "http://:8080" -F "socks5://:1080"
./gost -C gost.yml

Structure

FilePurpose
cmd/gost/main.goCLI entry point: flag parsing, multi-worker mode (-- separator), program launch via svc.Run
cmd/gost/program.goService lifecycle (Init/Start/Stop), config loading, API/metrics/profiling servers, SIGHUP reload
cmd/gost/register.goBlank imports for all built-in handlers, listeners, dialers, connectors — triggers init() registration
cmd/gost/version.goVersion resolution: ldflags injection → buildVersionFallback + short VCS commit → module build info → bare buildVersionFallback

CLI Flags

FlagUsage
-LInline service definition (repeatable)
-FInline chain node definition (repeatable)
-CPath to config file (YAML/JSON)
-D / -DDDebug / trace logging
-apiAPI service address (e.g. :8080)
-metricsPrometheus metrics address
-OOutput merged config as yaml or json, then exit
-VPrint version and exit

Multi-Worker Mode

Arguments separated by -- spawn multiple worker processes via exec.CommandContext. Each worker runs as a child process with _GOST_ID set. Any worker's exit cancels all others. This is triggered in init() before flag parsing.

Service Lifecycle

  • Init → calls parser.Init() with all CLI/config inputs
  • Start → parser.Parse() → loader.Load() → p.run() (starts services, API, metrics, profiling)
  • Stop → cancels reload context, closes all services
  • SIGHUP → reloadConfig() re-parses and re-runs without restarting the process

Key Dependencies

  • github.com/go-gost/core — interface definitions
  • github.com/go-gost/x — all implementations, config, registry
  • github.com/judwhite/go-svc — OS service framework (handles daemon/SIGHUP/SIGTERM)

Registration Pattern

All components register via init() side-effects in their packages. cmd/gost/register.go triggers them with blank imports. When adding a new built-in handler/listener/dialer/connector, add a blank import here.

Tests

Tests are in tests/e2e/ — integration tests using the built binary. No unit tests. Run with go test ./tests/e2e/....

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.