netanel-haber

Snakepath — Design skill for Claude Code

Design community

Python's Pathlib in C99. Single header, STB style.

How to install Snakepath

This entry records only its repository, not the path inside it, so there is no exact command to give. Open netanel-haber/snakepath and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Snakepath does

Python's Pathlib in C99. Single header, STB style. With Claude Opus 4.5+6/5.5 and codex 5.2/3/4/5. Use at your own peril.

Alternatives in Design

  • Pair — Fuse two extracted designs into a single hybrid identity 3.6k ★
  • Clipify — Claude Code skill: turn long videos into social-ready clips 549 ★
  • Agent Design Patterns — A 7×6 framework for agent architecture 239 ★

README

C99 STB-style header-only port of [Python's pathlib](https://docs.python.org/3/library/pathlib.html). Passes CPython 3.15's own pathlib test suite.

POSIX + Windows. No malloc (OS functions like `opendir`/`stat` may allocate internally). Vibe-coded with Claude + Codex.

The original API was created by [Antoine Pitrou](https://peps.python.org/pep-0428/).

u=https://raw.githubusercontent.com/netanel-haber/snakepath/main/snakepath.h &&
curl -sSLo snakepath.h "$u" &&
cat <<'EOF' | cc -xc - -o demo &&
#define SP_PATH_MAX 4096
#define SNAKEPATH_FLUENT
#define SNAKEPATH_IMPLEMENTATION
#include "snakepath.h"
#include 

int main(void) {
    SpPath boring = sp_path("/foo/bar.txt");
    printf("BORING API: %s\n", sp_name(&boring).buf);
    printf("BORING API: %s\n", sp_stem(&boring).buf);

    SpPath fluent = SPF("/etc")->join("nginx")->join("nginx.conf")->path();
    printf("FLUENT API: %s\n", sp_str(&fluent));
}
EOF
./demo
rm -f demo snakepath.h

Build & Test

cc -x c -o nob nob.h && ./nob

Needs a C compiler, Python and clang-format.

Snakepath API Reference (api_demo.c)
/* compile: cc api_demo.c -o api_demo && ./api_demo
 * Creates a demo_tmp/ directory in cwd, cleans up on exit. */
#define SP_PATH_MAX 4096
#define SNAKEPATH_FLUENT
#define SNAKEPATH_IMPLEMENTATION
#include "snakepath.h"
#include 
#include 

static void section(const char *s) { printf("\n--- %s ---\n\n", s); }

/* Actions return an SpError, which the compiler won't let you ignore */
static void check(const char *what, SpError err) { printf("  %-9s %s\n", what, sp_error_str(err)); }

int main(void) {
    SpPath tmp;

    SpPath p     = sp_path("/home/user/docs/report.tar.gz");
    SpPath posix = sp_path_f("/etc/nginx/nginx.conf", SP_FLAVOR_POSIX);
    SpPath win   = sp_path_f("C:\\Users\\dev\\file.txt", SP_FLAVOR_WINDOWS);
    S