
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
A compact, YAML-based inventory of your codebase, intended to be prepended to a coding agent's context at session start.
defs (functions/classes with line numbers)npm install agentmap
# Map current directory
npx agentmap
# Map specific directory
npx agentmap ./src
# Write to file
npx agentmap -o map.yaml
# Ignore patterns
npx agentmap --ignore "dist/**" --ignore "**/test/**"
-o, --output <file> Write output to file (default: stdout)
-i, --ignore <pattern> Ignore pattern (can be repeated)
-h, --help Show help
-v, --version Show version
import { generateMap, generateMapYaml } from 'agentmap'
// Get as object
const map = await generateMap({ dir: './src' })
// Get as YAML string
const yaml = await generateMapYaml({ dir: './src' })
// With ignore patterns
const yaml = await generateMapYaml({
dir: './src',
ignore: ['**/test/**', '**/*.spec.ts']
})
Only files with the @agentmap marker comment are included. Add it to the top of files you want in the map:
// @agentmap
// CLI entrypoint.
// Parses args, wires deps, calls into lib/.
export function main() { ... }
# @agentmap
# Parsing + normalization utilities.
def parse_input(): ...
Block comments also work:
/**
* @agentmap
* Core data structures.
*/
my-project:
src:
main.py:
desc: |
CLI entrypoint.
Parses args, wires deps, calls into lib/.
defs:
main: 12
parse_args: 34
App: 58
lib:
parse.py:
desc: |
Parsing + normalization utilities.
defs:
parse_input: 10
ASTNode: 41
desc (description) and defs (definitions)desc uses YAML literal block scalar (|) for multi-line textdefs maps symbol names to 1-based line numbersfunction and class definitions are included| Language | Extensions |
|---|---|
| TypeScript | .ts .tsx .mts .cts |
| JavaScript | .js .jsx .mjs .cjs |
| Python | .py .pyi |
| Rust | .rs |
| Go | .go |
agentmap includes a plugin for OpenCode that automatically injects the codebase map into the system prompt at session start.
Add the plugin to your opencode.json:
{
"plugin": ["agentmap/opencode"]
}
The plugin will scan your project for files with @agentmap markers and inject the map into the system prompt wrapped in <agentmap> tags:
<agentmap>
These are some of the files in the repo with their descriptions and definition locations:
my-project:
src:
main.ts:
desc: CLI entrypoint.
defs:
main: 12
</agentmap>
This gives the AI agent immediate context about your codebase structure without needing to explore files first.
MIT
FAQs
Generate a YAML map of your codebase for AI agent context
The npm package agentmap receives a total of 8 weekly downloads. As such, agentmap popularity was classified as not popular.
We found that agentmap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.