[{"data":1,"prerenderedAt":336},["ShallowReactive",2],{"project-47181471":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":42,"post_text":45,"what":46,"said":77,"maker_in_thread":175,"shape":177,"grid":182,"attempts":300,"same_week":301,"maker_shows":32,"maker_hidden":329,"reader_version":330,"card":331},"47181471","Repo Tokens","Badge that shows how well your codebase fits in an LLM's context window","title","Show HN: Badge that shows how well your codebase fits in an LLM's context window","https:\u002F\u002Fgithub.com\u002Fqwibitai\u002Fnanoclaw\u002Ftree\u002Fmain\u002Frepo-tokens","github.com","jimminyx",1772205282,2026,88,41,775,4366,18,"notable","dev_tools","repository metrics badge","other",[24,25,26,27,28],"llm context window","token count","github action","codebase size","readme badge","mixed",-0.32,{"positive":32,"neutral":33,"mixed":34,"critical":35},2,11,1,12,26,{"idea":38,"design":40},{"positive":32,"critical":39},10,{"positive":41,"critical":32},0,[43,41,43,41,41,41,34,43,34,34,34,43,34,34,41,41,41,43,43,34,34,41,41,43,41,41,41,41,34,43,43,41,43,34,44,41,44,34,34,43],3,5,"Small codebases were always a good thing. With coding agents, there's now a huge advantage to having a codebase small enough that an agent can hold the full thing in context.\n\nRepo Tokens is a GitHub Action that counts your codebase's size in tokens (using tiktoken) and updates a badge in your README. The badge color reflects what percentage of an LLM's context window the codebase fills: green for under 30%, yellow for 50-70%, red for 70%+. Context window size is configurable and defaults to 200k (size of Claude models).\n\nIt's a composite action. Installs tiktoken, runs ~60 lines of inline Pyt",{"problem":47,"audience":53,"pricing":58,"motivation":59,"time_to_build":58,"stack":63,"openness":76,"stage":76,"team_size":76},{"value":48,"source":49,"evidence":50},"Shows how much of an LLM's context window a codebase fills","maker",[51],{"id":52},"post",{"value":54,"source":55,"evidence":56},"Developers using coding agents on their repositories","inferred",[57],{"id":52},null,{"value":60,"source":49,"evidence":61},"Make token size a visible metric and nudge toward lean, agent-friendly codebases",[62],{"id":52},[64,68,72],{"value":65,"source":49,"evidence":66},"GitHub Actions (composite action)",[67],{"id":52},{"value":69,"source":49,"evidence":70},"Python",[71],{"id":52},{"value":73,"source":49,"evidence":74},"tiktoken",[75],{"id":52},"unknown",{"praise":78,"objections":91,"requests":132,"questions":148,"alternatives":156},[79],{"value":80,"source":81,"evidence":82},"Token budgets as a visible metric is a useful idea","commenter",[83,87],{"id":84,"by":85,"text":86},"47181668","agentica_ai","Smart idea. Token budgets are becoming the new line count metric for the LLM era.",{"id":88,"by":89,"text":90},"47181968","ai-christianson","This is a really interesting metric to track. I agree with the sentiment that token budgets are becoming the new 'lines of code' metric. Even though context windows are…",[92,99,114,125],{"value":93,"source":81,"evidence":94},"Large codebases are often useful; the badge conflates size with quality",[95],{"id":96,"by":97,"text":98},"47181862","nebezb","Useful and useless (or good and “less good”) aren’t easily mapped to big and small. From a purely UX perspective, showing a red badge seems you’re conflating “less good” with…",{"value":100,"source":81,"evidence":101},"Whole codebases are rarely loaded into context; agents work on subsets",[102,106,110],{"id":103,"by":104,"text":105},"47183264","Doohickey-d","For at least some codebases, I'm not sure this is a useful metric. Because you don't usually put the whole codebase in your context at the same time. For example in my current…",{"id":107,"by":108,"text":109},"47182383","kccqzy","It’s interesting but I think it’s measuring the wrong thing. Abstraction is a fundamental principle in software. As a human, I’ve worked with classes and modules far larger than…",{"id":111,"by":112,"text":113},"47183086","hennell","Outside of packages I doubt few of my code bases would fit into this. But the individual domain areas would. I don't care about users in a orders context, I don't care about…",{"value":115,"source":81,"evidence":116},"Context windows are growing, so the metric may age poorly",[117,121],{"id":118,"by":119,"text":120},"47181819","jannniii","Interesting concept, but is it going to age well with context sizes of models are changing all the time (growing, mostly)?",{"id":122,"by":123,"text":124},"47182073","b112","It's a fun, in the \"style of the time\" thing to track, but within a year or two, context window limitations won't be a thing. Doubt me? Think back 2 years. Now compare today.",{"value":126,"source":81,"evidence":127},"Metric rewards dynamic languages and penalizes comments and descriptive names",[128],{"id":129,"by":130,"text":131},"47182532","daxfohl","Also this rewards dynamic languages over typed languages, penalizes comments, descriptive function names, etc. Though frankly, it'd be interesting to see whether AI would work…",[133,137],{"value":134,"source":81,"evidence":135},"Measure only files edited recently or relevant modules rather than the whole repo",[136],{"id":103,"by":104,"text":105},{"value":138,"source":81,"evidence":139},"Bundle with repomix or strip comments before counting",[140,144],{"id":141,"by":142,"text":143},"47183943","t1amat","Interesting idea, but I think it might have made more sense to use something like repomix to generate the source bundle and tiktoken’d that. Practically speaking you don’t send…",{"id":145,"by":146,"text":147},"47185582","ciaranmca","Never thought about the impact of comments, perhaps there is value in stripping those out of read file tools",[149],{"value":150,"source":81,"evidence":151},"How to count tokens for a plain dump file with basic shell tools",[152],{"id":153,"by":154,"text":155},"47181788","collabs","This is an interesting concept. Thank you for sharing. I have an export.sh or export.ps1 script that takes the relevant files in my repository and puts them in a `dump.txt` file…",[157,164,168],{"value":158,"source":81,"evidence":159},"forgithub.badge, a badge backed by uithub that needs no GitHub Action",[160],{"id":161,"by":162,"text":163},"47260557","janwilmake","Hi, i just open sourced my alternative at https:\u002F\u002Fgithub.com\u002Fjanwilmake\u002Fforgithub.badge, which is backed by uithub.com. The advantage is that you don't need a github action to…",{"value":165,"source":81,"evidence":166},"repomix for bundling source before counting tokens",[167],{"id":141,"by":142,"text":143},{"value":169,"source":81,"evidence":170},"prompttower context creator",[171],{"id":172,"by":173,"text":174},"47182515","ramoz","I haven't cared too much about repo tokens in a good while. But my coolest app was a better context creator. I found it hard to extend to actual agentic coding use. Agentic…",{"comments":41,"answered":41,"key":176},[],{"commenters":178,"max_depth":179,"maker_replies":41,"first_comment_mins":180,"lifespan_hours":181},38,4,15,141,[183,187,191,194,198,202,204,206,210,214,215,216,217,218,222,226,230,232,235,237,238,239,242,245,248,251,255,258,260,264,267,271,274,275,277,281,285,287,290,292,293,294,295],[184,41,43,185,186,41],"47182816","project\u002Fneutral\u002Fidea","layer8",[188,41,41,189,190,41],"47182947","other\u002Fneutral\u002Fidea","sltr",[192,41,43,185,193,41],"47183128","bee_rider",[195,41,41,196,197,41],"47184178","other\u002Fneutral\u002Fnone","GeoAtreides",[199,41,41,200,201,41],"47184501","commenter\u002Fneutral\u002Fnone","Terretta",[203,41,41,200,186,41],"47184512",[96,34,34,205,97,41],"project\u002Fcritical\u002Fdesign",[207,34,43,208,209,41],"47181885","project\u002Fneutral\u002Fnone","iterateoften",[211,34,34,212,213,41],"47182340","project\u002Fcritical\u002Fidea","adam_arthur",[103,32,34,212,104,41],[111,43,34,212,112,41],[161,179,43,208,162,41],[172,44,34,212,173,41],[219,220,41,196,221,41],"47184342",6,"nicoburns",[223,224,34,212,225,41],"47183117",7,"bilekas",[227,228,41,189,229,41],"47183365",8,"joshmarlow",[231,228,41,200,186,41],"47183433",[233,228,41,189,234,41],"47185666","f33d5173",[153,236,43,208,154,41],9,[141,39,43,185,142,41],[122,33,34,212,123,41],[240,33,34,212,241,41],"47182258","arscan",[243,33,41,200,244,41],"47182357","spot5010",[246,33,41,200,247,41],"47182259","written-beyond",[249,35,43,185,250,41],"47181866","Retr0id",[252,253,41,196,254,41],"47181812",13,"Towaway69",[256,253,41,196,257,41],"47181849","c0balt",[259,253,41,196,254,41],"47181998",[261,253,41,262,263,41],"47183276","other\u002Fneutral\u002Fpricing","xienze",[265,253,41,266,254,41],"47183560","other\u002Fneutral\u002Fdocs",[268,269,34,212,270,41],"47182120",14,"spicyusername",[272,269,43,185,273,41],"47182527","unglaublich",[118,180,43,185,119,41],[276,180,41,196,250,41],"47181894",[278,279,43,185,280,41],"47184521",16,"a13o",[282,283,34,212,284,41],"47182290",17,"KingOfCoders",[84,18,44,286,85,41],"project\u002Fpositive\u002Fidea",[288,18,41,200,289,41],"47181712","irishcoffee",[88,291,44,286,89,41],19,[107,291,34,212,108,41],[129,291,34,205,130,41],[145,291,43,185,146,41],[296,297,43,298,299,41],"47181971",20,"project\u002Fmixed\u002Fidea","hal9000xbot",[],[302,307,312,316,321,325],{"id":303,"name":304,"points":305,"category":306},"47224295","I built a sub-500ms latency voice agent from scratch",570,"ai",{"id":308,"name":309,"points":310,"category":311},"47164270","Terminal Phone",322,"security_privacy",{"id":313,"name":314,"points":315,"category":306},"47195123","Now I Get It",305,{"id":317,"name":318,"points":319,"category":320},"47220809","Govbase",219,"productivity",{"id":322,"name":323,"points":324,"category":306},"47212576","Timber",207,{"id":326,"name":327,"points":328,"category":20},"47180083","RetroTick",195,false,"v2",{"id":332,"name":5,"line":6,"ai":329,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":333,"maker":11,"domain":10,"tier":19,"attempts":41,"strip":334,"url":9,"mix":335,"praise":80,"objection":93,"sub":21},47181471,[24,25,26,27,28],"3030001311131100033110030000133031505113",[32,33,34,35],1794036694663]