Catalog npm
Back to packageRELEASE DETAILS

0.1.1

npm

@0xanand/coremap

Pack a repo into one AI-friendly file — or pass --task to keep only the lines that matter, with a verification receipt.

clicode-searchcodexcoding-agentscontextcoremapdeveloper-toolsevalsllmopenaitypescript
Published14 Jul 2026
Direct dependencies10
Transitive dependenciesNot calculated

README

Current package documentation

CoreMap

Pack your repository into one AI-friendly file — or pass a task and keep only the lines that matter.

npx @0xanand/coremap .

Writes coremap.md: directory tree, source files, and a short summary. Secrets are excluded.

npm Node.js License: MIT


Two modes

ModeCommandOutput
Packcoremap .Full repo → one file (coremap.md)
Taskcoremap . --task "fix …"Exact spans → coremap-context.md + coremap-receipt.json

Pack is the everyday path. Task mode selects a small evidence set and can verify it by applying a patch and running your tests.


Install

No install (recommended):

npx @0xanand/coremap .

Global:

npm install -g @0xanand/coremap
coremap .

Requires Node.js 20+.


Usage

Pack mode

coremap .                          # → coremap.md
coremap . --out-file context.md    # custom name
coremap . --max-tokens 200000      # raise whole-file budget
coremap . --out-dir ./out          # write elsewhere

Task mode

coremap . --task "fix the tax bug" --budget-lines 25

# Optional: prove the context was enough
coremap . --task "fix the tax bug" --verify
coremap . --task "…" --verify --no-llm   # offline (no API key)

Pinned demo (included in this repo):

npm run demo

Example output:

                          Full  Compress   CoreMap
--------------------  --------  --------  --------
Context tokens             432        81       192
HitFile                      —         —      1.00
HitRegion≈                   —         —      0.71
Patch produced              no        no       yes
Tests (original repo)        no        no       yes

coremap: GREEN DELTA  tokens 432→192  |  HitFile=1.00  |  HitRegion≈0.71  |  tests=PASS

Tests (original repo) is the same baseline for the Full and Compress columns; CoreMap applies the demo oracle patch only in an isolated temporary copy.


Features

  • One command — pack a repo in seconds
  • Git-aware — respects .gitignore and optional .coremapignore
  • Secret-safe — path + content filters (keys, tokens, PEMs, etc.)
  • Real token counts — js-tiktoken o200k_base
  • Exact spans — path + line ranges with real source (task mode)
  • Verification receipt — optional patch + tests (--verify)
  • Works offline — pack and selection need no API key

CLI reference

Usage: coremap [options] [path]

Arguments:
  path                        repository path (default: ".")

Options:
  --task <text>               issue / change request (enables task mode)
  --budget-lines <n>          max source lines in the context pack (default: 200)
  --verify                    run one patch attempt + tests
  --no-llm                    offline selection; skip LLM patch
  --ground-truth <patch>      unified diff for HitFile / HitRegion scoring only
  --max-tokens <n>            pack mode whole-file token budget (default: 50000)
  --out-file <name>           pack mode output filename (default: coremap.md)
  --out-dir <dir>             output directory (default: .)
  -V, --version               output version number
  -h, --help                  display help
FlagModeNotes
--tasktaskTurns on span selection + receipt
--budget-linestaskHard line budget for selected source
--verifytaskPatch attempt + test run
--no-llmtaskNever call OpenAI; use oracle if --ground-truth is set
--ground-truthtaskEval only — never used as selection input
--max-tokenspackSkip huge files once the budget is hit
--out-file / --out-dirbothControl where artifacts land

How it works

Pack: walk the tree (gitignore-aware) → filter secrets → emit tree + files + summary with token counts.

Task: parse the task → gather candidates (terms, symbols, imports, tests) → rank → select exact spans under the line budget → write pack + receipt → optionally verify.

CoreMap architecture


Project layout

src/
  cli.ts              # CLI entry
  index.ts            # library exports
  coremap/            # pack, select, receipt, verify, …
bin/coremap           # npm bin wrapper (optional; published bin is dist/cli.js)
fixtures/             # mini-repo + tax-bug eval fixture
evals/tax-bug/        # issue text + ground-truth patch
specs/coremap/        # product spec / plan / tasks
tests/                # vitest

Development

git clone https://github.com/Anand-0037/coremap.git
cd coremap
npm install
npm test          # 22 tests
npm run build
npm run lint
npm run pack      # dogfood: pack this repo → repomap.txt
npm run demo      # GREEN DELTA on the pinned eval

Scripts

ScriptPurpose
npm testRun vitest
npm run buildCompile TypeScript → dist/
npm run coremapRun CLI via tsx
npm run packFull pack of this repo
npm run demoPinned task + verify demo

Ignore rules

CoreMap respects .gitignore. Add a .coremapignore (gitignore syntax) for extra exclusions.


Security

  • Path patterns: .env*, keys, PEMs, credential filenames, and similar
  • Content scan: private-key headers, sk-…, AKIA…, high-entropy secret-like assignments
  • Matched files are skipped; secret contents are never written into the pack

Report security issues via GitHub Issues (or privately if you prefer).


Contributing

  1. Fork and create a branch
  2. Keep changes small and typed (strict TypeScript)
  3. Add or update a vitest for behavior you change
  4. Run npm test && npm run build before opening a PR

Bug reports and PRs are welcome.


License

MIT


Built for the OpenAI Codex Build Week hackathon (Delhi NCR). See CODEX.md. Agent rules: AGENTS.md.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 10

Native requirements
10 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
ignore
Environment
{
  "local_name": "ignore",
  "alias": false,
  "peer_metadata": null
}
^7.0.4runtime
commander
Environment
{
  "local_name": "commander",
  "alias": false,
  "peer_metadata": null
}
^13.1.0runtime
js-tiktoken
Environment
{
  "local_name": "js-tiktoken",
  "alias": false,
  "peer_metadata": null
}
^1.0.19runtime
web-tree-sitter
Environment
{
  "local_name": "web-tree-sitter",
  "alias": false,
  "peer_metadata": null
}
^0.25.10runtime
tree-sitter-wasms
Environment
{
  "local_name": "tree-sitter-wasms",
  "alias": false,
  "peer_metadata": null
}
^0.1.13runtime
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.19.3development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^3.1.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.8.3development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.14.1development
openai
Environment
{
  "local_name": "openai",
  "alias": false,
  "peer_metadata": null
}
^4.96.0optional

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "2010c69b870966d44bd11f9cfbfe16cb28ee0d9e",
  "tarball": "https://registry.npmjs.org/@0xanand/coremap/-/coremap-0.1.1.tgz",
  "fileCount": 40,
  "integrity": "sha512-cKtMmUNwrmmCZmuAIEyFshzgmG5hO854mXigwuHp9KBVNvQvPUz6WIxj6C7uyh8W8Tvj3nwXb6Qz8lvvGvgIig==",
  "signatures": [
    {
      "sig": "MEYCIQCqEefNBN9nnhnlnD6z7E/AVTl9iQ6mPIDp/TW85/P3KgIhAKJpZHqKODKfPQHbSbbqF62PkJ7YkV0RrvBVTdeFhkT7",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 86070
}

Repository

PENDING
anand-0037/coremap

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:40 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:094adf03519baee645f3f8cbcca61a883fca028dfd11c6f61ccce8d65f02cc36

Other collected versions

0.1.214 Jul0.1.014 JulView all collected versions →