Courtesy of Matt Farwell

Mid-June, 2011: I find myself alone in a dark wooded park tucked between million-dollar houses south of Stanford University, looking for a spot in the bushes to stash my bags. Until that morning I’d been living in a cheap weekly-rate motel in Palo Alto. Before checkout, knowing I couldn’t afford the $48 fee for another night, I laid out my stuff on the bed. Over the cigarette burns on threadbare sheets, I scrounged for quarters, dimes and nickels. There was enough for an extra value meal at Taco Bell. I divided everything else I had between three bags; an olive-drab backpack my brother used in the Army Rangers, a black duffel I bought at Goodwill and a satchel for my laptop.

This was my life. I was two weeks shy of my 28th birthday, unemployed, broke, thousands of miles from my family, watching the weather forecast to see how uncomfortable sleeping outside would be that night. Whatever the prediction, I could handle it. Four and a half years in the Army, including 16 months as an infantryman in eastern Afghanistan, provided plenty of skills with no legal application in the civilian world. It was, however, wonderful preparation for being homeless.

I was searching for a hole in the bushes to hide my bags. They were heavy and awkward, cumbersome to lug around Palo Alto. They clashed with the mishmash of designer bags embroidered with labels from Silicon Valley tech companies that the Stanford kids carried. Walking with them, I stood out, the opening scene of the first Rambo movie cycling through my mind: Sylvester Stallone on the side of the road with a big, green duffel bag slung over his shoulder and blending in with every part of his faded green field jacket except the red, white and blue flag patch, attracts the attention of the sheriff who wants John Rambo and all the bad mojo he carries from Vietnam out of his town. That movie ended badly for Rambo, the sheriff and the town. My life wasn’t a movie and I wasn’t John Rambo, but the same possibilities for a bad ending loomed. I’d learned that fact the only way fools like me learn anything: experience.

As infantry on the ground in Afghanistan, we were introduced to the ugliness of violent, unpredictable death. Over the 16 months of our tour, we caused it and we endured it; we grew well acquainted with it. Sometimes I think that we took it back, an invisible scythe-carrying stowaway on board the airplane we took back to the States. How else to explain my friend Michael Cloutier, whose spot-on shooting probably saved my life when our observation post was attacked by Taliban who outnumbered us three to one, dying of a drug overdose a year after we came back?

Or the staff sergeant from my former battalion — Second Battalion, 87th Infantry Regiment, Third Brigade, Tenth Mountain Division — who committed suicide by cop on Fort Drum later that year when military police were called to investigate a domestic disturbance? I didn’t know him that well and had already left Fort Drum for a cushy assignment as an assistant in a four-star general’s headquarters, but I wrote the eulogy my old company commander delivered at his funeral.

Not too long after that, when my friends in my old unit were rotating back, I started to crack a bit. That year the Taliban killed two of my friends, Staff Sgt. Esau I. DeLaPena-Hernandez, 25, and Sgt. Carlie M. Lee III, 23. The next year a helicopter crash killed my brother, Chief Warrant Officer Gary Marc Farwell. As my last real duty in the Army, I escorted his body home from Germany, wearing a dress uniform and saluting his casket in Atlanta and Salt Lake City as it was loaded and unloaded from the commercial airliner.

None of this was on my mind that night in Palo Alto. I just wanted to stash my bags and get some sleep, if I could. I had a plan. I wrapped the bags in a space blanket to keep the books and clothes inside dry, then wrapped it in a camouflage, Army-issue poncho liner to keep them concealed. After I stashed them in the bushes and saved the location on the G.P.S. that also held grid coordinates for Firebases and Combat Outposts I had manned in Afghanistan, I set off with my satchel, bound for Stanford and their 24-hour library.

It was finals time and short of a T.S.A. inspection at the library entrance, no one would know that under my laptop, iPad, chargers, batteries, pens, paperback books and notepads were my hobo essentials: a Ziploc with a small hygiene kit, deodorant, a pair of underwear and a change of socks. Wearing a polo shirt and a pair of khakis, I could blend in, hide out and hopefully get a little sleep in the once-familiar environment — an American college campus — that, like my country, now felt so foreign and hostile.

Paul Rieckhoff, a veteran of Operation Iraqi Freedom and the founder and chairman of Iraq & Afghanistan Veterans of America testified that over 11,000 veterans between the ages of 18 and 30 were officially listed — that is, somehow identified, confirmed and entered in the Department of Veteran’s Affairs database — as homeless. That’s more than a standard Army division. It’s also really tricky to measure exactly, since there are plenty, like me, you’d never suspect were homeless veterans if you saw them around town.

The law, “United States Code Title 42, Chapter 119, Subchapter 1,” essentially defines a homeless person as somebody with no stable bed or shelter. If you live in a box under the bridge, this counts. If you live in a state- or church-funded homeless shelter, this counts. If you are an inpatient for some sort of medical or psychiatric condition, this counts. Also, if you’re somewhere in between: couch surfing, living in a series of cheap motels, staying with your parents for an extended period of time, that counts. By the definition of the law, I’ve been homeless for about 16 months. To put that in perspective, I’ve been out of the Army for about 18 months.

I’m still not sure how I got there. Before Afghanistan, I was no saint but I generally kept out of trouble. No trouble with the law beyond a handful of tickets for speeding and parking. I was a healthy and an absurdly well-educated striver. My résumé lists Eagle Scout, Davis Scholar, Echols Scholar and National Merit Finalist alongside the Combat Infantryman’s Badge, Army Commendation Medals and Parachutist wings. With the exception of the last year, which I have spent unemployed, attending one semester of college while recuperating from a spinal injury and trying to write, my work experience is unbroken since I landed my first job at 15; soldier, SAT & G.R.E. tutor, defense contracting intern, plumbing guy at Lowe’s, waiter and lifeguard. I try to gloss over the multiple arrests and hospitalizations after the war and highlight my hope to return to the college I dropped out of once my head gets screwed on a little straighter.

Part of the reason I came to California was to heal and figure out why my life seemed determined to come unglued. Blaming it on the war, the things I’d seen and done there, seems a cop-out and a cliché, but maybe there’s something to it. Jonathan Shay, a psychiatrist with the Veterans Administration who earned a MacArthur Genius Grant for his work on behalf of vets, wrote that combat post-traumatic stress disorder is “a war injury.”

“Veterans with combat PTSD are war wounded, carrying the burdens of sacrifice for the rest of us as surely as the amputees, the burned, the blind and the paralyzed carry them,” he wrote. The Palo Alto V.A. was one of the best in the country, I’d heard, and their psychiatric division in Menlo Park, near Facebook’s new headquarters, had one of the best programs for treating guys like me, so I was waiting to get in.

That night in June, though, I was on my own. I walked down to Greene Library, took a spot on a couch in the corner, unpacked my laptop and carefully set up my workspace. I used the bathroom, washed my hands, rolled a cigarette and walked outside to bum a light from a stressed-out student. I inhaled, exhaled and saw the sky. Looking at the stars, I laughed and coughed, the honest part of me wishing I was still in Afghanistan.

Memories (bad, good and indifferent) of four and a half years wearing the uniform, a third of that in combat, occupy psychic space next to deeply ingrained habits, skills and instinctive reactions that, like all things war-related, are double-edged back home: they helped keep me alive and sane amid the boredom, ennui, confused terror and brief moments of adrenaline-fueled elation of combat — a euphoric sense of zen-like calm and focus that’s better than any drug I’ve ever tried or heard about — but they’ve been doing their damnedest to kill me and my friends since we got back.

Matt Farwell was a soldier in the United States Army from 2005 to 2010. After infantry and airborne training at Fort Benning, Ga., he was assigned to the Tenth Mountain Division’s Second Battalion, 87th Infantry Regiment and deployed to Afghanistan for 16 months. Before enlisting, he studied government and history at the University of Virginia as an Echols Scholar and graduated from the United World College of the American West as a Davis Scholar. He currently lives in California. Follow him on Twitter at @mattbfarwell.